* [PATCH] Fix BIOS CPU enumeration
@ 2007-08-22 14:08 Li, Xin B
[not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E11FD-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Li, Xin B @ 2007-08-22 14:08 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
KVM BIOS uses the following code to delay an expected milliseconds
void delay_ms(int n)
{
int i, j;
for(i = 0; i < n; i++) {
/* approximative ! */
for(j = 0; j < 1000000; j++);
}
}
It's OK when we run APIC in user level, but when APIC is in kernel, the
delayed time is not enough and causes BSP delays a too short peroid
that APs have no enough time to reach the point BIOS enumerates CPU,
so BIOS always reports only one CPU is detected in this VM.
The following patch fixed this issue.
Signed-off-by: Xin Li <xin.b.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
diff --git a/bios/rombios32.c b/bios/rombios32.c
index 1562047..9b200b9 100644
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -355,7 +355,8 @@ void delay_ms(int n)
{
int i, j;
for(i = 0; i < n; i++) {
-#ifdef BX_QEMU
+#if 0
+//#ifdef BX_QEMU
/* approximative ! */
for(j = 0; j < 1000000; j++);
#else
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
^ permalink raw reply related [flat|nested] 8+ messages in thread[parent not found: <B30DA1341B0CFA4893EF8A36B40B5C5D018E11FD-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] Fix BIOS CPU enumeration [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E11FD-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2007-08-22 14:17 ` Li, Xin B [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E1200-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> 2007-08-23 7:50 ` Li, Xin B 1 sibling, 1 reply; 8+ messages in thread From: Li, Xin B @ 2007-08-22 14:17 UTC (permalink / raw) To: Li, Xin B, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Now on lapic5 branch, we can run Windows guests, both 32bit and 64bit are OK, but Linux still has problems. And we will send out the SMP patches for review soon. -Xin >-----Original Message----- >From: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >[mailto:kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Li, Xin B >Sent: Wednesday, August 22, 2007 10:08 PM >To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >Subject: [kvm-devel] [PATCH] Fix BIOS CPU enumeration > >KVM BIOS uses the following code to delay an expected milliseconds > >void delay_ms(int n) >{ > int i, j; > for(i = 0; i < n; i++) { > /* approximative ! */ > for(j = 0; j < 1000000; j++); > } >} > >It's OK when we run APIC in user level, but when APIC is in kernel, the >delayed time is not enough and causes BSP delays a too short peroid >that APs have no enough time to reach the point BIOS enumerates CPU, >so BIOS always reports only one CPU is detected in this VM. >The following patch fixed this issue. > >Signed-off-by: Xin Li <xin.b.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > >diff --git a/bios/rombios32.c b/bios/rombios32.c >index 1562047..9b200b9 100644 >--- a/bios/rombios32.c >+++ b/bios/rombios32.c >@@ -355,7 +355,8 @@ void delay_ms(int n) > { > int i, j; > for(i = 0; i < n; i++) { >-#ifdef BX_QEMU >+#if 0 >+//#ifdef BX_QEMU > /* approximative ! */ > for(j = 0; j < 1000000; j++); > #else > >--------------------------------------------------------------- >---------- >This SF.net email is sponsored by: Splunk Inc. >Still grepping through log files to find problems? Stop. >Now Search log events and configuration files using AJAX and a browser. >Download your FREE copy of Splunk now >> http://get.splunk.com/ >_______________________________________________ >kvm-devel mailing list >kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >https://lists.sourceforge.net/lists/listinfo/kvm-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <B30DA1341B0CFA4893EF8A36B40B5C5D018E1200-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] Fix BIOS CPU enumeration [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E1200-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2007-08-22 14:41 ` Li, Xin B [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E1227-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Li, Xin B @ 2007-08-22 14:41 UTC (permalink / raw) To: Li, Xin B, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Just rebased to the latest lapic5 branch, found SMP patch is there, so kernel APIC SMP is working on your side? But I don't think you can even pass BIOS CPU enumeration. -Xin >-----Original Message----- >From: Li, Xin B >Sent: Wednesday, August 22, 2007 10:17 PM >To: Li, Xin B; kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >Subject: RE: [kvm-devel] [PATCH] Fix BIOS CPU enumeration > >Now on lapic5 branch, we can run Windows guests, both 32bit >and 64bit are OK, but Linux still has problems. >And we will send out the SMP patches for review soon. > >-Xin > >>-----Original Message----- >>From: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >>[mailto:kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of >Li, Xin B >>Sent: Wednesday, August 22, 2007 10:08 PM >>To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >>Subject: [kvm-devel] [PATCH] Fix BIOS CPU enumeration >> >>KVM BIOS uses the following code to delay an expected milliseconds >> >>void delay_ms(int n) >>{ >> int i, j; >> for(i = 0; i < n; i++) { >> /* approximative ! */ >> for(j = 0; j < 1000000; j++); >> } >>} >> >>It's OK when we run APIC in user level, but when APIC is in >kernel, the >>delayed time is not enough and causes BSP delays a too short peroid >>that APs have no enough time to reach the point BIOS enumerates CPU, >>so BIOS always reports only one CPU is detected in this VM. >>The following patch fixed this issue. >> >>Signed-off-by: Xin Li <xin.b.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> >> >>diff --git a/bios/rombios32.c b/bios/rombios32.c >>index 1562047..9b200b9 100644 >>--- a/bios/rombios32.c >>+++ b/bios/rombios32.c >>@@ -355,7 +355,8 @@ void delay_ms(int n) >> { >> int i, j; >> for(i = 0; i < n; i++) { >>-#ifdef BX_QEMU >>+#if 0 >>+//#ifdef BX_QEMU >> /* approximative ! */ >> for(j = 0; j < 1000000; j++); >> #else >> >>--------------------------------------------------------------- >>---------- >>This SF.net email is sponsored by: Splunk Inc. >>Still grepping through log files to find problems? Stop. >>Now Search log events and configuration files using AJAX and >a browser. >>Download your FREE copy of Splunk now >> http://get.splunk.com/ >>_______________________________________________ >>kvm-devel mailing list >>kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >>https://lists.sourceforge.net/lists/listinfo/kvm-devel >> > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <B30DA1341B0CFA4893EF8A36B40B5C5D018E1227-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] Fix BIOS CPU enumeration [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E1227-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2007-08-22 14:45 ` Avi Kivity 0 siblings, 0 replies; 8+ messages in thread From: Avi Kivity @ 2007-08-22 14:45 UTC (permalink / raw) To: Li, Xin B; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Li, Xin B wrote: > Just rebased to the latest lapic5 branch, found SMP patch is there, so > kernel APIC SMP is working on your side? > But I don't think you can even pass BIOS CPU enumeration. > If it got there, it's something in progress that wasn't meant to be pushed. Do a 'git reset --hard HEAD^' to get rid of it. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Fix BIOS CPU enumeration [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E11FD-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> 2007-08-22 14:17 ` Li, Xin B @ 2007-08-23 7:50 ` Li, Xin B [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E15C1-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> 1 sibling, 1 reply; 8+ messages in thread From: Li, Xin B @ 2007-08-23 7:50 UTC (permalink / raw) To: Li, Xin B, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Current BIOS delays 10ms for AP to boot up, but we found it may be too short : on some machine 10ms is OK, some other not. And if we look at the OS side, Linux waits for 5s for AP to boot up, so I would suggest to wait for a much longer time, like 2000ms, is that OK? -Xin >-----Original Message----- >From: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >[mailto:kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Li, Xin B >Sent: Wednesday, August 22, 2007 10:08 PM >To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >Subject: [kvm-devel] [PATCH] Fix BIOS CPU enumeration > >KVM BIOS uses the following code to delay an expected milliseconds > >void delay_ms(int n) >{ > int i, j; > for(i = 0; i < n; i++) { > /* approximative ! */ > for(j = 0; j < 1000000; j++); > } >} > >It's OK when we run APIC in user level, but when APIC is in kernel, the >delayed time is not enough and causes BSP delays a too short peroid >that APs have no enough time to reach the point BIOS enumerates CPU, >so BIOS always reports only one CPU is detected in this VM. >The following patch fixed this issue. > >Signed-off-by: Xin Li <xin.b.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > >diff --git a/bios/rombios32.c b/bios/rombios32.c >index 1562047..9b200b9 100644 >--- a/bios/rombios32.c >+++ b/bios/rombios32.c >@@ -355,7 +355,8 @@ void delay_ms(int n) > { > int i, j; > for(i = 0; i < n; i++) { >-#ifdef BX_QEMU >+#if 0 >+//#ifdef BX_QEMU > /* approximative ! */ > for(j = 0; j < 1000000; j++); > #else > >--------------------------------------------------------------- >---------- >This SF.net email is sponsored by: Splunk Inc. >Still grepping through log files to find problems? Stop. >Now Search log events and configuration files using AJAX and a browser. >Download your FREE copy of Splunk now >> http://get.splunk.com/ >_______________________________________________ >kvm-devel mailing list >kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >https://lists.sourceforge.net/lists/listinfo/kvm-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <B30DA1341B0CFA4893EF8A36B40B5C5D018E15C1-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] Fix BIOS CPU enumeration [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E15C1-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2007-08-23 8:29 ` Avi Kivity [not found] ` <46CD454F.3000903-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Avi Kivity @ 2007-08-23 8:29 UTC (permalink / raw) To: Li, Xin B; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Li, Xin B wrote: > Current BIOS delays 10ms for AP to boot up, but we found it may be too > short : on some machine 10ms is OK, some other not. And if we look at > the OS side, Linux waits for 5s for AP to boot up, so I would suggest to > wait for a much longer time, like 2000ms, is that OK Two seconds is a bit long. But now that we have the bios in our source repo, we can go wild, and pass the cpu count in the cmos non volatile memory or through some port, and make it timing independent. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <46CD454F.3000903-atKUWr5tajBWk0Htik3J/w@public.gmane.org>]
* Re: [PATCH] Fix BIOS CPU enumeration [not found] ` <46CD454F.3000903-atKUWr5tajBWk0Htik3J/w@public.gmane.org> @ 2007-08-23 8:30 ` Li, Xin B [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E160A-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Li, Xin B @ 2007-08-23 8:30 UTC (permalink / raw) To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f >-----Original Message----- >From: Avi Kivity [mailto:avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org] >Sent: Thursday, August 23, 2007 4:29 PM >To: Li, Xin B >Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >Subject: Re: [kvm-devel] [PATCH] Fix BIOS CPU enumeration > >Li, Xin B wrote: >> Current BIOS delays 10ms for AP to boot up, but we found it >may be too >> short : on some machine 10ms is OK, some other not. And if we look at >> the OS side, Linux waits for 5s for AP to boot up, so I >would suggest to >> wait for a much longer time, like 2000ms, is that OK > >Two seconds is a bit long. But now that we have the bios in >our source >repo, we can go wild, and pass the cpu count in the cmos non volatile >memory or through some port, and make it timing independent. Hmmm, sounds good! -Xin ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <B30DA1341B0CFA4893EF8A36B40B5C5D018E160A-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] Fix BIOS CPU enumeration [not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E160A-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2007-08-23 8:47 ` Avi Kivity 0 siblings, 0 replies; 8+ messages in thread From: Avi Kivity @ 2007-08-23 8:47 UTC (permalink / raw) To: Li, Xin B; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Li, Xin B wrote: >> -----Original Message----- >> From: Avi Kivity [mailto:avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org] >> Sent: Thursday, August 23, 2007 4:29 PM >> To: Li, Xin B >> Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >> Subject: Re: [kvm-devel] [PATCH] Fix BIOS CPU enumeration >> >> Li, Xin B wrote: >> >>> Current BIOS delays 10ms for AP to boot up, but we found it >>> >> may be too >> >>> short : on some machine 10ms is OK, some other not. And if we look at >>> the OS side, Linux waits for 5s for AP to boot up, so I >>> >> would suggest to >> >>> wait for a much longer time, like 2000ms, is that OK >>> >> Two seconds is a bit long. But now that we have the bios in >> our source >> repo, we can go wild, and pass the cpu count in the cmos non volatile >> memory or through some port, and make it timing independent. >> > > Hmmm, sounds good! > Okay, so I am dropping this patch (using the PIT) and waiting for a timing independent patch. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-08-23 8:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-22 14:08 [PATCH] Fix BIOS CPU enumeration Li, Xin B
[not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E11FD-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-08-22 14:17 ` Li, Xin B
[not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E1200-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-08-22 14:41 ` Li, Xin B
[not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E1227-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-08-22 14:45 ` Avi Kivity
2007-08-23 7:50 ` Li, Xin B
[not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E15C1-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-08-23 8:29 ` Avi Kivity
[not found] ` <46CD454F.3000903-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-23 8:30 ` Li, Xin B
[not found] ` <B30DA1341B0CFA4893EF8A36B40B5C5D018E160A-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-08-23 8:47 ` Avi Kivity
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox