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 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&

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 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
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

[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 --

[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 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 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 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

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 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] [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] [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 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 +++

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

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-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 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
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

[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

[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 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 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 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 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 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 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

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

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 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

[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

[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 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 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 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

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] 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 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

[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

[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 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 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 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

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

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 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_

[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 |

[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 3/4] i386: import & use bootparam.h

2019-01-17 Thread Li Zhijian
it's from v4.20-rc5. CC: Stefano Garzarella CC: Michael S. Tsirkin Signed-off-by: Li Zhijian Reviewed-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella --- V6: Fix line over 80 characters && use double quates for all pathes (Stefano Garzarella) V5: add reviewed-by tag V4:

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

2019-01-17 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

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

2019-01-17 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 2/2] Acceptance tests: add support more than 2GiB initrd test with linux-v4.19

2019-01-18 Thread Li Zhijian
timeout is updated to 5mins since we need more time to load a large initrd to the guest CC: Wainer dos Santos Moschetta CC: Caio Carrara CC: Cleber Rosa CC: Eduardo Habkost CC: Philippe Mathieu-Daudé Signed-off-by: Li Zhijian --- tests/acceptance/linux_initrd.py | 37

[Qemu-devel] [PATCH 1/2] Acceptance tests: use linux-3.6 and set vm memory to 4GiB

2019-01-18 Thread Li Zhijian
linux-3.6 kernel shipped by Fedora-19 cannot support xldflags so that it cannot support loading more than 2GiB initrd CC: Wainer dos Santos Moschetta CC: Caio Carrara CC: Cleber Rosa CC: Eduardo Habkost CC: Philippe Mathieu-Daudé Signed-off-by: Li Zhijian --- this patch is basing on early

Re: [Qemu-devel] [PATCH 1/2] Acceptance tests: use linux-3.6 and set vm memory to 4GiB

2019-01-18 Thread Li Zhijian
Sorry, there are some typos, please ignore this version i will correct in V2 On 1/18/19 18:02, Li Zhijian wrote: linux-3.6 kernel shipped by Fedora-19 cannot support xldflags so that it s/Fedora-19/Fedora-18 cannot support loading more than 2GiB initrd CC: Wainer dos Santos Moschetta CC

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add support more than 2GiB initrd test with linux-v4.19

2019-01-18 Thread Li Zhijian
Sorry, there are some typos, please ignore this version i will correct in V2 s/v4.19/v4.16 on subject. On 1/18/19 18:02, Li Zhijian wrote: timeout is updated to 5mins since we need more time to load a large initrd to the guest CC: Wainer dos Santos Moschetta CC: Caio Carrara CC: Cleber

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 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 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 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 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

[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

[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 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

[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

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.

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] [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

[PATCH] .gitignore: add virtiofsd binary

2020-08-21 Thread Li Zhijian
Signed-off-by: Li Zhijian --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2992d15931..28729241f1 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ /qemu-ga /qemu-bridge-helper /qemu-keymap +/virtiofsd /qemu-monitor.texi /qemu-monitor

[PATCH] virtio-gpu: fix unmap the already mapped items

2020-08-21 Thread Li Zhijian
we go here either (!(*iov)[i].iov_base) or (len != l), so we need to consider to unmap the 'i'th item as well when the 'i'th item is not nil Signed-off-by: Li Zhijian --- hw/display/virtio-gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/displ

Re: [PATCH] virtio-gpu: fix unmap the already mapped items

2020-08-21 Thread Li Zhijian
On 8/21/20 6:07 PM, Gerd Hoffmann wrote: On Fri, Aug 21, 2020 at 04:49:45PM +0800, Li Zhijian wrote: we go here either (!(*iov)[i].iov_base) or (len != l), so we need to consider to unmap the 'i'th item as well when the 'i'th item is not nil Signed-off-by: Li Zhiji

[PATCH v2] virtio-gpu: fix unmap the already mapped items

2020-08-21 Thread Li Zhijian
we go here either (!(*iov)[i].iov_base) or (len != l), so we need to consider to unmap the 'i'th item as well when the 'i'th item is not nil Signed-off-by: Li Zhijian --- v2: address Gerd's comments --- hw/display/virtio-gpu.c | 3 +++ 1 file changed, 3 insertions(+)

[PATCH v2 1/4] migration/rdma: cleanup rmda in rdma_start_incoming_migration error path

2021-05-25 Thread Li Zhijian
the error path after calling qemu_rdma_dest_init() should do rdma cleanup Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- migration/rdma.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 41726cc74a8

[PATCH v2 3/4] migration/rdma: destination: create the return patch after the first accept

2021-05-25 Thread Li Zhijian
later. Signed-off-by: Li Zhijian --- V2: alloc memory for host_port --- migration/rdma.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 651534e8255..d829d08d076 100644 --- a/migration/rdma.c +++ b

[PATCH v2 2/4] migration/rdma: Fix rdma_addrinfo res leaks

2021-05-25 Thread Li Zhijian
rdma_freeaddrinfo() is the reverse operation of rdma_getaddrinfo() Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- migration/rdma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/migration/rdma.c b/migration/rdma.c index 7e7595faabf..651534e8255 100644 --- a/migration

[PATCH v2 4/4] migration/rdma: source: poll cm_event from return path

2021-05-25 Thread Li Zhijian
source side always blocks if postcopy is only enabled at source side. users are not able to cancel this migration in this case. Let source side have chance to cancel this migration Signed-off-by: Li Zhijian --- V2: utilize poll to check cm event --- migration/rdma.c | 42

[PATCH] migration/rdma: Fix cm event use after free

2021-06-01 Thread Li Zhijian
Signed-off-by: Li Zhijian --- migration/rdma.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 1cdb4561f32..d90b29a4b51 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -1539,16 +1539,20 @@ static int

[PATCH] migration/rdma: Fix cm_event used before being initialized

2021-05-13 Thread Li Zhijian
_event after rdma_connect"); 2499 ERROR(errp, "connecting to destination!"); 2500 rdma_ack_cm_event(cm_event); <<<< cause segmentation fault 2501 goto err_rdma_source_connect; 2502 } Signed-off-by: Li Zhijian --- migration/rdma.c | 2 +- 1 f

[PATCH v2] migration/rdma: Fix cm_event used before being initialized

2021-05-19 Thread Li Zhijian
dated/changed only if rdma_get_cm_event() returns 0. So it's okey to remove the ack in error patch. Signed-off-by: Li Zhijian --- V2: remove ack from the error patch (Dave) --- migration/rdma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/rdma.c b/migration/rdma.c index 00eac342

[PATCH 2/4] migration/rdma: Fix rdma_addrinfo res leaks

2021-05-20 Thread Li Zhijian
rdma_freeaddrinfo() is the reverse operation of rdma_getaddrinfo() Signed-off-by: Li Zhijian --- migration/rdma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/migration/rdma.c b/migration/rdma.c index 7e7595faab..651534e825 100644 --- a/migration/rdma.c +++ b/migration/rdma.c

[PATCH 1/4] migration/rdma: cleanup rmda in rdma_start_incoming_migration error path

2021-05-20 Thread Li Zhijian
the error path after calling qemu_rdma_dest_init() should do rdma cleanup Signed-off-by: Li Zhijian --- migration/rdma.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 41726cc74a..7e7595faab 100644 --- a/migration/rdma.c

[PATCH 3/4] migration/rdma: destination: create the return patch after the first accept

2021-05-20 Thread Li Zhijian
enabled postcopy later. Signed-off-by: Li Zhijian --- migration/rdma.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 651534e825..3b228c46eb 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -316,6

[PATCH RESEND 1/4] migration/rdma: cleanup rmda in rdma_start_incoming_migration error path

2021-05-20 Thread Li Zhijian
the error path after calling qemu_rdma_dest_init() should do rdma cleanup Signed-off-by: Li Zhijian --- migration/rdma.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 41726cc74a..7e7595faab 100644 --- a/migration/rdma.c

[PATCH RESEND 2/4] migration/rdma: Fix rdma_addrinfo res leaks

2021-05-20 Thread Li Zhijian
rdma_freeaddrinfo() is the reverse operation of rdma_getaddrinfo() Signed-off-by: Li Zhijian --- migration/rdma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/migration/rdma.c b/migration/rdma.c index 7e7595faab..651534e825 100644 --- a/migration/rdma.c +++ b/migration/rdma.c

[PATCH RESEND 3/4] migration/rdma: destination: create the return patch after the first accept

2021-05-20 Thread Li Zhijian
later. Signed-off-by: Li Zhijian --- migration/rdma.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 651534e825..3b228c46eb 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -316,6 +316,7 @@ typedef

[PATCH RESEND 4/4] migration/rdma: source: get accept cm_event from return path in non-block mode

2021-05-20 Thread Li Zhijian
source side always blocks if postcopy is only enabled at source side. users are not able to cancel this migration in this case. Here we try to get the cm_event every 100ms tile timeout. Signed-off-by: Li Zhijian --- migration/rdma.c | 59 1 file

Re: [Bug 1914696] Re: aarch64: migration failed: Segmentation fault (core dumped)

2021-02-05 Thread Li Zhijian
On 2/5/21 5:52 PM, Claudio Fontana wrote: Hi LiZhiJian, just one thing I noticed in your call stack, your $Subject talks about AArch64, and you end up in arm_v7m_mmu_idx_for_secstate, which means that ARM_FEATURE_M is detected, so definitely something looks off when it comes to the feature

[PATCH 2/2] migration: allow enabling mutilfd for specific protocol only

2021-07-16 Thread Li Zhijian
And change the default to true so that '-incoming defer' can enable multifd first. Signed-off-by: Li Zhijian --- migration/migration.c | 8 migration/multifd.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migrati

[PATCH 1/2] migration: allow multifd for socket protocol only

2021-07-16 Thread Li Zhijian
=0x563b4c44bb80) at ../util/qemu-thread-posix.c:541 #5 0x7f7fe9b5b3f9 in ?? () #6 0x in ?? () It's enough to check migrate_multifd_is_allowed() in multifd cleanup() and multifd setup() though there are so many other places using migrate_use_multifd(). Signed-off-by: Li Zh

[PATCH v2 0/2] enable fsdax rdma migration

2021-08-22 Thread Li Zhijian
in some modern HCA hardware/drivers. For the (2), IB provides advise API to prefetch pages in specific memory region. It can help driver reduce the page fault on responder(destination) side during RDMA_WRITE. CC: marcel.apfelb...@gmail.com Li Zhijian (2): migration/rdma: Try to register On

[PATCH v2 2/2] migration/rdma: advise prefetch write for ODP region

2021-08-22 Thread Li Zhijian
the responder does page fault as little as possible. Signed-off-by: Li Zhijian Reviewed-by: Marcel Apfelbaum --- V2: use IBV_ADVISE_MR_FLAG_FLUSH instead of IB_UVERBS_ADVISE_MR_FLAG_FLUSH and add Reviewed-by tag. # Marcel --- migration/rdma.c | 40

[PATCH v2 1/2] migration/rdma: Try to register On-Demand Paging memory region

2021-08-22 Thread Li Zhijian
]: http://pmem.io/rpma/manpages/v0.9.0/rpma_mr_reg.3 CC: Marcel Apfelbaum Signed-off-by: Li Zhijian --- V2: add ODP sanity check and remove goto --- migration/rdma.c | 73 ++ migration/trace-events | 1 + 2 files changed, 54 insertions(+), 20 deletions

[RFC PATCH] migration/rdma: Fix out of order wrid

2021-06-10 Thread Li Zhijian
wait Y CQ event(dropped at (7), blocks forever) Looks it only happens on soft RoCE rdma device in my a hundred of runs, a hardward IB device works fine. Signed-off-by: Li Zhijian --- This is just a draft to address this problem. One possible approach could be creating their

[PATCH] docs/nvdimm: update doc

2021-06-10 Thread Li Zhijian
The prompt was updated since def835f0da ('hostmem: Don't report pmem attribute if unsupported') Signed-off-by: Li Zhijian --- docs/nvdimm.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index 0aae682be3e..71cdbdf554b 10

[PATCH 1/2] migration/rdma: Try to register On-Demand Paging memory region

2021-07-31 Thread Li Zhijian
]: http://pmem.io/rpma/manpages/v0.9.0/rpma_mr_reg.3 Signed-off-by: Li Zhijian --- migration/rdma.c | 27 ++- migration/trace-events | 1 + 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 5c2d113aa94..8784b5f22a6

[PATCH 0/2] enable fsdax rdma migration

2021-07-31 Thread Li Zhijian
some modern HCA hardware/drivers. For the (2), IB provides advise API to prefetch pages in specific memory region. It can help driver reduce the page fault on responder(destination) side during RDMA_WRITE. Li Zhijian (2): migration/rdma: Try to register On-Demand Paging memory region migration

[PATCH 2/2] migration/rdma: advise prefetch write for ODP region

2021-07-31 Thread Li Zhijian
the responder does page fault as little as possible. Signed-off-by: Li Zhijian --- migration/rdma.c | 40 migration/trace-events | 1 + 2 files changed, 41 insertions(+) diff --git a/migration/rdma.c b/migration/rdma.c index 8784b5f22a6

[PATCH v2 2/2] migration: allow enabling mutilfd for specific protocol only

2021-07-31 Thread Li Zhijian
And change the default to true so that in '-incoming defer' case, user is able to change multifd capability. Signed-off-by: Li Zhijian --- migration/migration.c | 8 migration/multifd.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/migration/mig

<    1   2   3   >