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

2015-10-30 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 Signed-off-by: Xiao Guangrong

[PATCH v6 20/33] dimm: introduce realize callback

2015-10-30 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 Signed-off-by: Xiao Guangrong --- hw/mem/dimm.c

[PATCH v6 06/33] acpi: add aml_method_serialized

2015-10-30 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

[PATCH v6 13/33] pc-dimm: make pc_existing_dimms_capacity static and rename it

2015-10-30 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 Signed-off-by: Xiao Guangrong --- hw/mem/pc-dimm.c | 73

[PATCH v6 21/33] nvdimm: implement NVDIMM device abstract

2015-10-30 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,

[PATCH v6 03/33] acpi: add aml_create_field

2015-10-30 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

[PATCH v6 14/33] pc-dimm: drop the prefix of pc-dimm

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

[PATCH v6 12/33] pc-dimm: remove DEFAULT_PC_DIMMSIZE

2015-10-30 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 +++

[PATCH v6 05/33] acpi: add aml_object_type

2015-10-30 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

[PATCH v6 16/33] pc-dimm: rename pc-dimm.c and pc-dimm.h

2015-10-30 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 Signed-off-by: Xiao Guangrong --- hw/Makefile.objs | 2 +- hw/acpi/ich9.c | 2 +-

[PATCH v6 19/33] dimm: keep the state of the whole backend memory

2015-10-30 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 ---

[PATCH v6 22/33] docs: add NVDIMM ACPI documentation

2015-10-30 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

[PATCH v6 04/33] acpi: add aml_concatenate

2015-10-30 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

[PATCH v6 17/33] dimm: abstract dimm device from pc-dimm

2015-10-30 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 Signed-off-by: Xiao Guangrong --- default-configs/i386-softmmu.mak | 1 + default-configs/ppc64-softmmu.mak | 1 +

[PATCH v6 09/33] exec: allow file_ram_alloc to work on file

2015-10-30 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

[PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao When calling perf_event_create_kernel_counter to create perf_event, assign a overflow handler. Then when perf event overflows, set irq_pending and call kvm_vcpu_kick() to sync the interrupt. Signed-off-by: Shannon Zhao ---

[PATCH v4 13/21] KVM: ARM64: Add reset and access handlers for PMOVSSET and PMOVSCLR register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMOVSSET and PMOVSCLR is UNKNOWN, use reset_unknown for its reset handler. Add a new case to emulate writing PMOVSSET or PMOVSCLR register. When writing non-zero value to PMOVSSET, pend PMU interrupt. When the value writing to

[PATCH v4 17/21] KVM: ARM64: Add helper to handle PMCR register bits

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao According to ARMv8 spec, when writing 1 to PMCR.E, all counters are enabled by PMCNTENSET, while writing 0 to PMCR.E, all counters are disabled. When writing 1 to PMCR.P, reset all event counters, not including PMCCNTR, to zero. When writing 1 to

[PATCH v4 21/21] KVM: ARM64: Add a new kvm ARM PMU device

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Add a new kvm device type KVM_DEV_TYPE_ARM_PMU_V3 for ARM PMU. Implement the kvm_device_ops for it. Signed-off-by: Shannon Zhao --- Documentation/virtual/kvm/devices/arm-pmu.txt | 15 + arch/arm64/include/uapi/asm/kvm.h

[PATCH v4 04/21] KVM: ARM64: Add reset and access handlers for PMCR_EL0 register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Add reset handler which gets host value of PMCR_EL0 and make writable bits architecturally UNKNOWN except PMCR.E to zero. Add a common access handler for PMU registers which emulates writing and reading register and add emulation for PMCR.

[PATCH v4 01/21] ARM64: Move PMU register related defines to asm/pmu.h

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao To use the ARMv8 PMU related register defines from the KVM code, we move the relevant definitions to asm/pmu.h header file. Signed-off-by: Anup Patel Signed-off-by: Shannon Zhao ---

[PATCH v4 20/21] KVM: ARM64: Free perf event of PMU when destroying vcpu

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao When KVM frees VCPU, it needs to free the perf_event of PMU. Signed-off-by: Shannon Zhao --- arch/arm/kvm/arm.c| 1 + include/kvm/arm_pmu.h | 2 ++ virt/kvm/arm/pmu.c| 21 + 3 files changed, 24

[PATCH v4 19/21] KVM: ARM64: Reset PMU state when resetting vcpu

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao When resetting vcpu, it needs to reset the PMU state to initial status. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/reset.c | 3 +++ include/kvm/arm_pmu.h | 2 ++ virt/kvm/arm/pmu.c | 19 +++ 3

[PATCH v4 00/21] KVM: ARM64: Add guest PMU support

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao This patchset adds guest PMU support for KVM on ARM64. It takes trap-and-emulate approach. When guest wants to monitor one event, it will be trapped by KVM and KVM will call perf_event API to create a perf event and call relevant perf_event APIs to get

[PATCH v4 14/21] KVM: ARM64: Add reset and access handlers for PMUSERENR register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao The reset value of PMUSERENR_EL0 is UNKNOWN, use reset_unknown. While the reset value of PMUSERENR is zero, use reset_val_cp15 with zero for its reset handler. Add a helper for CP15 registers reset to specified value. Signed-off-by: Shannon Zhao

[PATCH v4 02/21] KVM: ARM64: Define PMU data structure for each vcpu

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Here we plan to support virtual PMU for guest by full software emulation, so define some basic structs and functions preparing for futher steps. Define struct kvm_pmc for performance monitor counter and struct kvm_pmu for performance monitor unit for

[PATCH v4 03/21] KVM: ARM64: Add offset defines for PMU registers

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao We are about to trap and emulate acccesses to each PMU register individually. This adds the context offsets for the AArch64 PMU registers and their AArch32 counterparts. Signed-off-by: Shannon Zhao ---

[PATCH v4 11/21] KVM: ARM64: Add reset and access handlers for PMCNTENSET and PMCNTENCLR register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMCNTENSET and PMCNTENCLR is UNKNOWN, use reset_unknown for its reset handler. Add a new case to emulate writing PMCNTENSET or PMCNTENCLR register. When writing to PMCNTENSET, call perf_event_enable to enable the perf event.

[PATCH v4 15/21] KVM: ARM64: Add reset and access handlers for PMSWINC register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Add access handler which emulates writing and reading PMSWINC register and add support for creating software increment event. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.c | 18 +++-

Re: [PATCH] vfio/platform: store mapped memory in region, instead of an on-stack copy

2015-10-30 Thread Baptiste Reynal
Hi James, Thanks for this fix. Acked-by: Baptiste Reynal Tested-by: Baptiste Reynal On Thu, Oct 29, 2015 at 5:50 PM, James Morse wrote: > vfio_platform_{read,write}_mmio() call ioremap_nocache() to map > a

[PATCH v4 12/21] KVM: ARM64: Add reset and access handlers for PMINTENSET and PMINTENCLR register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMINTENSET and PMINTENCLR is UNKNOWN, use reset_unknown for its reset handler. Add a new case to emulate writing PMINTENSET or PMINTENCLR register. Signed-off-by: Shannon Zhao ---

[PATCH v4 07/21] KVM: ARM64: PMU: Add perf event map and introduce perf event creating function

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao When we use tools like perf on host, perf passes the event type and the id of this event type category to kernel, then kernel will map them to hardware event number and write this number to PMU PMEVTYPER_EL0 register. When getting the event number in

[PATCH v4 09/21] KVM: ARM64: Add reset and access handlers for PMXEVCNTR register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMXEVCNTR is UNKNOWN, use reset_unknown for its reset handler. Add access handler which emulates writing and reading PMXEVCNTR register. When reading PMXEVCNTR, call perf_event_read_value to get the count value of the perf

Re: [RFC PATCH] VFIO: Add a parameter to force nonthread IRQ

2015-10-30 Thread Yunhong Jiang
On Thu, Oct 29, 2015 at 10:45:44AM +0100, Paolo Bonzini wrote: > > > On 29/10/2015 04:11, Alex Williamson wrote: > > > The irqfd is already able to schedule a work item, because it runs with > > > interrupts disabled, so I think we can always return IRQ_HANDLED. > > > > I'm confused by this.

[PATCH v4 16/21] KVM: ARM64: Add access handlers for PMEVCNTRn and PMEVTYPERn register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Add access handler which emulates writing and reading PMEVCNTRn and PMEVTYPERn. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.c | 164 ++ 1 file changed, 164

[PATCH v4 06/21] KVM: ARM64: Add reset and access handlers for PMCEID0 and PMCEID1 register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Add reset handler which gets host value of PMCEID0 or PMCEID1. Since write action to PMCEID0 or PMCEID1 is ignored, add a new case for this. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.c | 29

[PATCH v4 08/21] KVM: ARM64: Add reset and access handlers for PMXEVTYPER register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMXEVTYPER is UNKNOWN, use reset_unknown or reset_unknown_cp15 for its reset handler. Add access handler which emulates writing and reading PMXEVTYPER register. When writing to PMXEVTYPER, call kvm_pmu_set_counter_event_type to

Re: [PATCH/RFC 0/4] dma ops and virtio

2015-10-30 Thread Cornelia Huck
On Thu, 29 Oct 2015 15:50:38 -0700 Andy Lutomirski wrote: > Progress! After getting that sort-of-working, I figured out what was > wrong with my earlier command, and I got that working, too. Now I > get: > > qemu-system-s390x -fsdev >

[PATCH v6 32/33] nvdimm acpi: support _FIT method

2015-10-30 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

[PATCH v6 23/33] nvdimm acpi: init the resource used by NVDIMM ACPI

2015-10-30 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

[PATCH v6 28/33] nvdimm acpi: support Get Namespace Label Size function

2015-10-30 Thread Xiao Guangrong
Function 4 is used to get Namespace label size 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

[PATCH v6 00/33] implement vNVDIMM

2015-10-30 Thread Xiao Guangrong
This patchset can be found at: https://github.com/xiaogr/qemu.git nvdimm-v6 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 v6: - changes from Stefan's comments: 1) fix code style of struct naming

[PATCH v6 07/33] util: introduce qemu_file_get_page_size()

2015-10-30 Thread Xiao Guangrong
There are three places use the some logic to get the page size on the file path or file fd This patch introduces qemu_file_get_page_size() to unify the code Signed-off-by: Xiao Guangrong --- include/qemu/osdep.h | 1 + target-ppc/kvm.c | 21

[PATCH v6 24/33] nvdimm acpi: build ACPI NFIT table

2015-10-30 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

[PATCH v6 15/33] stubs: rename qmp_pc_dimm_device_list.c

2015-10-30 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

[PATCH v6 27/33] nvdimm acpi: support function 0

2015-10-30 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

[PATCH v6 11/33] hostmem-file: use whole file size if possible

2015-10-30 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 | 48 1 file changed, 44 insertions(+), 4

[PATCH v6 08/33] exec: allow memory to be allocated from any kind of path

2015-10-30 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 ---

[PATCH v6 31/33] nvdimm: allow using whole backend memory as pmem

2015-10-30 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

[PATCH v6 33/33] nvdimm: add maintain info

2015-10-30 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

[PATCH v6 10/33] hostmem-file: clean up memory allocation

2015-10-30 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 Signed-off-by: Xiao Guangrong

[PATCH v6 29/33] nvdimm acpi: support Get Namespace Label Data function

2015-10-30 Thread Xiao Guangrong
Function 5 is used to get Namespace Label Data 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

[PATCH v6 26/33] nvdimm acpi: save arg3 for NVDIMM device _DSM method

2015-10-30 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

[PATCH v6 01/33] acpi: add aml_derefof

2015-10-30 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

[PATCH v6 25/33] nvdimm acpi: build ACPI nvdimm devices

2015-10-30 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,

[PATCH v6 30/33] nvdimm acpi: support Set Namespace Label Data function

2015-10-30 Thread Xiao Guangrong
Function 6 is used to set Namespace Label Data 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 8c27b25..5c8be41 100644 ---

[PATCH v6 02/33] acpi: add aml_sizeof

2015-10-30 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

[PATCH v4 05/21] KVM: ARM64: Add reset and access handlers for PMSELR register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMSELR_EL0 is UNKNOWN, use reset_unknown for its reset handler. As it doesn't need to deal with the acsessing action specially, it uses default case to emulate writing and reading PMSELR register. Add a helper for CP15

[PATCH v4 10/21] KVM: ARM64: Add reset and access handlers for PMCCNTR register

2015-10-30 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMCCNTR is UNKNOWN, use reset_unknown for its reset handler. Add a new case to emulate reading and writing to PMCCNTR register. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.c | 31

[PATCH] KVM: x86: removing unused variable

2015-10-30 Thread Saurabh Sengar
removing unused variables, found by coccinelle Signed-off-by: Saurabh Sengar --- arch/x86/kvm/x86.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 9a9a198..ec15294 100644 ---

Re: [PATCH/RFC 0/4] dma ops and virtio

2015-10-30 Thread Andy Lutomirski
On Fri, Oct 30, 2015 at 1:25 AM, Cornelia Huck wrote: > On Thu, 29 Oct 2015 15:50:38 -0700 > Andy Lutomirski wrote: > >> Progress! After getting that sort-of-working, I figured out what was >> wrong with my earlier command, and I got that working,

Re: [PATCH v1 2/2] dma-mapping-common: add DMA attribute - DMA_ATTR_IOMMU_BYPASS

2015-10-30 Thread Arnd Bergmann
On Saturday 31 October 2015 10:17:22 Benjamin Herrenschmidt wrote: > On Fri, 2015-10-30 at 11:32 +0100, Arnd Bergmann wrote: > > On Thursday 29 October 2015 10:10:46 Benjamin Herrenschmidt wrote: > > > > > > > Maybe we should at least coordinate IOMMU 'paranoid/fast' modes > > > > across > > > >

[PATCH v3 0/3] KVM/arm64/arm: enhance armv7/8 fp/simd lazy switch

2015-10-30 Thread Mario Smarduch
This short patch series combines the previous armv7 and armv8 versions. For an FP and lmbench load it reduces fp/simd context switch from 30-50% down to 2%. Results will vary with load but is no worse then current approach. In summary current lazy vfp/simd implementation switches hardware

Re: [PATCH v1 2/2] dma-mapping-common: add DMA attribute - DMA_ATTR_IOMMU_BYPASS

2015-10-30 Thread Benjamin Herrenschmidt
On Fri, 2015-10-30 at 11:32 +0100, Arnd Bergmann wrote: > On Thursday 29 October 2015 10:10:46 Benjamin Herrenschmidt wrote: > > > > > Maybe we should at least coordinate IOMMU 'paranoid/fast' modes > > > across > > > architectures, and then the DMA_ATTR_IOMMU_BYPASS flag would have > > > a > > >

Re: [PATCH v6 00/33] implement vNVDIMM

2015-10-30 Thread Stefan Hajnoczi
On Fri, Oct 30, 2015 at 01:55:54PM +0800, Xiao Guangrong wrote: > This patchset can be found at: > https://github.com/xiaogr/qemu.git nvdimm-v6 > > It is based on pci branch on Michael's tree and the top commit is: > commit 6f96a31a06c2a1 (tests: re-enable vhost-user-test). > > Changelog

Re: [PATCH v6 27/33] nvdimm acpi: support function 0

2015-10-30 Thread Stefan Hajnoczi
On Fri, Oct 30, 2015 at 01:56:21PM +0800, Xiao Guangrong wrote: > static uint64_t > nvdimm_dsm_read(void *opaque, hwaddr addr, unsigned size) > { > -return 0; > +AcpiNVDIMMState *state = opaque; > +MemoryRegion *dsm_ram_mr = >ram_mr; > +NvdimmDsmIn *in; > +GArray *out; > +

Re: [PATCH v4 2/6] virtio_ring: Support DMA APIs

2015-10-30 Thread Cornelia Huck
On Thu, 29 Oct 2015 18:09:47 -0700 Andy Lutomirski wrote: > virtio_ring currently sends the device (usually a hypervisor) > physical addresses of its I/O buffers. This is okay when DMA > addresses and physical addresses are the same thing, but this isn't > always the case. For

Re: [PATCH v4 2/6] virtio_ring: Support DMA APIs

2015-10-30 Thread Christian Borntraeger
Am 30.10.2015 um 13:01 schrieb Cornelia Huck: > On Thu, 29 Oct 2015 18:09:47 -0700 > Andy Lutomirski wrote: > >> virtio_ring currently sends the device (usually a hypervisor) >> physical addresses of its I/O buffers. This is okay when DMA >> addresses and physical addresses are

[PATCH] vhost: move is_le setup to the backend

2015-10-30 Thread Greg Kurz
The vq->is_le field is used to fix endianness when accessing the vring via the cpu_to_vhost16() and vhost16_to_cpu() helpers in the following cases: 1) host is big endian and device is modern virtio 2) host has cross-endian support and device is legacy virtio with a different endianness than

