[Qemu-devel] [PATCH] memory: call begin, log_start and commit when registering a new listener

2015-11-02 Thread Paolo Bonzini
This ensures that cpu_reload_memory_map() is called as soon as tcg_cpu_address_space_init() is called, and before cpu->memory_dispatch is used. qemu-system-s390x never changes the address spaces after tcg_cpu_address_space_init() is called, and thus tcg_commit() is never called. This causes a SIG

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Markus Armbruster
Eric Blake writes: > Loaded question in response to > https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06988.html, but Discussion of our parser's enormous appetite for wasting RAM. Fixable, but it's work, and it's not its only defect. > posting as a new thread to call attention to it:

[Qemu-devel] [PATCH] qom/object: fix 2 comment typos

2015-11-02 Thread Cao jin
Signed-off-by: Cao jin --- include/qom/object.h | 2 +- qom/object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index be7280c..9e5162a 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -511,7 +511,7 @@ s

Re: [Qemu-devel] [PATCH V3] hw/virtio: Add PCIe capability to virtio devices

2015-11-02 Thread Cornelia Huck
On Sun, 1 Nov 2015 11:15:24 +0200 Marcel Apfelbaum wrote: > By the way, HW_COMPAT_2_3 sets any-layout to off only for a few virtio > devices, > not for all. Does anybody know if is in purpose or can we do the same for > them too? net and scsi already defaulted any_layout to true before. Are a

Re: [Qemu-devel] [PATCH] fixup! char: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
Eric Blake writes: > Fix build failure on w32 > > Signed-off-by: Eric Blake Squashed, thanks! > --- > > Hopefully, this is the only use of qapi union types hiding > behind #ifdefs (I relied on the compiler to tell me which spots > need conversion, but that doesn't work for spots that aren't >

Re: [Qemu-devel] [RFC v1 1/1] i2c: Factor our send() and recv() common logic

2015-11-02 Thread Frederic Konrad
On 19/10/2015 06:09, Peter Crosthwaite wrote: > Most of the control flow logic between send and recv (error checking > etc) is the same. Factor this out into a common send_recv() API. > This is then usable by clients, where the control logic for send > and receive differs only by a boolean. E.g. >

[Qemu-devel] [PULL v2 09/25] qapi-types: Refactor base fields output

2015-11-02 Thread Markus Armbruster
From: Eric Blake Move code from gen_union() into gen_struct_fields() in order for a later patch to share code when enumerating inherited fields for struct types. No change to generated code. Signed-off-by: Eric Blake Message-Id: <1445898903-12082-9-git-send-email-ebl...@redhat.com> Signed-off-

[Qemu-devel] [PULL v2 04/25] qapi: More robust conditions for when labels are needed

2015-11-02 Thread Markus Armbruster
From: Eric Blake We were using regular expressions to see if ret included any earlier text that emitted a 'goto out;' line, to decide whether we needed to output an 'out:' label. But this is fragile, if the ret text can possibly combine more than one generated function body, where the first func

[Qemu-devel] [PULL v2 03/25] qapi: More idiomatic string operations

2015-11-02 Thread Markus Armbruster
From: Eric Blake Rather than slicing the end of a string, we can use python's endswith(). And rather than creating a set of characters, we can search for a character within a string. Signed-off-by: Eric Blake Message-Id: <1445898903-12082-3-git-send-email-ebl...@redhat.com> Signed-off-by: Mark

[Qemu-devel] [PULL v2 08/25] qapi-visit: Split off visit_type_FOO_fields forward decl

2015-11-02 Thread Markus Armbruster
From: Eric Blake We generate a static visit_type_FOO_fields() for every type FOO. However, sometimes we need a forward declaration. Split the code to generate the forward declaration out of gen_visit_implicit_struct() into a new gen_visit_fields_decl(), and also prepare for a forward declaration

[Qemu-devel] [PULL v2 05/25] qapi: Reserve '*List' type names for list types

2015-11-02 Thread Markus Armbruster
From: Eric Blake Type names ending in 'List' can clash with qapi list types in generated C. We don't currently use such names. It is easier to outlaw them now than to worry about how to resolve such a clash in the future. For precedence, see commit 4dc2e69, which did the same for names ending in

[Qemu-devel] [PULL v2 02/25] tests/qapi-schema: Test for reserved names, empty struct

2015-11-02 Thread Markus Armbruster
From: Eric Blake Add some testsuite coverage to ensure future patches are on the right track: Our current C representation of qapi arrays is done by appending 'List' to the element name; but we are not preventing the creation of an object type with the same name. Add reserved-type-list.json to

[Qemu-devel] [PULL v2 01/25] qapi-schema: mark InetSocketAddress as mandatory again

