Support more than 255 cpus
cover Support more than 255 cpus
From: "Li, ZhenHua" <[email protected]>
These series patches are trying to make Qemu support more than 255 CPUs. The max cpu number changed to 4096.
Support more than 255 cpus: ACPI and APIC defines Support more than 255 cpus: max_cpus to 4096 Support more than 255 cpus: max cpumask bit to 4096 Support more than 255 cpus: runtime chec
include/hw/acpi/cpu_hotplug_defs.h | 4 ++-- include/hw/i386/apic_internal.h | 2 +- include/hw/i386/pc.h | 2 +- include/sysemu/sysemu.h | 2 +- hw/i386/acpi-build.c | 8 ++++----
PATCH 1/4 Support more than 255 cpus: ACPI and APIC defines
From: "Li, ZhenHua" <[email protected]>
Change ACPI_CPU_HOTPLUG_ID_LIMIT from 256 to 4096; Change MAX_APICS from 256 to 4096;
--- include/hw/acpi/cpu_hotplug_defs.h | 4 ++-- include/hw/i386/apic_internal.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
include/hw/acpi/cpu_hotplug_defs.h +2 -2
@@ -21,10 +21,10 @@/* Limit for CPU arch IDs for CPU hotplug. All hotpluggable CPUs should * have CPUClass.get_arch_id() < ACPI_CPU_HOTPLUG_ID_LIMIT. */ -#define ACPI_CPU_HOTPLUG_ID_LIMIT 256 +#define ACPI_CPU_HOTPLUG_ID_LIMIT 4096/* 256 CPU IDs, 8 bits per entry: */ -#define ACPI_GPE_PROC_LEN 32 +#define ACPI_GPE_PROC_LEN ((ACPI_CPU_HOTPLUG_ID_LIMIT)/8)#define ICH9_CPU_HOTPLUG_IO_BASE 0x0CD8#define PIIX4_CPU_HOTPLUG_IO_BASE 0xaf00
include/hw/i386/apic_internal.h +1 -1
@@ -64,7 +64,7 @@#define VAPIC_ENABLE_BIT 0#define VAPIC_ENABLE_MASK (1 << VAPIC_ENABLE_BIT) -#define MAX_APICS 255 +#define MAX_APICS 4096typedef struct APICCommonState APICCommonState ;
Signature · 1 line
2.0.0-rc0
PATCH 2/4 Support more than 255 cpus: max_cpus to 4096
In reply to Li, Zhen-HuaFrom: "Li, ZhenHua" <[email protected]>
max_cpus from 255 to 4096. So the machine types can support up to 4096 cpus.
--- include/hw/i386/pc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/i386/pc.h +1 -1
@@ -411,6 +411,6 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);#define PC_DEFAULT_MACHINE_OPTIONS \ PC_COMMON_MACHINE_OPTIONS, \ .hot_add_cpu = pc_hot_add_cpu, \ - .max_cpus = 255 + .max_cpus = 4096#endif
Signature · 1 line
2.0.0-rc0
PATCH 3/4 Support more than 255 cpus: max cpumask bit to 4096
In reply to Li, Zhen-HuaFrom: "Li, ZhenHua" <[email protected]>
Change MAX_CPUMASK_BITS from 255 to 4096.
--- include/sysemu/sysemu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/sysemu/sysemu.h +1 -1
@@ -139,7 +139,7 @@ extern QEMUClockType rtc_clock;* * Note that cpu->get_arch_id() may be larger than MAX_CPUMASK_BITS. */ -#define MAX_CPUMASK_BITS 255 +#define MAX_CPUMASK_BITS 4096extern int nb_numa_nodes;extern uint64_t node_mem[MAX_NODES ];
Signature · 1 line
2.0.0-rc0
PATCH 4/4 Support more than 255 cpus: runtime check
In reply to Li, Zhen-HuaFrom: "Li, ZhenHua" <[email protected]>
There is some runtime check for max cpu count. Make them support 4096 cpus.
--- hw/i386/acpi-build.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/i386/acpi-build.c +4 -4
@@ -272,7 +272,7 @@ static void GCC_FMT_ATTR(2, 3) build_append_nameseg(GArray *array, const char *format, ...) { /* It would be nicer to use g_string_vprintf but it's only there in 2.22 */ - char s[] = "XXXX"; + char s[] = "XXXXXX"; int len; va_list args;
@@ -280,7 +280,7 @@ build_append_nameseg(GArray *array, const char *format, ...) len =vsnprintf (s,sizeof s, format, args);va_end (args); -assert (len ==4 ); +assert (len ==4 || len ==5 || len ==6 );g_array_append_vals (array, s, len); }
@@ -680,7 +680,7 @@ build_append_notify_method(GArray *device, const char *name,for (i =0 ; i < count; i++) {GArray *target =build_alloc_array ();build_append_nameseg (target, format, i); -assert (i <256 );/* Fits in 1 byte */ +assert (i <4096 );/* Fits in 1 byte */ build_append_notify_target_ifequal (method, target, i,1 );build_free_array (target); }
@@ -1006,7 +1006,7 @@ build_ssdt(GArray *table_data, GArray *linker,/* The current AML generator can cover the APIC ID range [0..255], * inclusive, for VCPU hotplug. */ -QEMU_BUILD_BUG_ON (ACPI_CPU_HOTPLUG_ID_LIMIT >256 ); +QEMU_BUILD_BUG_ON (ACPI_CPU_HOTPLUG_ID_LIMIT >4096 );g_assert (acpi_cpus <=ACPI_CPU_HOTPLUG_ID_LIMIT );/* Copy header and patch values in the S3_ / S4_ / S5_ packages */
Signature · 1 line
2.0.0-rc0
Re: [Qemu-devel] [PATCH 4/4] Support more than 255 cpus: runtime check
Quoted 13 lines · Zhen-Hua
From: "Li, ZhenHua" <[email protected]>
There is some runtime check for max cpu count. Make them support 4096 cpus.
Signed-off-by Li, ZhenHua <[email protected]>--- hw/i386/acpi-build.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)hw/i386/acpi-build.c +0
-0
[...]
hw/i386/acpi-build.c build_append_notify_method(GArray *device, const char *name, · line 683
Quoted 6 lines
hw/i386/acpi-build.c +1
-1@@ -680,7 +680,7 @@ build_append_notify_method(GArray *device, const char *name,for (i =0 ; i < count; i++) {GArray *target =build_alloc_array ();build_append_nameseg (target, format, i); -assert (i <256 );/* Fits in 1 byte */ +assert (i <4096 );/* Fits in 1 byte */
The comment is no longer true.
Also the function build_append_notify_method is called with format argument set to "CP%0.02X", looks like this should be changed to "CP%0.03X".
Signature · 2 lines
Thanks. -- Max
Re: [Qemu-devel] [PATCH 4/4] Support more than 255 cpus: runtime check
Maybe it should be 4 bytes for 4096 (0x1000).
Quoted 26 lines · Max Filippov
Quoted 13 lines · Zhen-Hua
From: "Li, ZhenHua" <[email protected]>
There is some runtime check for max cpu count. Make them support 4096 cpus.
Signed-off-by Li, ZhenHua <[email protected]>--- hw/i386/acpi-build.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)hw/i386/acpi-build.c +0
-0[...]
hw/i386/acpi-build.c build_append_notify_method(GArray *device, const char *name, · line 683
Quoted 6 lines
hw/i386/acpi-build.c +1
-1@@ -680,7 +680,7 @@ build_append_notify_method(GArray *device, const char *name,for (i =0 ; i < count; i++) {GArray *target =build_alloc_array ();build_append_nameseg (target, format, i); -assert (i <256 );/* Fits in 1 byte */ +assert (i <4096 );/* Fits in 1 byte */ The comment is no longer true.
Also the functionbuild_append_notify_methodis called with format argument set to "CP%0.02X", looks like this should be changed to "CP%0.03X".
Re: [Qemu-devel] [PATCH 4/4] Support more than 255 cpus: runtime check
Quoted 1 line · ZhenHua
Maybe it should be 4 bytes for 4096 (
0x1000).
I'd say that 2 bytes should be enough, but actually I don't see why anybody would care in that function how many bytes it is.
Quoted 21 lines · Max Filippov
Quoted 20 lines · Zhen-Hua
Quoted 15 lines
From: "Li, ZhenHua" <[email protected]>
There is some runtime check for max cpu count. Make them support 4096 cpus.
Signed-off-by Li, ZhenHua <[email protected]>--- hw/i386/acpi-build.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)hw/i386/acpi-build.c +0
-0[...]
Quoted 5 lines
Quoted 5 lines
hw/i386/acpi-build.c build_append_notify_method(GArray *device, const char · line 683
Quoted 5 lines
hw/i386/acpi-build.c +0
-0@@ -680,7 +680,7 @@ build_append_notify_method(GArray *device, const char *name, for (i = 0; i < count; i++) {GArray *target =build_alloc_array ();build_append_nameseg (target, format, i);
BTW, build_append_nameseg also expects format string that makes a string of 4 characters, otherwise it asserts.
Quoted 7 lines
Quoted 7 lines
hw/i386/acpi-build.c build_append_notify_method(GArray *device, const char *name, · line 683
Quoted 2 lines
hw/i386/acpi-build.c +1
-1-assert (i <256 );/* Fits in 1 byte */ +assert (i <4096 );/* Fits in 1 byte */ The comment is no longer true.
Also the functionbuild_append_notify_methodis called with format argument
set to "CP%0.02X", looks like this should be changed to "CP%0.03X".
Signature · 2 lines
Thanks. -- Max
Am 13.05.2014 09:09, schrieb Li, Zhen-Hua:
Quoted 4 lines
From: "Li, ZhenHua" <[email protected]>
These series patches are trying to make Qemu support more than 255 CPUs. The max cpu number changed to 4096.
This series is not trivial.
And it's not a bug fix either, so not stable material.
CC'ing Igor and Eduardo for review.
Regards,
Andreas
Quoted 10 lines
Support more than 255 cpus: ACPI and APIC defines Support more than 255 cpus:
max_cpusto 4096 Support more than 255 cpus: max cpumask bit to 4096 Support more than 255 cpus: runtime checinclude/hw/acpi/cpu_hotplug_defs.h | 4 ++-- include/hw/i386/apic_internal.h | 2 +- include/hw/i386/pc.h | 2 +- include/sysemu/sysemu.h | 2 +- hw/i386/acpi-build.c | 8 ++++----
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 10 lines · Zhen-Hua
From: "Li, ZhenHua" <[email protected]>
These series patches are trying to make Qemu support more than 255 CPUs. The max cpu number changed to 4096.
Support more than 255 cpus: ACPI and APIC defines Support more than 255 cpus:
max_cpusto 4096 Support more than 255 cpus: max cpumask bit to 4096 Support more than 255 cpus: runtime chec
Quoted 5 lines
include/hw/acpi/cpu_hotplug_defs.h | 4 ++-- include/hw/i386/apic_internal.h | 2 +- include/hw/i386/pc.h | 2 +- include/sysemu/sysemu.h | 2 +- hw/i386/acpi-build.c | 8 ++++----
Don't we need x2APIC support to provide >255 CPUs? Where so you enforce this, i.e. keep the restriction to 255 CPUs when we are not in KVM mode with in-kernel APIC (the emulate APIC lacks x2APIC mode, unfortunately)? But, wait, KVM only supports up to 255 VCPUs. So what are you targeting at?
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux
Kernel's kvm support is not here.
x2APIC is needed, I will try to do that later.
Quoted 23 lines · Jan Kiszka
Quoted 10 lines · Zhen-Hua
From: "Li, ZhenHua" <[email protected]>
These series patches are trying to make Qemu support more than 255 CPUs. The max cpu number changed to 4096.
Support more than 255 cpus: ACPI and APIC defines Support more than 255 cpus:
max_cpusto 4096 Support more than 255 cpus: max cpumask bit to 4096 Support more than 255 cpus: runtime checQuoted 5 lines
include/hw/acpi/cpu_hotplug_defs.h | 4 ++-- include/hw/i386/apic_internal.h | 2 +- include/hw/i386/pc.h | 2 +- include/sysemu/sysemu.h | 2 +- hw/i386/acpi-build.c | 8 ++++----Don't we need x2APIC support to provide >255 CPUs? Where so you enforce this, i.e. keep the restriction to 255 CPUs when we are not in KVM mode with in-kernel APIC (the emulate APIC lacks x2APIC mode, unfortunately)? But, wait, KVM only supports up to 255 VCPUs. So what are you targeting at?
Jan
Quoted 2 lines · ZhenHua
Kernel's kvm support is not here.
x2APIC is needed, I will try to do that later.
x2APIC emulation can wait if KVM support is there. But we need at least one of them before starting to think about raising the limit.
Jan
PS: Please don't top-post.
Quoted 27 lines · Jan Kiszka
Quoted 24 lines · Zhen-Hua
Quoted 10 lines
From: "Li, ZhenHua" <[email protected]>
These series patches are trying to make Qemu support more than 255 CPUs. The max cpu number changed to 4096.
Support more than 255 cpus: ACPI and APIC defines Support more than 255 cpus:
max_cpusto 4096 Support more than 255 cpus: max cpumask bit to 4096 Support more than 255 cpus: runtime checQuoted 5 lines
include/hw/acpi/cpu_hotplug_defs.h | 4 ++-- include/hw/i386/apic_internal.h | 2 +- include/hw/i386/pc.h | 2 +- include/sysemu/sysemu.h | 2 +- hw/i386/acpi-build.c | 8 ++++----Don't we need x2APIC support to provide >255 CPUs? Where so you enforce this, i.e. keep the restriction to 255 CPUs when we are not in KVM mode with in-kernel APIC (the emulate APIC lacks x2APIC mode, unfortunately)? But, wait, KVM only supports up to 255 VCPUs. So what are you targeting at?
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux