Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386 Make sure no bioscall is issued when booting o...



details:   https://anonhg.NetBSD.org/src/rev/d649efef57f1
branches:  trunk
changeset: 464709:d649efef57f1
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Oct 18 01:00:24 2019 +0000

description:
Make sure no bioscall is issued when booting off UEFI system

diffstat:

 sys/arch/i386/i386/machdep.c |  17 ++++++++++++-----
 sys/arch/i386/pci/piixpcib.c |  10 ++++++++--
 2 files changed, 20 insertions(+), 7 deletions(-)

diffs (77 lines):

diff -r 4b0806212b50 -r d649efef57f1 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Fri Oct 18 00:56:25 2019 +0000
+++ b/sys/arch/i386/i386/machdep.c      Fri Oct 18 01:00:24 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.821 2019/10/12 06:31:03 maxv Exp $       */
+/*     $NetBSD: machdep.c,v 1.822 2019/10/18 01:00:24 manu Exp $       */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.821 2019/10/12 06:31:03 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.822 2019/10/18 01:00:24 manu Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -119,6 +119,8 @@
 
 #include <sys/sysctl.h>
 
+#include <x86/efi.h>
+
 #include <machine/cpu.h>
 #include <machine/cpufunc.h>
 #include <machine/cpuvar.h>
@@ -1368,10 +1370,15 @@
        init386_ksyms();
 
 #if NMCA > 0
-       /* check for MCA bus, needed to be done before ISA stuff - if
+       /* 
+        * check for MCA bus, needed to be done before ISA stuff - if
         * MCA is detected, ISA needs to use level triggered interrupts
-        * by default */
-       mca_busprobe();
+        * by default
+        * And we do not search for MCA using bioscall() on EFI systems
+        * that lacks it (they lack MCA too, anyway).
+        */
+       if (lookup_bootinfo(BTINFO_EFI) == NULL)
+               mca_busprobe();
 #endif
 
 #ifdef XENPV
diff -r 4b0806212b50 -r d649efef57f1 sys/arch/i386/pci/piixpcib.c
--- a/sys/arch/i386/pci/piixpcib.c      Fri Oct 18 00:56:25 2019 +0000
+++ b/sys/arch/i386/pci/piixpcib.c      Fri Oct 18 01:00:24 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpcib.c,v 1.22 2016/07/11 11:31:49 msaitoh Exp $ */
+/* $NetBSD: piixpcib.c,v 1.23 2019/10/18 01:00:25 manu Exp $ */
 
 /*-
  * Copyright (c) 2004, 2006 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: piixpcib.c,v 1.22 2016/07/11 11:31:49 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpcib.c,v 1.23 2019/10/18 01:00:25 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -195,6 +195,12 @@
 {
        struct bioscallregs regs;
 
+       /* No bioscall with EFI */
+       if (lookup_bootinfo(BTINFO_EFI) != NULL) {
+               *sig = *smicmd = *cmd = *smidata = *flags = -1;
+               return;
+       }
+               
        memset(&regs, 0, sizeof(struct bioscallregs));
        regs.EAX = 0x0000e980;  /* IST support */
        regs.EDX = PIIXPCIB_GSIC;



Home | Main Index | Thread Index | Old Index