Re: [PATCH] KVM: MMU: fix check the reserved bits on the gpte of L2

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 12:59:19PM +0800, Xiao Guangrong wrote: Current code always uses arch.mmu to check the reserved bits on guest gpte which is valid only for L1 guest, we should use arch.nested_mmu instead when we translate gva to gpa for the L2 guest Fix it by using @mmu instead since

RE: [PATCH] KVM: nVMX: correctly set tr base on nested vmexit emulation

2013-08-05 Thread Ren, Yongjie
-Original Message- From: Gleb Natapov [mailto:g...@redhat.com] Sent: Sunday, August 04, 2013 8:08 PM To: kvm@vger.kernel.org Cc: Ren, Yongjie; pbonz...@redhat.com; yzt...@gmail.com Subject: [PATCH] KVM: nVMX: correctly set tr base on nested vmexit emulation After commit

Re: [PATCH] nVMX: Keep arch.pat in sync on L1-L2 switches

2013-08-05 Thread Jan Kiszka
On 2013-08-05 04:19, Arthur Chunqi Li wrote: On Sun, Aug 4, 2013 at 11:17 PM, Jan Kiszka jan.kis...@web.de wrote: From: Jan Kiszka jan.kis...@siemens.com When asking vmx to load the PAT MSR for us while switching from L1 to L2 or vice versa, we have to update arch.pat as well as it may later

Re: [PATCH 6/7] KVM: nVMX: Implement support for EFER saving on VM-exit

2013-08-05 Thread Arthur Chunqi Li
On Mon, Aug 5, 2013 at 1:49 AM, Jan Kiszka jan.kis...@web.de wrote: From: Jan Kiszka jan.kis...@siemens.com Implement and advertise VM_EXIT_SAVE_IA32_EFER. L0 traps EFER writes unconditionally, so we always find the current L2 value in the architectural state. Signed-off-by: Jan Kiszka

Re: [PATCH 6/7] KVM: nVMX: Implement support for EFER saving on VM-exit

2013-08-05 Thread Jan Kiszka
On 2013-08-05 09:21, Arthur Chunqi Li wrote: On Mon, Aug 5, 2013 at 1:49 AM, Jan Kiszka jan.kis...@web.de wrote: From: Jan Kiszka jan.kis...@siemens.com Implement and advertise VM_EXIT_SAVE_IA32_EFER. L0 traps EFER writes unconditionally, so we always find the current L2 value in the

[PATCH v7 01/15] nEPT: Support LOAD_IA32_EFER entry/exit controls for L1

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com Recent KVM, since http://kerneltrap.org/mailarchive/linux-kvm/2010/5/2/6261577 switch the EFER MSR when EPT is used and the host and guest have different NX bits. So if we add support for nested EPT (L1 guest using EPT to run L2) and want to be able to run

[PATCH v7 04/15] nEPT: Move common code to paging_tmpl.h

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com For preparation, we just move gpte_access(), prefetch_invalid_gpte(), s_rsvd_bits_set(), protect_clean_gpte() and is_dirty_gpte() from mmu.c to paging_tmpl.h. Reviewed-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Signed-off-by: Nadav Har'El

[PATCH v7 12/15] nEPT: Nested INVEPT

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com If we let L1 use EPT, we should probably also support the INVEPT instruction. In our current nested EPT implementation, when L1 changes its EPT table for L2 (i.e., EPT12), L0 modifies the shadow EPT table (EPT02), and in the course of this modification already

[PATCH v7 03/15] nEPT: Fix wrong test in kvm_set_cr3

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com kvm_set_cr3() attempts to check if the new cr3 is a valid guest physical address. The problem is that with nested EPT, cr3 is an *L2* physical address, not an L1 physical address as this test expects. As the comment above this test explains, it isn't necessary,

[PATCH v7 09/15] nEPT: correctly check if remote tlb flush is needed for shadowed EPT tables

2013-08-05 Thread Gleb Natapov
need_remote_flush() assumes that shadow page is in PT64 format, but with addition of nested EPT this is no longer always true. Fix it by bits definitions that depend on host shadow page type. Reported-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Reviewed-by: Xiao Guangrong

[PATCH v7 11/15] nEPT: MMU context for nested EPT

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com KVM's existing shadow MMU code already supports nested TDP. To use it, we need to set up a new MMU context for nested EPT, and create a few callbacks for it (nested_ept_*()). This context should also use the EPT versions of the page table access functions

[PATCH v7 02/15] nEPT: Fix cr3 handling in nested exit and entry

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com The existing code for handling cr3 and related VMCS fields during nested exit and entry wasn't correct in all cases: If L2 is allowed to control cr3 (and this is indeed the case in nested EPT), during nested exit we must copy the modified cr3 from vmcs02 to

[PATCH v7 10/15] nEPT: Add nEPT violation/misconfigration support

