[coreboot] [PATCH] Warn if we run out of MTRRs

ron minnich rminnich at gmail.com
Wed Feb 11 17:23:46 CET 2009


I think it is an emergency as you always want a print.

Ron

On 2/11/09, Myles Watson <mylesgw at gmail.com> wrote:
> On Wed, Feb 11, 2009 at 7:24 AM, Carl-Daniel Hailfinger
> <c-d.hailfinger.devel.2006 at gmx.net> wrote:
>> Print a loud warning message if we run out of MTRRs.
>
> Is it really an emergency?  I guess it doesn't matter too much, but it
> could be printk_info.
>
>> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
>>
> Acked-by: Myles Watson <mylesgw at gmail.com>
>
> Myles
>
>> ==================================================================
>> --- corebootv2/src/cpu/x86/mtrr/mtrr.c  (revision 3935)
>> +++ corebootv2/src/cpu/x86/mtrr/mtrr.c  (working copy)
>> @@ -228,9 +228,14 @@
>>        unsigned long range_startk, unsigned long range_sizek,
>>        unsigned long next_range_startk, unsigned char type, unsigned
>> address_bits)
>>  {
>> -       if (!range_sizek || (reg >= BIOS_MTRRS)) {
>> +       if (!range_sizek) {
>> +               printk_debug("range_to_mtrr called for empty range\n");
>>                return reg;
>>        }
>> +       if (reg >= BIOS_MTRRS) {
>> +               printk_emerg("Running out of variable MTRRs!\n");
>> +               return reg;
>> +       }
>>        while(range_sizek) {
>>                unsigned long max_align, align;
>>                unsigned long sizek;
>> @@ -249,8 +254,10 @@
>>                set_var_mtrr(reg++, range_startk, sizek, type,
>> address_bits);
>>                range_startk += sizek;
>>                range_sizek -= sizek;
>> -               if (reg >= BIOS_MTRRS)
>> +               if (reg >= BIOS_MTRRS) {
>> +                       printk_emerg("Running out of variable MTRRs!\n");
>>                        break;
>> +               }
>>        }
>>        return reg;
>>  }
>>
>>
>> --
>> http://www.hailfinger.org/
>>
>>
>> --
>> coreboot mailing list: coreboot at coreboot.org
>> http://www.coreboot.org/mailman/listinfo/coreboot
>>
>
> --
> coreboot mailing list: coreboot at coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot
>

-- 
Sent from my mobile device




More information about the coreboot mailing list