Re: [PATCH] vfio/platform: store mapped memory in region, instead of an on-stack copy

2015-10-30 Thread Eric Auger
Hi, On 10/30/2015 09:51 AM, Baptiste Reynal wrote: > Hi James, > > Thanks for this fix. > > Acked-by: Baptiste Reynal > Tested-by: Baptiste Reynal > > On Thu, Oct 29, 2015 at 5:50 PM, James Morse wrote: >>

Re: [PATCH v1 2/2] dma-mapping-common: add DMA attribute - DMA_ATTR_IOMMU_BYPASS

2015-10-30 Thread Arnd Bergmann
On Thursday 29 October 2015 10:10:46 Benjamin Herrenschmidt wrote: > > > Maybe we should at least coordinate IOMMU 'paranoid/fast' modes across > > architectures, and then the DMA_ATTR_IOMMU_BYPASS flag would have a > > sane meaning in the paranoid mode (and perhaps we'd want an ultra > >

Re: [PATCH net-next rfc V2 0/2] basic busy polling support for vhost_net

2015-10-30 Thread Jason Wang
On 10/29/2015 04:45 PM, Jason Wang wrote: > Hi all: > > This series tries to add basic busy polling for vhost net. The idea is > simple: at the end of tx processing, busy polling for new tx added > descriptor and rx receive socket for a while. The maximum number of > time (in us) could be spent

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-10-30 Thread kbuild test robot
Hi Shannon, [auto build test ERROR on kvm/linux-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base] url: https://github.com/0day-ci/linux/commits/Shannon-Zhao/KVM-ARM64-Add-guest-PMU-support/20151030-143148 config: arm-axm55xx_defconfig (attached

Re: [PATCH 5/6] KVM: PPC: Book3S HV: Send IPI to host core to wake VCPU

2015-10-30 Thread kbuild test robot
Hi Suresh, [auto build test ERROR on kvm/linux-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base] url: https://github.com/0day-ci/linux/commits/Suresh-Warrier/KVM-PPC-Book3S-HV-Optimize-wakeup-VCPU-from-H_IPI/20151030-081329 config: powerpc

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-10-30 Thread Shannon Zhao
iate base, > please suggest rules for selecting the more suitable base] > > url: > https://github.com/0day-ci/linux/commits/Shannon-Zhao/KVM-ARM64-Add-guest-PMU-support/20151030-143148 > config: arm-axm55xx_defconfig (attached as .config) > reproduce: > wget >

