x86: Fix APIC version register test
PATCH 1/1 x86: Fix APIC version register test
From: Nadav Amit <[email protected]>
The local APIC existance test considers reserved bits (bits [8:15]), which is not good. In addition, it is best to consider every integrated APIC version as valid.
Cc Sean Christopherson <[email protected]>
Signed-off-by Nadav Amit <[email protected]>
--- x86/apic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
x86/apic.c +4 -4
@@ -11,11 +11,11 @@static void test_lapic_existence (void ) { -u32 lvr; +u8 version; - lvr =apic_read (APIC_LVR ); -printf ("apic version: %x\n" , lvr); -report ("apic existence" , (u16 )lvr ==0x14 ); + version = (u8 )apic_read (APIC_LVR ); +printf ("apic version: %x\n" , version); +report ("apic existence" , version >=0x10 && version <=0x15 ); }#define TSC_DEADLINE_TIMER_VECTOR 0xef
Signature · 1 line
2.17.1
Quoted 23 lines · On 30/04/19 16:32, [email protected] wrote:
From: Nadav Amit <[email protected]>
The local APIC existance test considers reserved bits (bits [8:15]), which is not good. In addition, it is best to consider every integrated APIC version as valid.
Cc Sean Christopherson <[email protected]>Signed-off-by Nadav Amit <[email protected]>--- x86/apic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)x86/apic.c +1
-1@@ -11,11 +11,11 @@static void test_lapic_existence (void ) { -u32 lvr; +u8 version;
x86/apic.c line 21
Quoted 10 lines
x86/apic.c +3
-3- lvr =apic_read (APIC_LVR ); -printf ("apic version: %x\n" , lvr); -report ("apic existence" , (u16 )lvr ==0x14 ); + version = (u8 )apic_read (APIC_LVR ); +printf ("apic version: %x\n" , version); +report ("apic existence" , version >=0x10 && version <=0x15 ); }#define TSC_DEADLINE_TIMER_VECTOR 0xef
Queued, thanks.
Paolo