qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org, seabios@seabios.org
Cc: Igor Mammedov <imammedo@redhat.com>,
	Kevin O'Connor <kevin@koconnor.net>,
	Laszlo Ersek <lersek@redhat.com>, Gleb Natapov <gleb@redhat.com>
Subject: [Qemu-devel] [SeaBIOS PATCH 1/2] report real I/O APIC ID (0) on MADT and MP-table (v3)
Date: Wed, 25 Jul 2012 15:45:29 -0300	[thread overview]
Message-ID: <1343241930-9506-2-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1343241930-9506-1-git-send-email-ehabkost@redhat.com>

When resetting an I/O APIC, its ID is set to 0, and SeaBIOS doesn't
change it, so report it correctly on the ACPI MADT table and MP-table.

Some hardware may require the BIOS to initialize I/O APIC ID to an
unique value, but SeaBIOS doesn't do that. This patch at least makes the
tables reflect reality.

Changes v2 -> v3:
 - Fix MP-table too, not just ACPI MADT table

Changes v1 -> v2:
 - Cosmetic: whitespace change (removed extra newline)
 - New patch description

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 src/acpi.c    |    2 +-
 src/config.h  |    1 +
 src/mptable.c |    2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/acpi.c b/src/acpi.c
index d39cbd9..da3bc57 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -336,7 +336,7 @@ build_madt(void)
     struct madt_io_apic *io_apic = (void*)apic;
     io_apic->type = APIC_IO;
     io_apic->length = sizeof(*io_apic);
-    io_apic->io_apic_id = CountCPUs;
+    io_apic->io_apic_id = BUILD_IOAPIC_ID;
     io_apic->address = cpu_to_le32(BUILD_IOAPIC_ADDR);
     io_apic->interrupt = cpu_to_le32(0);
 
diff --git a/src/config.h b/src/config.h
index 3a70867..0d4066d 100644
--- a/src/config.h
+++ b/src/config.h
@@ -52,6 +52,7 @@
 #define BUILD_PCIMEM64_END        0x10000000000ULL
 
 #define BUILD_IOAPIC_ADDR         0xfec00000
+#define BUILD_IOAPIC_ID           0
 #define BUILD_HPET_ADDRESS        0xfed00000
 #define BUILD_APIC_ADDR           0xfee00000
 
diff --git a/src/mptable.c b/src/mptable.c
index 103f462..74ed33d 100644
--- a/src/mptable.c
+++ b/src/mptable.c
@@ -92,7 +92,7 @@ mptable_init(void)
     entrycount += bus - buses;
 
     /* ioapic */
-    u8 ioapic_id = CountCPUs;
+    u8 ioapic_id = BUILD_IOAPIC_ID;
     struct mpt_ioapic *ioapic = (void*)bus;
     memset(ioapic, 0, sizeof(*ioapic));
     ioapic->type = MPT_TYPE_IOAPIC;
-- 
1.7.10.4

  reply	other threads:[~2012-07-25 18:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 18:45 [Qemu-devel] [SeaBIOS PATCH 0/2] Allow non-contiguous APIC IDs (v3) Eduardo Habkost
2012-07-25 18:45 ` Eduardo Habkost [this message]
2012-07-25 18:45 ` [Qemu-devel] [SeaBIOS PATCH 2/2] allow CPUs to have non-contiguous Local APIC IDs (v2) Eduardo Habkost
2012-07-27 13:42   ` Laszlo Ersek
2012-07-27 13:43     ` Laszlo Ersek
2012-08-01  1:14 ` [Qemu-devel] [SeaBIOS PATCH 0/2] Allow non-contiguous APIC IDs (v3) Kevin O'Connor
2012-08-01  7:47   ` Gleb Natapov
2012-08-02  0:49     ` Kevin O'Connor

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=1343241930-9506-2-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=gleb@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=lersek@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.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).