Re: [Qemu-devel] [PATCH v3 0/3] nvdimm: support MAP_SYNC for memory-backend-file

2018-01-24 Thread Haozhong Zhang
ping? On 01/17/18 16:13 +0800, Haozhong Zhang wrote: > v3 is based on Eduardo's machine-next tree. Changes of > memory-backend-file are based on my previous patches in that tree. > > > Linux 4.15 introduces a new mmap flag MAP_SYNC, which can be used to > guarantee t

Re: [Qemu-devel] [PULL 00/19] machine queue, 2018-01-18

2018-01-18 Thread Haozhong Zhang
On 01/18/18 19:20 -0200, Eduardo Habkost wrote: > On Thu, Jan 18, 2018 at 03:22:05PM +, Peter Maydell wrote: > > On 18 January 2018 at 02:09, Eduardo Habkost wrote: > > > The following changes since commit > > > 8e5dc9ba49743b46d955ec7dacb04e42ae7ada7c: > > > > > > Merge remote-tracking bra

[Qemu-devel] [PATCH v3 2/3] hostmem: add more information in error messages

2018-01-17 Thread Haozhong Zhang
When there are multiple memory backends in use, including the object type name, ID and the property name in the error message can help users to locate the error. Signed-off-by: Haozhong Zhang Suggested-by: "Dr. David Alan Gilbert" --- backends/hostmem-file.c | 9 ++--- backends

[Qemu-devel] [PATCH v3 0/3] nvdimm: support MAP_SYNC for memory-backend-file

2018-01-17 Thread Haozhong Zhang
Tsirkin) * Move OS dependent definitions of MAP_SYNC and MAP_SHARED_VALIDATE to osdep.h. (Michael S. Tsirkin) Haozhong Zhang (3): util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap() hostmem: add hostmem type name and id in error messages hostmem-file: add 'sync' option back

[Qemu-devel] [PATCH v3 3/3] hostmem-file: add 'sync' option

2018-01-17 Thread Haozhong Zhang
x27;share=on', work as if 'sync=on'; otherwise, work as if 'sync=off' Signed-off-by: Haozhong Zhang Suggested-by: Eduardo Habkost --- backends/hostmem-file.c | 40 +++- docs/nvdimm.txt | 15 ++- exec.c

[Qemu-devel] [PATCH v3 1/3] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2018-01-17 Thread Haozhong Zhang
- If sync == ON_OFF_AUTO_AUTO, and * if the host OS and the backend file support MAP_SYNC, and MAP_SYNC is not conflict with other flags, qemu_ram_mmap() will work as if sync == ON_OFF_AUTO_ON. * otherwise, qemu_ram_mmap() will work as if sync == ON_OFF_AUTO_OFF. Signed-off-by: Haozhong Zhang -

Re: [Qemu-devel] [PATCH v2 2/2] hostmem-file: add 'sync' option

2018-01-11 Thread Haozhong Zhang
On 01/11/18 20:06 +, Dr. David Alan Gilbert wrote: > * Haozhong Zhang (haozhong.zh...@intel.com) wrote: > > This option controls whether QEMU mmap(2) the memory backend file with > > MAP_SYNC flag, which can fully guarantee the guest write persistence > > to the backend

[Qemu-devel] [PATCH v2 1/2] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2018-01-11 Thread Haozhong Zhang
- If sync == ON_OFF_AUTO_AUTO, and * if the host OS and the backend file support MAP_SYNC, and MAP_SYNC is not conflict with other flags, qemu_ram_mmap() will work as if sync == ON_OFF_AUTO_ON. * otherwise, qemu_ram_mmap() will work as if sync == ON_OFF_AUTO_OFF. Signed-off-by: Haozhong Zhang -

[Qemu-devel] [PATCH v2 0/2] nvdimm: support MAP_SYNC for memory-backend-file

2018-01-11 Thread Haozhong Zhang
* Add 'sync' option to control the use of MAP_SYNC. (Eduardo Habkost) * Remove the unnecessary set of MAP_SHARED_VALIDATE in some cases and the retry mechanism in qemu_ram_mmap(). (Michael S. Tsirkin) * Move OS dependent definitions of MAP_SYNC and MAP_SHARED_VALIDATE to osdep.

[Qemu-devel] [PATCH v2 2/2] hostmem-file: add 'sync' option

2018-01-11 Thread Haozhong Zhang
x27;share=on', work as if 'sync=on'; otherwise, work as if 'sync=off' Signed-off-by: Haozhong Zhang Sugguested-by: Eduardo Habkost --- backends/hostmem-file.c | 39 ++- docs/nvdimm.txt | 15 ++- exec.c

Re: [Qemu-devel] [PATCH] qemu: improve hugepage allocation failure message

2018-01-09 Thread Haozhong Zhang
On 01/09/18 17:37 -0200, Marcelo Tosatti wrote: > > Improve hugepage allocation failure message, indicating > whats happening to the user. > > Signed-off-by: Marcelo Tosatti > > diff --git a/exec.c b/exec.c > index 4722e521d4..439abedb98 100644 > --- a/exec.c > +++ b/exec.c > @@ -1643,7 +1643,8

Re: [Qemu-devel] [PATCH] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2018-01-03 Thread Haozhong Zhang
On 01/03/18 11:45 -0200, Eduardo Habkost wrote: > On Wed, Jan 03, 2018 at 11:16:39AM +0800, Haozhong Zhang wrote: > > On 01/02/18 18:02 +0200, Michael S. Tsirkin wrote: > > > On Wed, Dec 27, 2017 at 02:56:20PM +0800, Haozhong Zhang wrote: > > > > When a file sup

Re: [Qemu-devel] [PATCH] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2018-01-02 Thread Haozhong Zhang
On 01/02/18 18:02 +0200, Michael S. Tsirkin wrote: > On Wed, Dec 27, 2017 at 02:56:20PM +0800, Haozhong Zhang wrote: > > When a file supporting DAX is used as vNVDIMM backend, mmap it with > > MAP_SYNC flag in addition can guarantee the persistence of guest write > > to the

Re: [Qemu-devel] [PATCH 1/2] util/pmem: add function to make writes to pmem persistent

2018-01-02 Thread Haozhong Zhang
On 12/31/17 17:55 +0200, Michael S. Tsirkin wrote: > On Mon, Dec 25, 2017 at 09:06:10AM +0800, Haozhong Zhang wrote: > > The new function pmem_persistent() flushes the previous cached writes > > on the specified memory buffer, which ensures the write persistence if > > the bu

[Qemu-devel] [PATCH] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2017-12-26 Thread Haozhong Zhang
MAP_SYNC fails if MAP_SYNC is not supported by the kernel or the backend file. On such failures, QEMU retries mmap without MAP_SYNC and MAP_SHARED_VALIDATE. Signed-off-by: Haozhong Zhang --- util/mmap-alloc.c | 36 +++- 1 file changed, 35 insertions(+), 1 deletion

[Qemu-devel] [PATCH 1/2] util/pmem: add function to make writes to pmem persistent

2017-12-24 Thread Haozhong Zhang
The new function pmem_persistent() flushes the previous cached writes on the specified memory buffer, which ensures the write persistence if the buffer is in persistent memory. Signed-off-by: Haozhong Zhang --- include/qemu/pmem.h | 25 ++ util/Makefile.objs | 1 + util/pmem.c

[Qemu-devel] [PATCH 0/2] mem/nvdimm: ensure persistence of QEMU writes to real NVDIMM device

2017-12-24 Thread Haozhong Zhang
QEMU intercepts guest writes to vNVDIMM labels, and then stores them to the backend. When the backend is a real NVDIMM device, QEMU needs to ensure the write persistence before returning to guest, so that the guest labels will not be lost if QEMU exits abnormally. Haozhong Zhang (2): util/pmem

[Qemu-devel] [PATCH 2/2] mem/nvdimm: ensure persistence of QEMU writes to real NVDIMM device

2017-12-24 Thread Haozhong Zhang
QEMU intercepts guest writes to vNVDIMM labels, and then stores them to the backend. When the backend is a real NVDIMM device, QEMU needs to ensure the write persistence before returning to guest, so that the guest labels will not be lost if QEMU exits abnormally. Signed-off-by: Haozhong Zhang

[Qemu-devel] [PATCH] pc: fail memory hot-plug/unplug with -no-acpi and Q35 machine type

2017-12-21 Thread Haozhong Zhang
it's disabled. Signed-off-by: Haozhong Zhang --- hw/i386/pc.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 3fcf318a95..55686bf5d8 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1695,9 +1695,14 @@ static

[Qemu-devel] [PATCH v3 1/2] pc: add 2.12 machine types

2017-12-18 Thread Haozhong Zhang
Signed-off-by: Haozhong Zhang --- hw/i386/pc_piix.c| 15 --- hw/i386/pc_q35.c | 13 +++-- include/hw/i386/pc.h | 3 +++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5e47528993..f235ee12c2 100644 --- a/hw

[Qemu-devel] [PATCH v3 2/2] target/i386: add clflushopt to "Skylake-Server" cpu model

2017-12-18 Thread Haozhong Zhang
CPUID_7_0_EBX_CLFLUSHOPT is missed in current "Skylake-Server" cpu model. Add it to "Skylake-Server" cpu model on pc-i440fx-2.12 and pc-q35-2.12. Keep it disabled in "Skylake-Server" cpu model on older machine types. Signed-off-by: Haozhong Zhang --- include/hw/i3

[Qemu-devel] [PATCH v3 0/2] Add clflushopt to "Skylake-Server" cpu model

2017-12-18 Thread Haozhong Zhang
Changes in v3: * Rebase on QEMU 2.12. * Add 2.12 PC machine types. Denis V. Lunev has already posted a similar patch [1]. If that one is merged first, please ignore patch 1 in this patch series. [1] https://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg02961.html Haozhong Zhang (2

[Qemu-devel] [PATCH v2] target/i386: add clflushopt to "Skylake-Server" cpu model

2017-12-11 Thread Haozhong Zhang
CPUID_7_0_EBX_CLFLUSHOPT is missed in current "Skylake-Server" cpu model. Add it to "Skylake-Server" cpu model on pc-i440fx-2.11 and pc-q35-2.11. Keep it disabled in "Skylake-Server" cpu model on older machine types. Signed-off-by: Haozhong Zhang -

[Qemu-devel] [PATCH] target/i386: add CPU model "Skylake-Server-clflushopt"

2017-12-11 Thread Haozhong Zhang
The only difference from the existing CPU model "Skylake-Server" is the add of CPUID_7_0_EBX_CLFLUSHOPT, which is missed in "Skylake-Server". Signed-off-by: Haozhong Zhang --- target/i386/cpu.c | 49 + 1 file changed, 49 inser

[Qemu-devel] [PATCH v4 1/3] hostmem-file: add "align" option

2017-12-10 Thread Haozhong Zhang
to 'memory-backend-file', so that users or management utils, which have enough knowledge about the backend, can specify a proper alignment via this option. Signed-off-by: Haozhong Zhang --- backends/hostmem-file.c | 41 - docs/nvd

[Qemu-devel] [PATCH v4 3/3] nvdimm: add 'unarmed' option

