[SeaBIOS] [PATCH 1/3] Halt if number of started cpus are more then expected

Igor Mammedov imammedo at redhat.com
Mon Mar 12 10:52:18 CET 2012


On 03/11/2012 11:36 AM, Gleb Natapov wrote:
> On Sat, Mar 10, 2012 at 12:47:26PM +0100, Igor Mammedov wrote:
>> Reduce amount of consumed cpu time (i.e. don't spin forever) if
>> number of started cpus are more then expected. And print a bug
>> message into debug port.
>>
>> Signed-off-by: Igor Mammedov<imammedo at redhat.com>
>> ---
>>   src/smp.c |    8 +++++++-
>>   1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/smp.c b/src/smp.c
>> index 8c077a1..9933ac6 100644
>> --- a/src/smp.c
>> +++ b/src/smp.c
>> @@ -115,8 +115,14 @@ smp_probe(void)
>>           msleep(10);
>>       } else {
>>           u8 cmos_smp_count = inb_cmos(CMOS_BIOS_SMP_COUNT);
>> -        while (cmos_smp_count + 1 != readl(&CountCPUs))
>> +        while (cmos_smp_count + 1 != readl(&CountCPUs)) {
>> +            if (cmos_smp_count + 1<  readl(&CountCPUs)) {
>> +                dprintf(1, "BUG: Expected %d cpu(s) but %d cpus started\n",
>> +                        cmos_smp_count + 1, readl(&CountCPUs));
> Shouldn't we print it to the console too?
I'm not sure if it's possible to print at this stage, but I'll try and
re-post if it works.

>
>> +                hlt();
>> +            }
>>               yield();
>> +        }
>>       }
>>
>>       // Restore memory.
>> --
>> 1.7.7.6
>
> --
> 			Gleb.

-- 
-----
  Igor



More information about the SeaBIOS mailing list