kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] fix a arrayIndexOutOfBounds in function init_apic_map, online_cpus[i / 8] when i in 248...254.
@ 2020-12-22 13:00 Xinpeng Liu
  2021-01-18 17:42 ` Thomas Huth
  0 siblings, 1 reply; 3+ messages in thread
From: Xinpeng Liu @ 2020-12-22 13:00 UTC (permalink / raw)
  To: kvm; +Cc: liuxp11

refer to x86/cstart64.S:online_cpus:.fill (max_cpus + 7) / 8, 1, 0

Signed-off-by: Xinpeng Liu <liuxp11@chinatelecom.cn>
---
 lib/x86/apic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/x86/apic.c b/lib/x86/apic.c
index f43e9ef..da8f301 100644
--- a/lib/x86/apic.c
+++ b/lib/x86/apic.c
@@ -232,7 +232,7 @@ void mask_pic_interrupts(void)
     outb(0xff, 0xa1);
 }
 
-extern unsigned char online_cpus[MAX_TEST_CPUS / 8];
+extern unsigned char online_cpus[(MAX_TEST_CPUS + 7) / 8];
 
 void init_apic_map(void)
 {
-- 
1.8.3.1


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

* Re: [kvm-unit-tests PATCH] fix a arrayIndexOutOfBounds in function init_apic_map, online_cpus[i / 8] when i in 248...254.
  2020-12-22 13:00 [kvm-unit-tests PATCH] fix a arrayIndexOutOfBounds in function init_apic_map, online_cpus[i / 8] when i in 248...254 Xinpeng Liu
@ 2021-01-18 17:42 ` Thomas Huth
  2021-01-18 17:53   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2021-01-18 17:42 UTC (permalink / raw)
  To: Xinpeng Liu, kvm, Paolo Bonzini

On 22/12/2020 14.00, Xinpeng Liu wrote:
> refer to x86/cstart64.S:online_cpus:.fill (max_cpus + 7) / 8, 1, 0
> 
> Signed-off-by: Xinpeng Liu <liuxp11@chinatelecom.cn>
> ---
>   lib/x86/apic.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/x86/apic.c b/lib/x86/apic.c
> index f43e9ef..da8f301 100644
> --- a/lib/x86/apic.c
> +++ b/lib/x86/apic.c
> @@ -232,7 +232,7 @@ void mask_pic_interrupts(void)
>       outb(0xff, 0xa1);
>   }
>   
> -extern unsigned char online_cpus[MAX_TEST_CPUS / 8];
> +extern unsigned char online_cpus[(MAX_TEST_CPUS + 7) / 8];

According to apic-defs.h, MAX_TEST_CPUS is set to 255, so this makes sense, 
indeed!

Reviewed-by: Thomas Huth <thuth@redhat.com>


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

* Re: [kvm-unit-tests PATCH] fix a arrayIndexOutOfBounds in function init_apic_map, online_cpus[i / 8] when i in 248...254.
  2021-01-18 17:42 ` Thomas Huth
@ 2021-01-18 17:53   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2021-01-18 17:53 UTC (permalink / raw)
  To: Thomas Huth, Xinpeng Liu, kvm

On 18/01/21 18:42, Thomas Huth wrote:
> On 22/12/2020 14.00, Xinpeng Liu wrote:
>> refer to x86/cstart64.S:online_cpus:.fill (max_cpus + 7) / 8, 1, 0
>>
>> Signed-off-by: Xinpeng Liu <liuxp11@chinatelecom.cn>
>> ---
>>   lib/x86/apic.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/x86/apic.c b/lib/x86/apic.c
>> index f43e9ef..da8f301 100644
>> --- a/lib/x86/apic.c
>> +++ b/lib/x86/apic.c
>> @@ -232,7 +232,7 @@ void mask_pic_interrupts(void)
>>       outb(0xff, 0xa1);
>>   }
>> -extern unsigned char online_cpus[MAX_TEST_CPUS / 8];
>> +extern unsigned char online_cpus[(MAX_TEST_CPUS + 7) / 8];
> 
> According to apic-defs.h, MAX_TEST_CPUS is set to 255, so this makes 
> sense, indeed!
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 

Queued, thanks.

Paolo


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

end of thread, other threads:[~2021-01-18 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 13:00 [kvm-unit-tests PATCH] fix a arrayIndexOutOfBounds in function init_apic_map, online_cpus[i / 8] when i in 248...254 Xinpeng Liu
2021-01-18 17:42 ` Thomas Huth
2021-01-18 17:53   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).