qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: kevin@koconnor.net
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 05/21] irq0override provided by qemu.
Date: Thu,  8 Oct 2009 17:59:10 +0200	[thread overview]
Message-ID: <1255017566-26220-6-git-send-email-gleb@redhat.com> (raw)
In-Reply-To: <1255017566-26220-1-git-send-email-gleb@redhat.com>

Read it instead of relying on compile time flag.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 src/acpi.c     |    2 +-
 src/mptable.c  |    9 ++-------
 src/paravirt.c |   12 ++++++++++++
 src/paravirt.h |    2 ++
 src/util.h     |    3 ---
 5 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/src/acpi.c b/src/acpi.c
index 1b4f4c5..fb57860 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -314,7 +314,7 @@ build_madt(void)
     io_apic->interrupt = cpu_to_le32(0);
 
     struct madt_intsrcovr *intsrcovr = (void*)&io_apic[1];
-    if (irq0override) {
+    if (qemu_cfg_irq0_override()) {
         memset(intsrcovr, 0, sizeof(*intsrcovr));
         intsrcovr->type   = APIC_XRUPT_OVERRIDE;
         intsrcovr->length = sizeof(*intsrcovr);
diff --git a/src/mptable.c b/src/mptable.c
index aeb1f94..4aaff1e 100644
--- a/src/mptable.c
+++ b/src/mptable.c
@@ -8,12 +8,7 @@
 #include "util.h" // dprintf
 #include "config.h" // CONFIG_*
 #include "mptable.h" // MPTABLE_SIGNATURE
-
-#if CONFIG_KVM
-int irq0override = 1;
-#else
-int irq0override = 0;
-#endif
+#include "paravirt.h"
 
 void
 mptable_init(void)
@@ -103,7 +98,7 @@ mptable_init(void)
         intsrc->srcbusirq = i;
         intsrc->dstapic = ioapic_id;
         intsrc->dstirq = i;
-        if (irq0override) {
+        if (qemu_cfg_irq0_override()) {
             /* Destination 2 is covered by irq0->inti2 override (i ==
                0). Source IRQ 2 is unused */
             if (i == 0)
diff --git a/src/paravirt.c b/src/paravirt.c
index 9637f87..8c08ce7 100644
--- a/src/paravirt.c
+++ b/src/paravirt.c
@@ -79,6 +79,18 @@ int qemu_cfg_show_boot_menu(void)
     return v;
 }
 
+int qemu_cfg_irq0_override(void)
+{
+    u8 v;
+
+    if (!qemu_cfg_present)
+        return 0;
+
+    qemu_cfg_read_entry(&v, QEMU_CFG_IRQ0_OVERRIDE, sizeof(v));
+
+    return v;
+}
+
 u16 qemu_cfg_acpi_additional_tables(void)
 {
     u16 cnt;
diff --git a/src/paravirt.h b/src/paravirt.h
index da01c0c..2b2f314 100644
--- a/src/paravirt.h
+++ b/src/paravirt.h
@@ -34,12 +34,14 @@ static inline int kvm_para_available(void)
 #define QEMU_CFG_ARCH_LOCAL		0x8000
 #define QEMU_CFG_ACPI_TABLES		(QEMU_CFG_ARCH_LOCAL + 0)
 #define QEMU_CFG_SMBIOS_ENTRIES		(QEMU_CFG_ARCH_LOCAL + 1)
+#define QEMU_CFG_IRQ0_OVERRIDE		(QEMU_CFG_ARCH_LOCAL + 1)
 
 extern int qemu_cfg_present;
 
 void qemu_cfg_port_probe(void);
 int qemu_cfg_show_boot_menu(void);
 void qemu_cfg_get_uuid(u8 *uuid);
+int qemu_cfg_irq0_override(void);
 u16 qemu_cfg_acpi_additional_tables(void);
 u16 qemu_cfg_next_acpi_table_len(void);
 void *qemu_cfg_next_acpi_table_load(void *addr, u16 len);
diff --git a/src/util.h b/src/util.h
index dd8619b..ca16ac7 100644
--- a/src/util.h
+++ b/src/util.h
@@ -302,9 +302,6 @@ void reset_vector() __attribute__ ((noreturn));
 // misc.c
 extern u8 BiosChecksum;
 
-// mptable.c
-extern int irq0override;
-
 // version (auto generated file out/version.c)
 extern const char VERSION[];
 
-- 
1.6.3.3

  parent reply	other threads:[~2009-10-08 15:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-08 15:59 [Qemu-devel] [PATCH 00/21] Bring seabios and qemu pcbios closer together Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH v2 01/21] Add support for passing additional acpi tables from qemu Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH v2 02/21] Load SMBIOS entries and files " Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 03/21] Always create PCI interrupt override acpi tables Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 04/21] Correct default pci irq links Gleb Natapov
2009-10-08 15:59 ` Gleb Natapov [this message]
2009-10-08 15:59 ` [Qemu-devel] [PATCH 06/21] Check at runtime if VM is KVM Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 07/21] Remove CONFIG_KVM compile option Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 08/21] Add rule to compile DSDT to make file Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 09/21] Use preprocessor for pci link routing Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 10/21] Advertise pci irqs as active high in DSDT Gleb Natapov
2009-10-09 10:56   ` Jamie Lokier
2009-10-09 11:37     ` Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 11/21] Restrict pci interrupts to irq 5/9/10/11 Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 12/21] Use extended interrupt descriptor for pci irqs Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 13/21] Remove irq 9 from the pci interrupt link resources Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 14/21] Provide gpe _L0x methods Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 15/21] Pci hotplug support Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 16/21] HPET support Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 17/21] Add 26 pci slots, bringing the total to 32 Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 18/21] Add SRAT ACPI table support Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 19/21] Read max number of cpus from VM Gleb Natapov
2009-10-08 15:59 ` [Qemu-devel] [PATCH 20/21] Move qemu cfg init before smp init Gleb Natapov
2009-10-09  2:18   ` [Qemu-devel] " Kevin O'Connor
2009-10-08 15:59 ` [Qemu-devel] [PATCH 21/21] Use MaxCountCPUs during building of per cpu tables Gleb Natapov
2009-10-09  2:22   ` [Qemu-devel] " Kevin O'Connor
2009-10-09  6:37     ` Gleb Natapov
2009-10-09 13:44       ` 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=1255017566-26220-6-git-send-email-gleb@redhat.com \
    --to=gleb@redhat.com \
    --cc=kevin@koconnor.net \
    --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).