NetBSD Problem Report #39114

From www@NetBSD.org  Tue Jul  8 02:04:49 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 9C14563BD43
	for <gnats-bugs@gnats.netbsd.org>; Tue,  8 Jul 2008 02:04:49 +0000 (UTC)
Message-Id: <20080708020449.6BB0D63BC6A@narn.NetBSD.org>
Date: Tue,  8 Jul 2008 02:04:49 +0000 (UTC)
From: ggm@pobox.com
Reply-To: ggm@pobox.com
To: gnats-bugs@NetBSD.org
Subject: sys/arch/x86/x86/patch.c needs a minor #ifdef for PARALLELS (VT extensions problem)
X-Send-Pr-Version: www-1.0

>Number:         39114
>Category:       kern
>Synopsis:       sys/arch/x86/x86/patch.c needs a minor #ifdef for PARALLELS (VT extensions problem)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 08 02:05:00 +0000 2008
>Closed-Date:    Sun Sep 01 23:54:13 +0000 2019
>Last-Modified:  Sun Sep 01 23:54:13 +0000 2019
>Originator:     George Michaelson
>Release:        current
>Organization:
>Environment:
NetBSD snoid 4.99.69 NetBSD 4.99.69 (GENERIC) #3: Mon Jul  7 20:34:51 EST 2008  ggm@snoid:/usr/obj/sys/arch/i386/compile/GENERIC i386
>Description:
Parallels on Mac has support for 'VT extensions' but when they hit a NetBSD current kernel, some code in patch.c causes a hang during boot.

You can disable the VT extensions, but thats a PITA. There is an existing #if !defined(GPROF) on the code which causes the problem, but having to enable GPROF to get a working kernel also has downsides.

If this patch is acceptable, or something close to it, then a single new Option/define in any kernel Makefile which sets -DPARALLELS will fix the problem.

-George

>How-To-Repeat:
Run Parallels on OS 10.5+ (Leopard) with NetBSD current and a GENERIC kernel. 
>Fix:
--- sys/arch/x86/x86/patch.c.dist       2008-07-08 21:58:22.000000000 +1000
+++ sys/arch/x86/x86/patch.c    2008-07-08 21:59:26.000000000 +1000
@@ -120,7 +120,7 @@
 void
 x86_patch(void)
 {
-#if !defined(GPROF)
+#if !defined(GPROF) && !defined(PARALLELS)
        static int again;
        u_long psl;
        u_long cr0;
@@ -191,5 +191,5 @@

        /* Re-enable write protection. */
        lcr0(cr0);
-#endif /* GPROF */
+#endif /* GPROF && PARALLELS */
 }

>Release-Note:

>Audit-Trail:
From: "Jared D. McNeill" <jmcneill@invisible.ca>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org, 
 netbsd-bugs@netbsd.org
Subject: Re: kern/39114: sys/arch/x86/x86/patch.c needs a minor #ifdef for
 PARALLELS (VT extensions problem)
Date: Tue, 08 Jul 2008 02:35:44 -0400

 ggm@pobox.com wrote:
 >> Number:         39114
 >> Category:       kern
 >> Synopsis:       sys/arch/x86/x86/patch.c needs a minor #ifdef for PARALLELS (VT extensions problem)
 >> Confidential:   no
 >> Severity:       non-critical
 >> Priority:       low
 >> Responsible:    kern-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Tue Jul 08 02:05:00 +0000 2008
 >> Originator:     George Michaelson
 >> Release:        current
 >> Organization:
 >> Environment:
 > NetBSD snoid 4.99.69 NetBSD 4.99.69 (GENERIC) #3: Mon Jul  7 20:34:51 EST 2008  ggm@snoid:/usr/obj/sys/arch/i386/compile/GENERIC i386
 >> Description:
 > Parallels on Mac has support for 'VT extensions' but when they hit a NetBSD current kernel, some code in patch.c causes a hang during boot.
 > 
 > You can disable the VT extensions, but thats a PITA. There is an existing #if !defined(GPROF) on the code which causes the problem, but having to enable GPROF to get a working kernel also has downsides.
 > 
 > If this patch is acceptable, or something close to it, then a single new Option/define in any kernel Makefile which sets -DPARALLELS will fix the problem.

 Hi George --

 Newer Parallels versions should give reasonable data in DMI tables. Can 
 you look into modifying your patch to automatically detect and disable 
 this section of code based on that information rather than adding 
 another compile-time option? See the pmf(4) man page for information on 
 retrieving DMI information from the driver.

 Cheers,
 Jared