2013-08-05 Thread Gleb Natapov
From: Yang Zhang yang.z.zh...@intel.com Inject nEPT fault to L1 guest. This patch is original from Xinhao. Reviewed-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Signed-off-by: Jun Nakajima jun.nakaj...@intel.com Signed-off-by: Xinhao Xu xinhao...@intel.com Signed-off-by: Yang Zhang

[PATCH v7 15/15] nEPT: Miscelleneous cleanups

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com Some trivial code cleanups not really related to nested EPT. Reviewed-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Signed-off-by: Nadav Har'El n...@il.ibm.com Signed-off-by: Jun Nakajima jun.nakaj...@intel.com Signed-off-by: Xinhao Xu xinhao...@intel.com

[PATCH v7 06/15] nEPT: Support shadow paging for guest paging without A/D bits

2013-08-05 Thread Gleb Natapov
Some guest paging modes do not support A/D bits. Add support for such modes in shadow page code. For such modes PT_GUEST_DIRTY_MASK, PT_GUEST_ACCESSED_MASK, PT_GUEST_DIRTY_SHIFT and PT_GUEST_ACCESSED_SHIFT should be set to zero. Reviewed-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com

[PATCH v7 13/15] nEPT: Advertise EPT to L1

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com Advertise the support of EPT to the L1 guest, through the appropriate MSR. This is the last patch of the basic Nested EPT feature, so as to allow bisection through this patch series: The guest will not see EPT support until this last patch, and will not attempt

[PATCH v7 00/15] Nested EPT

2013-08-05 Thread Gleb Natapov
Xiao comment about checking ept pointer before flushing individual ept context is addressed here. Gleb Natapov (3): nEPT: make guest's A/D bits depends on guest's paging mode nEPT: Support shadow paging for guest paging without A/D bits nEPT: correctly check if remote tlb flush is needed

[PATCH v7 05/15] nEPT: make guest's A/D bits depends on guest's paging mode

2013-08-05 Thread Gleb Natapov
This patch makes guest A/D bits definition to be dependable on paging mode, so when EPT support will be added it will be able to define them differently. Reviewed-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/paging_tmpl.h | 30

[PATCH v7 08/15] nEPT: Redefine EPT-specific link_shadow_page()

2013-08-05 Thread Gleb Natapov
From: Yang Zhang yang.z.zh...@intel.com Since nEPT doesn't support A/D bit, so we should not set those bit when build shadow page table. Reviewed-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Signed-off-by: Yang Zhang yang.z.zh...@intel.com Signed-off-by: Gleb Natapov g...@redhat.com ---

[PATCH v7 07/15] nEPT: Add EPT tables support to paging_tmpl.h

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com This is the first patch in a series which adds nested EPT support to KVM's nested VMX. Nested EPT means emulating EPT for an L1 guest so that L1 can use EPT when running a nested guest L2. When L1 uses EPT, it allows the L2 guest to set its own cr3 and take its

[PATCH v7 14/15] nEPT: Some additional comments

2013-08-05 Thread Gleb Natapov
From: Nadav Har'El n...@il.ibm.com Some additional comments to preexisting code: Explain who (L0 or L1) handles EPT violation and misconfiguration exits. Don't mention shadow on either EPT or shadow as the only two options. Reviewed-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com

Re: [PATCH] kvm-unit-tests: VMX: Fix confused definition of rflags

2013-08-05 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 11:41:00PM +0800, Arthur Chunqi Li wrote: Change rflags in struct regs to host_rflags. Remove settings to GUEST_RFLAGS since GUEST_RFLAGS can be set by vmwrite. Treat host_rflags as host rflags before and after vmenter. I am not sure the change is for the better.

RE: [Qemu-devel] vm performance degradation after kvm live migration or save-restore with EPT enabled

2013-08-05 Thread Zhanghaoyu (A)
hi all, I met similar problem to these, while performing live migration or save-restore test on the kvm platform (qemu:1.4.0, host:suse11sp2, guest:suse11sp2), running tele-communication software suite in guest,

Re: [PATCH] nVMX: Keep arch.pat in sync on L1-L2 switches

2013-08-05 Thread Gleb Natapov
On Sun, Aug 04, 2013 at 05:17:27PM +0200, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com When asking vmx to load the PAT MSR for us while switching from L1 to L2 or vice versa, we have to update arch.pat as well as it may later be used again to load or read out the MSR content.

Re: [Qemu-devel] vm performance degradation after kvm live migration or save-restore with EPT enabled

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 08:35:09AM +, Zhanghaoyu (A) wrote: hi all, I met similar problem to these, while performing live migration or save-restore test on the kvm platform (qemu:1.4.0, host:suse11sp2, guest:suse11sp2), running tele-communication software suite in

Re: [PATCH] kvm-unit-tests: VMX: Fix confused definition of rflags