2015-11-02 Thread Markus Armbruster
From: "Daniel P. Berrange" Revert the qapi-schema.json change done in: commit 0983f5e6af76d5df8c6346cbdfff9d8305fb6da0 Author: Daniel P. Berrange Date: Tue Sep 1 14:46:50 2015 +0100 sockets: allow port to be NULL when listening on IP address Switching "port" from mandatory to opti

[Qemu-devel] [PULL v2 00/25] QAPI patches

2015-11-02 Thread Markus Armbruster
v2: * Squashed Eric's build fix. * Moved Dan's fix to the front, to make merging it easier in case something's still wrong with Eric's patches. The following changes since commit 3a958f559ecd0511583d27b10011fa7f3cf79b63: Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request'

[Qemu-devel] [PULL v2 14/25] qapi-visit: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 07/25] vnc: Hoist allocation of VncBasicInfo to callers

2015-11-02 Thread Markus Armbruster
From: Eric Blake A future qapi patch will rework generated structs with a base class to be unboxed. In preparation for that, change the code that allocates then populates an info struct to instead merely populate the fields of an info field passed in as a parameter (renaming vnc_basic_info_get*

[Qemu-devel] [PULL v2 10/25] qapi: Prefer typesafe upcasts to qapi base classes

2015-11-02 Thread Markus Armbruster
From: Eric Blake A previous patch (commit 1e6c1616) made it possible to directly cast from a qapi flat union type to its base type. However, it requires the use of a C cast, which turns off compiler type-safety checks. Fortunately, no such casts exist, just yet. Regardless, add inline type-safe

[Qemu-devel] [PULL v2 22/25] tpm: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 13/25] qapi: Start converting to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 19/25] char: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 18/25] net: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 11/25] qapi: Unbox base members

2015-11-02 Thread Markus Armbruster
From: Eric Blake Rather than storing a base class as a pointer to a box, just store the fields of that base class in the same order, so that a child struct can be directly cast to its parent. This gives less malloc overhead, less pointer dereferencing, and even less generated code. Compare to t

[Qemu-devel] [PULL v2 06/25] qapi: Reserve 'q_*' and 'has_*' member names

2015-11-02 Thread Markus Armbruster
From: Eric Blake c_name() produces names starting with 'q_' when protecting a dictionary member name that would fail to directly compile, but in doing so can cause clashes with any member name already beginning with 'q-' or 'q_'. Likewise, we create a C name 'has_' for any optional member that c

[Qemu-devel] [PULL v2 17/25] sockets: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 24/25] qapi: Reserve 'u' member name

2015-11-02 Thread Markus Armbruster
From: Eric Blake Now that we have separated union tag values from colliding with non-variant C names, by naming the union 'u', we should reserve this name for our use. Note that we want to forbid 'u' even in a struct with no variants, because it is possible for a future qemu release to extend QM

[Qemu-devel] [PULL v2 20/25] input: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 12/25] qapi-visit: Remove redundant functions for flat union base

2015-11-02 Thread Markus Armbruster
From: Eric Blake The code for visiting the base class of a child struct created visit_type_Base_fields() which covers all fields of Base; while the code for visiting the base class of a flat union created visit_type_Union_fields() covering all fields of the base except the discriminator. But sin

[Qemu-devel] [PATCH v7 07/35] util: introduce qemu_file_get_page_size()

2015-11-02 Thread Xiao Guangrong
There are three places use the some logic to get the page size on the file path or file fd Windows did not support file hugepage, so it will return normal page for this case. And this interface has not been used on windows so far This patch introduces qemu_file_get_page_size() to unify the code

[Qemu-devel] [PULL v2 15/25] tests: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 23/25] qapi: Finish converting to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 16/25] block: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PULL v2 21/25] memory: Convert to new qapi union layout

2015-11-02 Thread Markus Armbruster
From: Eric Blake We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-varia

[Qemu-devel] [PATCH v7 15/35] pc-dimm: make pc_existing_dimms_capacity static and rename it

2015-11-02 Thread Xiao Guangrong
pc_existing_dimms_capacity() can be static since it is not used out of pc-dimm.c and drop the pc_ prefix to prepare the work which abstracts dimm device type from pc-dimm Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Xiao Guangrong --- hw/mem/pc-dimm.c | 73 ++

[Qemu-devel] [PULL v2 25/25] qapi: Simplify gen_struct_field()

2015-11-02 Thread Markus Armbruster
From: Eric Blake Rather than having all callers pass a name, type, and optional flag, have them instead pass a QAPISchemaObjectTypeMember which already has all that information. No change to generated code. Signed-off-by: Eric Blake Message-Id: <1445898903-12082-25-git-send-email-ebl...@redhat

[Qemu-devel] [PATCH v7 21/35] dimm: keep the state of the whole backend memory