From: Jason Thorpe <thorpej@shagadelic.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 ggm@pobox.com
Subject: Re: kern/39114: sys/arch/x86/x86/patch.c needs a minor #ifdef for PARALLELS (VT extensions problem)
Date: Tue, 8 Jul 2008 07:45:12 -0700

 On Jul 8, 2008, at 3:40 AM, Jared D. McNeill wrote:

 > The following reply was made to PR kern/39114; it has been noted by  
 > GNATS.
 >
 > From: "Jared D. McNeill" <jmcneill@invisible.ca>
 > To: gnats-bugs@NetBSD.org
 > Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
 > netbsd-bugs@netbsd.org
 > Subject: Re: kern/39114: sys/arch/x86/x86/patch.c needs a minor  
 > #ifdef for
 > PARALLELS (VT extensions problem)
 > Date: Tue, 08 Jul 2008 02:35:44 -0400
 >
 > ggm@pobox.com wrote:
 >>> Number:         39114
 >>> Category:       kern
 >>> Synopsis:       sys/arch/x86/x86/patch.c needs a minor #ifdef for  
 >>> PARALLELS (VT extensions problem)
 >>> Confidential:   no
 >>> Severity:       non-critical
 >>> Priority:       low
 >>> Responsible:    kern-bug-people
 >>> State:          open
 >>> Class:          sw-bug
 >>> Submitter-Id:   net
 >>> Arrival-Date:   Tue Jul 08 02:05:00 +0000 2008
 >>> Originator:     George Michaelson
 >>> Release:        current
 >>> Organization:
 >>> Environment:
 >> NetBSD snoid 4.99.69 NetBSD 4.99.69 (GENERIC) #3: Mon Jul  7  
 >> 20:34:51 EST 2008  ggm@snoid:/usr/obj/sys/arch/i386/compile/GENERIC  
 >> i386
 >>> Description:
 >> Parallels on Mac has support for 'VT extensions' but when they hit  
 >> a NetBSD current kernel, some code in patch.c causes a hang during  
 >> boot.
 >>
 >> You can disable the VT extensions, but thats a PITA. There is an  
 >> existing #if !defined(GPROF) on the code which causes the problem,  
 >> but having to enable GPROF to get a working kernel also has  
 >> downsides.
 >>
 >> If this patch is acceptable, or something close to it, then a  
 >> single new Option/define in any kernel Makefile which sets - 
 >> DPARALLELS will fix the problem.
 >
 > Hi George --
 >
 > Newer Parallels versions should give reasonable data in DMI tables.  
 > Can
 > you look into modifying your patch to automatically detect and disable
 > this section of code based on that information rather than adding
 > another compile-time option? See the pmf(4) man page for information  
 > on
 > retrieving DMI information from the driver.

 I'd say it's flat-out wrong to make this change at all, unless you're  
 specifically testing for buggy versions of Parallels when you apply  
 the work-around.

 This issue needs to be reported to Parallels so that they can fix it.   
 The work-around can lead to a significant performance penalty.


 >
 >
 > Cheers,
 > Jared
 >

 -- thorpej

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sun, 01 Sep 2019 23:54:13 +0000
State-Changed-Why:
Assuming this is fixed in newer emulator versions. Thanks for the report.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.