NetBSD-Bugs archive

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

Re: kern/44069: NetBSD-current hangs during boot under Linux kvm emulation

The following reply was made to PR kern/44069; it has been noted by GNATS.

From: Jukka Ruohonen <>
Subject: Re: kern/44069: NetBSD-current hangs during boot under Linux kvm 
Date: Mon, 8 Nov 2010 20:10:36 +0200

 zOn Mon, Nov 08, 2010 at 04:40:01PM +0000, Andreas Gustafsson wrote:
 > Booting versions of -current with CVS source date older than
 > 2009. works (the exact date was identified using
 > automated binary serach).  The problem was introduced, or perhaps
 > exposed, by following commit by toshii:
 > Index: mpacpi.c
 > ===================================================================
 > RCS file: /cvsroot/src/sys/arch/x86/x86/mpacpi.c,v
 > retrieving revision 1.78
 > retrieving revision 1.79
 > diff -u -r1.78 -r1.79
 > --- mpacpi.c    16 Sep 2009 10:47:54 -0000      1.78
 > +++ mpacpi.c    4 Nov 2009 14:39:17 -0000       1.79
 > @@ -1069,7 +1069,7 @@
 >                 arg.Type = ACPI_TYPE_INTEGER;
 >                 arg.Integer.Value = 1;  /* I/O APIC (0 = PIC, 2 = IOSAPIC) */
 >                 rv = AcpiEvaluateObject(NULL, "\\_PIC", &arglist, NULL);
 > -               if (ACPI_FAILURE(rv)) {
 > +               if (ACPI_FAILURE(rv) && rv != AE_NOT_FOUND) {
 >                         if (mp_verbose)
 >                                 printf("mpacpi: switch to APIC mode 
 > failed\n");
 >                         return 0;
 Interestingly, the commit message tells the exact opposite story:
 "revision 1.79
  date: 2009/11/04 14:39:17;  author: toshii;  state: Exp;  lines: +3 -3
  Don't return an error if the _PIC method isn't found.
  It's an optional method and not found in kvm/qemu.
 To my understanding, the check added by toshii is right. If the _PIC method
 is not available, PIC is assumed by default. The specification is quote
 clear about this:
 "The \_PIC optional method is used to report to the BIOS the current
  interrupt model used by the OS.  This control method returns nothing. The
  argument passed into the method signifies the interrupt model OSPM has
  chosen, PIC mode, APIC mode, or SAPIC mode.  Notice that calling this method
  is optional for OSPM.  If the method is never called, the BIOS must assume
  PIC mode.  It is important that the BIOS save the value passed in by OSPM
  for later use during wake operations."
 Moreover, the check (namely 'if (ACPI_FAILURE(rv) && rv != AE_NOT_FOUND)')
 is exactly the same as in Linux.
 A quick conclusion: I doubt anyone dares to change this highly error-prone
 code path based on the supplied information alone. It works on real hardware.
 Has NetBSD worked on KVM before? Can you post the full dmesg?
 - Jukka.

Home | Main Index | Thread Index | Old Index