2015-11-02 Thread Xiao Guangrong
QEMU keeps the state of memory of dimm device during live migration, however, it is not enough for nvdimm device as its memory does not contain its label data, so that we should protect the whole backend memory instead Signed-off-by: Xiao Guangrong --- hw/mem/dimm.c | 14 -- 1 file c

[Qemu-devel] [PATCH v7 01/35] acpi: add aml_derefof

2015-11-02 Thread Xiao Guangrong
Implement DeRefOf term which is used by NVDIMM _DSM method in later patch Reviewed-by: Igor Mammedov Signed-off-by: Xiao Guangrong --- hw/acpi/aml-build.c | 8 include/hw/acpi/aml-build.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-bu

[Qemu-devel] [PATCH v7 02/35] acpi: add aml_sizeof

2015-11-02 Thread Xiao Guangrong
Implement SizeOf term which is used by NVDIMM _DSM method in later patch Reviewed-by: Igor Mammedov Signed-off-by: Xiao Guangrong --- hw/acpi/aml-build.c | 8 include/hw/acpi/aml-build.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-bui

Re: [Qemu-devel] [PATCH v2 03/16] sockets: allow port to be NULL when listening on IP address

2015-11-02 Thread Markus Armbruster
Peter Maydell writes: > On 31 October 2015 at 08:51, Shannon Zhao wrote: >> On 2015/10/22 1:52, Knut Omang wrote: >>> I just noticed that after a rebase a few minutes ago, all options I >>> have that uses this type of port syntax: >>> >>> -serial telnet:ip:port >>> -serial tcp:ip:port >>> -qmp i

[Qemu-devel] [PATCH v7 22/35] dimm: introduce realize callback

2015-11-02 Thread Xiao Guangrong
nvdimm need check if the backend memory is large enough to contain label data and init its memory region when the device is realized, so introduce realize callback which is called after common dimm has been realize Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Xiao Guangrong --- hw/m

[Qemu-devel] [PATCH v7 05/35] acpi: add aml_object_type

2015-11-02 Thread Xiao Guangrong
Implement ObjectType which is used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong --- hw/acpi/aml-build.c | 8 include/hw/acpi/aml-build.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index efc06ab..9f792ab 1

[Qemu-devel] [PATCH v7 00/35] implement vNVDIMM

2015-11-02 Thread Xiao Guangrong
This patchset can be found at: https://github.com/xiaogr/qemu.git nvdimm-v7 It is based on pci branch on Michael's tree and the top commit is: commit 6f96a31a06c2a1 (tests: re-enable vhost-user-test). Changelog in v7: - changes from Vladimir Sementsov-Ogievskiy's comments: 1) let gethugep

[Qemu-devel] [PATCH v7 03/35] acpi: add aml_create_field

2015-11-02 Thread Xiao Guangrong
Implement CreateField term which is used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong --- hw/acpi/aml-build.c | 13 + include/hw/acpi/aml-build.h | 1 + 2 files changed, 14 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index a722

[Qemu-devel] [PATCH v7 29/35] nvdimm acpi: support function 0

2015-11-02 Thread Xiao Guangrong
__DSM is defined in ACPI 6.0: 9.14.1 _DSM (Device Specific Method) Function 0 is a query function. We do not support any function on root device and only 3 functions are support for NVDIMM device, Get Namespace Label Size, Get Namespace Label Data and Set Namespace Label Data, that means we curren

[Qemu-devel] [PATCH v7 11/35] util: introduce qemu_file_getlength()

2015-11-02 Thread Xiao Guangrong
It is used to get the size of the specified file, also qemu_fd_getlength() is introduced to unify the code with raw_getlength() in block/raw-posix.c Signed-off-by: Xiao Guangrong --- block/raw-posix.c| 7 +-- include/qemu/osdep.h | 2 ++ util/osdep.c | 31 ++

[Qemu-devel] [PATCH v7 06/35] acpi: add aml_method_serialized

2015-11-02 Thread Xiao Guangrong
It avoid explicit Mutex and will be used by NVDIMM ACPI Signed-off-by: Xiao Guangrong --- hw/acpi/aml-build.c | 26 -- include/hw/acpi/aml-build.h | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c ind

[Qemu-devel] [PATCH v7 04/35] acpi: add aml_concatenate

2015-11-02 Thread Xiao Guangrong
Implement Concatenate term which is used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong --- hw/acpi/aml-build.c | 14 ++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 15 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 9fe

[Qemu-devel] [PATCH v7 13/35] hostmem-file: use whole file size if possible

2015-11-02 Thread Xiao Guangrong
Use the whole file size if @size is not specified which is useful if we want to directly pass a file to guest Signed-off-by: Xiao Guangrong --- backends/hostmem-file.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/backends/hostmem-file.c b/backends/h

