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

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

[PATCH 2/3] KVM: x86: handle SMBASE as physical address in RSM

2015-10-30 Thread Radim Krčmář
GET_SMSTATE depends on real mode to ensure that smbase+offset is treated as a physical address, which has already caused a bug after shuffling the code. Enforce physical addressing. Signed-off-by: Radim Krčmář --- arch/x86/kvm/emulate.c | 7 +++ 1 file changed, 3

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

2015-10-30 Thread Radim Krčmář
This reverts 0123456789abc ("KVM: x86: fix RSM into 64-bit protected mode, round 2"). We've achieved the same by treating SMBASE as a physical address in the previous patch. Signed-off-by: Radim Krčmář --- arch/x86/kvm/emulate.c | 37 +++-- 1

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

2015-10-30 Thread Eduardo Habkost
On Fri, Oct 30, 2015 at 01:56:01PM +0800, Xiao Guangrong wrote: > 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

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

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

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

2015-10-30 Thread Christopher Covington
Hi Drew, On 10/30/2015 09:00 AM, Andrew Jones wrote: > 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

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

2015-10-30 Thread David Woodhouse
(Sorry, missed part of this before). On Thu, 2015-10-29 at 11:01 +0200, Michael S. Tsirkin wrote: > Isn't this specified by the hypervisor? I don't think this is a good > way to do this: guest security should be up to guest. And it is. When the guest sees an IOMMU, it can choose to use it, or

[PATCH 2/2] Makefile: consider LDFLAGS on feature tests and when linking executables

2015-10-30 Thread Andre Przywara
While we have an LDFLAGS variable in kvmtool's Makefile, it's not really used when both doing the feature tests and when finally linking the lkvm executable. Add that variable to all the linking steps to allow the user to specify custom library directories or linker options on the command line.

[PATCH 1/2] Makefile: allow overriding CFLAGS on the command line

