All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zachary Amsden <zach@vmware.com>
To: Zachary Amsden <zach@vmware.com>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Jeffrey Sheldon <jeffshel@vmware.com>,
	Ole Agesen <agesen@vmware.com>, Shai Fultheim <shai@scalex86.org>,
	Andrew Morton <akpm@odsl.org>, Jack Lo <jlo@vmware.com>,
	Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Virtualization Mailing List <virtualization@lists.osdl.org>,
	Chris Wright <chrisw@osdl.org>, Martin Bligh <mbligh@mbligh.org>,
	Pratap Subrahmanyam <pratap@vmware.com>,
	Christopher Li <chrisl@vmware.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>, Andi Kleen <ak@muc.de>
Subject: Re: [PATCH 2/3] Pnp bios gdt fix
Date: Wed, 28 Sep 2005 16:06:24 -0700	[thread overview]
Message-ID: <433B21F0.1030103@vmware.com> (raw)
In-Reply-To: <200509282143.j8SLh7dY032231@zach-dev.vmware.com>

[-- Attachment #1: Type: text/plain, Size: 585 bytes --]

Zachary Amsden wrote:

>PnP BIOS for x86 is part of drivers, so I missed it in the initial
>GDT page alignment patch.  Kudos to Andrew for fixing that.
>Unfortunately, fixing the build introduced a kernel panic when
>trying to setup the as of yet unallocated GDTs for the APs.
>This fixes the problem by setting only the BSP's GDT, then copying
>the PnP segments back to the cpu_gdt_table template.
>
>  
>

Bogus patch!  I was just getting lucky and not running PnP BIOS code on 
the AP's -- until now.  Turns out the fix and the bug were much 
simpler.  Please apply this instead.



[-- Attachment #2: pnp-bios-gdt-fix --]
[-- Type: text/plain, Size: 1104 bytes --]

PnP BIOS for x86 is part of drivers, so I missed it in the initial
GDT page alignment patch.  Kudos to Andrew for fixing that.
Unfortunately, fixing the build introduced a kernel panic when
trying to setup the as of yet unallocated GDTs for the APs.

I totally misdiagnosed this.  The problem happens only
when NR_CPUS > physical CPUs.  Fix is to ignore missing GDT's.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Index: linux-2.6.14-rc2/drivers/pnp/pnpbios/bioscalls.c
===================================================================
--- linux-2.6.14-rc2.orig/drivers/pnp/pnpbios/bioscalls.c	2005-09-28 15:57:42.000000000 -0700
+++ linux-2.6.14-rc2/drivers/pnp/pnpbios/bioscalls.c	2005-09-28 15:59:37.000000000 -0700
@@ -537,6 +537,8 @@ void pnpbios_calls_init(union pnp_bios_i
 	_set_limit((char *)&bad_bios_desc, 4095 - (0x40 << 4));
 	for(i=0; i < NR_CPUS; i++)
 	{
+		if (!get_cpu_gdt_table(i))
+			continue;
 		Q2_SET_SEL(i, PNP_CS32, &pnp_bios_callfunc, 64 * 1024);
 		Q_SET_SEL(i, PNP_CS16, header->fields.pm16cseg, 64 * 1024);
 		Q_SET_SEL(i, PNP_DS, header->fields.pm16dseg, 64 * 1024);

      reply	other threads:[~2005-09-28 23:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-28 21:43 [PATCH 2/3] Pnp bios gdt fix Zachary Amsden
2005-09-28 23:06 ` Zachary Amsden [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=433B21F0.1030103@vmware.com \
    --to=zach@vmware.com \
    --cc=agesen@vmware.com \
    --cc=ak@muc.de \
    --cc=akpm@odsl.org \
    --cc=chrisl@vmware.com \
    --cc=chrisw@osdl.org \
    --cc=hpa@zytor.com \
    --cc=jeffshel@vmware.com \
    --cc=jlo@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@mbligh.org \
    --cc=mingo@elte.hu \
    --cc=pratap@vmware.com \
    --cc=shai@scalex86.org \
    --cc=torvalds@osdl.org \
    --cc=virtualization@lists.osdl.org \
    --cc=zwane@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.