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 Apply patch, requested by riastradh in t...



details:   https://anonhg.NetBSD.org/src/rev/797e2be356a8
branches:  netbsd-6
changeset: 776477:797e2be356a8
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Oct 20 13:16:57 2013 +0000

description:
Apply patch, requested by riastradh in ticket #962:
sys/arch/x86/pci/pci_machdep.c                  1.61 via patch

        Force PCI mode 1 when running under QEMU, to work around
        QEMU bug 897771.
        This should also make it possible to boot NetBSD under versions of KVM
        that have inherited said QEMU bug.  Fixes PR kern/45671.

diffstat:

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

diffs (40 lines):

diff -r 22165a5825b8 -r 797e2be356a8 sys/arch/x86/pci/pci_machdep.c
--- a/sys/arch/x86/pci/pci_machdep.c    Sun Oct 20 13:14:31 2013 +0000
+++ b/sys/arch/x86/pci/pci_machdep.c    Sun Oct 20 13:16:57 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.54 2012/02/15 16:30:29 tsutsui Exp $ */
+/*     $NetBSD: pci_machdep.c,v 1.54.2.1 2013/10/20 13:16: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 2012/02/15 16:30:29 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.54.2.1 2013/10/20 13:16:57 bouyer Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -522,6 +522,7 @@
        uint32_t sav, val;
        int i;
        pcireg_t idreg;
+       extern char cpu_brand_string[];
 
        if (pci_mode != -1)
                return pci_mode;
@@ -551,6 +552,13 @@
                        return (pci_mode);
                }
        }
+        if (memcmp(cpu_brand_string, "QEMU", 4) == 0) {
+               /* PR 45671, https://bugs.launchpad.net/qemu/+bug/897771 */
+#ifdef DEBUG
+               printf("forcing PCI mode 1 for QEMU\n");
+#endif
+               return (pci_mode);
+       }
 
        /*
         * Strong check for standard compliant mode 1:



Home | Main Index | Thread Index | Old Index