2013-08-05 Thread Arthur Chunqi Li
On Mon, Aug 5, 2013 at 4:29 PM, Gleb Natapov g...@redhat.com wrote: On Tue, Jul 30, 2013 at 11:41:00PM +0800, Arthur Chunqi Li wrote: Change rflags in struct regs to host_rflags. Remove settings to GUEST_RFLAGS since GUEST_RFLAGS can be set by vmwrite. Treat host_rflags as host rflags before

Re: [PATCH v7 12/15] nEPT: Nested INVEPT

2013-08-05 Thread Xiao Guangrong
On 08/05/2013 04:07 PM, Gleb Natapov wrote: From: Nadav Har'El n...@il.ibm.com If we let L1 use EPT, we should probably also support the INVEPT instruction. In our current nested EPT implementation, when L1 changes its EPT table for L2 (i.e., EPT12), L0 modifies the shadow EPT table

[PATCH] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Arthur Chunqi Li
Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- arch/x86/kvm/vmx.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 45fd70c..240f0db 100644 ---

RE: [Qemu-devel] vm performance degradation after kvm live migration or save-restore with EPT enabled

2013-08-05 Thread Zhanghaoyu (A)
hi all, I met similar problem to these, while performing live migration or save-restore test on the kvm platform (qemu:1.4.0, host:suse11sp2, guest:suse11sp2), running tele-communication software suite in guest,

Re: [PATCH] kvm-unit-tests: VMX: Fix confused definition of rflags

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 04:48:47PM +0800, Arthur Chunqi Li wrote: On Mon, Aug 5, 2013 at 4:29 PM, Gleb Natapov g...@redhat.com wrote: On Tue, Jul 30, 2013 at 11:41:00PM +0800, Arthur Chunqi Li wrote: Change rflags in struct regs to host_rflags. Remove settings to GUEST_RFLAGS since

Re: [Qemu-devel] vm performance degradation after kvm live migration or save-restore with EPT enabled

2013-08-05 Thread Andreas Färber
Hi, Am 05.08.2013 11:09, schrieb Zhanghaoyu (A): When I build the upstream, encounter a problem that I compile and install the upstream(commit: e769ece3b129698d2b09811a6f6d304e4eaa8c29) on sles11sp2 environment via below command cp /boot/config-3.0.13-0.27-default ./.config yes | make

RE: [Qemu-devel] vm performance degradation after kvm live migration or save-restore with EPT enabled

2013-08-05 Thread Zhanghaoyu (A)
Hi, Am 05.08.2013 11:09, schrieb Zhanghaoyu (A): When I build the upstream, encounter a problem that I compile and install the upstream(commit: e769ece3b129698d2b09811a6f6d304e4eaa8c29) on sles11sp2 environment via below command cp /boot/config-3.0.13-0.27-default ./.config yes | make

Re: [PATCH] kvm-unit-tests: VMX: Fix confused definition of rflags

2013-08-05 Thread Gmail
在 2013-8-5,17:10,Gleb Natapov g...@redhat.com 写道: On Mon, Aug 05, 2013 at 04:48:47PM +0800, Arthur Chunqi Li wrote: On Mon, Aug 5, 2013 at 4:29 PM, Gleb Natapov g...@redhat.com wrote: On Tue, Jul 30, 2013 at 11:41:00PM +0800, Arthur Chunqi Li wrote: Change rflags in struct regs to

Re: [PATCH] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 05:10:35PM +0800, Arthur Chunqi Li wrote: Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- arch/x86/kvm/vmx.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c

Re: [PATCH] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Gmail
On Mon, Aug 05, 2013 at 05:10:35PM +0800, Arthur Chunqi Li wrote: Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- arch/x86/kvm/vmx.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [Qemu-devel] vm performance degradation after kvm live migration or save-restore with EPT enabled

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 09:09:56AM +, Zhanghaoyu (A) wrote: The QEMU command line (/var/log/libvirt/qemu/[domain name].log), LC_ALL=C PATH=/bin:/sbin:/usr/bin:/usr/sbin HOME=/ QEMU_AUDIO_DRV=none /usr/local/bin/qemu-system-x86_64 -name ATS1 -S -M pc-0.12 -cpu qemu32 -enable-kvm -m 12288

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-08-05 Thread Ingo Molnar
* Gleb Natapov g...@redhat.com wrote: On Fri, Aug 02, 2013 at 11:25:39AM +0200, Ingo Molnar wrote: Ingo, Do you have any concerns reg this series? please let me know if this looks good now to you. I'm inclined to NAK it for excessive quotation - who knows how many people

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-08-05 Thread Raghavendra K T
That result was only for patch 18 of the series, not pvspinlock in general. Okay - I've re-read the performance numbers and they are impressive, so no objections from me. The x86 impact seems to be a straightforward API change, with most of the changes on the virtualization side. So:

Re: [PATCH] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Jan Kiszka
On 2013-08-05 11:36, Gmail wrote: On Mon, Aug 05, 2013 at 05:10:35PM +0800, Arthur Chunqi Li wrote: Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- arch/x86/kvm/vmx.c |3 ++- 1 file changed, 2 insertions(+), 1

