From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony PERARD Subject: Re: [PATCH v2] xen: Allow CPU to be counted than currently "plugged". Date: Mon, 17 Jun 2013 16:44:53 +0100 Message-ID: <51BF2EF5.4010006@citrix.com> References: <1371478402-28082-1-git-send-email-anthony.perard@citrix.com> <1371478955-29750-1-git-send-email-anthony.perard@citrix.com> <1371482669.8055.10.camel@dagon.hellion.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1371482669.8055.10.camel@dagon.hellion.org.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Stefano Stabellini , Xen Devel List-Id: xen-devel@lists.xenproject.org On 17/06/13 16:24, Ian Campbell wrote: > On Mon, 2013-06-17 at 15:22 +0100, Anthony PERARD wrote: >> Under Xen, SeaBIOS can count more CPU than there should be. This patch >> will allow more CPU to come up instead of going to infinite loop waiting >> for the CPU counter to be decremented. > > Current upstream SeaBIOS has this very different and only runs this loop > on Qemu. > > At a minimum I think we would need to backport: > 5dbf173 Only perform SMP setup on QEMU. > 897fb11 Consistently use CONFIG_COREBOOT, CONFIG_QEMU, and runningOnXen(). > > We've currently got SeaBIOS 1.7.1 in our tree and these are only in the > master branch, but I think backporting is the way to go. > > Hrm, 897fb11 doesn't backport cleanly (lots of changes) and without it > 5dbf173 doesn't backport cleanly either. But I think the net affect when > running on Xen would be the same as the following, can you try it? > > diff --git a/src/smp.c b/src/smp.c > index 3c36f8c..fb55a6e 100644 > --- a/src/smp.c > +++ b/src/smp.c > @@ -84,6 +84,9 @@ int apic_id_is_present(u8 apic_id) > void > smp_probe(void) > { > + if (usingXen()) > + return; > + > ASSERT32FLAT(); > u32 eax, ebx, ecx, cpuid_features; > cpuid(1, &eax, &ebx, &ecx, &cpuid_features); > > This patch definitely works. It was one of my two choices. I though the other approch was better because of mtrr_setup() called before this function, and some mtrr stuff in this function, but I did not realize that mtrr_setup is not doing anything under Xen. So this patch (no smp_probe) is better. -- Anthony PERARD