Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-02 Thread Dr. David Alan Gilbert
* Catherine Ho (catherine.h...@gmail.com) wrote: > On Tue, 2 Apr 2019 at 20:37, Peter Xu wrote: > > > On Tue, Apr 02, 2019 at 05:06:15PM +0800, Catherine Ho wrote: > > > On Tue, 2 Apr 2019 at 15:58, Peter Xu wrote: > > > > > > > On Tue, Apr 02, 2019 at 03:47:16PM +0800, Catherine Ho wrote: > >

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-02 Thread Catherine Ho
On Tue, 2 Apr 2019 at 22:17, Catherine Ho wrote: > > > On Tue, 2 Apr 2019 at 20:37, Peter Xu wrote: > >> On Tue, Apr 02, 2019 at 05:06:15PM +0800, Catherine Ho wrote: >> > On Tue, 2 Apr 2019 at 15:58, Peter Xu wrote: >> > >> > > On Tue, Apr 02, 2019 at 03:47:16PM +0800, Catherine Ho wrote: >>

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-02 Thread Catherine Ho
On Tue, 2 Apr 2019 at 20:37, Peter Xu wrote: > On Tue, Apr 02, 2019 at 05:06:15PM +0800, Catherine Ho wrote: > > On Tue, 2 Apr 2019 at 15:58, Peter Xu wrote: > > > > > On Tue, Apr 02, 2019 at 03:47:16PM +0800, Catherine Ho wrote: > > > > Hi Peter Maydell > > > > > > > > On Tue, 2 Apr 2019 at

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-02 Thread Peter Xu
On Tue, Apr 02, 2019 at 05:06:15PM +0800, Catherine Ho wrote: > On Tue, 2 Apr 2019 at 15:58, Peter Xu wrote: > > > On Tue, Apr 02, 2019 at 03:47:16PM +0800, Catherine Ho wrote: > > > Hi Peter Maydell > > > > > > On Tue, 2 Apr 2019 at 11:05, Peter Maydell > > wrote: > > > > > > > On Tue, 2 Apr

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-02 Thread Catherine Ho
On Tue, 2 Apr 2019 at 15:58, Peter Xu wrote: > On Tue, Apr 02, 2019 at 03:47:16PM +0800, Catherine Ho wrote: > > Hi Peter Maydell > > > > On Tue, 2 Apr 2019 at 11:05, Peter Maydell > wrote: > > > > > On Tue, 2 Apr 2019 at 09:57, Catherine Ho > > > wrote: > > > > The root cause is the used idx

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-02 Thread Catherine Ho
Hi Peter Maydell On Tue, 2 Apr 2019 at 11:05, Peter Maydell wrote: > On Tue, 2 Apr 2019 at 09:57, Catherine Ho > wrote: > > The root cause is the used idx is moved forward after 1st time incoming, > and in 2nd time incoming, > > the last_avail_idx will be incorrectly restored from the saved

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-02 Thread Catherine Ho
On Tue, 2 Apr 2019 at 15:47, Catherine Ho wrote: > Hi Peter Maydell > > On Tue, 2 Apr 2019 at 11:05, Peter Maydell > wrote: > >> On Tue, 2 Apr 2019 at 09:57, Catherine Ho >> wrote: >> > The root cause is the used idx is moved forward after 1st time >> incoming, and in 2nd time incoming, >> >

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-02 Thread Peter Xu
On Tue, Apr 02, 2019 at 03:47:16PM +0800, Catherine Ho wrote: > Hi Peter Maydell > > On Tue, 2 Apr 2019 at 11:05, Peter Maydell wrote: > > > On Tue, 2 Apr 2019 at 09:57, Catherine Ho > > wrote: > > > The root cause is the used idx is moved forward after 1st time incoming, > > and in 2nd time

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-02 Thread Peter Maydell
On Tue, 2 Apr 2019 at 14:47, Catherine Ho wrote: > > Here is my step: > 1. start guest normal by qemu with shared memory-backend file > 2. stop the vm. save the device state to another file via monitor migrate > "exec: cat>..." > 3. quit the vm > 4. retore the vm by qemu -incoming "exec:cat

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-01 Thread Catherine Ho
Hi all, I found an insterested issue here besides writting "dtb" rom into ram. That is, should qemu support incoming from the ignore-shared memory backend file repeatedly? After I resolve the issue of writting "dtb" rom into ram, the incoming from the ignore-shared memory backend file works fine

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-04-01 Thread Peter Maydell
On Tue, 2 Apr 2019 at 09:57, Catherine Ho wrote: > The root cause is the used idx is moved forward after 1st time incoming, and > in 2nd time incoming, > the last_avail_idx will be incorrectly restored from the saved device state > file(not in the ram). > > I watched this even on x86 for a

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-26 Thread Catherine Ho
Hi all, thanks for the comments, I am digging into another potential error in the ignore-shared live migration. After that, I will send out the v2 asap B.R. Catherine On Mon, 25 Mar 2019 at 11:39, Peter Xu wrote: > > On Fri, Mar 22, 2019 at 10:12:11AM +, Dr. David Alan Gilbert wrote: > >

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-24 Thread Peter Xu
On Fri, Mar 22, 2019 at 10:12:11AM +, Dr. David Alan Gilbert wrote: [...] > > In general, when we reset the system, we want to bring it > > back to exactly the state that it was in when QEMU was > > first started. That means we need to reload all the rom blob > > data into memory (because

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-22 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > On Fri, 22 Mar 2019 at 10:12, Dr. David Alan Gilbert > wrote: > > Right, so in Catherine's patch there's a simple in_incoming_migration > > and checking ramblock_is_ignored > > Mmm, but I think it is in the wrong place. It is being checked > in

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-22 Thread Peter Maydell
On Fri, 22 Mar 2019 at 10:12, Dr. David Alan Gilbert wrote: > Right, so in Catherine's patch there's a simple in_incoming_migration > and checking ramblock_is_ignored Mmm, but I think it is in the wrong place. It is being checked in address_space_write_rom_internal(). Either we want to suppress

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-22 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > On Thu, 21 Mar 2019 at 15:32, Catherine Ho wrote: > > So in igore-shared case, dtb is not required here ? > > Can you explain what the "ignore-shared" case is? It's a migration capability added recently by Yury Kotov, which as you say below,

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-22 Thread Peter Maydell
On Thu, 21 Mar 2019 at 06:20, Peter Xu wrote: > I tried to dig on how x86 implemented the "-kernel" parameter and I > noticed that it's dumping the kernel image into fw_cfg and probably > that's also the reason why this should not be a problem for x86 > because rom reset on x86 won't overwrite

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-22 Thread Peter Maydell
On Thu, 21 Mar 2019 at 15:32, Catherine Ho wrote: > So in igore-shared case, dtb is not required here ? Can you explain what the "ignore-shared" case is? In general, when we reset the system, we want to bring it back to exactly the state that it was in when QEMU was first started. That means we

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-22 Thread Peter Xu
On Thu, Mar 21, 2019 at 11:31:30PM +0800, Catherine Ho wrote: > Thanks, Peter > See my comments below, please > > On Thu, 21 Mar 2019 at 14:10, Peter Xu wrote: > > > > On Wed, Mar 20, 2019 at 04:05:58PM +0800, chenxi He wrote: > > > On Wed, 20 Mar 2019 at 13:07, Peter Xu wrote: > > > > > > > >

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-21 Thread Catherine Ho
Thanks, Peter See my comments below, please On Thu, 21 Mar 2019 at 14:10, Peter Xu wrote: > > On Wed, Mar 20, 2019 at 04:05:58PM +0800, chenxi He wrote: > > On Wed, 20 Mar 2019 at 13:07, Peter Xu wrote: > > > > > > On Tue, Mar 19, 2019 at 11:49:22AM -0400, Catherine Ho wrote: > > > > Commit

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-21 Thread Peter Xu
On Wed, Mar 20, 2019 at 04:05:58PM +0800, chenxi He wrote: > On Wed, 20 Mar 2019 at 13:07, Peter Xu wrote: > > > > On Tue, Mar 19, 2019 at 11:49:22AM -0400, Catherine Ho wrote: > > > Commit 18269069c310 ("migration: Introduce ignore-shared capability") > > > addes a ignore-shared capability to

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-20 Thread chenxi He
On Wed, 20 Mar 2019 at 13:07, Peter Xu wrote: > > On Tue, Mar 19, 2019 at 11:49:22AM -0400, Catherine Ho wrote: > > Commit 18269069c310 ("migration: Introduce ignore-shared capability") > > addes a ignore-shared capability to bypass the shared ramblock (e,g, > > membackend + numa node). It does

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-19 Thread Peter Xu
On Tue, Mar 19, 2019 at 11:49:22AM -0400, Catherine Ho wrote: > Commit 18269069c310 ("migration: Introduce ignore-shared capability") > addes a ignore-shared capability to bypass the shared ramblock (e,g, > membackend + numa node). It does good to live migration. > > This commit expected that

Re: [Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-19 Thread Jia He
On 2019/3/19 23:49, Catherine Ho wrote: Commit 18269069c310 ("migration: Introduce ignore-shared capability") addes a ignore-shared capability to bypass the shared ramblock (e,g, membackend + numa node). It does good to live migration. This commit expected that QEMU doesn't write to guest RAM

[Qemu-devel] [PATCH] migration: avoid copying ignore-shared ramblock when in incoming migration

2019-03-19 Thread Catherine Ho
Commit 18269069c310 ("migration: Introduce ignore-shared capability") addes a ignore-shared capability to bypass the shared ramblock (e,g, membackend + numa node). It does good to live migration. This commit expected that QEMU doesn't write to guest RAM until VM starts, but it does on aarch64