[Qemu-devel] [PATCH v6 0/4] allow to load initrd below 4G for recent kernel

2019-01-17 Thread Li Zhijian
kin) V2: add 2 patches(3/5, 4/5) to fix potential loading issue. CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum CC: Stefano Garzarella CC: Peter Crosthwaite CC: Peter Maydell Li Zhijian (4): unify len and addr type

[Qemu-devel] [PATCH v6 4/4] i386: allow to load initrd below 4 GB for recent linux

2019-01-17 Thread Li Zhijian
CC: Eduardo Habkost CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum Signed-off-by: Li Zhijian --- V6: update comments V5: udpate comments and changelog V3: correct grammar and check XLF_CAN_BE_LOADED_ABOVE_4G first (Michael S. Tsirkin) Signed-off-by: Li Zhijian --- hw/i386/pc.c |

Re: [Qemu-devel] [PATCH v5 4/4] i386: allow to load initrd below 4G for recent linux

2019-01-16 Thread Li Zhijian
Hi Michael, Eduardo On 1/15/19 09:46, Michael S. Tsirkin wrote: On Tue, Jan 15, 2019 at 09:35:09AM +0800, Li Zhijian wrote: Hi Eduardo On 1/15/19 01:53, Eduardo Habkost wrote: +if (protocol >= 0x20c && +lduw_p(header+0x236) & XLF_CAN_BE_

Re: [Qemu-devel] [PATCH v5 4/4] i386: allow to load initrd below 4G for recent linux

2019-01-14 Thread Li Zhijian
Hi Eduardo On 1/15/19 01:53, Eduardo Habkost wrote: +if (protocol >= 0x20c && +lduw_p(header+0x236) & XLF_CAN_BE_LOADED_ABOVE_4G) { +/* + * Linux has supported initrd up to 4 GB for a very long time (2007, + * long before XLF_CAN_BE_LOADED_ABOVE_4G which was

Re: [Qemu-devel] [PATCH v5 3/4] i386: import & use bootparam.h

2019-01-11 Thread Li Zhijian
Hi Stefano On 1/11/19 17:48, Stefano Garzarella wrote: Hi Li, On Fri, Jan 11, 2019 at 10:06 AM Li Zhijian wrote: +# unnecessary import of several video/ist/etc headers +sed -e '/__ASSEMBLY__/,/__ASSEMBLY__/d' $tmpdir/include/asm/bootparam.h > $tmpdi

[Qemu-devel] [PATCH v5 3/4] i386: import & use bootparam.h

2019-01-11 Thread Li Zhijian
it's from v4.20-rc5. CC: Michael S. Tsirkin Signed-off-by: Li Zhijian Reviewed-by: Michael S. Tsirkin --- V5: add reviewed-by tag V4: use scirpt to import bootparam.h (Michael S. Tsirkin) V3: new patch --- hw/i386/pc.c | 8 +-- include/standard-header

[Qemu-devel] [PATCH v5 4/4] i386: allow to load initrd below 4G for recent linux

2019-01-11 Thread Li Zhijian
ocol (specifically the ext_ramdisk_image field). Therefore here just limit initrd_max to UINT32_MAX simply as well to allow initrd to be loaded below 4 GB. CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum Signed-off-by: Li

[Qemu-devel] [PATCH v5 0/4] allow to load initrd below 4G for recent kernel

2019-01-11 Thread Li Zhijian
ot; CC: Marcel Apfelbaum CC: Stefano Garzarella CC: Peter Crosthwaite CC: Peter Maydell Li Zhijian (4): unify len and addr type for memory/address APIs hw/core/loader.c: Read as long as possible in load_image_size() i386: import & use bootparam.h i386: allow to load initrd below

[Qemu-devel] [PATCH v5 2/4] hw/core/loader.c: Read as long as possible in load_image_size()

2019-01-11 Thread Li Zhijian
Don't expect read(2) can always read as many as it's told. CC: Richard Henderson CC: Stefano Garzarella Signed-off-by: Li Zhijian Reviewed-by: Richard Henderson Reviewed-by: Stefano Garzarella --- V5: update subject and add reviewed-by tag (Stefano Garzarella) V4: add revie

[Qemu-devel] [PATCH v5 1/4] unify len and addr type for memory/address APIs

2019-01-11 Thread Li Zhijian
ry_read(uint32_t len) -> dma_memory_rw(uint32_t len) -> dma_memory_rw_relaxed(uint32_t len) -> address_space_rw(int len) # len overflow CC: Paolo Bonzini CC: Peter Crosthwaite CC: Richard Henderson CC: Peter Maydell CC: Stefano Garzarella Signed-off-by: Li Zhijian Reviewed-b

Re: [Qemu-devel] [PATCH for-4.0 v4 4/4] i386: allow to load initrd below 4G for recent linux

2019-01-08 Thread Li Zhijian
On 1/7/19 20:11, Stefano Garzarella wrote: Hi, On Thu, Dec 27, 2018 at 9:32 PM Eduardo Habkost wrote: On Fri, Dec 21, 2018 at 11:10:30AM -0500, Michael S. Tsirkin wrote: On Thu, Dec 06, 2018 at 10:32:13AM +0800, Li Zhijian wrote: a new field xloadflags was added to recent x86 linux, and BIT

Re: [Qemu-devel] [PATCH for-4.0 v4 3/4] i386: import & use bootparam.h

2019-01-07 Thread Li Zhijian
Hi Stefano, On 1/5/19 00:41, Stefano Garzarella wrote: +# Remove everything except the macros from bootparam.h avoiding the +# unnecessary import of several video/ist/etc headers +sed -e '/__ASSEMBLY__/,/__ASSEMBLY__/d' $tmpdir/include/asm/bootparam.h > $tmpdir/bootpara

Re: [Qemu-devel] [PATCH for-4.0 v4 2/4] refactor load_image_size

2019-01-07 Thread Li Zhijian
On 1/7/19 18:33, Stefano Garzarella wrote: On Mon, Dec 24, 2018 at 3:16 AM Li Zhijian wrote: On 12/22/18 00:12, Michael S. Tsirkin wrote: On Thu, Dec 06, 2018 at 10:32:11AM +0800, Li Zhijian wrote: Don't expect read(2) can always read as many as it's told. Signed-off-by:

Re: [Qemu-devel] [PATCH for-4.0 v4 1/4] unify len and addr type for memory/address APIs

2019-01-07 Thread Li Zhijian
On 1/7/19 18:04, Stefano Garzarella wrote: As Philippe already suggested, s/espcially/especially Hi Stefano, thanks a lot, will update it at next version. Thanks

Re: [Qemu-devel] [PATCH for-4.0 v4 4/4] i386: allow to load initrd below 4G for recent linux

2018-12-27 Thread Li Zhijian
On 12/28/2018 4:31 AM, Eduardo Habkost wrote: On Fri, Dec 21, 2018 at 11:10:30AM -0500, Michael S. Tsirkin wrote: On Thu, Dec 06, 2018 at 10:32:13AM +0800, Li Zhijian wrote: /* highest address for loading the initrd */ -if (protocol >= 0x203) { +if (protocol >=

Re: [Qemu-devel] [PATCH for-4.0 v4 2/4] refactor load_image_size

2018-12-23 Thread Li Zhijian
On 12/22/18 00:12, Michael S. Tsirkin wrote: On Thu, Dec 06, 2018 at 10:32:11AM +0800, Li Zhijian wrote: Don't expect read(2) can always read as many as it's told. Signed-off-by: Li Zhijian Reviewed-by: Richard Henderson This is more a theoretical bugfix than a refactoring ri

Re: [Qemu-devel] did the qemu can emulate the whole system with the processor that without support the "virtulization and kvm"?

2018-12-21 Thread Li Zhijian
The reasons for not having a /dev/kvm can vary but you haven't said what your host architecture is and what OS you are running so it's hard to offer advice here. -- Alex Bennée -- Best regards. Li Zhijian (8528)

Re: [Qemu-devel] [PATCH for-4.0 v4 0/4] allow to load initrd below 4G for recent kernel

2018-12-20 Thread Li Zhijian
ping On 12/6/18 10:32, Li Zhijian wrote: Long long ago, linux kernel has supported up to 4G initrd, but it's header still hard code to allow loading initrd below 2G only. cutting from arch/x86/head.S: # (Header version 0x0203 or later) the highest safe address for the contents #

Re: [Qemu-devel] [PATCH for-4.0 v4 5/7] colo: check chardev can switch context

2018-12-05 Thread Li Zhijian
On 12/06/2018 04:37 AM, Marc-André Lureau wrote: COLO uses a worker context (iothread) to drive the chardev. All backends are not able to switch the context, let's report an error in this case. Signed-off-by: Marc-André Lureau Reviewed-by: Li Zhijian --- net/colo-compare.

[Qemu-devel] [PATCH for-4.0 v4 1/4] unify len and addr type for memory/address APIs

2018-12-05 Thread Li Zhijian
ry_read(uint32_t len) -> dma_memory_rw(uint32_t len) -> dma_memory_rw_relaxed(uint32_t len) -> address_space_rw(int len) # len overflow CC: Paolo Bonzini CC: Peter Crosthwaite CC: Richard Henderson CC: Peter Maydell Signed-off-by: Li Zhijian Reviewed-by: Peter Maydell Reviewed-b

[Qemu-devel] [PATCH for-4.0 v4 2/4] refactor load_image_size

2018-12-05 Thread Li Zhijian
Don't expect read(2) can always read as many as it's told. Signed-off-by: Li Zhijian Reviewed-by: Richard Henderson --- V4: add reviewed-by tag --- hw/core/loader.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/core/loader.c b/hw/core/load

[Qemu-devel] [PATCH for-4.0 v4 0/4] allow to load initrd below 4G for recent kernel

2018-12-05 Thread Li Zhijian
eader bootparam.h (Michael S. Tsirkin) V2: add 2 patches(3/5, 4/5) to fix potential loading issue. Li Zhijian (4): unify len and addr type for memory/address APIs refactor load_image_size i386: import & use bootparam.h i386: allow to load initrd below 4G for recent linux

[Qemu-devel] [PATCH for-4.0 v4 3/4] i386: import & use bootparam.h

2018-12-05 Thread Li Zhijian
it's from v4.20-rc5. CC: Michael S. Tsirkin Signed-off-by: Li Zhijian --- V4: use scirpt to import bootparam.h (Michael S. Tsirkin) V3: new patch Signed-off-by: Li Zhijian --- hw/i386/pc.c | 8 +-- include/standard-headers/asm-x86/bootparam.h

[Qemu-devel] [PATCH for-4.0 v4 4/4] i386: allow to load initrd below 4G for recent linux

2018-12-05 Thread Li Zhijian
enough if this bit is set. CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum Signed-off-by: Li Zhijian --- V3: correct grammar and check XLF_CAN_BE_LOADED_ABOVE_4G first (Michael S. Tsirkin) Signed-off-by: Li Zhijian --

Re: [Qemu-devel] [PATCH for-4.0 v3 3/4] i386: import bootparam.h

2018-12-05 Thread Li Zhijian
On 12/05/2018 11:33 PM, Michael S. Tsirkin wrote: On Wed, Dec 05, 2018 at 06:28:11PM +0800, Li Zhijian wrote: Hi Michael I cooked a draft with cp_portable to import bootparam.h, could you have a look. diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index

Re: [Qemu-devel] [PATCH for-4.0 v3 1/4] unify len and addr type for memory/address APIs

2018-12-05 Thread Li Zhijian
On 12/05/2018 01:40 AM, Philippe Mathieu-Daudé wrote: Hi Li, On 3/12/18 15:48, Li Zhijian wrote: Some address/memory APIs have different type between 'hwaddr/target_ulong addr' and 'int len'. It is very unsafety, espcially I'm not native English speaker, but I t

Re: [Qemu-devel] [PATCH for-4.0 v3 3/4] i386: import bootparam.h

2018-12-05 Thread Li Zhijian
lude/asm/unistd_x32.h" "$output/linux-headers/asm-x86/" cp "$tmpdir/include/asm/unistd_64.h" "$output/linux-headers/asm-x86/" cp_portable "$tmpdir/include/asm/kvm_para.h" "$output/include/standard-headers/asm-$arch" +

Re: [Qemu-devel] [PATCH for-4.0 v3 3/4] i386: import bootparam.h

2018-12-04 Thread Li Zhijian
On 12/04/2018 09:06 AM, Michael S. Tsirkin wrote: On Mon, Dec 03, 2018 at 10:48:51PM +0800, Li Zhijian wrote: It provides setup_data struct and header fields CC: Michael S. Tsirkin Signed-off-by: Li Zhijian Sorry I was unclear when I said "import it from Linux". Sorry, it&

[Qemu-devel] [PATCH for-4.0 v3 1/4] unify len and addr type for memory/address APIs

2018-12-03 Thread Li Zhijian
ry_read(uint32_t len) -> dma_memory_rw(uint32_t len) -> dma_memory_rw_relaxed(uint32_t len) -> address_space_rw(int len) # len overflow CC: Paolo Bonzini CC: Peter Crosthwaite CC: Richard Henderson CC: Peter Maydell Signed-off-by: Li Zhijian --- V3: use the same type betwe

[Qemu-devel] [PATCH for-4.0 v3 2/4] refactor load_image_size

2018-12-03 Thread Li Zhijian
Don't expect read(2) can always read as many as it's told. Signed-off-by: Li Zhijian --- hw/core/loader.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index fa41842..9cbceab 100644 --- a/hw/core/loader.c +++

[Qemu-devel] [PATCH for-4.0 v3 0/4] allow to load initrd below 4G for recent kernel

2018-12-03 Thread Li Zhijian
code basing on http://patchwork.ozlabs.org/cover/1005990 and https://patchew.org/QEMU/20181122133507.30950-1-peter.mayd...@linaro.org - add new patch 3/4 to import header bootparam.h (Michael S. Tsirkin) V2: add 2 patches(3/5, 4/5) to fix potential loading issue. Li Zhijian (4): unify len and

[Qemu-devel] [PATCH for-4.0 v3 4/4] i386: allow to load initrd below 4G for recent linux

2018-12-03 Thread Li Zhijian
enough if this bit is set. CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum Signed-off-by: Li Zhijian --- V3: correct grammar and check XLF_CAN_BE_LOADED_ABOVE_4G first (Michael S. Tsirkin) Signed-off-by: Li Zhijian --

[Qemu-devel] [PATCH for-4.0 v3 3/4] i386: import bootparam.h

2018-12-03 Thread Li Zhijian
It provides setup_data struct and header fields CC: Michael S. Tsirkin Signed-off-by: Li Zhijian --- V3: new patch --- hw/i386/pc.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 067d23a..8db7417 100644 --- a/hw/i386/pc.c

Re: [Qemu-devel] [PATCH v2 1/5] unify len and addr type for memory/address APIs

2018-12-02 Thread Li Zhijian
On 11/30/2018 09:40 PM, Peter Maydell wrote: On Wed, 21 Nov 2018 at 02:07, Li Zhijian wrote: Some address/memory APIs have different type between 'hwaddr addr' and 'int len'. It is very unsafety, espcially some APIs will be passed a non-int len by caller which might ca

Re: [Qemu-devel] [PATCH v2 2/5] change load_image() reture type to ssize_t

2018-12-02 Thread Li Zhijian
On 11/30/2018 11:14 PM, Peter Maydell wrote: I'm just about to send out a patchset which removes all the load_image() callers; that would make patches 2 and 4 in this set unnecessary. Got it, i will remove them at next version basing on your patch set. Thanks Zhijian

Re: [Qemu-devel] [PATCH v2 5/5] x86: allow load initrd below 4G for recent linux

2018-12-02 Thread Li Zhijian
On 11/30/2018 10:53 PM, Michael S. Tsirkin wrote: On Wed, Nov 21, 2018 at 10:06:06AM +0800, Li Zhijian wrote: a new field xloadflags was added to recent x86 linux, and BIT 1: XLF_CAN_BE_LOADED_ABOVE_4G is used to tell bootload that where initrd can be loaded saftly. safely Current QEMU

[Qemu-devel] [PATCH v2 4/5] x86: exit qemu if load_image fails

2018-11-20 Thread Li Zhijian
CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum Signed-off-by: Li Zhijian --- hw/i386/pc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f095725..2ffe6fb 10064

[Qemu-devel] [PATCH v2 3/5] refactor load_image/load_image_size

2018-11-20 Thread Li Zhijian
Don't expect read(2) can always read as many as it's told. Signed-off-by: Li Zhijian --- hw/core/loader.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 0d53229..5f891e2 100644 --- a/hw/core/load

[Qemu-devel] [PATCH v2 5/5] x86: allow load initrd below 4G for recent linux

2018-11-20 Thread Li Zhijian
this bit is set. CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum Signed-off-by: Li Zhijian --- hw/i386/pc.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 2ffe6fb..6d4b

[Qemu-devel] [PATCH v2 0/5] support loading initrd below 4G for recent kernel

2018-11-20 Thread Li Zhijian
len = len > INT32_MAX ? INT32_MAX : len; + /* If the access is not a read access, it will be a skip access, * tested before. */ changes: V2: add 2 patches(3/5, 4/5) to fix potential loading issue. Li Zhijian (5): unify len and addr type for memory/addre

[Qemu-devel] [PATCH v2 1/5] unify len and addr type for memory/address APIs

2018-11-20 Thread Li Zhijian
-> dma_memory_rw(uint32_t len) -> dma_memory_rw_relaxed(uint32_t len) -> address_space_rw(int len) # len overflow CC: Paolo Bonzini CC: Peter Crosthwaite CC: Richard Henderson Signed-off-by: Li Zhijian --- exec.c| 49

[Qemu-devel] [PATCH v2 2/5] change load_image() reture type to ssize_t

2018-11-20 Thread Li Zhijian
This patch allow load_iamge to load >=2G file Signed-off-by: Li Zhijian --- hw/core/loader.c| 5 +++-- include/hw/loader.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index aa0b3fc..0d53229 100644 --- a/hw/core/loader.c +++ b

[Qemu-devel] [PATCH 1/3] unify len and addr type for memory/address APIs

2018-11-11 Thread Li Zhijian
-> dma_memory_rw(uint32_t len) -> dma_memory_rw_relaxed(uint32_t len) -> address_space_rw(int len) # len overflow CC: Paolo Bonzini CC: Peter Crosthwaite CC: Richard Henderson Signed-off-by: Li Zhijian --- exec.c| 49

[Qemu-devel] [PATCH 2/3] change load_image() reture type to ssize_t

2018-11-11 Thread Li Zhijian
This patch allow load_iamge to load >=2G file Signed-off-by: Li Zhijian --- hw/core/loader.c| 5 +++-- include/hw/loader.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index aa0b3fc..0d53229 100644 --- a/hw/core/loader.c +++ b

[Qemu-devel] [PATCH 3/3] x86: allow load initrd below 4G for recent linux

2018-11-11 Thread Li Zhijian
this bit is set. CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum Signed-off-by: Li Zhijian --- hw/i386/pc.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f095725..5e2f

Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd

2018-11-09 Thread Li Zhijian
On 11/9/2018 3:20 PM, Ingo Molnar wrote: * Li Zhijian wrote: If the kernel initrd creation process creates an initrd which is larger than 2GB and also claims that it can't be placed with any part of it above 2GB, then that sounds like a bug in the initrd creation process... Exactly, i

Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd

2018-11-09 Thread Li Zhijian
. bootloader side: if protocol >= 2.15 if XLF_INITRD_LOAD_BELOW_4G support ~4G initrd fi else if protocol >=2.12 if XLF_CAN_BE_LOADED_ABOVE_4G support ~4G initrd fi fi thanks Zhijian On 11/9/2018 6:04 PM, Juergen Gross wrote: On 09/11/2018 10:57, Li Zhijian wrote: O

Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd

2018-11-09 Thread Li Zhijian
- If 1, kernel/boot_params/cmdline/ramdisk can be above 4G. 629 maybe we can reuse this field and append a new Bit 5 XLF_INITRD_SIZE_4G or such thanks Zhijian On 11/9/2018 6:04 PM, Juergen Gross wrote: On 09/11/2018 10:57, Li Zhijian wrote: On 11/9/2018 3:20 PM, Ingo Molnar wrote

Re: [Qemu-devel] [RFC/PoC PATCH 2/3] change size type from int to int64_t on load_image()

2018-11-08 Thread Li Zhijian
On 11/08/2018 07:04 PM, Peter Maydell wrote: On 8 November 2018 at 10:59, Li Zhijian wrote: allow load_image to load >= 2G file CC: Philip Li Signed-off-by: Li Zhijian --- hw/core/loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/c

Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd

2018-11-08 Thread Li Zhijian
On 11/08/2018 07:06 PM, Peter Maydell wrote: On 8 November 2018 at 10:59, Li Zhijian wrote: x86/x86_64 has alredy supported 4G initrd. linux/arch/x86/boot/header.S: # (Header version 0x0203 or later) the highest safe address for the contents # of an initrd. The current kernel allows up

[Qemu-devel] [RFC/PoC PATCH 0/3] support initrd size up to 4G

2018-11-08 Thread Li Zhijian
$ make # all errors gone CC: Paolo Bonzini CC: Peter Crosthwaite CC: Richard Henderson Li Zhijian (3): i386: set initrd_max to 4G - 1 to allow up to 4G initrd change size type from int to int64_t on load_image() change int len to uin32_t len exec.c| 42 +++

[Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd

2018-11-08 Thread Li Zhijian
: Li Zhijian --- hw/i386/pc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index cd5029c..e1b910f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -913,6 +913,12 @@ static void load_linux(PCMachineState *pcms, /* highest address for loading the initrd

[Qemu-devel] [RFC/PoC PATCH 2/3] change size type from int to int64_t on load_image()

2018-11-08 Thread Li Zhijian
allow load_image to load >= 2G file CC: Philip Li Signed-off-by: Li Zhijian --- hw/core/loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index aa0b3fc..8fbc4bd 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -77,7 +7

[Qemu-devel] [PATCH 3/3] change int len to uin32_t len

2018-11-08 Thread Li Zhijian
w_relaxed(uint32_t len) -> address_space_rw(int len) # len overflow -> address_space_read_full(int len) CC: Paolo Bonzini CC: Peter Crosthwaite CC: Richard Henderson CC: Philip Li Signed-off-by: Li Zhijian --- exec.c| 42 +---

[Qemu-devel] [PATCH v3] change get_image_size return type to int64_t

2018-09-27 Thread Li Zhijian
oot@haswell-OptiPlex-9020:/home/lizj# du -sh large.cgz 2.5Glarge.cgz this patch changes the caller side that use this function to calculate size of initrd file as well. Signed-off-by: Li Zhijian --- v3: hide version changelog v2: update error message and int64_t printing format hw/alpha/dp26

[Qemu-devel] [PATCH v2] change get_image_size return type to int64_t

2018-09-13 Thread Li Zhijian
oot@haswell-OptiPlex-9020:/home/lizj# du -sh large.cgz 2.5Glarge.cgz this patch changes the caller side that use this function to calculate size of initrd file as well. v2: update error message and int64_t printing format Signed-off-by: Li Zhijian --- hw/alpha/dp264.c| 3 ++- hw/c

[Qemu-devel] [PATCH] change get_image_size return type to int64_t

2018-09-12 Thread Li Zhijian
oot@haswell-OptiPlex-9020:/home/lizj# du -sh large.cgz 2.5Glarge.cgz this patch changes the caller side that use this function to calculate size of initrd file as well. Signed-off-by: Li Zhijian --- hw/alpha/dp264.c| 2 +- hw/core/loader.c| 5 +++-- hw/hppa/machine.c

Re: [Qemu-devel] [Bug 1754542] Re: colo: vm crash with segmentation fault

2018-03-23 Thread Li Zhijian
Just noticed that's a little old, you may need to rebase it Thanks On 03/23/2018 11:51 AM, Li Zhijian wrote: On 03/21/2018 02:04 PM, Zhang Chen wrote: Hi Suiheng, I made a new guest image and retest it, and got the same bug from latest branch. I found that after the COLO checkpoint

Re: [Qemu-devel] [Bug 1754542] Re: colo: vm crash with segmentation fault

2018-03-22 Thread Li Zhijian
this bug occurred in COLO frame related codes. This part of codes wrote by Li zhijian and Zhang hailiang and currently maintained by Zhang hailiang. So, I add them to this thread. CC Zhijian and Hailiang: Any idea or comments about this bug? One clue is the memory of SVM not is same with PVM. we

Re: [Qemu-devel] [PATCH 2/4] net/colo-compare.c: compare tcp packet base on sequence number

2017-07-06 Thread Li Zhijian
this title confused me i think you want to express "only compare the packets that has the same sequence number" and i think this optimization can not reduce this checkpoint optimization. Thanks On 07/07/2017 01:43 PM, Zhang Chen wrote: If primary packet's sequence number not same with secon

Re: [Qemu-devel] [PATCH 1/4] net/colo-compare.c: Add checkpoint min period to optimize performance

2017-07-06 Thread Li Zhijian
t->creation_ms; +} break; } } -- Best regards. Li Zhijian (8528)

Re: [Qemu-devel] [PATCH] Change the method to calculate dirty-pages-rate

2017-03-13 Thread Li Zhijian
rcu_read(&migration_bitmap_rcu)->bmap = 0b0011, the new_dirty will be 0b1100, and this function will return 2 but not 4 which is expected. the dirty pages in dirty_memory[DIRTY_MEMORY_MIGRATION] are all new, so these should be calculated also. Signed-off-by: Chao Fan Signed-off-by: Li Zhijia

Re: [Qemu-devel] [PATCH COLO-Frame (Base) v21 00/17] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT)

2016-10-26 Thread Li Zhijian
On 10/26/2016 05:53 PM, Li Zhijian wrote: On 10/26/2016 04:26 PM, Amit Shah wrote: On (Wed) 26 Oct 2016 [14:43:30], Hailiang Zhang wrote: Hi Amit, On 2016/10/26 14:09, Amit Shah wrote: Hello, On (Tue) 18 Oct 2016 [20:09:56], zhanghailiang wrote: This is the 21th version of COLO frame

Re: [Qemu-devel] [PATCH COLO-Frame (Base) v21 00/17] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT)

2016-10-26 Thread Li Zhijian
tperf with TCP_RR, client will get *twice* latency with a Request/Response -- Best regards. Li Zhijian Also, can you tell how did you arrive at the default checkpoint interval? Er, for this value, we referred to Remus in XEN platform. ;) But after we implement COLO with colo proxy, this int

Re: [Qemu-devel] [PATCH COLO-Frame (Base) v21 00/17] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT)

2016-10-26 Thread Li Zhijian
Amit . -- Best regards. Li Zhijian (8555)

[Qemu-devel] [PATCH 1/2] migration: add qemu_loadvm_section_header() helper

2016-10-05 Thread Li Zhijian
no fuctional changes Signed-off-by: Li Zhijian --- migration/savevm.c | 51 ++- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 33a2911..c36a675 100644 --- a/migration/savevm.c +++ b

[Qemu-devel] [PATCH 2/2] migration: introduce section type QEMU_VM_SECTION_HEADER

2016-10-05 Thread Li Zhijian
-device virtio-scsi-pci,id=scsi0), after migration, the source goto status "paused (postmigrate)" and distination will exit since detect inconsistent device. Signed-off-by: Li Zhijian --- include/migration/migration.h | 1 + migration/savevm.c| 19 +-- 2 files c

Re: [Qemu-devel] [PATCH 2/2] migration: send and check the devices between source and distination at the begining

2016-10-05 Thread Li Zhijian
On 09/30/2016 05:58 PM, Dr. David Alan Gilbert wrote: * Li Zhijian (lizhij...@cn.fujitsu.com) wrote: On 09/30/2016 02:15 PM, Amit Shah wrote: Hi, On (Thu) 29 Sep 2016 [19:06:32], Li Zhijian wrote: Priviously, if the source and distination have different devices, source could goto the

Re: [Qemu-devel] [PATCH 2/2] migration: send and check the devices between source and distination at the begining

2016-09-30 Thread Li Zhijian
On 09/30/2016 02:15 PM, Amit Shah wrote: Hi, On (Thu) 29 Sep 2016 [19:06:32], Li Zhijian wrote: Priviously, if the source and distination have different devices, source could goto the status "paused (postmigrate)", and the distination will exit that means no qemu is alive.

[Qemu-devel] [PATCH 2/2] migration: send and check the devices between source and distination at the begining

2016-09-29 Thread Li Zhijian
migration, source keep in status "running". Signed-off-by: Li Zhijian --- migration/savevm.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 09d8e99..0c07671 100644 --- a/migration/savevm.c +++ b/migratio

[Qemu-devel] [PATCH 1/2] migration: split qemu_loadvm_section_start_full() to qemu_loadvm_section_{start(), full()}

2016-09-29 Thread Li Zhijian
Signed-off-by: Li Zhijian --- migration/savevm.c | 53 +++-- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 33a2911..09d8e99 100644 --- a/migration/savevm.c +++ b/migration/savevm.c

Re: [Qemu-devel] [PATCH] net/net: Bugfix for net_fill_rstate()

2016-08-17 Thread Li Zhijian
? because the callers only concern about the error case. -- Best regards. Li Zhijian On 08/17/2016 08:33 PM, Zhang Chen wrote: When network is busy, we will receive multiple packets at one time. this bug will lost packets that comes late. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian ---

[Qemu-devel] [PATCH] qemu-options.hx: correct spice options streaming-video default document value to 'off'

2016-07-31 Thread Li Zhijian
since f1d3e58, the code had changed the default value to 'off', so this patch make document and code are consistent. Signed-off-by: Li Zhijian --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 8e0d9a5..878b

Re: [Qemu-devel] [RFC PATCH V9 5/7] qemu-char: Add qemu_chr_add_handlers_full() for GMaincontext

2016-07-21 Thread Li Zhijian
Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/sysemu/char.h | 11 - qemu-char.c | 119 +++--- 2 files changed, 84 insertions(+), 46 deletions(-) diff --git a/include/sysemu/char.h b/include/sysemu/char.h index 307fd8f

Re: [Qemu-devel] [PATCH] net/net: Add ReadState for reuse codes

2016-05-09 Thread Li Zhijian
On 05/06/2016 06:56 PM, Zhang Chen wrote: Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/net/net.h | 8 ++ net/filter-mirror.c | 60 net/net.c | 56

Re: [Qemu-devel] [PATCH v2] vl: change runstate only if new state is different from current state

2016-04-26 Thread Li Zhijian
ping... Thanks Li Zhijian On 04/14/2016 11:25 AM, Li Zhijian wrote: Previously, qemu will abort at following scenario: (qemu) stop (qemu) system_reset (qemu) system_reset (qemu) 2016-04-13T20:54:38.979158Z qemu-system-x86_64: invalid runstate transition: 'prelaunch' -> '

Re: [Qemu-devel] [PATCH] vl: chanage runstate only if new state is different from current state

2016-04-13 Thread Li Zhijian
I send V2 with minor fix - fix patch title typo 'chanage' -> 'change' - coding sytle: 'return ;' -> 'return;' - add Acked tag pls review the V2. Best regards Li Zhijian On 04/13/2016 07:57 PM, Paolo Bonzini wrote: On 13/04/2016 11:27, Li

[Qemu-devel] [PATCH v2] vl: change runstate only if new state is different from current state

2016-04-13 Thread Li Zhijian
Previously, qemu will abort at following scenario: (qemu) stop (qemu) system_reset (qemu) system_reset (qemu) 2016-04-13T20:54:38.979158Z qemu-system-x86_64: invalid runstate transition: 'prelaunch' -> 'prelaunch' Signed-off-by: Li Zhijian Acked-by: Paolo Bonzini --- fr

[Qemu-devel] [PATCH] vl: chanage runstate only if new state is different from current state

2016-04-13 Thread Li Zhijian
Previously, qemu will abort at following scenario: (qemu) stop (qemu) system_reset (qemu) system_reset (qemu) 2016-04-13T20:54:38.979158Z qemu-system-x86_64: invalid runstate transition: 'prelaunch' -> 'prelaunch' Signed-off-by: Li Zhijian --- vl.c | 4 1 fil

Re: [Qemu-devel] [PATCH COLO-Frame v16 16/35] COLO: synchronize PVM's state to SVM periodically

2016-04-11 Thread Li Zhijian
On 04/08/2016 02:26 PM, zhanghailiang wrote: Do checkpoint periodically, the default interval is 200ms. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v12: - Add Reviewed-by tag v11: - Fix wrong sleep time for checkpoint period. (Dave&#

Re: [Qemu-devel] [PATCH V2 1/3] colo-compare: introduce colo compare initlization

2016-03-31 Thread Li Zhijian
On 04/01/2016 01:11 PM, Jason Wang wrote: On 03/31/2016 05:24 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: On 03/30/2016 05:25 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: packet come from primary char inde

Re: [Qemu-devel] [PATCH V2 0/3] Introduce COLO-compare

2016-03-31 Thread Li Zhijian
On 03/31/2016 05:43 PM, Dr. David Alan Gilbert wrote: * Li Zhijian (lizhij...@cn.fujitsu.com) wrote: On 03/30/2016 08:05 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: COLO-compare is a part of COLO project. It is used to compare the network package

Re: [Qemu-devel] [PATCH V2 2/3] colo-compare: track connection and enqueue packet

2016-03-30 Thread Li Zhijian
ill be used, like lizhijian said. I mean you should remove this now, and re-introduce when you integrate to COLO frame Thanks Li Zhijian

Re: [Qemu-devel] [PATCH V2 0/3] Introduce COLO-compare

2016-03-30 Thread Li Zhijian
gilb...@redhat.com / Manchester, UK . -- Best regards. Li Zhijian (8555)

Re: [Qemu-devel] [PATCH V2 3/3] colo-compare: introduce packet comparison thread

2016-03-30 Thread Li Zhijian
On 03/30/2016 07:41 PM, Dr. David Alan Gilbert wrote: [...] >@@ -433,7 +532,9 @@ static void compare_pri_chr_in(void *opaque, const uint8_t *buf, int size) > if (ret == 1) { > if (packet_enqueue(s, PRIMARY_IN)) { > error_report("primary: unsupported packet in"); >-

Re: [Qemu-devel] [PATCH V2 2/3] colo-compare: track connection and enqueue packet

2016-03-30 Thread Li Zhijian
+---v++---v+ +---v+ |primary | |secondary|primary | |secondary |packet | |packet +|packet | |packet + ++ ++++ ++ Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-

Re: [Qemu-devel] [PATCH V5 1/2] net/filter-mirror: implement filter-redirector

2016-03-20 Thread Li Zhijian
g Signed-off-by: Li Zhijian --- net/filter-mirror.c | 245 qemu-options.hx | 9 ++ vl.c| 3 +- 3 files changed, 256 insertions(+), 1 deletion(-) diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 1b1ec16..7

Re: [Qemu-devel] [PATCH V6 1/2] net/filter-mirror: implement filter-redirector

2016-03-19 Thread Li Zhijian
v user,id=hn0 -chardev socket,id=s0,host=ip_primary,port=X,server,nowait -chardev socket,id=s1,host=ip_primary,port=Y,server,nowait -filter-redirector,id=r0,netdev=hn0,queue=tx/rx/all,indev=s0,outdev=s1 Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- net/fi

Re: [Qemu-devel] [PATCH V4 1/2] net/filter-mirror: implement filter-redirector

2016-03-16 Thread Li Zhijian
v user,id=hn0 -chardev socket,id=s0,host=ip_primary,port=X,server,nowait -chardev socket,id=s1,host=ip_primary,port=Y,server,nowait -filter-redirector,id=r0,netdev=hn0,queue=tx/rx/all,indev=s0,outdev=s1 Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- net/filter-m

Re: [Qemu-devel] [PATCH V4 1/2] net/filter-mirror: implement filter-redirector

2016-03-16 Thread Li Zhijian
rimary,port=X,server,nowait -chardev socket,id=s1,host=ip_primary,port=Y,server,nowait -filter-redirector,id=r0,netdev=hn0,queue=tx/rx/all,indev=s0,outdev=s1 Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- net/filter-m

Re: [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate()

2016-03-14 Thread Li Zhijian
On 03/15/2016 11:08 AM, Jason Wang wrote: On 03/09/2016 04:02 PM, Li Zhijian wrote: On 03/08/2016 04:04 PM, Yang Hongyang wrote: Hi Chen, What's the motivation that you want to change this name? The function actually is not intent to iterate every filter. Right. but this fun

Re: [Qemu-devel] [PULL 00/14] Net patches

2016-03-14 Thread Li Zhijian
On 03/15/2016 11:07 AM, Jason Wang wrote: On 03/10/2016 11:51 AM, Li Zhijian wrote: On 03/10/2016 10:28 AM, Jason Wang wrote: On 03/08/2016 05:54 PM, Peter Maydell wrote: On 8 March 2016 at 16:06, Zhang Chen wrote: I found the reason for this problem is that unix_connect() have not

Re: [Qemu-devel] [Patch 1/1] net/net: Allocating Large sized arrays to heap

2016-03-13 Thread Li Zhijian
return nc->info->receive(nc, buffer, offset); } + +g_free(buf); } ssize_t qemu_deliver_packet_iov(NetClientState *sender, -- Best regards. Li Zhijian

Re: [Qemu-devel] [Patch 1/1] net/socket: Allocating Large sized arrays to heap

2016-03-13 Thread Li Zhijian
K) @@ -170,7 +170,6 @@ static void net_socket_send(void *opaque) s->index = 0; s->packet_len = 0; s->nc.link_down = true; -memset(s->buf, 0, sizeof(s->buf)); memset(s->nc.info_str, 0, sizeof(s->nc.info_str)); fo

Re: [Qemu-devel] [PULL 00/14] Net patches

2016-03-09 Thread Li Zhijian
i don't know. Is this because that both qemu accepting the connection and qmp command are working under *iothread*, so that when the qemu command returns, we can guaranteed the connection is accepted ? Thanks Li Zhijian

Re: [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate()

2016-03-09 Thread Li Zhijian
until the packet is stolen(filter receiving handler return non-zero). In other words, packet could be handled by several filters at this function. BTW, it's difficult to determine what name is better. Thanks Li Zhijian On Mon, Mar 7, 2016 at 6:03 PM, Zhang Chen mailto:zhangchen.f...@cn.fuji

Re: [Qemu-devel] [PULL 00/14] Net patches

2016-03-08 Thread Li Zhijian
On 03/09/2016 09:36 AM, Wen Congyang wrote: On 03/08/2016 05:54 PM, Peter Maydell wrote: On 8 March 2016 at 16:06, Zhang Chen wrote: I found the reason for this problem is that unix_connect() have not connect to sock_path before iov_send(). It need time to establish connection. so can we fix

Re: [Qemu-devel] [PATCH V3 2/3] net/filter-mirror:Add filter-redirector func

2016-03-07 Thread Li Zhijian
On 03/07/2016 05:09 PM, Jason Wang wrote: On 03/07/2016 04:26 PM, Li Zhijian wrote: On 03/07/2016 03:56 PM, Jason Wang wrote: On 03/04/2016 08:01 PM, Zhang Chen wrote: Filter-redirector is a netfilter plugin. It gives qemu the ability to redirect net packet. redirector can redirect

Re: [Qemu-devel] [PATCH V3 2/3] net/filter-mirror:Add filter-redirector func

2016-03-07 Thread Li Zhijian
ach time when you receive partial len, store them in the buffer and advance the pointer until you receive at least sizeof(len) bytes. qemu_chr_fe_read_all() seem have done this work. Do you mean that we implement a similar code to do that instead of qemu_chr_fe_read_all() thanks Li Zhijian Then

Re: [Qemu-devel] [PATCH V2 3/3] tests/test-filter-redirector: Add unit test for filter-redirector

2016-03-03 Thread Li Zhijian
+ | | rd0+->+chardev| | +-+ +---+---+ | ^ | +-+ | | | rd1+--+ | +^+| | | +++| +-------+ | rd2<---+sock0 | +-+| +---+ + Thanks Li Zhijian

<    1   2   3   >