[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/15] mark extra cpus as present
From: |
Glauber Costa |
Subject: |
[Qemu-devel] [PATCH 2/15] mark extra cpus as present |
Date: |
Tue, 26 Feb 2008 16:56:32 -0300 |
Mark cpus over smp_cpus as present, but disable.
The OS can then recognize it and make room for future hotplug
Signed-off-by: Glauber Costa <address@hidden>
---
bios/rombios.h | 2 ++
bios/rombios32.c | 21 +++++++++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/bios/rombios.h b/bios/rombios.h
index 412c5e9..2cf2bb3 100644
--- a/bios/rombios.h
+++ b/bios/rombios.h
@@ -58,6 +58,8 @@ #define PM_IO_BASE 0xb000
#define SMB_IO_BASE 0xb100
#define CPU_COUNT_ADDR 0xf000
+#define MAX_CPUS 16
+
// Define the application NAME
#if defined(BX_QEMU)
# define BX_APPNAME "QEMU"
diff --git a/bios/rombios32.c b/bios/rombios32.c
index 3ec85cb..f2db740 100755
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -948,20 +948,22 @@ #endif
putstr(&q, "0.1 "); /* vendor id */
putle32(&q, 0); /* OEM table ptr */
putle16(&q, 0); /* OEM table size */
- putle16(&q, smp_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 < smp_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 */
if (i == 0)
putb(&q, 3); /* cpu flags: enabled, bootstrap cpu */
- else
+ else if ( i < smp_cpus)
putb(&q, 1); /* cpu flags: enabled */
+ else
+ putb(&q, 0); /* cpu flags: disabled */
putb(&q, 0); /* cpu signature */
putb(&q, 6);
putb(&q, 0);
@@ -981,7 +983,7 @@ #endif
putstr(&q, "ISA ");
/* ioapic */
- ioapic_id = smp_cpus;
+ ioapic_id = MAX_CPUS;
putb(&q, 2); /* entry type = I/O APIC */
putb(&q, ioapic_id); /* apic ID */
putb(&q, 0x11); /* I/O APIC version number */
@@ -1393,7 +1395,7 @@ #endif
addr = (addr + 7) & ~7;
madt_addr = addr;
madt_size = sizeof(*madt) +
- sizeof(struct madt_processor_apic) * smp_cpus +
+ sizeof(struct madt_processor_apic) * MAX_CPUS +
sizeof(struct madt_io_apic);
madt = (void *)(addr);
addr += madt_size;
@@ -1466,18 +1468,21 @@ #endif
madt->local_apic_address = cpu_to_le32(0xfee00000);
madt->flags = cpu_to_le32(1);
apic = (void *)(madt + 1);
- for(i=0;i<smp_cpus;i++) {
+ for(i=0;i<MAX_CPUS;i++) {
apic->type = APIC_PROCESSOR;
apic->length = sizeof(*apic);
apic->processor_id = i;
apic->local_apic_id = i;
- apic->flags = cpu_to_le32(1);
+ if (i < smp_cpus)
+ apic->flags = cpu_to_le32(1);
+ else
+ apic->flags = 0;
apic++;
}
io_apic = (void *)apic;
io_apic->type = APIC_IO;
io_apic->length = sizeof(*io_apic);
- io_apic->io_apic_id = smp_cpus;
+ io_apic->io_apic_id = MAX_CPUS;
io_apic->address = cpu_to_le32(0xfec00000);
io_apic->interrupt = cpu_to_le32(0);
--
1.4.2
- [Qemu-devel] [PATCH 0/15] acpi processor hotplug, Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 1/15] Make a GPE register block be acessible., Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 2/15] mark extra cpus as present,
Glauber Costa <=
- [Qemu-devel] [PATCH 3/15] introduce cpu_set to qemu monitor, Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 4/15] mark processors as presents, Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 5/15] provide gpe _L0x methods, Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 6/15] provide operation region for pio to the gpes, Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 7/15] implement method _L00 for GPE0, Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 8/15] isolate cpu initialization function in hw/pc.c, Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 9/15] initialize hot add system., Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 10/15] handle gpe data for pio, Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 11/15] manipulate the gpe bits and send sci up the os., Glauber Costa, 2008/02/26
- [Qemu-devel] [PATCH 12/15] isolate cpu thread creation in qemu-kvm.c, Glauber Costa, 2008/02/26