2017-12-10 Thread Haozhong Zhang
ice read-only if the unarmed flag in guest NFIT is set. The default value of 'unarmed' option is 'off' in order to keep the backwards compatibility. Signed-off-by: Haozhong Zhang --- docs/nvdimm.txt | 15 +++ hw/acpi/nvdimm.c|

[Qemu-devel] [PATCH v4 2/3] nvdimm: add a macro for property "label-size"

2017-12-10 Thread Haozhong Zhang
Signed-off-by: Haozhong Zhang Reviewed-by: Stefan Hajnoczi --- hw/mem/nvdimm.c | 2 +- include/hw/mem/nvdimm.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 952fce5ec8..618c3d677b 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem

[Qemu-devel] [PATCH for-2.12 v4 0/3] nvdimm: fixes for (non-)dax backends

2017-12-10 Thread Haozhong Zhang
device dax check. * Document new options added by this patch series. Haozhong Zhang (3): hostmem-file: add "align" option nvdimm: add a macro for property "label-size" nvdimm: add 'unarmed' option backends/hostmem-file.c | 41 ++

[Qemu-devel] [RFC QEMU PATCH v4 08/10] nvdimm acpi: add functions to access DSM memory on Xen

2017-12-07 Thread Haozhong Zhang
hvmloader memory in DSM emulation, it has to take a different path, i.e., xen_copy_{from,to}_guest(). Signed-off-by: Haozhong Zhang --- Cc: Xiao Guangrong Cc: "Michael S. Tsirkin" Cc: Igor Mammedov --- hw/acpi/nvdimm.c | 44 +--- 1 file c

[Qemu-devel] [RFC QEMU PATCH v4 10/10] xen-hvm: enable building NFIT and SSDT of vNVDIMM for HVM domains

2017-12-07 Thread Haozhong Zhang
When QEMU is used the device model of Xen HVM domain and vNVDIMM devices are present, enable building ACPI tables related to vNVDIMM. Signed-off-by: Haozhong Zhang --- Cc: Stefano Stabellini Cc: Anthony Perard Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson C

[Qemu-devel] [RFC QEMU PATCH v4 07/10] xen-hvm: add functions to copy data from/to HVM memory

2017-12-07 Thread Haozhong Zhang
Signed-off-by: Haozhong Zhang --- Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" --- hw/i386/xen/xen-hvm.c | 55 +++ include/hw/xen/xen.h | 3 +++

[Qemu-devel] [RFC QEMU PATCH v4 09/10] nvdimm acpi: add compatibility for 64-bit integer in ACPI 2.0 and later

2017-12-07 Thread Haozhong Zhang
is issue, we add a 32-bit reserved field after func_ret_status and always fill it with 0. Therefore, the minimum length of ODAT in both ACPI 1.0 and ACPI 2.0 is always 8 bytes, so no extra bytes will be added accidentally by the implicit conversion. Signed-off-by: Haozhong Zhang --- Cc: Xiao Guangrong

[Qemu-devel] [RFC QEMU PATCH v4 06/10] hw/acpi-build, xen-hvm: introduce a Xen-specific ACPI builder

2017-12-07 Thread Haozhong Zhang
QEMU on KVM/TCG and Xen requires different sets of guest ACPI tables. When QEMU builds ACPI for Xen HVM domains, the new Xen-specific ACPI build function xen_acpi_build() is called instead of the existing path from acpi_build(). Signed-off-by: Haozhong Zhang --- Cc: Stefano Stabellini Cc

[Qemu-devel] [RFC QEMU PATCH v4 03/10] hostmem-xen: add a host memory backend for Xen

2017-12-07 Thread Haozhong Zhang
x1: -object memory-backend-xen,id=mem1,host-addr=0x1,size=4G -device nvdimm,id=nvdimm1,memdev=mem1 Signed-off-by: Haozhong Zhang --- Cc: Eduardo Habkost Cc: Igor Mammedov Cc: "Michael S. Tsirkin" --- backends/Makefile.objs | 1 + backends

[Qemu-devel] [RFC QEMU PATCH v4 04/10] nvdimm: do not intiailize nvdimm->label_data if label size is zero

2017-12-07 Thread Haozhong Zhang
QEMU to labels is led by a label size check, let's not intiailize nvdimm->label_data if the label size is 0. Signed-off-by: Haozhong Zhang --- Cc: Xiao Guangrong Cc: "Michael S. Tsirkin" Cc: Igor Mammedov --- hw/mem/nvdimm.c | 10 +- 1 file changed, 9 insertions(+), 1

[Qemu-devel] [RFC QEMU PATCH v4 00/10] Implement vNVDIMM for Xen HVM guest

2017-12-07 Thread Haozhong Zhang
the Xen side support for labels is not implemented yet. Patch 5-10 enable building ACPI tables and passing them to Xen HVM domains. Haozhong Zhang (10): [01/10] xen-hvm: remove a trailing space [02/10] xen-hvm: create the hotplug memory region on Xen [03/10] hostmem-xen: add a host memory

[Qemu-devel] [RFC QEMU PATCH v4 01/10] xen-hvm: remove a trailing space

2017-12-07 Thread Haozhong Zhang
Signed-off-by: Haozhong Zhang --- Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" --- hw/i386/xen/xen-hvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/xen/xen-hvm.c b/h

[Qemu-devel] [RFC QEMU PATCH v4 05/10] xen-hvm: initialize fw_cfg interface

2017-12-07 Thread Haozhong Zhang
built by QEMU. Signed-off-by: Haozhong Zhang --- Cc: Stefano Stabellini Cc: Anthony Perard Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost --- hw/i386/xen/xen-hvm.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/i386/xen/xen-

