Re: [PATCH] x86: mtrr range check correction

2007-02-19 Thread Jan Beulich
>>> Chuck Ebbert <[EMAIL PROTECTED]> 18.02.07 22:33 >>>
>Jan Beulich wrote:
>> Whether a region is below 1Mb is determined by its start rather than
>> its end.
>> 
>> This hunk got erroneously dropped from a previous patch.
>> 
>> Signed-off-by: Jan Beulich <[EMAIL PROTECTED]>
>> 
>> --- linux-2.6.20/arch/i386/kernel/cpu/mtrr/generic.c 2007-02-04 
>> 19:44:54.0 +0100
>> +++ 2.6.20-x86-mtrr-range-check/arch/i386/kernel/cpu/mtrr/generic.c  
>> 2007-02-09 10:17:26.0 +0100
>> @@ -428,7 +428,7 @@ int generic_validate_add_page(unsigned l
>>  }
>>  }
>>  
>> -if (base + size < 0x100) {
>> +if (base < 0x100) {
>>  printk(KERN_WARNING "mtrr: cannot set region below 1 MiB 
>> (0x%lx000,0x%lx000)\n",
>> base, size);
>>  return -EINVAL;
>> 
>
>What about wraparound?

Should be caught by the subsequent checking of upper bits of first and last byte
being identical.

Jan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: mtrr range check correction

2007-02-18 Thread Chuck Ebbert
Jan Beulich wrote:
> Whether a region is below 1Mb is determined by its start rather than
> its end.
> 
> This hunk got erroneously dropped from a previous patch.
> 
> Signed-off-by: Jan Beulich <[EMAIL PROTECTED]>
> 
> --- linux-2.6.20/arch/i386/kernel/cpu/mtrr/generic.c  2007-02-04 
> 19:44:54.0 +0100
> +++ 2.6.20-x86-mtrr-range-check/arch/i386/kernel/cpu/mtrr/generic.c   
> 2007-02-09 10:17:26.0 +0100
> @@ -428,7 +428,7 @@ int generic_validate_add_page(unsigned l
>   }
>   }
>  
> - if (base + size < 0x100) {
> + if (base < 0x100) {
>   printk(KERN_WARNING "mtrr: cannot set region below 1 MiB 
> (0x%lx000,0x%lx000)\n",
>  base, size);
>   return -EINVAL;
> 

What about wraparound?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] x86: mtrr range check correction

2007-02-13 Thread Jan Beulich
Whether a region is below 1Mb is determined by its start rather than
its end.

This hunk got erroneously dropped from a previous patch.

Signed-off-by: Jan Beulich <[EMAIL PROTECTED]>

--- linux-2.6.20/arch/i386/kernel/cpu/mtrr/generic.c2007-02-04 
19:44:54.0 +0100
+++ 2.6.20-x86-mtrr-range-check/arch/i386/kernel/cpu/mtrr/generic.c 
2007-02-09 10:17:26.0 +0100
@@ -428,7 +428,7 @@ int generic_validate_add_page(unsigned l
}
}
 
-   if (base + size < 0x100) {
+   if (base < 0x100) {
printk(KERN_WARNING "mtrr: cannot set region below 1 MiB 
(0x%lx000,0x%lx000)\n",
   base, size);
return -EINVAL;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/