[kvm-unit-tests,3/3] x86: Bump max number of test CPUs to 255
diff mbox series

Message ID 20190906163450.30797-4-sean.j.christopherson@intel.com
State New
Headers show
Series
  • x86: Cleanup max test CPUs
Related show

Commit Message

Sean Christopherson Sept. 6, 2019, 4:34 p.m. UTC
The max number of CPUs is not actually enforced anywhere, e.g. manually
setting '-smp 240' when running a unit test will cause random corruption
and hangs during smp initialization.  Increase the max number of test
CPUs to 255, which is the true max kvm-unit-tests can support without
significant changes, e.g. it would need to boot with x2APIC enabled,
support interrupt remapping, etc...

There is no known use case for running with more than 64 CPUs, but the
cost of supporting 255 is minimal, e.g. increases the size of each test
binary by a few kbs and burns a few extra cycles in init_apic_map().

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 lib/x86/apic-defs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Sept. 10, 2019, 2:46 p.m. UTC | #1
On 06/09/19 18:34, Sean Christopherson wrote:
> The max number of CPUs is not actually enforced anywhere, e.g. manually
> setting '-smp 240' when running a unit test will cause random corruption
> and hangs during smp initialization.  Increase the max number of test
> CPUs to 255, which is the true max kvm-unit-tests can support without
> significant changes, e.g. it would need to boot with x2APIC enabled,
> support interrupt remapping, etc...
> 
> There is no known use case for running with more than 64 CPUs, but the
> cost of supporting 255 is minimal, e.g. increases the size of each test
> binary by a few kbs and burns a few extra cycles in init_apic_map().
> 
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
>  lib/x86/apic-defs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/x86/apic-defs.h b/lib/x86/apic-defs.h
> index 7107f0f..b2014de 100644
> --- a/lib/x86/apic-defs.h
> +++ b/lib/x86/apic-defs.h
> @@ -6,7 +6,7 @@
>   * both in C and ASM
>   */
>  
> -#define MAX_TEST_CPUS (64)
> +#define MAX_TEST_CPUS (255)
>  
>  /*
>   * Constants for various Intel APICs. (local APIC, IOAPIC, etc.)
> 

Since this is not a multiple of 8 anymore, the previous patch should
have used (max_cpus + 7) / 8.  Fixed that and queued.

Paolo

Patch
diff mbox series

diff --git a/lib/x86/apic-defs.h b/lib/x86/apic-defs.h
index 7107f0f..b2014de 100644
--- a/lib/x86/apic-defs.h
+++ b/lib/x86/apic-defs.h
@@ -6,7 +6,7 @@ 
  * both in C and ASM
  */
 
-#define MAX_TEST_CPUS (64)
+#define MAX_TEST_CPUS (255)
 
 /*
  * Constants for various Intel APICs. (local APIC, IOAPIC, etc.)