Skip to contentSkip to conversation

x86: ioapic: Run physical destination mode test iff cpu_count() > 1

PATCH Applied Sean Christopherson 3 participants 3 messages Apr 23, 2020 – May 4, 2020 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: ioapic: Run physical destination mode test iff cpu_count() > 1

Make test_ioapic_physical_destination_mode() depending on having at least two CPUs as it sets ->dest_id to '1', i.e. expects CPU0 and CPU1 to exist. This analysis is backed up by the fact that the test was originally gated by cpu_count() > 1.

Fixes dcf27dc5b5499 ("x86: Fix the logical destination mode test")
Cc Nitesh Narayan Lal <[email protected]>
---
 x86/ioapic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
x86/ioapic.c +2 -1
index 3106531..f315e4b 100644
@@ -504,7 +504,8 @@ int main(void)
 	test_ioapic_level_tmr(true);
 	test_ioapic_edge_tmr(true);
 
-	test_ioapic_physical_destination_mode();
+	if (cpu_count() > 1)
+		test_ioapic_physical_destination_mode();
 	if (cpu_count() > 3)
 		test_ioapic_logical_destination_mode();
 
Signature · 1 line
2.26.0
#1 lore raw
Quoted 17 lines · Sean Christopherson

Make test_ioapic_physical_destination_mode() depending on having at least two CPUs as it sets ->dest_id to '1', i.e. expects CPU0 and CPU1 to exist. This analysis is backed up by the fact that the test was originally gated by cpu_count() > 1.

Fixes dcf27dc5b5499 ("x86: Fix the logical destination mode test")
Cc Nitesh Narayan Lal <[email protected]>
---
 x86/ioapic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
x86/ioapic.c +0 -0
index 3106531..f315e4b 100644

x86/ioapic.c int main(void) · line 511

Quoted 9 lines
x86/ioapic.c +2 -1
@@ -504,7 +504,8 @@ int main(void)
 	test_ioapic_level_tmr(true);
 	test_ioapic_edge_tmr(true);
 
-	test_ioapic_physical_destination_mode();
+	if (cpu_count() > 1)
+		test_ioapic_physical_destination_mode();
 	if (cpu_count() > 3)
 		test_ioapic_logical_destination_mode();
 

Thank you Sean for fixing this.

Signature · 1 line
Nitesh
maintainer Applied
#2 lore raw
In reply to Sean Christopherson
Quoted 18 lines · Sean Christopherson

Make test_ioapic_physical_destination_mode() depending on having at least two CPUs as it sets ->dest_id to '1', i.e. expects CPU0 and CPU1 to exist. This analysis is backed up by the fact that the test was originally gated by cpu_count() > 1.

Fixes dcf27dc5b5499 ("x86: Fix the logical destination mode test")
Cc Nitesh Narayan Lal <[email protected]>
---
 x86/ioapic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
x86/ioapic.c +0 -0
index 3106531..f315e4b 100644

x86/ioapic.c int main(void) · line 511

Quoted 9 lines
x86/ioapic.c +2 -1
@@ -504,7 +504,8 @@ int main(void)
 	test_ioapic_level_tmr(true);
 	test_ioapic_edge_tmr(true);
 
-	test_ioapic_physical_destination_mode();
+	if (cpu_count() > 1)
+		test_ioapic_physical_destination_mode();
 	if (cpu_count() > 3)
 		test_ioapic_logical_destination_mode();
 

Queued, thanks.

Paolo