qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: aarcange@redhat.com, quintela@redhat.com, liang.z.li@intel.com,
	qemu-devel@nongnu.org, luis@cs.umu.se, amit.shah@redhat.com,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v8 00/54] Postcopy implementation
Date: Mon, 5 Oct 2015 10:34:18 +0100	[thread overview]
Message-ID: <20151005093418.GB2594@work-vm> (raw)
In-Reply-To: <20151005043830.GA15541@in.ibm.com>

* Bharata B Rao (bharata@linux.vnet.ibm.com) wrote:
> On Mon, Sep 28, 2015 at 05:51:39PM +0100, Dr. David Alan Gilbert (git) wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> > 
> >   This is the 8th cut of my version of postcopy.
> > 
> > The userfaultfd linux kernel code is now in the upstream kernel
> > tree, and so 4.3-rc3 can be used without modification.
> > 
> > This qemu series can be found at:
> > https://github.com/orbitfp7/qemu.git
> > on the wp3-postcopy-v8 tag
> > 
> > 
> > Testing status:
> >   * Tested heavily on x86
> >   * Smoke tested on aarch64 (so it does work on different page sizes)
> >   * Power is unhappy for me (but gets further than the htab problem
> >     v7 used to have) (I get a kvm run failed)
> 
> As I said earlier, postcopy migration works on Power, but memory hotplug
> seems to have some problem.
> 
> qemu-system-ppc64 ... -object memory-backend-ram,id=ram0,size=2G -device pc-dimm,memdev=ram0
> 
> qemu/exec.c:1278: find_ram_offset: Assertion `size != 0' failed.
> 
> Does this happen on x86 too ?

Hmm, yes it does - I hadn't tried that.
The problem is that I added a HOST_PAGE_ALIGN call during RAMBlock creation,
and -object gets parsed pretty early on, before the internal host page masks
have been setup.

The patch below passes a smoke test; I'll look to clean it up.

Thanks,

Dave

diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index a3719b7..b4c4b6e 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -81,7 +81,6 @@ void cpu_gen_init(void);
 int cpu_gen_code(CPUArchState *env, struct TranslationBlock *tb,
                  int *gen_code_size_ptr);
 bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc);
-void page_size_init(void);
 
 void QEMU_NORETURN cpu_resume_from_signal(CPUState *cpu, void *puc);
 void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 01d29dd..ae3530c 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -491,4 +491,6 @@ int parse_debug_env(const char *name, int max, int initial);
 
 const char *qemu_ether_ntoa(const MACAddr *mac);
 
+void page_size_init(void);
+
 #endif
diff --git a/kvm-all.c b/kvm-all.c
index de1924c..62b71fe 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1461,7 +1461,6 @@ static int kvm_init(MachineState *ms)
      * page size for the system though.
      */
     assert(TARGET_PAGE_SIZE <= getpagesize());
-    page_size_init();
 
     s->sigmask_len = 8;
 
diff --git a/vl.c b/vl.c
index e211f6a..818075c 100644
--- a/vl.c
+++ b/vl.c
@@ -4249,6 +4249,7 @@ int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
+    page_size_init();
     socket_init();
 
     if (qemu_opts_foreach(qemu_find_opts("object"),

> 
> Regards,
> Bharata.
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2015-10-05  9:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1443459153-10965-1-git-send-email-dgilbert@redhat.com>
2015-09-30 10:25 ` [Qemu-devel] [PATCH v8 00/54] Postcopy implementation Bharata B Rao
2015-09-30 10:53   ` Dr. David Alan Gilbert
2015-09-30 14:28     ` Bharata B Rao
2015-09-30 16:14       ` Dr. David Alan Gilbert
2015-10-01  3:04         ` Bharata B Rao
2015-10-02  9:03           ` Dr. David Alan Gilbert
2015-10-05  4:38 ` Bharata B Rao
2015-10-05  9:34   ` Dr. David Alan Gilbert [this message]
     [not found] ` <1443459153-10965-2-git-send-email-dgilbert@redhat.com>
     [not found]   ` <87oaftx1nw.fsf@neno.neno>
2015-10-20 11:54     ` [Qemu-devel] [PATCH v8 01/54] Add postcopy documentation Juan Quintela
     [not found] ` <1443459153-10965-5-git-send-email-dgilbert@redhat.com>
     [not found]   ` <87h9llx1lq.fsf@neno.neno>
2015-10-20 11:55     ` [Qemu-devel] [PATCH v8 04/54] Move configuration section writing Juan Quintela
     [not found] ` <1443459153-10965-7-git-send-email-dgilbert@redhat.com>
     [not found]   ` <87d1w9x1ho.fsf@neno.neno>
2015-10-20 11:56     ` [Qemu-devel] [PATCH v8 06/54] Rename mis->file to from_src_file Juan Quintela
     [not found] ` <1443459153-10965-10-git-send-email-dgilbert@redhat.com>
     [not found]   ` <874mhlx108.fsf@neno.neno>
2015-10-20 11:57     ` [Qemu-devel] [PATCH v8 09/54] Add QEMU_MADV_NOHUGEPAGE Juan Quintela
     [not found] ` <1443459153-10965-11-git-send-email-dgilbert@redhat.com>
     [not found]   ` <87zizdvm9m.fsf@neno.neno>
2015-10-20 11:58     ` [Qemu-devel] [PATCH v8 10/54] migration/ram.c: Use RAMBlock rather than MemoryRegion Juan Quintela
     [not found] ` <1443459153-10965-14-git-send-email-dgilbert@redhat.com>
     [not found]   ` <87vba1vm6n.fsf@neno.neno>
2015-10-20 11:58     ` [Qemu-devel] [PATCH v8 13/54] Move dirty page search state into separate structure Juan Quintela
     [not found] ` <1443459153-10965-18-git-send-email-dgilbert@redhat.com>
     [not found]   ` <87r3kpvl9x.fsf@neno.neno>
2015-10-20 11:59     ` [Qemu-devel] [PATCH v8 17/54] Return path: socket_writev_buffer: Block even on non-blocking fd's Juan Quintela
2015-09-29  8:37 [Qemu-devel] [PATCH v8 00/54] Postcopy implementation Dr. David Alan Gilbert (git)

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=20151005093418.GB2594@work-vm \
    --to=dgilbert@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=liang.z.li@intel.com \
    --cc=luis@cs.umu.se \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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).