[Qemu-devel] [RFC QEMU PATCH v4 02/10] xen-hvm: create the hotplug memory region on Xen

2017-12-07 Thread Haozhong Zhang
. Signed-off-by: Haozhong Zhang --- Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Stefano Stabellini Cc: Anthony Perard --- hw/i386/pc.c | 86 --- hw/i386/xen/xen-hvm.c | 2 ++ include/hw

Re: [Qemu-devel] [PATCH v3 3/3] nvdimm: add 'unarmed' option

2017-12-03 Thread Haozhong Zhang
On 12/01/17 10:44 +, Stefan Hajnoczi wrote: > On Mon, Nov 27, 2017 at 12:35:17PM +0800, Haozhong Zhang wrote: > > @@ -312,6 +315,10 @@ nvdimm_build_structure_memdev(GArray *structures, > > DeviceState *dev) > > > > /* Only one interleave for PM

Re: [Qemu-devel] [PATCH v3 1/3] hostmem-file: add "align" option

2017-11-28 Thread Haozhong Zhang
[ it looks my email client had some glitch and failed to add mst in cc list ] copy mst On 11/27/17 12:35 +0800, Haozhong Zhang wrote: > When mmap(2) the backend files, QEMU uses the host page size > (getpagesize(2)) by default as the alignment of mapping address. > However, some bac

Re: [Qemu-devel] [PATCH v3 1/3] hostmem-file: add "align" option

2017-11-28 Thread Haozhong Zhang
On 11/27/17 23:07 -0200, Eduardo Habkost wrote: > On Mon, Nov 27, 2017 at 12:35:15PM +0800, Haozhong Zhang wrote: > > When mmap(2) the backend files, QEMU uses the host page size > > (getpagesize(2)) by default as the alignment of mapping address. > > However, some backends m

Re: [Qemu-devel] [PATCH v3 1/3] hostmem-file: add "align" option

2017-11-28 Thread Haozhong Zhang
copy mst On 11/27/17 12:35 +0800, Haozhong Zhang wrote: > When mmap(2) the backend files, QEMU uses the host page size > (getpagesize(2)) by default as the alignment of mapping address. > However, some backends may require alignments different than the page > size. For example, mmap

[Qemu-devel] [PATCH v3 3/3] nvdimm: add 'unarmed' option

2017-11-26 Thread Haozhong Zhang
ice read-only if the unarmed flag in guest NFIT is set. The default value of 'unarmed' option is 'off' in order to keep the backwards compatibility. Signed-off-by: Haozhong Zhang --- docs/nvdimm.txt | 15 +++ hw/acpi/nvdimm.c|

[Qemu-devel] [PATCH v3 1/3] hostmem-file: add "align" option

2017-11-26 Thread Haozhong Zhang
to 'memory-backend-file', so that users or management utils, which have enough knowledge about the backend, can specify a proper alignment via this option. Signed-off-by: Haozhong Zhang --- backends/hostmem-file.c | 41 - docs/nvd

[Qemu-devel] [PATCH v3 2/3] nvdimm: add a macro for property "label-size"

2017-11-26 Thread Haozhong Zhang
Signed-off-by: Haozhong Zhang Reviewed-by: Stefan Hajnoczi --- hw/mem/nvdimm.c | 2 +- include/hw/mem/nvdimm.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 952fce5ec8..618c3d677b 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem

[Qemu-devel] [PATCH-for-2.12 v3 0/3] nvdimm: fixes for (non-)dax backends

2017-11-26 Thread Haozhong Zhang
to, because of the remove of device dax check. * Document new options added by this patch series. Haozhong Zhang (3): hostmem-file: add "align" option nvdimm: add a macro for property "label-size" nvdimm: add 'unarmed' option backends/hostmem-file.c |

Re: [Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest

2017-10-17 Thread Haozhong Zhang
On 10/17/17 13:45 +0200, Paolo Bonzini wrote: > On 14/10/2017 00:46, Stefano Stabellini wrote: > > On Fri, 13 Oct 2017, Jan Beulich wrote: > > On 13.10.17 at 13:13, wrote: > >>> To Jan, Andrew, Stefano and Anthony, > >>> > >>> what do you think about allowing QEMU to build the entire guest ACP

Re: [Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest

2017-10-13 Thread Haozhong Zhang
On 10/13/17 10:44 +0200, Igor Mammedov wrote: > On Fri, 13 Oct 2017 15:53:26 +0800 > Haozhong Zhang wrote: > > > On 10/12/17 17:45 +0200, Paolo Bonzini wrote: > > > On 12/10/2017 14:45, Haozhong Zhang wrote: > > > > Basically, QEMU builds two ROMs

Re: [Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest

2017-10-13 Thread Haozhong Zhang
On 10/12/17 13:39 -0400, Konrad Rzeszutek Wilk wrote: > On Thu, Oct 12, 2017 at 08:45:44PM +0800, Haozhong Zhang wrote: > > On 10/10/17 12:05 -0400, Konrad Rzeszutek Wilk wrote: > > > On Tue, Sep 12, 2017 at 11:15:09AM +0800, Haozhong Zhang wrote: > > > > On

Re: [Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest

2017-10-13 Thread Haozhong Zhang
On 10/12/17 17:45 +0200, Paolo Bonzini wrote: > On 12/10/2017 14:45, Haozhong Zhang wrote: > > Basically, QEMU builds two ROMs for guest, /rom@etc/acpi/tables and > > /rom@etc/table-loader. The former is unstructured to guest, and > > contains all data of guest

Re: [Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest

2017-10-12 Thread Haozhong Zhang
On 10/10/17 12:05 -0400, Konrad Rzeszutek Wilk wrote: > On Tue, Sep 12, 2017 at 11:15:09AM +0800, Haozhong Zhang wrote: > > On 09/11/17 11:52 -0700, Stefano Stabellini wrote: > > > CC'ing xen-devel, and the Xen tools and x86 maintainers. > > > > > >

Re: [Qemu-devel] [libvirt] QEMU -M nvdimm=on and hotplug

2017-09-13 Thread Haozhong Zhang
On 09/13/17 17:28 +0200, Michal Privoznik wrote: > > BTW: I ran a migration from no nvdimm qemu to one that had -M nvdimm=on > and guest migrated happily. So looks like guest ABI is stable (or at > least stable enough not to crash). But since ACPI table is changed I > doubt that. One example that

Re: [Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest

2017-09-11 Thread Haozhong Zhang
On 09/11/17 11:52 -0700, Stefano Stabellini wrote: > CC'ing xen-devel, and the Xen tools and x86 maintainers. > > On Mon, 11 Sep 2017, Igor Mammedov wrote: > > On Mon, 11 Sep 2017 12:41:47 +0800 > > Haozhong Zhang wrote: > > > > > This is the QEMU part p

[Qemu-devel] [RFC QEMU PATCH v3 09/10] nvdimm acpi: do not build _FIT method on Xen

2017-09-10 Thread Haozhong Zhang
Xen currently does not support vNVDIMM hotplug and always sets QEMU option "maxmem" to be just enough for RAM and vNVDIMM, so it's not necessary to build _FIT method when QEMU is used as Xen device model. Signed-off-by: Haozhong Zhang --- Cc: "Michael S. Tsirkin" Cc

[Qemu-devel] [RFC QEMU PATCH v3 05/10] hw/xen-hvm: initialize DM ACPI

2017-09-10 Thread Haozhong Zhang
Probe the base address and the length of guest ACPI buffer reserved for copying ACPI from QEMU. Signed-off-by: Haozhong Zhang --- Cc: Stefano Stabellini cc: Anthony Perard Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost --- hw/i386/xen/xen-

[Qemu-devel] [RFC QEMU PATCH v3 10/10] hw/xen-hvm: enable building DM ACPI if vNVDIMM is enabled

2017-09-10 Thread Haozhong Zhang
If the machine option 'nvdimm' is enabled and QEMU is used as Xen device model, construct the guest NFIT and ACPI namespace devices of vNVDIMM and copy them into guest memory. Signed-off-by: Haozhong Zhang --- Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Paolo Bonzini C

[Qemu-devel] [RFC QEMU PATCH v3 06/10] hw/xen-hvm: add function to copy ACPI into guest memory

2017-09-10 Thread Haozhong Zhang
cates it's the body of a namespace device, and its device name is indicated by $name in the XenStore path. - offset offset in byte from the beginning of above guest memory region - length size in byte of the copied ACPI Signed-off-by: Haozhong Zhang --- Cc: Stefano Stabellini C

[Qemu-devel] [RFC QEMU PATCH v3 07/10] nvdimm acpi: copy NFIT to Xen guest

2017-09-10 Thread Haozhong Zhang
Xen relies on QEMU to build the guest NFIT. Signed-off-by: Haozhong Zhang --- Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Xiao Guangrong --- hw/acpi/nvdimm.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index 9121a766c6..d9cdc5a

[Qemu-devel] [RFC QEMU PATCH v3 04/10] nvdimm acpi: do not use fw_cfg on Xen

2017-09-10 Thread Haozhong Zhang
Xen relies on QEMU to build guest ACPI for NVDIMM. However, no fw_cfg is created when QEMU is used as Xen device model, so QEMU should avoid using fw_cfg on Xen. Signed-off-by: Haozhong Zhang --- Cc: Xiao Guangrong Cc: "Michael S. Tsirkin" Cc: Igor Mammedov --- hw/acpi/nv

[Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest

2017-09-10 Thread Haozhong Zhang
nd a hotplug memory region for Xen guest, in order to make the existing nvdimm device plugging path work on Xen. Patch 4 - 10 build and cooy NFIT from QEMU to Xen guest, when QEMU is used as the Xen device model. Haozhong Zhang (10): nvdimm: do not intiailize nvdimm->label_data if label size

[Qemu-devel] [RFC QEMU PATCH v3 02/10] hw/xen-hvm: create the hotplug memory region on Xen

2017-09-10 Thread Haozhong Zhang
. Signed-off-by: Haozhong Zhang --- Cc: Paolo Bonzini Cc: Richard Henderson CC: Eduardo Habkost Cc: "Michael S. Tsirkin" Cc: Stefano Stabellini Cc: Anthony Perard --- hw/i386/pc.c | 86 --- hw/i386/xen/xen-hvm.c | 2 ++ include/hw

[Qemu-devel] [RFC QEMU PATCH v3 01/10] nvdimm: do not intiailize nvdimm->label_data if label size is zero

2017-09-10 Thread Haozhong Zhang
QEMU to labels is led by a label size check, let's not intiailize nvdimm->label_data if the label size is 0. Signed-off-by: Haozhong Zhang --- Cc: Xiao Guangrong Cc: "Michael S. Tsirkin" Cc: Igor Mammedov --- hw/mem/nvdimm.c | 10 +- 1 file changed, 9 insertions(+), 1

[Qemu-devel] [RFC QEMU PATCH v3 03/10] hostmem-xen: add a host memory backend for Xen

2017-09-10 Thread Haozhong Zhang
x1: -object memory-backend-xen,id=mem1,host-addr=0x1,size=4G -device nvdimm,id=nvdimm1,memdev=mem1 Signed-off-by: Haozhong Zhang --- Cc: Eduardo Habkost Cc: Igor Mammedov Cc: "Michael S. Tsirkin" --- backends/Makefile.objs | 1 + backends

[Qemu-devel] [RFC QEMU PATCH v3 08/10] nvdimm acpi: copy ACPI namespace device of vNVDIMM to Xen guest

2017-09-10 Thread Haozhong Zhang
Xen relies on QEMU to build the ACPI namespace device of vNVDIMM for Xen guest. Signed-off-by: Haozhong Zhang --- Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Xiao Guangrong --- hw/acpi/nvdimm.c | 55 ++- 1 file changed, 38

Re: [Qemu-devel] QEMU NVDIMM as type 7 in e820 table

2017-07-29 Thread Haozhong Zhang
On 07/28/17 13:45 -0600, Ross Zwisler wrote: > On Fri, Jul 28, 2017 at 11:11:10AM -0700, Dan Williams wrote: > > On Fri, Jul 28, 2017 at 11:04 AM, Ross Zwisler > > wrote: > > > I've been using the virtualized NVDIMM support in QEMU for testing, and I > > > noticed that the physical addresses used

Re: [Qemu-devel] KVM "fake DAX" flushing interface - discussion

2017-07-21 Thread Haozhong Zhang
On 07/21/17 02:56 -0400, Pankaj Gupta wrote: > > Hello, > > We shared a proposal for 'KVM fake DAX flushing interface'. > > https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg02478.html > In above link, "Overall goal of project is to increase the number of virtual machines that can

Re: [Qemu-devel] [PATCH] i386/kvm: mask MSR_IA32_BNDCFGS if MPX is not enabled in guest cpuid

2017-07-03 Thread Haozhong Zhang
On 07/03/17 17:45 +0200, Paolo Bonzini wrote: > > > On 03/07/2017 17:23, Haozhong Zhang wrote: > > Otherwise, QEMU on a host with MPX support will try to set guest > > MSR_IA32_BNDCFGS although guest MPX is not enabled, and result in > > abort. > > > >

[Qemu-devel] [PATCH] i386/kvm: mask MSR_IA32_BNDCFGS if MPX is not enabled in guest cpuid

2017-07-03 Thread Haozhong Zhang
-system-x86_64: /root/qemu.git/target/i386/kvm.c:1832: kvm_put_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed Signed-off-by: Haozhong Zhang --- target/i386/kvm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index ee36502789.

Re: [Qemu-devel] [PATCH] exec: fix access to ram_list.dirty_memory when sync dirty bitmap

2017-06-28 Thread Haozhong Zhang
On 06/28/17 11:09 +0200, Juan Quintela wrote: > Haozhong Zhang wrote: > > In cpu_physical_memory_sync_dirty_bitmap(rb, start, ...), the 2nd > > argument 'start' is relative to the start of the ramblock 'rb'. When > > it's used to a

[Qemu-devel] [PATCH v2] exec: fix access to ram_list.dirty_memory when sync dirty bitmap

2017-06-28 Thread Haozhong Zhang
per ramblock dirty bitmap. As a result, a guest with host memory backend may crash after migration. Fix it by adding the offset of ramblock when accessing the dirty memory bitmap of ram_list in cpu_physical_memory_sync_dirty_bitmap(). Reported-by: Stefan Hajnoczi Signed-off-by: Haozhong Zha

[Qemu-devel] [PATCH] exec: fix access to ram_list.dirty_memory when sync dirty bitmap

2017-06-27 Thread Haozhong Zhang
per ramblock dirty bitmap. As a result, a guest with host memory backend may crash after migration. Fix it by adding the offset of ramblock when accessing the dirty memory bitmap of ram_list in cpu_physical_memory_sync_dirty_bitmap(). Reported-by: Stefan Hajnoczi Signed-off-by: Haozhong Zhang -

Re: [Qemu-devel] NVDIMM live migration broken?

2017-06-27 Thread Haozhong Zhang
On 06/26/17 13:56 +0100, Stefan Hajnoczi wrote: > On Mon, Jun 26, 2017 at 10:05:01AM +0800, Haozhong Zhang wrote: > > On 06/23/17 10:55 +0100, Stefan Hajnoczi wrote: > > > On Fri, Jun 23, 2017 at 08:13:13AM +0800, haozhong.zh...@intel.com wrote: > > > > On 06/22/1

Re: [Qemu-devel] NVDIMM live migration broken?

2017-06-25 Thread Haozhong Zhang
On 06/23/17 10:55 +0100, Stefan Hajnoczi wrote: > On Fri, Jun 23, 2017 at 08:13:13AM +0800, haozhong.zh...@intel.com wrote: > > On 06/22/17 15:08 +0100, Stefan Hajnoczi wrote: > > > I tried live migrating a guest with NVDIMM on qemu.git/master (edf8bc984): > > > > > > $ qemu -M accel=kvm,nvdimm=

Re: [Qemu-devel] [PATCH v2 2/4] nvdimm: warn if the backend is not a DAX device

2017-06-11 Thread Haozhong Zhang
On 06/08/17 15:51 +0300, Michael S. Tsirkin wrote: > On Tue, Jun 06, 2017 at 03:22:27PM +0800, Haozhong Zhang wrote: > > Applications in Linux guest that use device-dax never trigger flush > > that can be trapped by KVM/QEMU. Meanwhile, if the host backend is not > > de

Re: [Qemu-devel] [PATCH v2 3/4] nvdimm: add a boolean option "restrict"

2017-06-11 Thread Haozhong Zhang
On 06/08/17 15:56 +0300, Michael S. Tsirkin wrote: > On Tue, Jun 06, 2017 at 03:22:28PM +0800, Haozhong Zhang wrote: > > If a vNVDIMM device is not backed by a DAX device and its "restrict" > > option is enabled, bit 3 of state flags in its region mapping > > str

Re: [Qemu-devel] [PATCH] hw/i386: fix nvdimm check error path

2017-06-11 Thread Haozhong Zhang
/pc.c:1713 > #8 0x5581d89b in pc_machine_device_plug_cb (hotplug_dev= out>, dev=0x56705590, errp=0x7fffc6c0) at qemu/hw/i386/pc.c:2004 > #9 0x55914da6 in device_set_realized (obj=, > value=, errp=0x7fffc7e8) at hw/core/qdev.c:926 > > Cc: Haozhon

Re: [Qemu-devel] [PATCH] nvdimm acpi: fix region format interface code

2017-06-07 Thread Haozhong Zhang
On 06/08/17 14:40 +0800, Xiao Guangrong wrote: > > > On 06/08/2017 01:06 PM, Haozhong Zhang wrote: > > On 06/08/17 11:07 +0800, Xiao Guangrong wrote: > > > > > > > > > On 06/07/2017 04:06 PM, Haozhong Zhang wrote: > > > > Per ACPI

Re: [Qemu-devel] [PATCH v2 3/4] nvdimm: add a boolean option "restrict"

2017-06-07 Thread Haozhong Zhang
On 06/07/17 16:27 +0100, Stefan Hajnoczi wrote: > On Tue, Jun 06, 2017 at 03:22:28PM +0800, Haozhong Zhang wrote: > > If a vNVDIMM device is not backed by a DAX device and its "restrict" > > option is enabled, bit 3 of state flags in its region mapping > > structure

Re: [Qemu-devel] [PATCH] nvdimm acpi: fix region format interface code

2017-06-07 Thread Haozhong Zhang
On 06/08/17 11:07 +0800, Xiao Guangrong wrote: > > > On 06/07/2017 04:06 PM, Haozhong Zhang wrote: > > Per ACPI 6.2, section 5.2.25.6 and JEDEC Annex L Release 3, the > > current region format interface code 0x201 indicates the block > > addressed function inte

Re: [Qemu-devel] [PATCH v2 3/4] nvdimm: add a boolean option "restrict"

2017-06-07 Thread Haozhong Zhang
On 06/07/17 16:27 +0100, Stefan Hajnoczi wrote: > On Tue, Jun 06, 2017 at 03:22:28PM +0800, Haozhong Zhang wrote: > > If a vNVDIMM device is not backed by a DAX device and its "restrict" > > option is enabled, bit 3 of state flags in its region mapping > > structure

Re: [Qemu-devel] [PATCH v2 2/4] nvdimm: warn if the backend is not a DAX device

2017-06-07 Thread Haozhong Zhang
On 06/07/17 16:14 +0100, Stefan Hajnoczi wrote: > On Tue, Jun 06, 2017 at 03:22:27PM +0800, Haozhong Zhang wrote: > > diff --git a/util/osdep.c b/util/osdep.c > > index a2863c8e53..02881f96bc 100644 > > --- a/util/osdep.c > > +++ b/util/osdep.c > > @@ -471,3 +471,

Re: [Qemu-devel] [PATCH v2 2/4] nvdimm: warn if the backend is not a DAX device

2017-06-07 Thread Haozhong Zhang
On 06/06/17 10:59 -0700, Dan Williams wrote: > On Tue, Jun 6, 2017 at 12:22 AM, Haozhong Zhang > wrote: > > Applications in Linux guest that use device-dax never trigger flush > > that can be trapped by KVM/QEMU. Meanwhile, if the host backend is not > > device-dax, Q

[Qemu-devel] [PATCH] nvdimm acpi: fix region format interface code

2017-06-07 Thread Haozhong Zhang
. Signed-off-by: Haozhong Zhang --- hw/acpi/nvdimm.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index 8e7d6ec034..b5734f5897 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -338,9 +338,10 @@ static void

[Qemu-devel] [PATCH v2 1/4] nvdimm: add a macro for property "label-size"

2017-06-06 Thread Haozhong Zhang
Signed-off-by: Haozhong Zhang --- hw/mem/nvdimm.c | 2 +- include/hw/mem/nvdimm.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index db896b0bb6..a9b0863f20 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -66,7 +66,7 @@ out

[Qemu-devel] [PATCH v2 4/4] util/mmap-alloc: account for DAX device in qemu_fd_getpagesize

2017-06-06 Thread Haozhong Zhang
A DAX device may require a page size different than getpagesize(). Signed-off-by: Haozhong Zhang --- include/qemu/osdep.h | 10 ++ util/mmap-alloc.c| 6 ++ util/osdep.c | 23 +++ 3 files changed, 39 insertions(+) diff --git a/include/qemu/osdep.h b

[Qemu-devel] [PATCH v2 2/4] nvdimm: warn if the backend is not a DAX device

2017-06-06 Thread Haozhong Zhang
device-dax. Signed-off-by: Haozhong Zhang Message-id: capcyv4hv2-zw8smcrtd0p_86kgr3dhovne+6t5sy2u7wxg3...@mail.gmail.com --- hw/mem/nvdimm.c | 6 ++ include/qemu/osdep.h | 9 util/osdep.c | 61 3 files changed, 76

[Qemu-devel] [PATCH v2 3/4] nvdimm: add a boolean option "restrict"

2017-06-06 Thread Haozhong Zhang
ce as read-only. This option is disabled by default for backwards compatibility. It's recommended to enable for the formal usage. Signed-off-by: Haozhong Zhang --- hw/acpi/nvdimm.c| 16 hw/mem/nvdimm.c | 38 +- include/

[Qemu-devel] [PATCH v2 0/4] nvdimm: fixes for (non-)dax backends

2017-06-06 Thread Haozhong Zhang
lags in guest NVDIMM region mapping structure. This behavior is controlled by a new QEMU nvdimm option "restrict". See details in patch 3. (Dan) * Patch 4: drop the "align" property and get the alignment of DAX device by QEMU itself. * Wrap Linux specific code by __linu

Re: [Qemu-devel] [PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-30 Thread Haozhong Zhang
On 05/30/17 10:16 +0100, Stefan Hajnoczi wrote: > On Fri, May 26, 2017 at 10:24:38AM +0800, Haozhong Zhang wrote: > > file_ram_alloc() currently maps the backend file via mmap to a virtual > > address aligned to the value returned by qemu_fd_getpagesize(). When a > > DAX dev

Re: [Qemu-devel] [PATCH 1/2] nvdimm: warn if the backend is not a DAX device

2017-05-30 Thread Haozhong Zhang
On 05/30/17 10:15 +0100, Stefan Hajnoczi wrote: > On Fri, May 26, 2017 at 10:24:37AM +0800, Haozhong Zhang wrote: > > Applications in Linux guest that use device-dax never trigger flush > > that can be trapped by KVM/QEMU. Meanwhile, if the host backend is not > > device-dax,

Re: [Qemu-devel] [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device

2017-05-26 Thread Haozhong Zhang
On 05/26/17 08:25 -0700, Dan Williams wrote: > On Fri, May 26, 2017 at 7:38 AM, Daniel P. Berrange > wrote: > > On Thu, May 25, 2017 at 08:34:23PM -0700, Dan Williams wrote: > >> On Thu, May 25, 2017 at 7:32 PM, Haozhong Zhang > >> wrote: > >> > Appli

Re: [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-26 Thread Haozhong Zhang
On 05/26/17 15:55 -0300, Eduardo Habkost wrote: > On Fri, May 26, 2017 at 07:24:26AM -0700, Dan Williams wrote: > > On Fri, May 26, 2017 at 12:16 AM, Haozhong Zhang > > wrote: > > > On 05/26/17 07:05 +, Marc-André Lureau wrote: > > >> Hi > > >>

Re: [Qemu-devel] [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device

2017-05-25 Thread Haozhong Zhang
On 05/25/17 20:34 -0700, Dan Williams wrote: > On Thu, May 25, 2017 at 7:32 PM, Haozhong Zhang > wrote: > > Applications in Linux guest that use device-dax never trigger flush > > that can be trapped by KVM/QEMU. Meanwhile, if the host backend is not > > device-dax, Q

Re: [Qemu-devel] [PATCH] MAINTAINERS: update mail address for NVDIMM

2017-05-25 Thread Haozhong Zhang
On 03/23/17 08:36 +, Stefan Hajnoczi wrote: > On Tue, Mar 21, 2017 at 01:33:57PM +0800, Xiao Guangrong wrote: > > From: Xiao Guangrong > > > > My Intel mail account will be disabled soon, update the mail info > > to my private mail > > > > Signed-off-by: Xiao Guangrong > > --- > > MAINTAIN

[Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-25 Thread Haozhong Zhang
d as before. Signed-off-by: Haozhong Zhang --- Cc: Eduardo Habkost Cc: Igor Mammedov Cc: Paolo Bonzini Cc: Peter Crosthwaite Cc: Richard Henderson Cc: Xiao Guangrong Cc: Stefan Hajnoczi Cc: Dan Williams --- Resend because the wrong maintainer email address was used. --- backends

[Qemu-devel] [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device

2017-05-25 Thread Haozhong Zhang
device-dax. Signed-off-by: Haozhong Zhang Message-id: capcyv4hv2-zw8smcrtd0p_86kgr3dhovne+6t5sy2u7wxg3...@mail.gmail.com --- Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Xiao Guangrong Cc: Stefan Hajnoczi Cc: Dan Williams --- Resend because the wrong maintainer email address was use

[Qemu-devel] [PATCH 1/2] nvdimm: warn if the backend is not a DAX device

2017-05-25 Thread Haozhong Zhang
device-dax. Signed-off-by: Haozhong Zhang Message-id: capcyv4hv2-zw8smcrtd0p_86kgr3dhovne+6t5sy2u7wxg3...@mail.gmail.com --- Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Xiao Guangrong Cc: Stefan Hajnoczi Cc: Dan Williams --- hw/mem/nvdimm.c | 37 +++

[Qemu-devel] [PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment

2017-05-25 Thread Haozhong Zhang
d as before. Signed-off-by: Haozhong Zhang --- Cc: Eduardo Habkost Cc: Igor Mammedov Cc: Paolo Bonzini Cc: Peter Crosthwaite Cc: Richard Henderson Cc: Xiao Guangrong Cc: Stefan Hajnoczi Cc: Dan Williams --- backends/hostmem-file.c | 41 - exec.c

Re: [Qemu-devel] [RFC PATCH 1/4] pc-dimm: add 'reserved-size' to reserve address range after the ending address

2017-04-11 Thread Haozhong Zhang
On 04/07/17 14:46 +0100, Stefan Hajnoczi wrote: > On Thu, Apr 06, 2017 at 06:46:49PM +0800, Haozhong Zhang wrote: > > On 04/06/17 11:24 +0100, Stefan Hajnoczi wrote: > > > On Fri, Mar 31, 2017 at 04:41:44PM +0800, Haozhong Zhang wrote: > > > > If option 'reserv

<    1   2   3   4   >