Re: [PATCH v4 1/6] virtio-net: Stop doing DMA from the stack

2015-10-30 Thread Andy Lutomirski
On Fri, Oct 30, 2015 at 6:55 AM, Christian Borntraeger wrote: > Am 30.10.2015 um 02:09 schrieb Andy Lutomirski: >> From: "Michael S. Tsirkin" >> >> Once virtio starts using the DMA API, we won't be able to safely DMA >> from the stack. virtio-net does a

[PATCHv2 0/3] dma ops and virtio

2015-10-30 Thread Christian Borntraeger
here is the 2nd version of providing an DMA API for s390. There are some attempts to unify the dma ops (Christoph) as well as some attempts to make virtio use the dma API (Andy). At kernel summit we concluded that we want to use the same code on all platforms, whereever possible, so having a

Re: [PATCH v4 1/6] virtio-net: Stop doing DMA from the stack

2015-10-30 Thread Christian Borntraeger
Am 30.10.2015 um 02:09 schrieb Andy Lutomirski: > From: "Michael S. Tsirkin" > > Once virtio starts using the DMA API, we won't be able to safely DMA > from the stack. virtio-net does a couple of config DMA requests > from small stack buffers -- switch to using

Re: [PATCH 4/4] s390/virtio: use noop dma ops

