Re: gva_to_gpa function internals

2015-12-01 Thread Yacine HEBBAL
In fact, my tool walks through paging data structures (entry by entry) using the function "kvm_read_guest" (sorry i don't have my machine with me right now to poste my code :-( ). for example to read PDPTEs, I do something like this: for(i = 0; i < 32; i= i + 8) { kvm_read_guest(kvm, cr3

Re: gva_to_gpa function internals

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 19:30, Yacine HEBBAL wrote: > Hi all, > I'm trying to build some tools on top of kvm in order to debug, monitor and > reverse engineer the guest OS (ubuntu 12.04, 32 bits) > One of my tools walks through (and prints) the guest paging data structures > as following: cr3 -> pdpte ->

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Daniel Axtens
"Geyslan G. Bem" writes: > The vcpu_book3s struct is assigned but never used. So remove it. Just out of interest, how did you find this? Compiler warning? Static analysis? Manual inspection? Thanks in advance! Regards, Daniel > > Signed-off-by: Geyslan G. Bem

[PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Geyslan G. Bem
The vcpu_book3s struct is assigned but never used. So remove it. Signed-off-by: Geyslan G. Bem --- arch/powerpc/kvm/book3s_64_mmu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu.c b/arch/powerpc/kvm/book3s_64_mmu.c index 774a253..9bf7031

[PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Geyslan G. Bem
The vcpu_book3s struct is assigned but never used. So remove it. Signed-off-by: Geyslan G. Bem --- arch/powerpc/kvm/book3s_64_mmu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu.c b/arch/powerpc/kvm/book3s_64_mmu.c index 774a253..9bf7031

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Daniel Axtens
"Geyslan G. Bem" writes: > The vcpu_book3s struct is assigned but never used. So remove it. Just out of interest, how did you find this? Compiler warning? Static analysis? Manual inspection? Thanks in advance! Regards, Daniel > > Signed-off-by: Geyslan G. Bem

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Geyslan G. Bem
2015-12-01 21:34 GMT-03:00 Daniel Axtens : > "Geyslan G. Bem" writes: > >> The vcpu_book3s struct is assigned but never used. So remove it. > > Just out of interest, how did you find this? Compiler warning? Static > analysis? Manual inspection? Sorry, I should

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Geyslan G. Bem
2015-12-01 21:34 GMT-03:00 Daniel Axtens : > "Geyslan G. Bem" writes: > >> The vcpu_book3s struct is assigned but never used. So remove it. > > Just out of interest, how did you find this? Compiler warning? Static > analysis? Manual inspection? Sorry, I should

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

2015-12-01 Thread Shannon Zhao
On 2015/12/2 0:57, Marc Zyngier wrote: > On 01/12/15 16:26, Shannon Zhao wrote: >> >> >> On 2015/12/1 23:41, Marc Zyngier wrote: The reason is that when guest clear the overflow register, it will trap > to kvm and call kvm_pmu_sync_hwstate() as you see above. At this moment, > the

Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC

2015-12-01 Thread Alexander Duyck
On Tue, Dec 1, 2015 at 7:28 AM, Michael S. Tsirkin wrote: > On Tue, Dec 01, 2015 at 11:04:31PM +0800, Lan, Tianyu wrote: >> >> >> On 12/1/2015 12:07 AM, Alexander Duyck wrote: >> >They can only be corrected if the underlying assumptions are correct >> >and they aren't. Your

Re: [PATCH 00/11] KVM: x86: track guest page access

2015-12-01 Thread Xiao Guangrong
On 12/01/2015 06:17 PM, Paolo Bonzini wrote: On 30/11/2015 19:26, Xiao Guangrong wrote: This patchset introduces the feature which allows us to track page access in guest. Currently, only write access tracking is implemented in this version. Four APIs are introduces: -

KVM with PCI forwarding really slow after 4.1

2015-12-01 Thread Michael Büsch
Hi, I use "-device pci-assign,host=00:1a.0" to forward a USB host chip to a Win7 32 bit inside of qemu/kvm. That used to work pretty well, but it broke horribly somewhere after 4.1. With recent kernels the virtual machine boots, but is _very_ slow. It takes hours to boot. If PCI forwarding is

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

2015-12-01 Thread Marc Zyngier
On 01/12/15 16:26, Shannon Zhao wrote: > > > On 2015/12/1 23:41, Marc Zyngier wrote: >>> The reason is that when guest clear the overflow register, it will trap to kvm and call kvm_pmu_sync_hwstate() as you see above. At this moment, the overflow register is still overflowed(that is

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Richard Henderson
On 11/30/2015 03:18 AM, Paolo Bonzini wrote: Because this is always little endian, I would write it as uint8_t[16][16]. Maybe. That isn't altogether handy for TCG, since we'll be wanting to bswap these buffers (probably in uint64_t chunks). r~ -- To unsubscribe from this list: send the

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Eduardo Habkost
On Tue, Dec 01, 2015 at 09:09:47AM -0800, Richard Henderson wrote: > On 11/30/2015 03:18 AM, Paolo Bonzini wrote: > >Because this is always little endian, I would write it as uint8_t[16][16]. > > Maybe. That isn't altogether handy for TCG, since we'll be wanting to bswap > these buffers

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Richard Henderson
On 12/01/2015 09:15 AM, Eduardo Habkost wrote: On Tue, Dec 01, 2015 at 09:09:47AM -0800, Richard Henderson wrote: On 11/30/2015 03:18 AM, Paolo Bonzini wrote: Because this is always little endian, I would write it as uint8_t[16][16]. Maybe. That isn't altogether handy for TCG, since we'll

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 18:20, Richard Henderson wrote: >> >> X86XSaveArea will be used only when loading/saving state using >> xsave, not for executing regular instructions. > > ... like the regular instruction xsave? > > https://patchwork.ozlabs.org/patch/493318/ Right, but that's a helper anyway.

Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC

2015-12-01 Thread Michael S. Tsirkin
On Tue, Dec 01, 2015 at 09:04:32AM -0800, Alexander Duyck wrote: > On Tue, Dec 1, 2015 at 7:28 AM, Michael S. Tsirkin wrote: > > On Tue, Dec 01, 2015 at 11:04:31PM +0800, Lan, Tianyu wrote: > >> > >> > >> On 12/1/2015 12:07 AM, Alexander Duyck wrote: > >> >They can only be

Re: [PATCH v2 00/21] arm64: KVM: world switch in C

2015-12-01 Thread Marc Zyngier
On 01/12/15 12:00, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 09:58:23AM +, Marc Zyngier wrote: >> On 30/11/15 20:33, Christoffer Dall wrote: >>> On Fri, Nov 27, 2015 at 06:49:54PM +, Marc Zyngier wrote: Once upon a time, the KVM/arm64 world switch was a nice, clean, lean

Re: KVM with PCI forwarding really slow after 4.1

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 18:09, Michael Büsch wrote: > Hi, > > I use "-device pci-assign,host=00:1a.0" to forward a USB host chip > to a Win7 32 bit inside of qemu/kvm. That used to work pretty well, > but it broke horribly somewhere after 4.1. With recent kernels the > virtual machine boots, but is

gva_to_gpa function internals

2015-12-01 Thread Yacine HEBBAL
Hi all, I'm trying to build some tools on top of kvm in order to debug, monitor and reverse engineer the guest OS (ubuntu 12.04, 32 bits) One of my tools walks through (and prints) the guest paging data structures as following: cr3 -> pdpte -> pde -> pte -> page (PAE paging, 32 bits) According to

[PATCH v2 0/5] Add virtio transport for AF_VSOCK

2015-12-01 Thread Stefan Hajnoczi
v2: * Rebased onto Linux v4.4-rc2 * vhost: Refuse to assign reserved CIDs * vhost: Refuse guest CID if already in use * vhost: Only accept correctly addressed packets (no spoofing!) * vhost: Support flexible rx/tx descriptor layout * vhost: Add missing total_tx_buf decrement *

[PATCH v2 3/5] VSOCK: Introduce virtio-vsock.ko

2015-12-01 Thread Stefan Hajnoczi
From: Asias He VM sockets virtio transport implementation. This module runs in guest kernel. Signed-off-by: Asias He Signed-off-by: Stefan Hajnoczi --- v2: * Fix total_tx_buf accounting * Add virtio_transport global mutex to prevent

[PATCH v2 4/5] VSOCK: Introduce vhost-vsock.ko

2015-12-01 Thread Stefan Hajnoczi
From: Asias He VM sockets vhost transport implementation. This module runs in host kernel. Signed-off-by: Asias He Signed-off-by: Stefan Hajnoczi --- v2: * Add missing total_tx_buf decrement * Support flexible rx/tx descriptor layout

[PATCH v2 2/5] VSOCK: Introduce virtio-vsock-common.ko

2015-12-01 Thread Stefan Hajnoczi
From: Asias He This module contains the common code and header files for the following virtio-vsock and virtio-vhost kernel modules. Signed-off-by: Asias He Signed-off-by: Stefan Hajnoczi --- v2: * Fix peer_buf_alloc inheritance on

[PATCH v2 5/5] VSOCK: Add Makefile and Kconfig

2015-12-01 Thread Stefan Hajnoczi
From: Asias He Enable virtio-vsock and vhost-vsock. Signed-off-by: Asias He Signed-off-by: Stefan Hajnoczi --- drivers/vhost/Kconfig | 4 drivers/vhost/Kconfig.vsock | 7 +++ drivers/vhost/Makefile | 4

[PATCH v9 3/5] nvdimm acpi: build ACPI NFIT table

2015-12-01 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 v9 5/5] nvdimm: add maintain info

2015-12-01 Thread Xiao Guangrong
Add NVDIMM maintainer Reviewed-by: Stefan Hajnoczi Signed-off-by: Xiao Guangrong --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bb1f3e4..7e82340 100644 --- a/MAINTAINERS +++

[PATCH v2 1/5] VSOCK: Introduce vsock_find_unbound_socket and vsock_bind_dgram_generic

2015-12-01 Thread Stefan Hajnoczi
From: Asias He Signed-off-by: Asias He Signed-off-by: Stefan Hajnoczi --- include/net/af_vsock.h | 2 ++ net/vmw_vsock/af_vsock.c | 70 2 files changed, 72 insertions(+) diff --git

[PATCH v9 1/5] nvdimm: implement NVDIMM device abstract

2015-12-01 Thread Xiao Guangrong
Introduce "nvdimm" device which is based on pc-dimm device type Currently, nothing is specific for nvdimm but hotplug is disabled Reviewed-by: Stefan Hajnoczi Signed-off-by: Xiao Guangrong --- default-configs/i386-softmmu.mak | 1 +

[PATCH v9 0/5] implement vNVDIMM

2015-12-01 Thread Xiao Guangrong
This patchset can be found at: https://github.com/xiaogr/qemu.git nvdimm-v9 It is based on pci branch on Michael's tree and the top commit is: commit 0c73277af7 (vhost-user-test: fix crash with glib < 2.36). Changelog in v9: - the changes address Michael's comments: 1) move the control

[PATCH v9 2/5] acpi: support specified oem table id for build_header

2015-12-01 Thread Xiao Guangrong
Let build_header() support specified OEM table id so that we can build multiple SSDT later If the oem table id is not specified (aka, NULL), we use the default id instead as the previous behavior Reviewed-by: Stefan Hajnoczi Signed-off-by: Xiao Guangrong

[PATCH v9 4/5] nvdimm acpi: build ACPI nvdimm devices

2015-12-01 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 Currently, we do not support any function on _DSM,

Re: [PATCH net-next 3/3] vhost_net: basic polling support

2015-12-01 Thread Jason Wang
On 12/01/2015 10:43 PM, Michael S. Tsirkin wrote: > On Tue, Dec 01, 2015 at 01:17:49PM +0800, Jason Wang wrote: >> >> On 11/30/2015 06:44 PM, Michael S. Tsirkin wrote: >>> On Wed, Nov 25, 2015 at 03:11:29PM +0800, Jason Wang wrote: > This patch tries to poll for new added tx buffer or socket

Re: [PATCH v2 09/21] arm64: KVM: Implement guest entry

2015-12-01 Thread Marc Zyngier
On 01/12/15 15:29, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:03PM +, Marc Zyngier wrote: >> Contrary to the previous patch, the guest entry is fairly different >> from its assembly counterpart, mostly because it is only concerned >> with saving/restoring the GP registers, and

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Eduardo Habkost
On Tue, Dec 01, 2015 at 06:27:17PM +0100, Paolo Bonzini wrote: > On 01/12/2015 18:20, Richard Henderson wrote: > >> > >> X86XSaveArea will be used only when loading/saving state using > >> xsave, not for executing regular instructions. > > > > ... like the regular instruction xsave? > > > >

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Marc Zyngier
On 01/12/15 15:41, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 03:01:16PM +, Marc Zyngier wrote: >> On 01/12/15 14:47, Christoffer Dall wrote: >>> On Tue, Dec 01, 2015 at 01:06:31PM +, Marc Zyngier wrote: On 01/12/15 12:56, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at

Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC

2015-12-01 Thread Alexander Duyck
On Tue, Dec 1, 2015 at 9:37 AM, Michael S. Tsirkin wrote: > On Tue, Dec 01, 2015 at 09:04:32AM -0800, Alexander Duyck wrote: >> On Tue, Dec 1, 2015 at 7:28 AM, Michael S. Tsirkin wrote: >> > There are several components to this: >> > - dma_map_* needs to

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Richard Henderson
On 12/01/2015 10:34 AM, Eduardo Habkost wrote: BTW, if we are going to implement xsave in TCG, the X86CPU<->xsave translation logic in kvm_{get,put}_xsave() could be moved to generic code and reused by TCG instead of being reimplemented. That's not trivial. In particular, stq_p isn't what the

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-01 Thread Marc Zyngier
On 01/12/15 15:39, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: >> KVM so far relies on code patching, and is likely to use it more >> in the future. The main issue is that our alternative system works >> at the instruction level, while we'd like to have

Re: [PATCH v2 00/21] arm64: KVM: world switch in C

2015-12-01 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 05:51:46PM +, Marc Zyngier wrote: > On 01/12/15 12:00, Christoffer Dall wrote: > > On Tue, Dec 01, 2015 at 09:58:23AM +, Marc Zyngier wrote: > >> On 30/11/15 20:33, Christoffer Dall wrote: > >>> On Fri, Nov 27, 2015 at 06:49:54PM +, Marc Zyngier wrote: >

Re: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-01 Thread Marc Zyngier
On 01/12/15 07:24, Pavel Fedin wrote: > Hello! > > My project involves ARM64, but from time to time i also test ARM32 > KVM. I have discovered that it stopped working in 4.4-rc3. The same > virtual machine works perfectly under current kvmarm/next, but gets > stuck at random point under 4.4-rc3

Re: best way to create a snapshot of a running vm ?

2015-12-01 Thread Stefan Hajnoczi
On Mon, Nov 30, 2015 at 04:34:14PM +0100, Lentes, Bernd wrote: > Stefan wrote: > > > > > Hi Bernd, > > qemu-img cannot be used on the disk image when the VM is running. > > Please use virsh, it communicates with the running QEMU process and > > ensures that the snapshot is crash-consistent. > >

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

2015-12-01 Thread Marc Zyngier
On 01/12/15 01:51, Shannon Zhao wrote: > Hi Marc, > > On 2015/12/1 1:56, Marc Zyngier wrote: >> Same remark here as the one I made earlier. I'm pretty sure we don't >> call any CP15 reset because they are all shared with their 64bit >> counterparts. The same thing goes for the whole series. > Ok,

RE: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-01 Thread Pavel Fedin
Hello! > The same kernel is used both as a guest and a host with v4.4-rc3. > > So until you bisect it to an exact commit and configuration, I declare > the alert over. ;-) By this time i have also tried it on another machine, and there it also works. Looks like it's triggered only on some

Re: [PATCH v2 00/21] arm64: KVM: world switch in C

2015-12-01 Thread Marc Zyngier
On 30/11/15 20:33, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:49:54PM +, Marc Zyngier wrote: >> Once upon a time, the KVM/arm64 world switch was a nice, clean, lean >> and mean piece of hand-crafted assembly code. Over time, features have >> crept in, the code has become harder to

RE: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-01 Thread Pavel Fedin
Hello! > > My project involves ARM64, but from time to time i also test ARM32 > > KVM. I have discovered that it stopped working in 4.4-rc3. The same > > virtual machine works perfectly under current kvmarm/next, but gets > > stuck at random point under 4.4-rc3 from linux-stable. I'm not sure >

Re: [PATCH v1 0/7] KVM: Hyper-V SynIC timers

2015-12-01 Thread Wanpeng Li
2015-11-26 16:34 GMT+08:00 Andrey Smetanin : > > > On 11/26/2015 08:28 AM, Wanpeng Li wrote: >> >> 2015-11-25 23:20 GMT+08:00 Andrey Smetanin : >>> >>> Per Hyper-V specification (and as required by Hyper-V-aware guests), >>> SynIC provides 4

Re: [PATCH 00/11] KVM: x86: track guest page access

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 19:26, Xiao Guangrong wrote: > This patchset introduces the feature which allows us to track page > access in guest. Currently, only write access tracking is implemented > in this version. > > Four APIs are introduces: > - kvm_page_track_add_page(kvm, gfn, mode), single guest page

[PATCH 3/3] KVM: arm/arm64: Decouple virtual timer from vGIC

2015-12-01 Thread Pavel Fedin
Remove dependency on vgic_initialized() and use the newly introduced infrastructure to send interrupts via the userspace if vGIC is not being used. Signed-off-by: Pavel Fedin --- arch/arm/kvm/arm.c| 8 +--- virt/kvm/arm/arch_timer.c | 23 +--

[PATCH 2/3] KVM: Documentation: Document KVM_EXIT_IRQ

2015-12-01 Thread Pavel Fedin
Add documentation for the new exit code. Signed-off-by: Pavel Fedin --- Documentation/virtual/kvm/api.txt | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 092ee9f..d8aae4c 100644

[PATCH 1/3] KVM: Introduce KVM_EXIT_IRQ

2015-12-01 Thread Pavel Fedin
This exit code means that this vCPU wants to inject an interrupt using userspace-emulated controller. IRQs are signalled by adding pending interrupt descriptors to vcpu structure. For simplicity, we currently reserve only one pointer for a single interrupt, which will be used by ARM virtual timer

[PATCH 0/3] Add support for handling IRQs in userspace

2015-12-01 Thread Pavel Fedin
This patch series introduces ability to handle IRQs in userspace. This is currently necessary for ARM KVM in order to be able to use virtual CP15 timer without in-kernel irqchip. This allows to use KVM on machines with either broken vGIC or custom interrupt controller, like Raspberry Pi 2. The

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 18:34, Eduardo Habkost wrote: > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > uses offset macros and bit manipulation to access the xsave area. > This series changes both to use C structs for

Re: [PATCH v1 0/7] KVM: Hyper-V SynIC timers

2015-12-01 Thread Denis V. Lunev
On 12/01/2015 01:12 PM, Wanpeng Li wrote: 2015-11-26 16:34 GMT+08:00 Andrey Smetanin : On 11/26/2015 08:28 AM, Wanpeng Li wrote: 2015-11-25 23:20 GMT+08:00 Andrey Smetanin : Per Hyper-V specification (and as required by Hyper-V-aware guests),

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 18:34, Eduardo Habkost wrote: > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > uses offset macros and bit manipulation to access the xsave area. > This series changes both to use C structs for

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

2015-12-01 Thread Shannon Zhao
On 2015/12/1 22:50, Marc Zyngier wrote: On 01/12/15 14:35, Shannon Zhao wrote: On 2015/12/1 2:22, Marc Zyngier wrote: On Fri, 30 Oct 2015 14:22:00 +0800 Shannon Zhao wrote: From: Shannon Zhao When calling

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Eduardo Habkost
On Tue, Dec 01, 2015 at 11:22:31AM +0100, Paolo Bonzini wrote: > On 30/11/2015 18:34, Eduardo Habkost wrote: > > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > > uses offset macros and bit manipulation to

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 16:25, Eduardo Habkost wrote: > > I think it's easier to use small guests (i.e. kvm-unit-tests) to test > > this code. > > I agree it's easier, but how likely it is to catch bugs in the > save/load code? If the code corrupts a register, we need to > trigger a save/load cycle at the

Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC

2015-12-01 Thread Michael S. Tsirkin
On Tue, Dec 01, 2015 at 11:04:31PM +0800, Lan, Tianyu wrote: > > > On 12/1/2015 12:07 AM, Alexander Duyck wrote: > >They can only be corrected if the underlying assumptions are correct > >and they aren't. Your solution would have never worked correctly. > >The problem is you assume you can keep

Re: [PATCH v2 09/21] arm64: KVM: Implement guest entry

2015-12-01 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:03PM +, Marc Zyngier wrote: > Contrary to the previous patch, the guest entry is fairly different > from its assembly counterpart, mostly because it is only concerned > with saving/restoring the GP registers, and nothing else. > > Signed-off-by: Marc Zyngier

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Eduardo Habkost
On Tue, Dec 01, 2015 at 04:09:44PM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 18:34, Eduardo Habkost wrote: > > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > > uses offset macros and bit manipulation

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-01 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: > KVM so far relies on code patching, and is likely to use it more > in the future. The main issue is that our alternative system works > at the instruction level, while we'd like to have alternatives at > the function level. > > In

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 03:01:16PM +, Marc Zyngier wrote: > On 01/12/15 14:47, Christoffer Dall wrote: > > On Tue, Dec 01, 2015 at 01:06:31PM +, Marc Zyngier wrote: > >> On 01/12/15 12:56, Christoffer Dall wrote: > >>> On Fri, Nov 27, 2015 at 06:50:02PM +, Marc Zyngier wrote: >

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

2015-12-01 Thread Marc Zyngier
On 01/12/15 15:13, Shannon Zhao wrote: > > > On 2015/12/1 22:50, Marc Zyngier wrote: >> On 01/12/15 14:35, Shannon Zhao wrote: >>> >>> >>> On 2015/12/1 2:22, Marc Zyngier wrote: On Fri, 30 Oct 2015 14:22:00 +0800 Shannon Zhao wrote: > From: Shannon

Re: [PATCH v2 07/21] arm64: KVM: Implement 32bit system register save/restore

2015-12-01 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:01PM +, Marc Zyngier wrote: > Implement the 32bit system register save restore as a direct > translation of the assembly code version. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/hyp.h | 2 ++ >

Re: [PATCH v2 06/21] arm64: KVM: Implement system register save/restore

2015-12-01 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:00PM +, Marc Zyngier wrote: > Implement the system registe save restore as a direct translation of nit: s/registe/register/ > the assembly code version. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/Makefile| 1 + >

Re: [PATCH v2 11/21] arm64: KVM: Implement the core world switch

2015-12-01 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:05PM +, Marc Zyngier wrote: > Implement the core of the world switch in C. Not everything is there > yet, and there is nothing to re-enter the world switch either. > > But this already outlines the code structure well enough. > > Signed-off-by: Marc Zyngier

Re: [PATCH v5 2/2] KVM: Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 15:38, Cornelia Huck wrote: > It obviously > requires an irqchip; but if you need some configuration/enablement > beforehand, you'll get different values depending on when you retrieve > the cap. So does KVM_CAP_IRQFD mean "irqfds are available in principle" > or "everything has

[PATCH v6] arm/arm64: KVM: Detect vGIC presence at runtime

2015-12-01 Thread Pavel Fedin
Before commit 662d9715840aef44dcb573b0f9fab9e8319c868a ("arm/arm64: KVM: Kill CONFIG_KVM_ARM_{VGIC,TIMER}") is was possible to compile the kernel without vGIC and vTimer support. Commit message says about possibility to detect vGIC support in runtime, but this has never been implemented. This

Re: [PATCH v2 05/21] arm64: KVM: Implement timer save/restore

2015-12-01 Thread Marc Zyngier
On 30/11/15 19:59, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:49:59PM +, Marc Zyngier wrote: >> Implement the timer save restore as a direct translation of >> the assembly code version. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/kvm/hyp/Makefile

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

2015-12-01 Thread Shannon Zhao
On 2015/12/1 16:49, Marc Zyngier wrote: > On 01/12/15 01:51, Shannon Zhao wrote: >> Hi Marc, >> >> On 2015/12/1 1:56, Marc Zyngier wrote: >>> Same remark here as the one I made earlier. I'm pretty sure we don't >>> call any CP15 reset because they are all shared with their 64bit >>>

Re: [PATCH v2 03/21] arm64: KVM: Implement vgic-v2 save/restore

2015-12-01 Thread Marc Zyngier
On 30/11/15 20:00, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:49:57PM +, Marc Zyngier wrote: >> Implement the vgic-v2 save restore (mostly) as a direct translation >> of the assembly code version. >> >> Signed-off-by: Marc Zyngier >> --- >>

Re: [PATCH v2 04/21] arm64: KVM: Implement vgic-v3 save/restore

2015-12-01 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 12:44:26PM +0100, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 11:32:20AM +, Marc Zyngier wrote: > > On 30/11/15 19:50, Christoffer Dall wrote: > > > On Fri, Nov 27, 2015 at 06:49:58PM +, Marc Zyngier wrote: > > >> Implement the vgic-v3 save restore as a direct

Re: [PATCH v2 04/21] arm64: KVM: Implement vgic-v3 save/restore

2015-12-01 Thread Marc Zyngier
On 01/12/15 11:50, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 12:44:26PM +0100, Christoffer Dall wrote: >> On Tue, Dec 01, 2015 at 11:32:20AM +, Marc Zyngier wrote: >>> On 30/11/15 19:50, Christoffer Dall wrote: On Fri, Nov 27, 2015 at 06:49:58PM +, Marc Zyngier wrote: >

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Marc Zyngier
On 01/12/15 12:56, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:02PM +, Marc Zyngier wrote: >> Implement the debug save restore as a direct translation of >> the assembly code version. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/kvm/hyp/Makefile

Re: [PATCH v2 04/21] arm64: KVM: Implement vgic-v3 save/restore

2015-12-01 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 11:32:20AM +, Marc Zyngier wrote: > On 30/11/15 19:50, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:49:58PM +, Marc Zyngier wrote: > >> Implement the vgic-v3 save restore as a direct translation of > >> the assembly code version. > >> > >> Signed-off-by:

Re: [PATCH v2 04/21] arm64: KVM: Implement vgic-v3 save/restore

2015-12-01 Thread Marc Zyngier
On 01/12/15 12:24, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 11:57:16AM +, Marc Zyngier wrote: >> On 01/12/15 11:50, Christoffer Dall wrote: >>> On Tue, Dec 01, 2015 at 12:44:26PM +0100, Christoffer Dall wrote: On Tue, Dec 01, 2015 at 11:32:20AM +, Marc Zyngier wrote: > On

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:02PM +, Marc Zyngier wrote: > Implement the debug save restore as a direct translation of > the assembly code version. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/Makefile | 1 + > arch/arm64/kvm/hyp/debug-sr.c | 130 >

[PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-01 Thread Pavel Fedin
This function takes stage-II physical addresses (A.K.A. IPA), on input, not real physical addresses. This causes kvm_is_device_pfn() to return wrong values, depending on how much guest and host memory maps match. This results in completely broken KVM on some boards. The problem has been caught on

RE: [PATCH v5 2/2] KVM: Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-12-01 Thread Pavel Fedin
Hello! > > b) I simply drop it as it is, because current qemu knows about the > > dependency and does not > try to use irqfd without irqchip, > > because there's simply no use for them. But, well, perhaps there would be > > an exception in > vhost, i don't remember testing it. > > Wouldn't

Re: [PATCH v2 00/21] arm64: KVM: world switch in C

2015-12-01 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 09:58:23AM +, Marc Zyngier wrote: > On 30/11/15 20:33, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:49:54PM +, Marc Zyngier wrote: > >> Once upon a time, the KVM/arm64 world switch was a nice, clean, lean > >> and mean piece of hand-crafted assembly code.

Re: [PATCH v2 04/21] arm64: KVM: Implement vgic-v3 save/restore

2015-12-01 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 11:57:16AM +, Marc Zyngier wrote: > On 01/12/15 11:50, Christoffer Dall wrote: > > On Tue, Dec 01, 2015 at 12:44:26PM +0100, Christoffer Dall wrote: > >> On Tue, Dec 01, 2015 at 11:32:20AM +, Marc Zyngier wrote: > >>> On 30/11/15 19:50, Christoffer Dall wrote: >

Re: [PATCH v2 04/21] arm64: KVM: Implement vgic-v3 save/restore

2015-12-01 Thread Marc Zyngier
On 30/11/15 19:50, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:49:58PM +, Marc Zyngier wrote: >> Implement the vgic-v3 save restore as a direct translation of >> the assembly code version. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/kvm/hyp/Makefile

Re: [PATCH v2 02/21] arm64: KVM: Add a HYP-specific header file

2015-12-01 Thread Marc Zyngier
On 30/11/15 20:00, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:49:56PM +, Marc Zyngier wrote: >> In order to expose the various EL2 services that are private to >> the hypervisor, add a new hyp.h file. >> >> So far, it only contains mundane things such as section annotation >> and VA

Re: [PATCH v2 02/21] arm64: KVM: Add a HYP-specific header file

2015-12-01 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 11:41:08AM +, Marc Zyngier wrote: > On 30/11/15 20:00, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:49:56PM +, Marc Zyngier wrote: > >> In order to expose the various EL2 services that are private to > >> the hypervisor, add a new hyp.h file. > >> > >> So

Re: [PATCH v2 04/21] arm64: KVM: Implement vgic-v3 save/restore

2015-12-01 Thread Marc Zyngier
On 01/12/15 11:44, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 11:32:20AM +, Marc Zyngier wrote: >> On 30/11/15 19:50, Christoffer Dall wrote: >>> On Fri, Nov 27, 2015 at 06:49:58PM +, Marc Zyngier wrote: Implement the vgic-v3 save restore as a direct translation of the

RE: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-01 Thread Pavel Fedin
Hello! > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Pavel Fedin > Sent: Tuesday, December 01, 2015 1:03 PM > To: 'Marc Zyngier'; kvm...@lists.cs.columbia.edu; kvm@vger.kernel.org > Cc: 'Ard Biesheuvel';

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 01:06:31PM +, Marc Zyngier wrote: > On 01/12/15 12:56, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:50:02PM +, Marc Zyngier wrote: > >> Implement the debug save restore as a direct translation of > >> the assembly code version. > >> > >> Signed-off-by:

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 03:47:37PM +0100, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 01:06:31PM +, Marc Zyngier wrote: > > On 01/12/15 12:56, Christoffer Dall wrote: > > > On Fri, Nov 27, 2015 at 06:50:02PM +, Marc Zyngier wrote: > > >> Implement the debug save restore as a direct

Re: [PATCH 00/11] KVM: x86: track guest page access

2015-12-01 Thread Andrea Arcangeli
On Tue, Dec 01, 2015 at 11:17:30AM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 19:26, Xiao Guangrong wrote: > > This patchset introduces the feature which allows us to track page > > access in guest. Currently, only write access tracking is implemented > > in this version. > > > > Four APIs

Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC

2015-12-01 Thread Lan, Tianyu
On 12/1/2015 12:07 AM, Alexander Duyck wrote: They can only be corrected if the underlying assumptions are correct and they aren't. Your solution would have never worked correctly. The problem is you assume you can keep the device running when you are migrating and you simply cannot. At some

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

2015-12-01 Thread Shannon Zhao
On 2015/12/1 2:22, Marc Zyngier wrote: > On Fri, 30 Oct 2015 14:22:00 +0800 > Shannon Zhao wrote: > >> From: Shannon Zhao >> >> When calling perf_event_create_kernel_counter to create perf_event, >> assign a overflow handler. Then when perf

Re: [PATCH net-next 3/3] vhost_net: basic polling support

2015-12-01 Thread Michael S. Tsirkin
On Tue, Dec 01, 2015 at 01:17:49PM +0800, Jason Wang wrote: > > > On 11/30/2015 06:44 PM, Michael S. Tsirkin wrote: > > On Wed, Nov 25, 2015 at 03:11:29PM +0800, Jason Wang wrote: > >> > This patch tries to poll for new added tx buffer or socket receive > >> > queue for a while at the end of

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

2015-12-01 Thread Marc Zyngier
On 01/12/15 14:35, Shannon Zhao wrote: > > > On 2015/12/1 2:22, Marc Zyngier wrote: >> On Fri, 30 Oct 2015 14:22:00 +0800 >> Shannon Zhao wrote: >> >>> From: Shannon Zhao >>> >>> When calling perf_event_create_kernel_counter to create

Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

2015-12-01 Thread Michael S. Tsirkin
On Tue, Dec 01, 2015 at 02:26:57PM +0800, Lan, Tianyu wrote: > > > On 11/30/2015 4:01 PM, Michael S. Tsirkin wrote: > >It is still not very clear what it is you are trying to achieve, and > >whether your patchset achieves it. You merely say "adding live > >migration" but it seems pretty clear

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Marc Zyngier
On 01/12/15 14:47, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 01:06:31PM +, Marc Zyngier wrote: >> On 01/12/15 12:56, Christoffer Dall wrote: >>> On Fri, Nov 27, 2015 at 06:50:02PM +, Marc Zyngier wrote: Implement the debug save restore as a direct translation of the

Re: [PATCH 00/11] KVM: x86: track guest page access

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 16:02, Andrea Arcangeli wrote: > > Applying your technique to non-leaf shadow pages actually makes this > > series quite interesting. :) Shadow paging is still in use for nested > > EPT, so it's always a good idea to speed it up. > > I don't have the full picture of how

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Alex Bennée
Marc Zyngier writes: > On 01/12/15 12:56, Christoffer Dall wrote: >> On Fri, Nov 27, 2015 at 06:50:02PM +, Marc Zyngier wrote: >>> Implement the debug save restore as a direct translation of >>> the assembly code version. >>> >>> Signed-off-by: Marc Zyngier

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Marc Zyngier
On 01/12/15 13:19, Alex Bennée wrote: > > Marc Zyngier writes: > >> On 01/12/15 12:56, Christoffer Dall wrote: >>> On Fri, Nov 27, 2015 at 06:50:02PM +, Marc Zyngier wrote: Implement the debug save restore as a direct translation of the assembly code version.

  1   2   >