[Qemu-devel] [PATCH v7 33/35] nvdimm: allow using whole backend memory as pmem

2015-11-02 Thread Xiao Guangrong
Introduce a parameter, named "reserve-label-data", if it is false which indicates that QEMU does not reserve any region on the backend memory to support label data. It is a 'label-less' NVDIMM device mode that linux will use whole memory on the device as a single namesapce This is useful for the u

[Qemu-devel] [PATCH v7 08/35] exec: allow memory to be allocated from any kind of path

2015-11-02 Thread Xiao Guangrong
Currently file_ram_alloc() is designed for hugetlbfs, however, the memory of nvdimm can come from either raw pmem device eg, /dev/pmem, or the file locates at DAX enabled filesystem So this patch let it work on any kind of path Signed-off-by: Xiao Guangrong --- exec.c | 24 -

[Qemu-devel] [PATCH v7 10/35] hostmem-file: clean up memory allocation

2015-11-02 Thread Xiao Guangrong
- hostmem-file.c is compiled only if CONFIG_LINUX is enabled so that is unnecessary to do the same check in the source file - the interface, HostMemoryBackendClass->alloc(), is not called many times, do not need to check if the memory-region is initialized Reviewed-by: Vladimir Sementsov-Ogie

[Qemu-devel] [PATCH v7 20/35] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region

2015-11-02 Thread Xiao Guangrong
Curretly, the memory region of backed memory is directly mapped to guest's address space, however, it is not true for nvdimm device This patch let dimm device realize this fact and use DIMMDeviceClass->get_memory_region method to get the mapped memory region Current code did not check the return

[Qemu-devel] [PATCH v7 14/35] pc-dimm: remove DEFAULT_PC_DIMMSIZE

2015-11-02 Thread Xiao Guangrong
It's not used any more Signed-off-by: Xiao Guangrong --- include/hw/mem/pc-dimm.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index d83bf30..11a8937 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -20,8 +20,6 @@

[Qemu-devel] [PATCH v7 09/35] exec: allow file_ram_alloc to work on file

2015-11-02 Thread Xiao Guangrong
Currently, file_ram_alloc() only works on directory - it creates a file under @path and do mmap on it This patch tries to allow it to work on file directly, if @path is a directory it works as before, otherwise it treats @path as the target file then directly allocate memory from it Signed-off-by

Re: [Qemu-devel] [PATCH v6 18/33] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region

2015-11-02 Thread Xiao Guangrong
On 10/31/2015 10:15 PM, Xiao Guangrong wrote: On 10/31/2015 06:52 PM, Vladimir Sementsov-Ogievskiy wrote: On 30.10.2015 08:56, Xiao Guangrong wrote: Curretly, the memory region of backed memory is directly mapped to guest's address space, however, it is not true for nvdimm device This patc

[Qemu-devel] [PATCH v7 12/35] util: let qemu_fd_getlength support block device

2015-11-02 Thread Xiao Guangrong
lseek can not work for all block devices as the man page says: | Some devices are incapable of seeking and POSIX does not specify | which devices must support lseek(). This patch tries to add the support on Linux by using BLKGETSIZE64 ioctl Signed-off-by: Xiao Guangrong --- util/osdep.c | 20 ++

[Qemu-devel] [PATCH v7 19/35] dimm: abstract dimm device from pc-dimm

2015-11-02 Thread Xiao Guangrong
A base device, dimm, is abstracted from pc-dimm, so that we can build nvdimm device based on dimm in the later patch Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Xiao Guangrong --- default-configs/i386-softmmu.mak | 1 + default-configs/ppc64-softmmu.mak | 1 + default-configs/

[Qemu-devel] [PATCH v7 18/35] pc-dimm: rename pc-dimm.c and pc-dimm.h

2015-11-02 Thread Xiao Guangrong
Rename: pc-dimm.c => dimm.c pc-dimm.h => dimm.h It prepares the work which abstracts dimm device type for both pc-dimm and nvdimm Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Xiao Guangrong --- hw/Makefile.objs | 2 +- hw/acpi/ich9.c

[Qemu-devel] [PATCH v7 24/35] docs: add NVDIMM ACPI documentation

2015-11-02 Thread Xiao Guangrong
It describes the basic concepts of NVDIMM ACPI and the interface between QEMU and the ACPI BIOS Signed-off-by: Xiao Guangrong --- docs/specs/acpi_nvdimm.txt | 179 + 1 file changed, 179 insertions(+) create mode 100644 docs/specs/acpi_nvdimm.txt diff

[Qemu-devel] [PATCH v7 17/35] stubs: rename qmp_pc_dimm_device_list.c

