All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: mtrr range check correction
@ 2007-02-14  7:44 Jan Beulich
  2007-02-18 21:33 ` Chuck Ebbert
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2007-02-14  7:44 UTC (permalink / raw)
  To: linux-kernel

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 <jbeulich@novell.com>

--- linux-2.6.20/arch/i386/kernel/cpu/mtrr/generic.c	2007-02-04 19:44:54.000000000 +0100
+++ 2.6.20-x86-mtrr-range-check/arch/i386/kernel/cpu/mtrr/generic.c	2007-02-09 10:17:26.000000000 +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;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: mtrr range check correction
  2007-02-14  7:44 [PATCH] x86: mtrr range check correction Jan Beulich
@ 2007-02-18 21:33 ` Chuck Ebbert
  2007-02-20  7:47   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Chuck Ebbert @ 2007-02-18 21:33 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel

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 <jbeulich@novell.com>
> 
> --- linux-2.6.20/arch/i386/kernel/cpu/mtrr/generic.c	2007-02-04 19:44:54.000000000 +0100
> +++ 2.6.20-x86-mtrr-range-check/arch/i386/kernel/cpu/mtrr/generic.c	2007-02-09 10:17:26.000000000 +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?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: mtrr range check correction
  2007-02-18 21:33 ` Chuck Ebbert
@ 2007-02-20  7:47   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2007-02-20  7:47 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: linux-kernel

>>> Chuck Ebbert <cebbert@redhat.com> 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 <jbeulich@novell.com>
>> 
>> --- linux-2.6.20/arch/i386/kernel/cpu/mtrr/generic.c	2007-02-04 19:44:54.000000000 +0100
>> +++ 2.6.20-x86-mtrr-range-check/arch/i386/kernel/cpu/mtrr/generic.c	2007-02-09 10:17:26.000000000 +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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-20  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-14  7:44 [PATCH] x86: mtrr range check correction Jan Beulich
2007-02-18 21:33 ` Chuck Ebbert
2007-02-20  7:47   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.