* [patch] qemu-kvm, use max_cpus to size MADT table
@ 2009-06-19 14:01 Jes Sorensen
0 siblings, 0 replies; only message in thread
From: Jes Sorensen @ 2009-06-19 14:01 UTC (permalink / raw)
To: Avi Kivity; +Cc: Gleb Natapov, kvm@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 223 bytes --]
Hi,
This one goes on top of the -maxcpus patch. It changes the bios to use
max_cpus to determine the size of the MADT table.
When no -maxcpus argument is given, we still fall back to the old
default of 16.
Cheers,
Jes
[-- Attachment #2: 0003-qemu-madt-maxcpus.patch --]
[-- Type: text/x-patch, Size: 1811 bytes --]
Build madt table based on max_cpus count.
Signed-off-by: Jes Sorensen <jes@sgi.com>
---
kvm/bios/rombios32.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: qemu-kvm/kvm/bios/rombios32.c
===================================================================
--- qemu-kvm.orig/kvm/bios/rombios32.c
+++ qemu-kvm/kvm/bios/rombios32.c
@@ -1168,13 +1168,13 @@ static void mptable_init(void)
putstr(&q, "0.1 "); /* vendor id */
putle32(&q, 0); /* OEM table ptr */
putle16(&q, 0); /* OEM table size */
- putle16(&q, MAX_CPUS + 18); /* entry count */
+ putle16(&q, max_cpus + 18); /* entry count */
putle32(&q, 0xfee00000); /* local APIC addr */
putle16(&q, 0); /* ext table length */
putb(&q, 0); /* ext table checksum */
putb(&q, 0); /* reserved */
- for(i = 0; i < MAX_CPUS ; i++) {
+ for(i = 0; i < max_cpus ; i++) {
putb(&q, 0); /* entry type = processor */
putb(&q, i); /* APIC id */
putb(&q, 0x11); /* local APIC version number */
@@ -1700,7 +1700,7 @@ void acpi_bios_init(void)
addr = (addr + 7) & ~7;
madt_addr = addr;
madt_size = sizeof(*madt) +
- sizeof(struct madt_processor_apic) * MAX_CPUS +
+ sizeof(struct madt_processor_apic) * max_cpus +
#ifdef BX_QEMU
sizeof(struct madt_io_apic) + sizeof(struct madt_int_override) * MAX_INT_OVERRIDES;
#else
@@ -1778,7 +1778,7 @@ void acpi_bios_init(void)
madt->local_apic_address = cpu_to_le32(0xfee00000);
madt->flags = cpu_to_le32(1);
*(uint32_t*)APIC_MADT_PTR = apic = (void *)(madt + 1);
- for(i=0;i<MAX_CPUS;i++) {
+ for(i=0; i < max_cpus; i++) {
apic->type = APIC_PROCESSOR;
apic->length = sizeof(*apic);
apic->processor_id = i;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-19 14:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-19 14:01 [patch] qemu-kvm, use max_cpus to size MADT table Jes Sorensen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.