All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Igor Mammedov <imammedo@redhat.com>
Subject: [PULL 15/15] xen: fixup RAM memory region initialization
Date: Thu,  2 Apr 2020 15:06:40 -0400	[thread overview]
Message-ID: <20200402190640.1693-16-pbonzini@redhat.com> (raw)
In-Reply-To: <20200402190640.1693-1-pbonzini@redhat.com>

From: Igor Mammedov <imammedo@redhat.com>

Since bd457782b3b0 ("x86/pc: use memdev for RAM") Xen
machine fails to start with:
   qemu-system-i386: xen: failed to populate ram at 0

The reason is that xen_ram_alloc() which is called by
memory_region_init_ram(), compares memory region with
statically allocated 'global' ram_memory memory region
that it uses for RAM, and does nothing in case it matches.

While it's possible feed machine->ram to xen_ram_alloc()
in the same manner to keep that hack working, I'd prefer
not to keep that circular dependency and try to untangle that.

However it doesn't look trivial to fix, so as temporary
fixup opt out Xen machine from memdev based RAM allocation,
and let xen_ram_alloc() do its trick for now.

Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20200402145418.5139-1-imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/xen/xen-common.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c
index 15650d7f6a..a15070f7f6 100644
--- a/hw/xen/xen-common.c
+++ b/hw/xen/xen-common.c
@@ -19,6 +19,7 @@
 #include "sysemu/runstate.h"
 #include "migration/misc.h"
 #include "migration/global_state.h"
+#include "hw/boards.h"
 
 //#define DEBUG_XEN
 
@@ -151,6 +152,8 @@ static void xen_setup_post(MachineState *ms, AccelState *accel)
 
 static int xen_init(MachineState *ms)
 {
+    MachineClass *mc = MACHINE_GET_CLASS(ms);
+
     xen_xc = xc_interface_open(0, 0, 0);
     if (xen_xc == NULL) {
         xen_pv_printf(NULL, 0, "can't open xen interface\n");
@@ -170,6 +173,10 @@ static int xen_init(MachineState *ms)
         return -1;
     }
     qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);
+    /*
+     * opt out of system RAM being allocated by generic code
+     */
+    mc->default_ram_id = NULL;
     return 0;
 }
 
-- 
2.18.2



  parent reply	other threads:[~2020-04-02 19:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 19:06 [PULL 00/15] Misc patches for 5.0-rc2 Paolo Bonzini
2020-04-02 19:06 ` [PULL 01/15] hw/scsi/vmw_pvscsi: Remove assertion for kick after reset Paolo Bonzini
2020-04-02 19:06 ` [PULL 02/15] hw/isa/superio: Correct the license text Paolo Bonzini
2020-04-02 19:06 ` [PULL 03/15] virtio-iommu: depend on PCI Paolo Bonzini
2020-04-02 19:06 ` [PULL 04/15] softmmu: fix crash with invalid -M memory-backend= Paolo Bonzini
2020-04-02 19:06 ` [PULL 05/15] MAINTAINERS: Add an entry for the HVF accelerator Paolo Bonzini
2020-04-02 19:06 ` [PULL 06/15] util/bufferiszero: assign length_to_accel value for each accelerator case Paolo Bonzini
2020-04-02 19:06 ` [PULL 07/15] util/bufferiszero: improve avx2 accelerator Paolo Bonzini
2020-04-02 19:06 ` [PULL 08/15] vl: fix broken IPA range for ARM -M virt with KVM enabled Paolo Bonzini
2020-04-02 19:06 ` [PULL 09/15] i386: hvf: Reset IRQ inhibition after moving RIP Paolo Bonzini
2020-04-02 19:06 ` [PULL 10/15] serial: Fix double migration data Paolo Bonzini
2020-04-02 19:06 ` [PULL 11/15] target/i386: do not set unsupported VMX secondary execution controls Paolo Bonzini
2020-04-02 19:06 ` [PULL 12/15] migration: fix cleanup_bh leak on resume Paolo Bonzini
2020-04-02 19:06 ` [PULL 13/15] qmp: fix leak on callbacks that return both value and error Paolo Bonzini
2020-04-02 19:06 ` [PULL 14/15] object-add: don't create return value if failed Paolo Bonzini
2020-04-02 19:06 ` Paolo Bonzini [this message]
2020-04-02 20:16 ` [PULL 00/15] Misc patches for 5.0-rc2 no-reply
2020-04-02 20:17 ` no-reply
2020-04-02 20:17 ` no-reply
2020-04-03  9:07 ` Peter Maydell

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=20200402190640.1693-16-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=imammedo@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.