Re: [PATCH] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 12:38:32PM +0200, Jan Kiszka wrote: On 2013-08-05 11:36, Gmail wrote: On Mon, Aug 05, 2013 at 05:10:35PM +0800, Arthur Chunqi Li wrote: Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com ---

Re: [PATCH] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Arthur Chunqi Li
On Mon, Aug 5, 2013 at 6:55 PM, Gleb Natapov g...@redhat.com wrote: On Mon, Aug 05, 2013 at 12:38:32PM +0200, Jan Kiszka wrote: On 2013-08-05 11:36, Gmail wrote: On Mon, Aug 05, 2013 at 05:10:35PM +0800, Arthur Chunqi Li wrote: Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT.

Re: [PATCH] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Jan Kiszka
On 2013-08-05 13:00, Arthur Chunqi Li wrote: On Mon, Aug 5, 2013 at 6:55 PM, Gleb Natapov g...@redhat.com wrote: On Mon, Aug 05, 2013 at 12:38:32PM +0200, Jan Kiszka wrote: On 2013-08-05 11:36, Gmail wrote: On Mon, Aug 05, 2013 at 05:10:35PM +0800, Arthur Chunqi Li wrote: Advertise

Re: [PATCH] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 01:04:25PM +0200, Jan Kiszka wrote: On 2013-08-05 13:00, Arthur Chunqi Li wrote: On Mon, Aug 5, 2013 at 6:55 PM, Gleb Natapov g...@redhat.com wrote: On Mon, Aug 05, 2013 at 12:38:32PM +0200, Jan Kiszka wrote: On 2013-08-05 11:36, Gmail wrote: On Mon, Aug 05,

[PATCH v2] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Arthur Chunqi Li
Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- ChangeLog to v1: Add host features check. Format is the same as entry controls. arch/x86/kvm/vmx.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff

Re: [PATCH v7 01/15] nEPT: Support LOAD_IA32_EFER entry/exit controls for L1

2013-08-05 Thread Arthur Chunqi Li
On Mon, Aug 5, 2013 at 4:07 PM, Gleb Natapov g...@redhat.com wrote: From: Nadav Har'El n...@il.ibm.com Recent KVM, since http://kerneltrap.org/mailarchive/linux-kvm/2010/5/2/6261577 switch the EFER MSR when EPT is used and the host and guest have different NX bits. So if we add support for

Re: FAQ on linux-kvm.org has broken link

2013-08-05 Thread Stefan Hajnoczi
On Fri, Aug 02, 2013 at 08:06:58PM +0200, folkert wrote: A couple of questions: Please post the QEMU command-line from the host (ps aux | grep qemu). I'll post them all: - UMTS-clone: this one works fine since it was created a weak ago - belle: this one was fine but suddenly also showed

Re: [PATCH v7 01/15] nEPT: Support LOAD_IA32_EFER entry/exit controls for L1

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 07:27:33PM +0800, Arthur Chunqi Li wrote: On Mon, Aug 5, 2013 at 4:07 PM, Gleb Natapov g...@redhat.com wrote: From: Nadav Har'El n...@il.ibm.com Recent KVM, since http://kerneltrap.org/mailarchive/linux-kvm/2010/5/2/6261577 switch the EFER MSR when EPT is used

Re: [PATCH v7 01/15] nEPT: Support LOAD_IA32_EFER entry/exit controls for L1

2013-08-05 Thread Paolo Bonzini
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e999dc7..27efa6a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void) #else nested_vmx_exit_ctls_high = 0; #endif -

Re: [PATCH v2] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Paolo Bonzini
- Original Message - From: Arthur Chunqi Li yzt...@gmail.com To: kvm@vger.kernel.org Cc: jan kiszka jan.kis...@web.de, g...@redhat.com, pbonz...@redhat.com, Arthur Chunqi Li yzt...@gmail.com Sent: Monday, August 5, 2013 1:18:13 PM Subject: [PATCH v2] KVM: nVMX: Advertise IA32_PAT

Re: [PATCH v7 01/15] nEPT: Support LOAD_IA32_EFER entry/exit controls for L1

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 07:48:54AM -0400, Paolo Bonzini wrote: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e999dc7..27efa6a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void) #else

Re: [PATCH v2] KVM: nVMX: Advertise IA32_PAT in VM exit control

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 08:03:31AM -0400, Paolo Bonzini wrote: - Original Message - From: Arthur Chunqi Li yzt...@gmail.com To: kvm@vger.kernel.org Cc: jan kiszka jan.kis...@web.de, g...@redhat.com, pbonz...@redhat.com, Arthur Chunqi Li yzt...@gmail.com Sent: Monday, August

[PATCH] kvm-unit-tests: VMX: Separate host and guest rflags

2013-08-05 Thread Arthur Chunqi Li
Separate host_rflags and guest_rflags (regs.rflags used for guest). Fix bug of set/get guest rflags when vmenter/vmexit. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- x86/vmx.c | 11 +++ x86/vmx.h |4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git