2015-10-30 Thread Andre Przywara
When a Makefile variable is set on the make command line, all Makefile-internal assignments to that very variable are _ignored_. Since we add quite some essential values to CFLAGS internally, specifying some CFLAGS on the command line will usually break the build (and not fix any include file

[PATCH 0/2] kvmtool: allow CFLAGS and LDFLAGS override

2015-10-30 Thread Andre Przywara
In the past there have been some complaints from cross-compilation users about missing libraries and include files. Fixing those issues by pointing make to the proper directories via CFLAGS and LDFLAGS proved to be complicated. This series fixes this, so custom CFLAGS and LDFLAGS can be given on

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

2015-10-30 Thread Eric Blake
On 10/29/2015 11:56 PM, Xiao Guangrong wrote: > 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

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

2015-10-30 Thread Eduardo Habkost
On Fri, Oct 30, 2015 at 01:56:05PM +0800, 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: [Qemu-devel] [PATCH] target-i386: enable cflushopt/clwb/pcommit instructions

2015-10-30 Thread Richard Henderson
On 10/29/2015 12:31 AM, Xiao Guangrong wrote: > These instructions are used by NVDIMM drivers and the specification > locates at: > https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf > > There instructions are available on Skylake Server > > Signed-off-by: Xiao Guangrong

[PATCH v3 1/3] KVM/arm: add hooks for armv7 fp/simd lazy switch support

2015-10-30 Thread Mario Smarduch
This patch adds vcpu fields to track lazy state, save host FPEXC, and offsets to fields. Signed-off-by: Mario Smarduch --- arch/arm/include/asm/kvm_host.h | 6 ++ arch/arm/kernel/asm-offsets.c | 2 ++ 2 files changed, 8 insertions(+) diff --git

[PATCH v3 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-10-30 Thread Mario Smarduch
This patch tracks vfp/simd hardware state with a vcpu lazy flag. vCPU lazy flag is set on guest access and traps to vfp/simd hardware switch handler. On vm-enter if lazy flag is set skip trap enable and save host fpexc. On vm-exit if flag is set skip hardware context switch and return to host

[PATCH 3/3] KVM/arm64: enable enhanced armv8 fp/simd lazy switch

2015-10-30 Thread Mario Smarduch
This patch enables arm64 lazy fp/simd switch, similar to arm described in second patch. Change from previous version - restore function is moved to host. Signed-off-by: Mario Smarduch --- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/kernel/asm-offsets.c | 1

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

2015-10-30 Thread Andy Lutomirski
On Fri, Oct 30, 2015 at 5:05 AM, Christian Borntraeger wrote: > 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

Re: [PATCH v4 0/6] virtio core DMA API conversion

2015-10-30 Thread Christian Borntraeger
Am 30.10.2015 um 02:09 schrieb Andy Lutomirski: > This switches virtio to use the DMA API unconditionally. I'm sure > it breaks things, but it seems to work on x86 using virtio-pci, with > and without Xen, and using both the modern 1.0 variant and the > legacy variant. > > This appears to work

Re: [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-30 Thread Alexander Duyck
On 10/29/2015 07:41 PM, Lan Tianyu wrote: On 2015年10月30日 00:17, Alexander Duyck wrote: On 10/29/2015 01:33 AM, Lan Tianyu wrote: On 2015年10月29日 14:58, Alexander Duyck wrote: Your code was having to do a bunch of shuffling in order to get things set up so that you could bring the interface

[PATCH 5/7] x86: use read wrappers in kernel loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops in the x86 kernel image loading functions with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara --- x86/kvm.c | 35

[PATCH 6/7] arm/arm64: use read_file() in kernel and initrd loading

2015-10-30 Thread Andre Przywara
Use the new read_file() wrapper in our arm/arm64 kernel image loading function instead of the private implementation. Signed-off-by: Andre Przywara --- arm/fdt.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git

[PATCH 7/7] arm: move kernel loading into arm/kvm.c

2015-10-30 Thread Andre Przywara
For some reasons (probably to have easy access to the command line) the kernel loading for arm and arm64 was located in arm/fdt.c. Move the routines to kvm.c (where other architectures put it) to only have real device tree code in fdt.c. We use the pointer in struct kvm to access the command line

[PATCH 1/7] Refactor kernel image loading

2015-10-30 Thread Andre Przywara
Let's face it: Kernel loading is quite architecture specific. Don't claim otherwise and move the loading routines into each architecture's responsibility. This introduces kvm__arch_load_kernel(), which each architecture can implement accordingly. Provide bzImage loading for x86 and ELF loading for

[PATCH 3/7] powerpc: use read_file() in kernel and initrd loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops in the powerpc kernel image loading function with our new and safe read_file() wrapper. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara --- powerpc/kvm.c | 36

[PATCH 4/7] MIPS: use read wrappers in kernel loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops used in the MIPS kernel image loading with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara --- mips/kvm.c | 36

[PATCH 6/7] arm/arm64: use read_file() in kernel and initrd loading

2015-10-30 Thread Andre Przywara
Use the new read_file() wrapper in our arm/arm64 kernel image loading function instead of the private implementation. Signed-off-by: Andre Przywara --- arm/fdt.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git

[PATCH 7/7] arm: move kernel loading into arm/kvm.c

2015-10-30 Thread Andre Przywara
For some reasons (probably to have easy access to the command line) the kernel loading for arm and arm64 was located in arm/fdt.c. Move the routines to kvm.c (where other architectures put it) to only have real device tree code in fdt.c. We use the pointer in struct kvm to access the command line

[PATCH 3/7] powerpc: use read_file() in kernel and initrd loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops in the powerpc kernel image loading function with our new and safe read_file() wrapper. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara --- powerpc/kvm.c | 36

[PATCH 5/7] x86: use read wrappers in kernel loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops in the x86 kernel image loading functions with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara --- x86/kvm.c | 35

[PATCH 0/7] kvmtool: Cleanup kernel loading

2015-10-30 Thread Andre Przywara
Hi, this series cleans up kvmtool's kernel loading functionality a bit. It has been broken out of a previous series I sent [1] and contains just the cleanup and bug fix parts, which should be less controversial and thus easier to merge ;-) I will resend the pipe loading part later on as a

[PATCH 0/7] kvmtool: Cleanup kernel loading

2015-10-30 Thread Andre Przywara
Hi, this series cleans up kvmtool's kernel loading functionality a bit. It has been broken out of a previous series I sent [1] and contains just the cleanup and bug fix parts, which should be less controversial and thus easier to merge ;-) I will resend the pipe loading part later on as a

[PATCH 1/7] Refactor kernel image loading

2015-10-30 Thread Andre Przywara
Let's face it: Kernel loading is quite architecture specific. Don't claim otherwise and move the loading routines into each architecture's responsibility. This introduces kvm__arch_load_kernel(), which each architecture can implement accordingly. Provide bzImage loading for x86 and ELF loading for

[PATCH 4/7] MIPS: use read wrappers in kernel loading

2015-10-30 Thread Andre Przywara
Replace the unsafe read-loops used in the MIPS kernel image loading with our safe read_file() and read_in_full() wrappers. This should fix random fails in kernel image loading, especially from pipes and sockets. Signed-off-by: Andre Przywara --- mips/kvm.c | 36

[PATCH 2/7] provide generic read_file() implementation

2015-10-30 Thread Andre Przywara
In various parts of kvmtool we simply try to read files into memory, but fail to do so in a safe way. The read(2) syscall can return early having only parts of the file read, or it may return -1 due to being interrupted by a signal (in which case we should simply retry). The ARM code seems to

[PATCH 2/7] provide generic read_file() implementation

2015-10-30 Thread Andre Przywara
In various parts of kvmtool we simply try to read files into memory, but fail to do so in a safe way. The read(2) syscall can return early having only parts of the file read, or it may return -1 due to being interrupted by a signal (in which case we should simply retry). The ARM code seems to

<    1   2