2015-11-02 Thread Xiao Guangrong
Rename qmp_pc_dimm_device_list.c to qmp_dimm_device_list.c Signed-off-by: Xiao Guangrong --- stubs/Makefile.objs | 2 +- stubs/{qmp_pc_dimm_device_list.c => qmp_dimm_device_list.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename stubs/{qmp_pc_d

[Qemu-devel] [PATCH v7 16/35] pc-dimm: drop the prefix of pc-dimm

2015-11-02 Thread Xiao Guangrong
This patch is generated by this script: find ./ -name "*.[ch]" -o -name "*.json" -o -name "trace-events" \ | xargs sed -i "s/PC_DIMM/DIMM/g" find ./ -name "*.[ch]" -o -name "*.json" -o -name "trace-events" \ | xargs sed -i "s/PCDIMM/DIMM/g" find ./ -name "*.[ch]" -o -name "*.json" -o -name "trac

[Qemu-devel] [PATCH v7 28/35] nvdimm acpi: save arg3 for NVDIMM device _DSM method

2015-11-02 Thread Xiao Guangrong
Check if the input Arg3 is valid then store it into dsm_in if needed Signed-off-by: Xiao Guangrong --- hw/acpi/nvdimm.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index 53ed675..e179a72 100644 --- a/hw/acpi/

[Qemu-devel] [PATCH v7 30/35] nvdimm acpi: support Get Namespace Label Size function

2015-11-02 Thread Xiao Guangrong
Function 4 is used to get Namespace label size Reviewed-by: Stefan Hajnoczi Signed-off-by: Xiao Guangrong --- hw/acpi/nvdimm.c | 87 +++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index 3

[Qemu-devel] [PATCH v7 23/35] nvdimm: implement NVDIMM device abstract

2015-11-02 Thread Xiao Guangrong
Introduce "nvdimm" device which is based on dimm device type 128K memory region which is the minimum namespace label size required by NVDIMM Namespace Spec locates at the end of backend memory device is reserved for label data We can use "-m 1G,maxmem=100G,slots=10 -object memory-backend-file, id

[Qemu-devel] [PATCH v7 34/35] nvdimm acpi: support _FIT method

2015-11-02 Thread Xiao Guangrong
FIT buffer is not completely mapped into guest address space, so a new function, Read FIT, function index 0x, is reserved by QEMU to read the piece of FIT buffer. The buffer is concatenated before _FIT return Refer to docs/specs/acpi-nvdimm.txt for detailed design Signed-off-by: Xiao Guan

Re: [Qemu-devel] [PATCH V3] hw/virtio: Add PCIe capability to virtio devices

2015-11-02 Thread Greg Kurz
On Thu, 29 Oct 2015 13:56:28 +0200 Marcel Apfelbaum wrote: > The virtio devices are converted to PCI-Express > if they are plugged into a PCI-Express bus and > the 'modern' protocol is enabled. > > Devices plugged directly into the Root Complex as > Integrated Endpoints remain PCI. > > Signed-o

[Qemu-devel] [PATCH v7 26/35] nvdimm acpi: build ACPI NFIT table

2015-11-02 Thread Xiao Guangrong
NFIT is defined in ACPI 6.0: 5.2.25 NVDIMM Firmware Interface Table (NFIT) Currently, we only support PMEM mode. Each device has 3 structures: - SPA structure, defines the PMEM region info - MEM DEV structure, it has the @handle which is used to associate specified ACPI NVDIMM device we will i

[Qemu-devel] [PATCH v7 25/35] nvdimm acpi: init the resource used by NVDIMM ACPI

2015-11-02 Thread Xiao Guangrong
A page staring from 0xFF0 and IO port 0x0a18 - 0xa1b in guest are reserved for NVDIMM ACPI emulation, refer to docs/specs/acpi_nvdimm.txt for detailed design A parameter, 'nvdimm-support', is introduced for PIIX4_PM and ICH9-LPC that controls if nvdimm support is enabled, it is true on default

Re: [Qemu-devel] [PATCH V3] hw/virtio: Add PCIe capability to virtio devices

2015-11-02 Thread Marcel Apfelbaum
On 11/02/2015 11:07 AM, Cornelia Huck wrote: On Sun, 1 Nov 2015 11:15:24 +0200 Marcel Apfelbaum wrote: By the way, HW_COMPAT_2_3 sets any-layout to off only for a few virtio devices, not for all. Does anybody know if is in purpose or can we do the same for them too? net and scsi already def

[Qemu-devel] [PATCH v7 27/35] nvdimm acpi: build ACPI nvdimm devices

2015-11-02 Thread Xiao Guangrong
NVDIMM devices is defined in ACPI 6.0 9.20 NVDIMM Devices There is a root device under \_SB and specified NVDIMM devices are under the root device. Each NVDIMM device has _ADR which returns its handle used to associate MEMDEV structure in NFIT We reserve handle 0 for root device. In this patch, w

[Qemu-devel] [PATCH v3 1/3] target-i386: add a subsection for migrating vcpu's TSC rate

2015-11-02 Thread Haozhong Zhang
A new subsection 'vmstate_tsc_khz' is added to migrate vcpu's TSC rate. For the backwards compatibility, this subsection is not migrated on pc-*-2.4 and older machine types. Signed-off-by: Haozhong Zhang --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 +

[Qemu-devel] [PATCH v3 2/3] target-i386: calculate vcpu's TSC rate to be migrated

2015-11-02 Thread Haozhong Zhang
The value of the migrated vcpu's TSC rate is determined as below. 1. If a TSC rate is specified by the cpu option 'tsc-freq', then this user-specified value will be used. 2. If neither a user-specified TSC rate nor a migrated TSC rate is present, we will use the TSC rate from KVM (returne

[Qemu-devel] [PATCH v7 31/35] nvdimm acpi: support Get Namespace Label Data function

2015-11-02 Thread Xiao Guangrong
Function 5 is used to get Namespace Label Data Reviewed-by: Stefan Hajnoczi Signed-off-by: Xiao Guangrong --- hw/acpi/nvdimm.c | 63 1 file changed, 63 insertions(+) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index cdc361c..f30e2ff

[Qemu-devel] [PATCH v7 32/35] nvdimm acpi: support Set Namespace Label Data function

2015-11-02 Thread Xiao Guangrong
Function 6 is used to set Namespace Label Data Reviewed-by: Stefan Hajnoczi Signed-off-by: Xiao Guangrong --- hw/acpi/nvdimm.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index f30e2ff..2553be9 100644 --- a/hw/acpi/nvd

Re: [Qemu-devel] [PATCH v3 2/3] target-i386: calculate vcpu's TSC rate to be migrated

2015-11-02 Thread James Hogan
On Mon, Nov 02, 2015 at 05:26:42PM +0800, Haozhong Zhang wrote: > The value of the migrated vcpu's TSC rate is determined as below. > 1. If a TSC rate is specified by the cpu option 'tsc-freq', then this > user-specified value will be used. > 2. If neither a user-specified TSC rate nor a migr

[Qemu-devel] [PATCH v7 35/35] nvdimm: add maintain info

2015-11-02 Thread Xiao Guangrong
Add NVDIMM maintainer Signed-off-by: Xiao Guangrong --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3144113..865c0cf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -907,6 +907,13 @@ M: Jiri Pirko S: Maintained F: hw/net/rocker/ +NVDI

[Qemu-devel] [PATCH v3 0/3] target-i386: save/restore vcpu's TSC rate during migration

2015-11-02 Thread Haozhong Zhang
This patchset enables QEMU to save/restore vcpu's TSC rate during the migration on machine types pc-*-2.5 or newer. On the source machine: * If the vcpu's TSC rate is specified by the cpu option 'tsc-freq', then this user-specified TSC rate will be migrated. * Otherwise, the TSC rate returned

[Qemu-devel] [PATCH v3 3/3] target-i386: load the migrated vcpu's TSC rate

2015-11-02 Thread Haozhong Zhang
Set vcpu's TSC rate to the migrated value if the user does not specify a TSC rate by cpu option 'tsc-freq' and a migrated TSC rate does exist. If KVM supports TSC scaling, guest programs will observe TSC increasing in the migrated rate other than the host TSC rate. Signed-off-by: Haozhong Zhang -

Re: [Qemu-devel] [PATCH V3] hw/virtio: Add PCIe capability to virtio devices

2015-11-02 Thread Marcel Apfelbaum
On 11/02/2015 11:42 AM, Greg Kurz wrote: On Thu, 29 Oct 2015 13:56:28 +0200 Marcel Apfelbaum wrote: The virtio devices are converted to PCI-Express if they are plugged into a PCI-Express bus and the 'modern' protocol is enabled. Devices plugged directly into the Root Complex as Integrated End

Re: [Qemu-devel] [PATCH V3] hw/virtio: Add PCIe capability to virtio devices

2015-11-02 Thread Cornelia Huck
On Mon, 2 Nov 2015 11:20:50 +0200 Marcel Apfelbaum wrote: > On 11/02/2015 11:07 AM, Cornelia Huck wrote: > > On Sun, 1 Nov 2015 11:15:24 +0200 > > Marcel Apfelbaum wrote: > > > >> By the way, HW_COMPAT_2_3 sets any-layout to off only for a few virtio > >> devices, > >> not for all. Does anybody

Re: [Qemu-devel] [PATCH V3] hw/virtio: Add PCIe capability to virtio devices

2015-11-02 Thread Marcel Apfelbaum
On 11/02/2015 11:54 AM, Cornelia Huck wrote: On Mon, 2 Nov 2015 11:20:50 +0200 Marcel Apfelbaum wrote: On 11/02/2015 11:07 AM, Cornelia Huck wrote: On Sun, 1 Nov 2015 11:15:24 +0200 Marcel Apfelbaum wrote: By the way, HW_COMPAT_2_3 sets any-layout to off only for a few virtio devices, not

[Qemu-devel] [PATCH] hw/arm/virt-acpi-build: _CCA attribute is compulsary

2015-11-02 Thread Graeme Gregory
According to ACPI specification 6.2.17 _CCA (Cache Coherency Attribute) this attribute is compulsary on ARM systems. Add this attribute to the PCI host bridges as required. Without this the kernel will produce the error [Firmware Bug]: PCI device :00:00.0 fail to setup DMA. Signed-off-by: Gra

Re: [Qemu-devel] [PULL 13/13] target-arm: Fix CPU breakpoint handling

2015-11-02 Thread Peter Maydell
On 21 October 2015 at 19:15, Sergey Fedorov wrote: > On 16.10.2015 16:58, Peter Maydell wrote: >> From: Sergey Fedorov >> >> A QEMU breakpoint match is not definitely an architectural breakpoint >> match. If an exception is generated unconditionally during translation, >> it is hardly possible to

Re: [Qemu-devel] [PULL] tilegx queued patch

2015-11-02 Thread Peter Maydell
On 30 October 2015 at 20:44, Richard Henderson wrote: > Just one mergable patch since the last update. > I guess this will be it before hard-freeze. > > > r~ > > > The following changes since commit b803894e2c4d744ccc113ca6cbe6654ec80c1dc6: > > Merge remote-tracking branch 'remotes/afaerber/tags

Re: [Qemu-devel] [PATCH] qom/object: fix 2 comment typos

2015-11-02 Thread Peter Maydell
On 2 November 2015 at 09:04, Cao jin wrote: > Signed-off-by: Cao jin > --- > include/qom/object.h | 2 +- > qom/object.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/qom/object.h b/include/qom/object.h > index be7280c..9e5162a 100644 > --- a/include

Re: [Qemu-devel] [PATCH 0/3] target-i386: Don't trigger "check" warnings by default in KVM mode

2015-11-02 Thread Paolo Bonzini
On 30/10/2015 20:13, Eduardo Habkost wrote: > On Fri, Oct 30, 2015 at 05:00:57PM -0200, Eduardo Habkost wrote: >> The x86 change to make "check" mode be enabled by default made QEMU print a >> warning in the default case if running in an Intel host: >> >> $ qemu-system-x86_64 -machine pc,accel=

Re: [Qemu-devel] RFC: libyajl for JSON

2015-11-02 Thread Paolo Bonzini
On 02/11/2015 09:40, Markus Armbruster wrote: > > * Optional interpolation > > If you pass a va_list to the parser, it replaces certain escape > sequences by values from that va_list. The escape sequences are a > subset of printf conversion specifiers, to enable compile-time > checking

Re: [Qemu-devel] [PATCH v7 00/35] implement vNVDIMM

2015-11-02 Thread Stefan Hajnoczi
I have reviewed ACPI interface: Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [Qemu-devel] [v2 RESEND 0/4] Fix long vm downtime during live migration

2015-11-02 Thread Paolo Bonzini
On 02/11/2015 08:36, Liang Li wrote: > The patch 3ea3b7fa9af067982f34b of kvm introduces a lazy collapsing > of small sptes into large sptes mechanism, which intend to solve the > performance drop issue if live migration fails or is canceled. The > rmap will be scanned in the KVM_SET_USER_MEMORY_

Re: [Qemu-devel] [PATCH RESEND v2 0/3] pc: Set hw_version on all machine classes

2015-11-02 Thread Paolo Bonzini
On 30/10/2015 20:36, Eduardo Habkost wrote: > In 2012, QEMU had a bug where it exposed QEMU version information > to the guest, meaning a QEMU upgrade would expose different > hardware to the guest OS even if the same machine-type is being > used. > > The bug was fixed by commit 93bfef4c6e4b23ca

Re: [Qemu-devel] [PATCH 0/7] Hyper-V Synthetic interrupt controller

2015-11-02 Thread Paolo Bonzini
On 26/10/2015 10:50, Andrey Smetanin wrote: > Hyper-V SynIC (synthetic interrupt controller) device > implementation. > > The implementation contains: > * msr's support > * irq routing setup > * irq injection > * irq ack callback registration > * event/message pages changes tracking at Hyper-V e

Re: [Qemu-devel] [PULL v2 00/25] QAPI patches

2015-11-02 Thread Peter Maydell
On 2 November 2015 at 09:13, Markus Armbruster wrote: > v2: > * Squashed Eric's build fix. > * Moved Dan's fix to the front, to make merging it easier in case > something's still wrong with Eric's patches. > > The following changes since commit 3a958f559ecd0511583d27b10011fa7f3cf79b63: > > Mer

Re: [Qemu-devel] [PATCH V3] hw/virtio: Add PCIe capability to virtio devices

2015-11-02 Thread Cornelia Huck
On Mon, 2 Nov 2015 12:01:06 +0200 Marcel Apfelbaum wrote: > On 11/02/2015 11:54 AM, Cornelia Huck wrote: > > On Mon, 2 Nov 2015 11:20:50 +0200 > > Marcel Apfelbaum wrote: > > > >> On 11/02/2015 11:07 AM, Cornelia Huck wrote: > >>> On Sun, 1 Nov 2015 11:15:24 +0200 > >>> Marcel Apfelbaum wrote:

Re: [Qemu-devel] [PATCH V3] hw/virtio: Add PCIe capability to virtio devices

2015-11-02 Thread Marcel Apfelbaum
On 11/02/2015 02:05 PM, Cornelia Huck wrote: On Mon, 2 Nov 2015 12:01:06 +0200 Marcel Apfelbaum wrote: On 11/02/2015 11:54 AM, Cornelia Huck wrote: On Mon, 2 Nov 2015 11:20:50 +0200 Marcel Apfelbaum wrote: On 11/02/2015 11:07 AM, Cornelia Huck wrote: On Sun, 1 Nov 2015 11:15:24 +0200 Marc

[Qemu-devel] [PATCH v2 2/2] block: test 'blockdev-snapshot' using a file BDS as the overlay

2015-11-02 Thread Alberto Garcia
This test checks that it is not possible to create a snapshot using as the overlay node a BDS that does not support backing images. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/085 | 12 +++- tests/qemu-iotests/085.out | 4 2 files changed, 15 insertions(+), 1 deletion(

Re: [Qemu-devel] [kvm-unit-tests PATCH] x86: hyperv_synic: Hyper-V SynIC test

2015-11-02 Thread Paolo Bonzini
On 26/10/2015 10:56, Andrey Smetanin wrote: > Hyper-V SynIC is a Hyper-V synthetic interrupt controller. > > The test runs on every vCPU and performs the following steps: > * read from all Hyper-V SynIC MSR's > * setup Hyper-V SynIC evt/msg pages > * setup SINT's routing > * inject SINT's into des

[Qemu-devel] [PATCH v2 1/2] block: Disallow snapshots if the overlay doesn't support backing files

2015-11-02 Thread Alberto Garcia
This addresses scenarios like this one: { 'execute': 'blockdev-add', 'arguments': { 'options': { 'driver': 'qcow2', 'node-name': 'new0', 'file': { 'driver': 'file', 'filename': 'new.qcow2', 'node-

[Qemu-devel] [PATCH v2 0/2] Disallow snapshots if the overlay doesn't support backing files

2015-11-02 Thread Alberto Garcia
We are currently allowing snapshots in cases like this one: { 'execute': 'blockdev-add', 'arguments': { 'options': { 'driver': 'qcow2', 'node-name': 'new0', 'file': { 'driver': 'file', 'filename': 'ne

Re: [Qemu-devel] [kvm-unit-tests PATCH] x86: hyperv_synic: Hyper-V SynIC test

2015-11-02 Thread Denis V. Lunev
On 11/02/2015 03:16 PM, Paolo Bonzini wrote: On 26/10/2015 10:56, Andrey Smetanin wrote: Hyper-V SynIC is a Hyper-V synthetic interrupt controller. The test runs on every vCPU and performs the following steps: * read from all Hyper-V SynIC MSR's * setup Hyper-V SynIC evt/msg pages * setup SINT'

Re: [Qemu-devel] [PATCH v7 20/35] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
On 02.11.2015 12:13, Xiao Guangrong wrote: Curretly, the memory region of backed memory is directly mapped to guest's address space, however, it is not true for nvdimm device This patch let dimm device realize this fact and use DIMMDeviceClass->get_memory_region method to get the mapped memory r

Re: [Qemu-devel] [kvm-unit-tests PATCH] x86: hyperv_synic: Hyper-V SynIC test

2015-11-02 Thread Paolo Bonzini
On 02/11/2015 13:18, Denis V. Lunev wrote: >> I'm keeping the kernel patches queued for my own testing, but this of >> course has to be fixed before including them---which will delay this >> feature to 4.5, unfortunately. > > well, the problem is that it actually uses auto EOI Ok, no big de

  1   2   3   >