Re: [PATCH 1/7] KVM: nEPT: Advertise WB type EPTP

2013-08-05 Thread Gleb Natapov
On Sun, Aug 04, 2013 at 07:49:00PM +0200, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com At least WB must be possible. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/vmx.c |4 ++-- 1 files changed, 2

[PATCH 2/3] Initial skeleton of VFIO support for Device Tree based devices

2013-08-05 Thread Antonios Motakis
Platform devices in the Linux kernel are usually managed by the DT interface. This patch forms the base to support these kind of devices with VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Kconfig | 10 +++ drivers/vfio/Makefile | 1 +

[PATCH 3/3] Return info for device and its memory regions and interrupts

2013-08-05 Thread Antonios Motakis
A VFIO userspace driver will start by opening the VFIO device that corresponds to an IOMMU group, and will use the ioctl interface to get the basic device info, such as number of memory regions and interrupts, and their properties. This patch implements the IOCTLs: - VFIO_DEVICE_GET_INFO -

[RFC 0/3] WIP VFIO for device tree devices on Arndale

2013-08-05 Thread Antonios Motakis
This is a very early base work, towards VFIO support on ARM platforms with an IOMMU. It forms a base on to which to implement the functionality necessary to enable using device tree devices on ARM (and other platforms based on device trees) with VFIO. This very early work of progress is only

[PATCH 1/3] VFIO_IOMMU_TYPE1 workaround to build for platform devices

2013-08-05 Thread Antonios Motakis
This is a workaround to make the VFIO_IOMMU_TYPE1 driver usable with platform devices instead of PCI. A future permanent fix should support both. This is required in order to use the Exynos SMMU, or the ARM SMMU driver with VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com

Re: [PATCH 1/3] mips/kvm: Improve code formatting in arch/mips/kvm/kvm_locore.S

2013-08-05 Thread James Hogan
Hi David, On 01/08/13 21:22, David Daney wrote: From: David Daney david.da...@cavium.com No code changes, just reflowing some comments and consistently using tabs and spaces. Object code is verified to be unchanged. Signed-off-by: David Daney david.da...@cavium.com Acked-by: Ralf

Re: [PATCH] kvm-unit-tests: VMX: Separate host and guest rflags

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 08:43:25PM +0800, Arthur Chunqi Li wrote: Separate host_rflags and guest_rflags (regs.rflags used for guest). Fix bug of set/get guest rflags when vmenter/vmexit. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- x86/vmx.c | 11 +++ x86/vmx.h |4

Re: [PATCH 1/3] mips/kvm: Improve code formatting in arch/mips/kvm/kvm_locore.S

2013-08-05 Thread Ralf Baechle
On Mon, Aug 05, 2013 at 02:17:01PM +0100, James Hogan wrote: On 01/08/13 21:22, David Daney wrote: From: David Daney david.da...@cavium.com No code changes, just reflowing some comments and consistently using tabs and spaces. Object code is verified to be unchanged.

Re: [PATCH 2/3] Initial skeleton of VFIO support for Device Tree based devices

2013-08-05 Thread Mark Rutland
[adding DT maintainers to Cc] On Mon, Aug 05, 2013 at 02:17:11PM +0100, Antonios Motakis wrote: Platform devices in the Linux kernel are usually managed by the DT interface. This patch forms the base to support these kind of devices with VFIO. Signed-off-by: Antonios Motakis

Re: [PATCH 1/3] mips/kvm: Improve code formatting in arch/mips/kvm/kvm_locore.S

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 03:21:57PM +0200, Ralf Baechle wrote: On Mon, Aug 05, 2013 at 02:17:01PM +0100, James Hogan wrote: On 01/08/13 21:22, David Daney wrote: From: David Daney david.da...@cavium.com No code changes, just reflowing some comments and consistently using tabs

Re: [PATCH] kvm-unit-tests: VMX: Separate host and guest rflags

2013-08-05 Thread Arthur Chunqi Li
On Mon, Aug 5, 2013 at 9:18 PM, Gleb Natapov g...@redhat.com wrote: On Mon, Aug 05, 2013 at 08:43:25PM +0800, Arthur Chunqi Li wrote: Separate host_rflags and guest_rflags (regs.rflags used for guest). Fix bug of set/get guest rflags when vmenter/vmexit. Signed-off-by: Arthur Chunqi Li

Re: [PATCH 2/3] Initial skeleton of VFIO support for Device Tree based devices

