qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Baboval <john.baboval@virtualcomputer.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/3] Xen conditionals
Date: Fri, 28 Oct 2011 15:38:23 -0400	[thread overview]
Message-ID: <4EAB04AF.5060803@virtualcomputer.com> (raw)

Don't perform RTC or APIC setup when running in xen mode.

Signed-off-by: John V. Baboval <john.baboval@virtualcomputer.com>
---
  hw/pc.c      |   56 
+++++++++++++++++++++++++++++---------------------------
  hw/pc_piix.c |    2 +-
  2 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index eb4c2d8..e571d38 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -40,6 +40,7 @@
  #include "sysbus.h"
  #include "sysemu.h"
  #include "blockdev.h"
+#include "xen.h"
  #include "ui/qemu-spice.h"
  #include "memory.h"
  #include "exec-memory.h"
@@ -340,35 +341,36 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t 
above_4g_mem_size,
      static pc_cmos_init_late_arg arg;
       /* various important CMOS locations needed by PC/Bochs bios */
-
-    /* memory size */
-    val = 640; /* base memory in K */
-    rtc_set_memory(s, 0x15, val);
-    rtc_set_memory(s, 0x16, val >> 8);
-
-    val = (ram_size / 1024) - 1024;
-    if (val > 65535)
-        val = 65535;
-    rtc_set_memory(s, 0x17, val);
-    rtc_set_memory(s, 0x18, val >> 8);
-    rtc_set_memory(s, 0x30, val);
-    rtc_set_memory(s, 0x31, val >> 8);
-
-    if (above_4g_mem_size) {
-        rtc_set_memory(s, 0x5b, (unsigned int)above_4g_mem_size >> 16);
-        rtc_set_memory(s, 0x5c, (unsigned int)above_4g_mem_size >> 24);
-        rtc_set_memory(s, 0x5d, (uint64_t)above_4g_mem_size >> 32);
+    if (!xen_enabled()) {
+	    /* memory size */
+	    val = 640; /* base memory in K */
+	    rtc_set_memory(s, 0x15, val);
+	    rtc_set_memory(s, 0x16, val >> 8);
+
+	    val = (ram_size / 1024) - 1024;
+	    if (val > 65535)
+		    val = 65535;
+	    rtc_set_memory(s, 0x17, val);
+	    rtc_set_memory(s, 0x18, val >> 8);
+	    rtc_set_memory(s, 0x30, val);
+	    rtc_set_memory(s, 0x31, val >> 8);
+
+	    if (above_4g_mem_size) {
+		    rtc_set_memory(s, 0x5b, (unsigned int)above_4g_mem_size >> 16);
+		    rtc_set_memory(s, 0x5c, (unsigned int)above_4g_mem_size >> 24);
+		    rtc_set_memory(s, 0x5d, (uint64_t)above_4g_mem_size >> 32);
+	    }
+
+	    if (ram_size > (16 * 1024 * 1024))
+		    val = (ram_size / 65536) - ((16 * 1024 * 1024) / 65536);
+	    else
+		    val = 0;
+	    if (val > 65535)
+		    val = 65535;
+	    rtc_set_memory(s, 0x34, val);
+	    rtc_set_memory(s, 0x35, val >> 8);
      }
  -    if (ram_size > (16 * 1024 * 1024))
-        val = (ram_size / 65536) - ((16 * 1024 * 1024) / 65536);
-    else
-        val = 0;
-    if (val > 65535)
-        val = 65535;
-    rtc_set_memory(s, 0x34, val);
-    rtc_set_memory(s, 0x35, val >> 8);
-
      /* set the number of CPU */
      rtc_set_memory(s, 0x5f, smp_cpus - 1);
  diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 8c7f2b7..f91658c 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -162,7 +162,7 @@ static void pc_init1(MemoryRegion *system_memory,
      for (i = 0; i < ISA_NUM_IRQS; i++) {
          gsi_state->i8259_irq[i] = i8259[i];
      }
-    if (pci_enabled) {
+    if (pci_enabled && !xen_enabled()) {
          ioapic_init(gsi_state);
      }
  -- 1.7.4.1

             reply	other threads:[~2011-10-28 19:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 19:38 John Baboval [this message]
2011-11-07 16:43 ` [Qemu-devel] [PATCH 2/3] Xen conditionals Stefano Stabellini

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=4EAB04AF.5060803@virtualcomputer.com \
    --to=john.baboval@virtualcomputer.com \
    --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).