Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/arch/x86/pci Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/d048bca6dd83
branches:  netbsd-6
changeset: 776626:d048bca6dd83
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed May 21 21:02:57 2014 +0000

description:
Pull up following revision(s) (requested by sborrill in ticket #1060):
        sys/arch/x86/pci/pci_machdep.c: revision 1.66
Force pci_mode 1 when running as Xen HVM domU to allow cd* to be
detected correctly. Fixes kern/48770. Thanks to cube@

diffstat:

 sys/arch/x86/pci/pci_machdep.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r 2d888a9de411 -r d048bca6dd83 sys/arch/x86/pci/pci_machdep.c
--- a/sys/arch/x86/pci/pci_machdep.c    Wed May 21 21:00:43 2014 +0000
+++ b/sys/arch/x86/pci/pci_machdep.c    Wed May 21 21:02:57 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.54.2.1 2013/10/20 13:16:57 bouyer Exp $      */
+/*     $NetBSD: pci_machdep.c,v 1.54.2.2 2014/05/21 21:02:57 bouyer Exp $      */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.54.2.1 2013/10/20 13:16:57 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.54.2.2 2014/05/21 21:02:57 bouyer Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -523,6 +523,7 @@
        int i;
        pcireg_t idreg;
        extern char cpu_brand_string[];
+       const char *system_vendor, *system_product;
 
        if (pci_mode != -1)
                return pci_mode;
@@ -552,7 +553,13 @@
                        return (pci_mode);
                }
        }
-        if (memcmp(cpu_brand_string, "QEMU", 4) == 0) {
+
+       system_vendor = pmf_get_platform("system-vendor");
+       system_product = pmf_get_platform("system-product");
+        if (memcmp(cpu_brand_string, "QEMU", 4) == 0 ||
+           (system_vendor != NULL && system_product != NULL &&
+            !strcmp(system_vendor, "Xen") &&
+            !strcmp(system_product, "HVM domU"))) {
                /* PR 45671, https://bugs.launchpad.net/qemu/+bug/897771 */
 #ifdef DEBUG
                printf("forcing PCI mode 1 for QEMU\n");



Home | Main Index | Thread Index | Old Index