2013-08-05 Thread Mark Rutland
+static const struct of_device_id vfio_dt_match[] = { + � � /* In the future, we can implement a better mechanism to bind the + � � �* module to any device. For now add the compatible property to the + � � �* dtb of the devices we want to use. � */ +

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-08-05 Thread Ingo Molnar
* Gleb Natapov g...@redhat.com wrote: On Mon, Aug 05, 2013 at 11:46:03AM +0200, Ingo Molnar wrote: Acked-by: Ingo Molnar mi...@kernel.org I guess you'd want to carry this in the KVM tree or so - maybe in a separate branch because it changes Xen as well? It changes KVM host and

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-08-05 Thread Paolo Bonzini
On Mon, Aug 05, 2013 at 11:46:03AM +0200, Ingo Molnar wrote: Acked-by: Ingo Molnar mi...@kernel.org I guess you'd want to carry this in the KVM tree or so - maybe in a separate branch because it changes Xen as well? It changes KVM host and guest side, XEN and common x86

RE: [PATCH 5/6 v2] kvm: powerpc: booke: Add linux pte lookup like booke3s

2013-08-05 Thread Bhushan Bharat-R65777
-Original Message- From: Benjamin Herrenschmidt [mailto:b...@kernel.crashing.org] Sent: Saturday, August 03, 2013 9:54 AM To: Bhushan Bharat-R65777 Cc: Wood Scott-B07421; ag...@suse.de; kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org Subject: Re: [PATCH

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-08-05 Thread Raghavendra K T
On 08/05/2013 07:35 PM, Paolo Bonzini wrote: I guess you'd want to carry this in the KVM tree or so - maybe in a separate branch because it changes Xen as well? It changes KVM host and guest side, XEN and common x86 spinlock code. I think it would be best to merge common x86 spinlock bits and

Re: [PATCH V2 4/4] x86: correctly detect hypervisor

2013-08-05 Thread Konrad Rzeszutek Wilk
On Mon, Aug 05, 2013 at 11:38:14AM +0800, Jason Wang wrote: On 07/25/2013 04:54 PM, Jason Wang wrote: We try to handle the hypervisor compatibility mode by detecting hypervisor through a specific order. This is not robust, since hypervisors may implement each others features. This

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-08-05 Thread Paolo Bonzini
Only thing I am thinking is about KVM_FEATURE_PV_UNHALT, and KVM_HC_KICK_CPU definition in the below hunk, that is needed by guest as well. may be this header file change can be a separate patch so that duplicate can be handled easily during merge? Sure, good idea. Paolo I do testing of

RE: [RFC 0/3] WIP VFIO for device tree devices on Arndale

2013-08-05 Thread Yoder Stuart-B08248
Thanks for starting work on this. -Original Message- From: Antonios Motakis [mailto:a.mota...@virtualopensystems.com] Sent: Monday, August 05, 2013 8:17 AM To: linux-arm-ker...@lists.infradead.org; alex.william...@redhat.com Cc: kvm...@lists.cs.columbia.edu;

Re: [PATCH 2/3] Initial skeleton of VFIO support for Device Tree based devices

2013-08-05 Thread Alex Williamson
On Mon, 2013-08-05 at 15:17 +0200, Antonios Motakis wrote: Platform devices in the Linux kernel are usually managed by the DT interface. This patch forms the base to support these kind of devices with VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com ---

RE: [PATCH 2/3] Initial skeleton of VFIO support for Device Tree based devices

2013-08-05 Thread Yoder Stuart-B08248
+MODULE_VERSION(DRIVER_VERSION); +MODULE_LICENSE(GPL v2); +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 284ff24..1e4bef2 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h @@

Re: [PATCH V2 4/4] x86: correctly detect hypervisor

2013-08-05 Thread H. Peter Anvin
On 08/05/2013 07:34 AM, Konrad Rzeszutek Wilk wrote: Could you provide me with a git branch so I can test it overnight please? Pull tip:x86/paravirt. -hpa -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-08-05 Thread Konrad Rzeszutek Wilk
On Mon, Aug 05, 2013 at 11:46:03AM +0200, Ingo Molnar wrote: * Gleb Natapov g...@redhat.com wrote: On Fri, Aug 02, 2013 at 11:25:39AM +0200, Ingo Molnar wrote: Ingo, Do you have any concerns reg this series? please let me know if this looks good now to you. I'm

Re: [PATCH 6/6 v2] kvm: powerpc: use caching attributes as per linux pte

2013-08-05 Thread Scott Wood
On Sat, 2013-08-03 at 14:25 +1000, Benjamin Herrenschmidt wrote: On Sat, 2013-08-03 at 03:11 +, Bhushan Bharat-R65777 wrote: Could you explain why we need to set dirty/referenced on the PTE, when we didn't need to do that before? All we're getting from the PTE is wimg. We

Re: [PATCH 6/6 v2] kvm: powerpc: use caching attributes as per linux pte

2013-08-05 Thread Scott Wood
On Fri, 2013-08-02 at 22:11 -0500, Bhushan Bharat-R65777 wrote: How does wimg get set in the pfnmap case? Pfnmap is not kernel managed pages, right? So should we set I+G there ? It could depend on ppc_md.phys_mem_access_prot(). Can't you pull it from the PTE regardless of pfnmap? -Scott

Re: [PATCH V2 4/4] x86: correctly detect hypervisor

2013-08-05 Thread Konrad Rzeszutek Wilk
On Mon, Aug 05, 2013 at 08:20:53AM -0700, H. Peter Anvin wrote: On 08/05/2013 07:34 AM, Konrad Rzeszutek Wilk wrote: Could you provide me with a git branch so I can test it overnight please? Pull tip:x86/paravirt. It works for me. Thanks. -hpa -- To unsubscribe from this

Re: [PATCH 1/3] mips/kvm: Improve code formatting in arch/mips/kvm/kvm_locore.S

2013-08-05 Thread Ralf Baechle
On Mon, Aug 05, 2013 at 04:43:27PM +0300, Gleb Natapov wrote: Date: Mon, 5 Aug 2013 16:43:27 +0300 From: Gleb Natapov g...@redhat.com To: Ralf Baechle r...@linux-mips.org Cc: James Hogan james.ho...@imgtec.com, David Daney ddaney.c...@gmail.com, linux-m...@linux-mips.org,

Re: [PATCH 1/3] mips/kvm: Improve code formatting in arch/mips/kvm/kvm_locore.S

2013-08-05 Thread David Daney
On 08/05/2013 06:43 AM, Gleb Natapov wrote: On Mon, Aug 05, 2013 at 03:21:57PM +0200, Ralf Baechle wrote: On Mon, Aug 05, 2013 at 02:17:01PM +0100, James Hogan wrote: On 01/08/13 21:22, David Daney wrote: From: David Daney david.da...@cavium.com No code changes, just reflowing some

Re: [PATCH 03/10] vfio: add external user support

2013-08-05 Thread Alex Williamson
On Tue, 2013-07-23 at 19:07 +1000, Alexey Kardashevskiy wrote: On 07/23/2013 12:23 PM, Alex Williamson wrote: On Tue, 2013-07-16 at 10:53 +1000, Alexey Kardashevskiy wrote: VFIO is designed to be used via ioctls on file descriptors returned by VFIO. However in some situations support

Re: [PATCH 1/3] mips/kvm: Improve code formatting in arch/mips/kvm/kvm_locore.S

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 07:06:10PM +0200, Ralf Baechle wrote: On Mon, Aug 05, 2013 at 04:43:27PM +0300, Gleb Natapov wrote: Date: Mon, 5 Aug 2013 16:43:27 +0300 From: Gleb Natapov g...@redhat.com To: Ralf Baechle r...@linux-mips.org Cc: James Hogan james.ho...@imgtec.com, David Daney

Re: [PATCH 5/6 v2] kvm: powerpc: booke: Add linux pte lookup like booke3s

2013-08-05 Thread Scott Wood
On Mon, 2013-08-05 at 09:27 -0500, Bhushan Bharat-R65777 wrote: -Original Message- From: Benjamin Herrenschmidt [mailto:b...@kernel.crashing.org] Sent: Saturday, August 03, 2013 9:54 AM To: Bhushan Bharat-R65777 Cc: Wood Scott-B07421; ag...@suse.de; kvm-...@vger.kernel.org;

Re: FAQ on linux-kvm.org has broken link

2013-08-05 Thread folkert
If you do find something in dmesg that could be very helpful. Ok it is down again: nothing in dmesg, neither on the guest or in the host. Based on this information it seems like a bug in the virtio_net guest driver or vhost_net on the host. Actually there is one contradictory piece of

[PATCH] kvm: Make kvm_rebooting visible

2013-08-05 Thread Andi Kleen
From: Andi Kleen a...@linux.intel.com kvm_rebooting is referenced from assembler code, thus needs to be visible. Signed-off-by: Andi Kleen a...@linux.intel.com --- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c

Re: [PATCH] kvm: Make kvm_rebooting visible

2013-08-05 Thread David Daney
On 08/05/2013 03:12 PM, Andi Kleen wrote: From: Andi Kleen a...@linux.intel.com kvm_rebooting is referenced from assembler code, thus needs to be visible. Signed-off-by: Andi Kleen a...@linux.intel.com --- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH RFC V11 0/18] Paravirtualized ticket spinlocks

2013-08-05 Thread H. Peter Anvin
So, having read through the entire thread I *think* this is what the status of this patchset is: 1. Patches 1-17 are noncontroversial, Raghavendra is going to send an update split into two patchsets; 2. There are at least two versions of patch 15; I think the PATCH RESEND RFC is the right

Re: [PATCH] kvm: Make kvm_rebooting visible

2013-08-05 Thread Andi Kleen
static void kvm_io_bus_destroy(struct kvm_io_bus *bus); -bool kvm_rebooting; +__visible bool kvm_rebooting; EXPORT_SYMBOL_GPL(kvm_rebooting); How many of these are there kernel wide? Not very many (at least on x86 allyes) ~10. Also most users are not exported. Probably not worth an

RE: [PATCH 5/6 v2] kvm: powerpc: booke: Add linux pte lookup like booke3s

2013-08-05 Thread Bhushan Bharat-R65777
-Original Message- From: Wood Scott-B07421 Sent: Tuesday, August 06, 2013 12:49 AM To: Bhushan Bharat-R65777 Cc: Benjamin Herrenschmidt; Wood Scott-B07421; ag...@suse.de; kvm- p...@vger.kernel.org; kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org Subject: Re: [PATCH 5/6 v2] kvm:

Re: [PATCH RFC V11 0/18] Paravirtualized ticket spinlocks

2013-08-05 Thread Raghavendra K T
On 08/06/2013 04:20 AM, H. Peter Anvin wrote: So, having read through the entire thread I *think* this is what the status of this patchset is: 1. Patches 1-17 are noncontroversial, Raghavendra is going to send an update split into two patchsets; Yes. Only one patch would be common to

[PATCH 20/23] KVM: PPC: Book3S PR: Better handling of host-side read-only pages

2013-08-05 Thread Paul Mackerras
Currently we request write access to all pages that get mapped into the guest, even if the guest is only loading from the page. This reduces the effectiveness of KSM because it means that we unshare every page we access. Also, we always set the changed (C) bit in the guest HPTE if it allows

[PATCH 09/23] KVM: PPC: Book3S PR: Correct errors in H_ENTER implementation

2013-08-05 Thread Paul Mackerras
The implementation of H_ENTER in PR KVM has some errors: * With H_EXACT not set, if the HPTEG is full, we return H_PTEG_FULL as the return value of kvmppc_h_pr_enter, but the caller is expecting one of the EMULATE_* values. The H_PTEG_FULL needs to go in the guest's R3 instead. * With

[PATCH 08/23] KVM: PPC: Book3S PR: Handle PP0 page-protection bit in guest HPTEs

2013-08-05 Thread Paul Mackerras
64-bit POWER processors have a three-bit field for page protection in the hashed page table entry (HPTE). Currently we only interpret the two bits that were present in older versions of the architecture. The only defined combination that has the new bit set is 110, meaning read-only for

[PATCH 16/23] KVM: PPC: Book3S: Merge implementations of KVM_PPC_GET_SMMU_INFO ioctl

2013-08-05 Thread Paul Mackerras
This merges the PR and HV implementations of kvm_vm_ioctl_get_smmu_info() into a single implementation in book3s.c. Since userspace tends to call this ioctl very early in the life of a VM, before (for instance) enabling PAPR mode, we will need this to return results that are compatible with both

[PATCH 22/23] KVM: PPC: Book3S PR: Mark pages accessed, and dirty if being written

2013-08-05 Thread Paul Mackerras
The mark_page_dirty() function, despite what its name might suggest, doesn't actually mark the page as dirty as far as the MM subsystem is concerned. It merely sets a bit in KVM's map of dirty pages, if userspace has requested dirty tracking for the relevant memslot. To tell the MM subsystem that

[PATCH 02/23] KVM: PPC: Book3S PR: Don't corrupt guest state when kernel uses VMX

2013-08-05 Thread Paul Mackerras
Currently the code assumes that once we load up guest FP/VSX or VMX state into the CPU, it stays valid in the CPU registers until we explicitly flush it to the thread_struct. However, on POWER7, copy_page() and memcpy() can use VMX. These functions do flush the VMX state to the thread_struct

[PATCH 03/23] KVM: PPC: Book3S PR: Make instruction fetch fallback work for system calls

2013-08-05 Thread Paul Mackerras
It turns out that if we exit the guest due to a hcall instruction (sc 1), and the loading of the instruction in the guest exit path fails for any reason, the call to kvmppc_ld() in kvmppc_get_last_inst() fetches the instruction after the hcall instruction rather than the hcall itself. This in turn

[PATCH 10/23] KVM: PPC: Book3S PR: Make HPT accesses and updates SMP-safe

2013-08-05 Thread Paul Mackerras
This adds a per-VM mutex to provide mutual exclusion between vcpus for accesses to and updates of the guest hashed page table (HPT). This also makes the code use single-byte writes to the HPT entry when updating of the reference (R) and change (C) bits. The reason for doing this, rather than

[PATCH 17/23] KVM: PPC: Book3S HV: Factorize kvmppc_core_vcpu_create_hv()

2013-08-05 Thread Paul Mackerras
This splits kvmppc_core_vcpu_create_hv() into three functions and adds a new kvmppc_free_vcores() to free the kvmppc_vcore structures that we allocate for a guest, which are currently being leaked. The reason for the split is to make the split-out code available for later use in converting PR

[PATCH 14/23] KVM: PPC: Book3S PR: Delay disabling relocation-on interrupts

2013-08-05 Thread Paul Mackerras
When we are running a PR KVM guest on POWER8, we have to disable the new POWER8 feature of taking interrupts with relocation on, that is, of taking interrupts without disabling the MMU, because the SLB does not contain the normal kernel SLB entries while in the guest. Currently we disable

  1   2   >