2015-10-30 Thread Cornelia Huck
On Fri, 30 Oct 2015 13:26:09 +0100 Christian Borntraeger wrote: > I am currently reworking this to > > static inline struct dma_map_ops *get_dma_ops(struct device *dev) > { > if (dev && dev->archdata.dma_ops) > return dev->archdata.dma_ops; >

Re: [PATCH v6 27/33] nvdimm acpi: support function 0

2015-10-30 Thread Xiao Guangrong
On 10/30/2015 06:14 PM, Stefan Hajnoczi wrote: On Fri, Oct 30, 2015 at 01:56:21PM +0800, Xiao Guangrong wrote: static uint64_t nvdimm_dsm_read(void *opaque, hwaddr addr, unsigned size) { -return 0; +AcpiNVDIMMState *state = opaque; +MemoryRegion *dsm_ram_mr = >ram_mr; +

Re: [Qemu-devel] [PATCH v6 07/33] util: introduce qemu_file_get_page_size()

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
logic is changed: in old version gethugepagesize on statfs error generates exit(1) in new it returns getpagesize() in this case (through fd_getpagesize) (I think, fd_getpagesize should be fixed to handle error) also, in new version for windows we have getpagesize(), when in old version

Re: [PATCH 4/4] s390/virtio: use noop dma ops

2015-10-30 Thread Christian Borntraeger
Am 30.10.2015 um 13:17 schrieb Cornelia Huck: > On Tue, 27 Oct 2015 23:48:51 +0100 > Christian Borntraeger wrote: > >> With all infrastructure in place, lets provide dma_ops for virtio >> devices on s390. >> >> Signed-off-by: Christian Borntraeger

Re: [Qemu-devel] [kvm-unit-tests PATCHv5 3/3] arm: pmu: Add CPI checking

2015-10-30 Thread Andrew Jones
On Wed, Oct 28, 2015 at 03:12:55PM -0400, Christopher Covington wrote: > Calculate the numbers of cycles per instruction (CPI) implied by ARM > PMU cycle counter values. The code includes a strict checking facility > intended for the -icount option in TCG mode but it is not yet enabled > in the

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

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: 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

Re: [PATCH 1/4] Provide simple noop dma ops

2015-10-30 Thread Christian Borntraeger
Am 28.10.2015 um 01:41 schrieb Joerg Roedel: > Hi Christian, > > On Tue, Oct 27, 2015 at 11:48:48PM +0100, Christian Borntraeger wrote: >> +static dma_addr_t dma_noop_map_page(struct device *dev, struct page *page, >> + unsigned long offset, size_t size, >> +

Re: [PATCH 4/4] s390/virtio: use noop dma ops

2015-10-30 Thread Christian Borntraeger
Am 28.10.2015 um 01:43 schrieb Joerg Roedel: > On Tue, Oct 27, 2015 at 11:48:51PM +0100, Christian Borntraeger wrote: >> @@ -1093,6 +1094,7 @@ static void virtio_ccw_auto_online(void *data, >> async_cookie_t cookie) >> struct ccw_device *cdev = data; >> int ret; >> >> +

Re: [PATCH 4/4] s390/virtio: use noop dma ops

2015-10-30 Thread Cornelia Huck
On Tue, 27 Oct 2015 23:48:51 +0100 Christian Borntraeger wrote: > With all infrastructure in place, lets provide dma_ops for virtio > devices on s390. > > Signed-off-by: Christian Borntraeger > --- > drivers/s390/virtio/kvm_virtio.c | 2 ++ >

[PATCH 1/3] Provide simple noop dma ops

2015-10-30 Thread Christian Borntraeger
We are going to require dma_ops for several common drivers, even for systems that do have an identity mapping. Lets provide some minimal no-op dma_ops that can be used for that purpose. Signed-off-by: Christian Borntraeger --- include/linux/dma-mapping.h | 2 ++

[PATCH 2/3] alpha: use common noop dma ops

2015-10-30 Thread Christian Borntraeger
Some of the alpha pci noop dma ops are identical to the common ones. Use them. Signed-off-by: Christian Borntraeger --- arch/alpha/kernel/pci-noop.c | 46 1 file changed, 4 insertions(+), 42 deletions(-) diff --git

[PATCH 3/3] s390/dma: Allow per device dma ops

2015-10-30 Thread Christian Borntraeger
As virtio-ccw now has dma ops, we can no longer default to the PCI ones. Make use of dev_archdata to keep the dma_ops per device. The pci devices now use that to override the default, and the default is changed to use the noop ops for everything that is not PCI. To compile without PCI support we

Re: [PATCH 1/4] Provide simple noop dma ops

2015-10-30 Thread Joerg Roedel
On Fri, Oct 30, 2015 at 01:55:56PM +0100, Christian Borntraeger wrote: > It not trivial without understanding the dma mask details. Do I read > the x86 implementation right, that it limits the dma to 32 bit? Then > we cannot collapse both implementations. Or maybe we can hide this in >

[PATCH] KVM: x86: zero apic_arb_prio on reset

2015-10-30 Thread Radim Krčmář
BSP doesn't get INIT so its apic_arb_prio isn't zeroed after reboot. BSP won't get lowest priority interrupts until other VCPUs get enough interrupts to match their pre-reboot apic_arb_prio. That behavior doesn't fit into KVM's round-robin-like interpretation of lowest priority delivery ...

Re: [Qemu-devel] [PATCH v6 09/33] exec: allow file_ram_alloc to work on file

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: 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

Re: [Qemu-devel] [PATCH v6 10/33] hostmem-file: clean up memory allocation

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: - 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

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-30 Thread Joerg Roedel
On Thu, Oct 29, 2015 at 11:01:41AM +0200, Michael S. Tsirkin wrote: > Example: you have a mix of assigned devices and virtio devices. You > don't trust your assigned device vendor not to corrupt your memory so > you want to limit the damage your assigned device can do to your guest, > so you use

Re: [Qemu-devel] [PATCH v6 11/33] hostmem-file: use whole file size if possible

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: 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 | 48

Re: [PATCH 5/6] KVM: PPC: Book3S HV: Send IPI to host core to wake VCPU

2015-10-30 Thread Suresh E. Warrier
inux-next -- if it's inappropriate base, > please suggest rules for selecting the more suitable base] > > url: > https://github.com/0day-ci/linux/commits/Suresh-Warrier/KVM-PPC-Book3S-HV-Optimize-wakeup-VCPU-from-H_IPI/20151030-081329 > config: powerpc-defconfig (attached

Re: [PATCH] KVM: x86: fix RSM into 64-bit protected mode, round 2

2015-10-30 Thread Radim Krčmář
2015-10-26 17:32+0100, Paolo Bonzini: > On 26/10/2015 16:43, Laszlo Ersek wrote: >>> The code would be cleaner if we had a different approach, but this works >>> too and is safer for stable. In case you prefer to leave the rewrite for >>> a future victim, >> >> It's hard to express how much I

[PATCH 1/3] KVM: x86: add read_phys to x86_emulate_ops

2015-10-30 Thread Radim Krčmář
We want to read the physical memory when emulating RSM. X86EMUL_IO_NEEDED is returned on all errors for consistency with other helpers. Signed-off-by: Radim Krčmář --- arch/x86/include/asm/kvm_emulate.h | 10 ++ arch/x86/kvm/x86.c | 10 ++ 2

[PATCH 0/3] KVM: x86: simplify RSM into 64-bit protected mode

2015-10-30 Thread Radim Krčmář
This series bases on "KVM: x86: fix RSM into 64-bit protected mode, round 2" and reverts it in [3/3]. To avoid regressions after doing so, [1/2] introduces a helper that is used in [2/2] to hopefully get the same behavior. I'll set up test environment next week, unless a random act of kindness

  1   2   >