From: Glauber Costa <gcosta@redhat.com>
To: kvm-devel@lists.sourceforge.net
Cc: marcelo@kvack.org, glommer@gmail.com, qemu-devel@nongnu.org,
Glauber Costa <gcosta@redhat.com>,
chrisw@sous-sol.org
Subject: [Qemu-devel] [PATCH 2/15] mark extra cpus as present
Date: Tue, 26 Feb 2008 16:56:32 -0300 [thread overview]
Message-ID: <1204055805-32349-3-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1204055805-32349-2-git-send-email-gcosta@redhat.com>
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 <gcosta@redhat.com>
---
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
next prev parent reply other threads:[~2008-02-26 20:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-26 19:56 [Qemu-devel] [PATCH 0/15] acpi processor hotplug Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 1/15] Make a GPE register block be acessible Glauber Costa
2008-02-26 19:56 ` Glauber Costa [this message]
2008-02-26 19:56 ` [Qemu-devel] [PATCH 3/15] introduce cpu_set to qemu monitor Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 4/15] mark processors as presents Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 5/15] provide gpe _L0x methods Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 6/15] provide operation region for pio to the gpes Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 7/15] implement method _L00 for GPE0 Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 8/15] isolate cpu initialization function in hw/pc.c Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 9/15] initialize hot add system Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 10/15] handle gpe data for pio Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 11/15] manipulate the gpe bits and send sci up the os Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 12/15] isolate cpu thread creation in qemu-kvm.c Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 13/15] provide _MAT to acpi processor Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 14/15] start a new cpu thread Glauber Costa
2008-02-26 19:56 ` [Qemu-devel] [PATCH 15/15] remove acpi_build_processor_ssdt Glauber Costa
2008-02-26 23:05 ` [Qemu-devel] Re: [kvm-devel] [PATCH 4/15] mark processors as presents Alexander Graf
2008-02-26 23:07 ` Alexander Graf
2008-02-27 10:55 ` [Qemu-devel] Re: [kvm-devel] [PATCH 0/15] acpi processor hotplug Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1204055805-32349-3-git-send-email-gcosta@redhat.com \
--to=gcosta@redhat.com \
--cc=chrisw@sous-sol.org \
--cc=glommer@gmail.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=marcelo@kvack.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).