[GIT PULL] KVM fixes for Linux 4.17-rc3

2018-04-27 Thread Radim Krčmář
use KarimAllah Ahmed (1): x86/headers/UAPI: Move DISABLE_EXITS KVM capability bits to the UAPI Marc Zyngier (3): KVM: arm/arm64: Close VMID generation race arm64: KVM: Demote SVE and LORegion warnings to debug only arm/arm64: KVM: Add PSCI version selection API Radim Krč

Re: [PATCH] [v3] x86: Convert x86_platform_ops to timespec64

2018-04-27 Thread Radim Krčmář
wall_clock->version)); > > delta = pvclock_clocksource_read(vcpu_time);/* time since system > boot */ > - delta += now.tv_sec * (u64)NSEC_PER_SEC + now.tv_nsec; > + delta += now.tv_sec * NSEC_PER_SEC + now.tv_nsec; > > now.tv_nsec = do_div(delta, NSEC_PER_SEC); > now.tv_sec = delta; > > - set_normalized_timespec(ts, now.tv_sec, now.tv_nsec); > + set_normalized_timespec64(ts, now.tv_sec, now.tv_nsec); > } > > void pvclock_set_pvti_cpu0_va(struct pvclock_vsyscall_time_info *pvti) kvmclock and pvclock changes Acked-by: Radim Krčmář <rkrc...@redhat.com>

Re: [PATCH] [v3] x86: Convert x86_platform_ops to timespec64

2018-04-27 Thread Radim Krčmář
(vcpu_time);/* time since system > boot */ > - delta += now.tv_sec * (u64)NSEC_PER_SEC + now.tv_nsec; > + delta += now.tv_sec * NSEC_PER_SEC + now.tv_nsec; > > now.tv_nsec = do_div(delta, NSEC_PER_SEC); > now.tv_sec = delta; > > - set_normalized_timespec(ts, now.tv_sec, now.tv_nsec); > + set_normalized_timespec64(ts, now.tv_sec, now.tv_nsec); > } > > void pvclock_set_pvti_cpu0_va(struct pvclock_vsyscall_time_info *pvti) kvmclock and pvclock changes Acked-by: Radim Krčmář

Re: [PATCH] [RESEND] KVM: x86: use timespec64 for KVM_HC_CLOCK_PAIRING

2018-04-27 Thread Radim Krčmář
2018-04-23 10:04+0200, Arnd Bergmann: > The hypercall was added using a struct timespec based implementation, > but we should not use timespec in new code. > > This changes it to timespec64. There is no functional change > here since the implementation is only used in 64-bit kernels > that use

Re: [PATCH] [RESEND] KVM: x86: use timespec64 for KVM_HC_CLOCK_PAIRING

2018-04-27 Thread Radim Krčmář
2018-04-23 10:04+0200, Arnd Bergmann: > The hypercall was added using a struct timespec based implementation, > but we should not use timespec in new code. > > This changes it to timespec64. There is no functional change > here since the implementation is only used in 64-bit kernels > that use

Re: [PATCH] kvm: Add emulation for movups/movupd

2018-04-03 Thread Radim Krčmář
rough. > > Signed-off-by: Christian Ehrhardt <christian_ehrha...@genua.de> > Signed-off-by: Stefan Fritsch <s...@sfritsch.de> > --- Nicely follows the implementation of aligned variants, Reviewed-by: Radim Krčmář <rkrc...@redhat.com>

Re: [PATCH] kvm: Add emulation for movups/movupd

2018-04-03 Thread Radim Krčmář
rough. > > Signed-off-by: Christian Ehrhardt > Signed-off-by: Stefan Fritsch > --- Nicely follows the implementation of aligned variants, Reviewed-by: Radim Krčmář

Re: [PATCH v4 2/2] KVM: X86: Add Force Emulation Prefix for "emulate the next instruction"

2018-04-03 Thread Radim Krčmář
string[12] = 0; > if (strncmp(string, "KVMKVMKVM\0\0\0", 12) == 0) > printf("kvm guest\n"); > else > printf("bare hardware\n"); > } > > Suggested-by: Andrew Cooper <andrew.coop...@

Re: [PATCH v4 2/2] KVM: X86: Add Force Emulation Prefix for "emulate the next instruction"

2018-04-03 Thread Radim Krčmář
if (strncmp(string, "KVMKVMKVM\0\0\0", 12) == 0) > printf("kvm guest\n"); > else > printf("bare hardware\n"); > } > > Suggested-by: Andrew Cooper > Reviewed-By: Liran Alon > Cc: Paolo Bonzini

Re: [PATCH 3/5] KVM: x86: hyperv: simplistic HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE} implementation

2018-04-03 Thread Radim Krčmář
2018-04-02 18:10+0200, Vitaly Kuznetsov: > Implement HvFlushVirtualAddress{List,Space} hypercalls in a simplistic way: > do full TLB flush with KVM_REQ_TLB_FLUSH and rely on kvm_vcpu_kick() > kicking only vCPUs which are currently IN_GUEST_MODE. > > Signed-off-by: Vitaly Kuznetsov

Re: [PATCH 3/5] KVM: x86: hyperv: simplistic HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE} implementation

2018-04-03 Thread Radim Krčmář
2018-04-02 18:10+0200, Vitaly Kuznetsov: > Implement HvFlushVirtualAddress{List,Space} hypercalls in a simplistic way: > do full TLB flush with KVM_REQ_TLB_FLUSH and rely on kvm_vcpu_kick() > kicking only vCPUs which are currently IN_GUEST_MODE. > > Signed-off-by: Vitaly Kuznetsov > --- >

Re: [PATCH] x86/kvm: replace TASK_UNINTERRUPTIBLE with TASK_KILLABLE

2018-03-29 Thread Radim Krčmář
2018-03-16 00:57-1000, Joey Pabalinas: > There doesn't seem to be any advantage to having a *completely* > uninterruptible task here. For most users, allowing a task to respond > to the SIGKILL interrupt signal (all other signals are ignored just like > TASK_UNINTERRUPTIBLE) will not impact them

Re: [PATCH] x86/kvm: replace TASK_UNINTERRUPTIBLE with TASK_KILLABLE

2018-03-29 Thread Radim Krčmář
2018-03-16 00:57-1000, Joey Pabalinas: > There doesn't seem to be any advantage to having a *completely* > uninterruptible task here. For most users, allowing a task to respond > to the SIGKILL interrupt signal (all other signals are ignored just like > TASK_UNINTERRUPTIBLE) will not impact them

Re: [PATCH v3 2/2] KVM: X86: Add Force Emulation Prefix for "emulate the next instruction"

2018-03-29 Thread Radim Krčmář
string[12] = 0; > if (strncmp(string, "KVMKVMKVM\0\0\0", 12) == 0) > printf("kvm guest\n"); > else > printf("bare hardware\n"); > } > > Suggested-by: Andrew Cooper <andrew.coop...@c

Re: [PATCH v3 2/2] KVM: X86: Add Force Emulation Prefix for "emulate the next instruction"

2018-03-29 Thread Radim Krčmář
if (strncmp(string, "KVMKVMKVM\0\0\0", 12) == 0) > printf("kvm guest\n"); > else > printf("bare hardware\n"); > } > > Suggested-by: Andrew Cooper > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc:

[GIT PULL] KVM fixes for Linux 4.16-rc8

2018-03-29 Thread Radim Krčmář
Linus, The following changes since commit daaf216c06fba4ee4dc3f62715667da929d68774: KVM: x86: Fix device passthrough when SME is active (2018-03-16 14:32:23 +0100) are available in the Git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm tags/for-linus for you to fetch changes up

[GIT PULL] KVM fixes for Linux 4.16-rc8

2018-03-29 Thread Radim Krčmář
Linus, The following changes since commit daaf216c06fba4ee4dc3f62715667da929d68774: KVM: x86: Fix device passthrough when SME is active (2018-03-16 14:32:23 +0100) are available in the Git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm tags/for-linus for you to fetch changes up

Re: [PATCH v2 5/5] KVM: SVM: Implement pause loop exit logic in SVM

2018-03-28 Thread Radim Krčmář
2018-03-16 16:37-0400, Babu Moger: > Bring the PLE(pause loop exit) logic to AMD svm driver. > > While testing, we found this helping in situations where numerous > pauses are generated. Without these patches we could see continuos > VMEXITS due to pause interceptions. Tested it on AMD EPYC

Re: [PATCH v2 5/5] KVM: SVM: Implement pause loop exit logic in SVM

2018-03-28 Thread Radim Krčmář
2018-03-16 16:37-0400, Babu Moger: > Bring the PLE(pause loop exit) logic to AMD svm driver. > > While testing, we found this helping in situations where numerous > pauses are generated. Without these patches we could see continuos > VMEXITS due to pause interceptions. Tested it on AMD EPYC

Re: [PATCH v2 3/5] KVM: VMX: Bring the common code to header file

2018-03-28 Thread Radim Krčmář
2018-03-16 16:37-0400, Babu Moger: > This patch brings some of the code from vmx to x86.h header file. Now, we > can share this code between vmx and svm. Modified couple functions to make > it common. > > Signed-off-by: Babu Moger > --- > diff --git a/arch/x86/kvm/vmx.c

Re: [PATCH v2 3/5] KVM: VMX: Bring the common code to header file

2018-03-28 Thread Radim Krčmář
2018-03-16 16:37-0400, Babu Moger: > This patch brings some of the code from vmx to x86.h header file. Now, we > can share this code between vmx and svm. Modified couple functions to make > it common. > > Signed-off-by: Babu Moger > --- > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > @@

Re: [PATCH v2 2/5] KVM: VMX: Remove ple_window_actual_max

2018-03-28 Thread Radim Krčmář
2018-03-16 16:37-0400, Babu Moger: > Get rid of ple_window_actual_max, because its benefits are really > minuscule and the logic is complicated. > > The overflows(and underflow) are controlled in __ple_window_grow > and _ple_window_shrink respectively. > > Suggested-b

Re: [PATCH v2 2/5] KVM: VMX: Remove ple_window_actual_max

2018-03-28 Thread Radim Krčmář
2018-03-16 16:37-0400, Babu Moger: > Get rid of ple_window_actual_max, because its benefits are really > minuscule and the logic is complicated. > > The overflows(and underflow) are controlled in __ple_window_grow > and _ple_window_shrink respectively. > > Suggested-by: R

Re: [PATCH v6 0/7] Enlightened VMCS support for KVM on Hyper-V

2018-03-28 Thread Radim Krčmář
2018-03-26 14:42+0200, Vitaly Kuznetsov: > Vitaly Kuznetsov writes: > > > Changes since v5: > > - Fix a couple of issues reported by kbuild test robot, both in > > PATCH7 (hope Radim's Reviewed-by: stands). > > > > When running nested KVM on Hyper-V it's possible to use so

Re: [PATCH v6 0/7] Enlightened VMCS support for KVM on Hyper-V

2018-03-28 Thread Radim Krčmář
2018-03-26 14:42+0200, Vitaly Kuznetsov: > Vitaly Kuznetsov writes: > > > Changes since v5: > > - Fix a couple of issues reported by kbuild test robot, both in > > PATCH7 (hope Radim's Reviewed-by: stands). > > > > When running nested KVM on Hyper-V it's possible to use so called > >

Re: [PATCH 1/2] KVM: X86: Fix setup the virt_spin_lock_key before static key get initialized

2018-03-28 Thread Radim Krčmář
c virt_spin_lock_key is set in kvm_spinlock_init() before > jump_label_init() > has been called, which will result in a WARN(). This patch fixes it by > delaying > the virt_spin_lock_key setup to .smp_prepare_cpus(). > > Reported-by: Davidlohr Bueso <dbu...@suse.d

Re: [PATCH 1/2] KVM: X86: Fix setup the virt_spin_lock_key before static key get initialized

2018-03-28 Thread Radim Krčmář
k_key is set in kvm_spinlock_init() before > jump_label_init() > has been called, which will result in a WARN(). This patch fixes it by > delaying > the virt_spin_lock_key setup to .smp_prepare_cpus(). > > Reported-by: Davidlohr Bueso > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Davidlohr Bueso > Signed-off-by: Wanpeng Li > --- Queued, thanks.

Re: [PATCH 2/2] KVM: X86: Fix disable pv tlb flush when steal time is enabled

2018-03-28 Thread Radim Krčmář
ally looks correct, > This patch fixes it. > > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Radim Krčmář <rkrc...@redhat.com> > Signed-off-by: Wanpeng Li <wanpen...@tencent.com> > --- I've modified the commit message and rebased it for kvm/master, thanks.

Re: [PATCH 2/2] KVM: X86: Fix disable pv tlb flush when steal time is enabled

2018-03-28 Thread Radim Krčmář
his patch fixes it. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-off-by: Wanpeng Li > --- I've modified the commit message and rebased it for kvm/master, thanks.

Re: [PATCH v4 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-16 Thread Radim Krčmář
inspect them all. > > Tight CPUID loop test shows significant speedup: > Before: 18890 cycles > After: 8304 cycles > > Static key is being used to avoid performance penalty for non-Hyper-V > deployments. > > Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> &

Re: [PATCH v4 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-16 Thread Radim Krčmář
inspect them all. > > Tight CPUID loop test shows significant speedup: > Before: 18890 cycles > After: 8304 cycles > > Static key is being used to avoid performance penalty for non-Hyper-V > deployments. > > Signed-off-by: Vitaly Kuznetsov > --- Looks good, thanks. Reviewed-by: Radim Krčmář

Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-15 Thread Radim Krčmář
2018-03-15 20:28+0100, Thomas Gleixner: > On Thu, 15 Mar 2018, Radim Krčmář wrote: > > 2018-03-15 16:19+0100, Vitaly Kuznetsov: > > > This works. But hell, this is a crude hack :-) Not sure if there's a > > > cleaner way to find what needs to be patched without some

Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-15 Thread Radim Krčmář
2018-03-15 20:28+0100, Thomas Gleixner: > On Thu, 15 Mar 2018, Radim Krčmář wrote: > > 2018-03-15 16:19+0100, Vitaly Kuznetsov: > > > This works. But hell, this is a crude hack :-) Not sure if there's a > > > cleaner way to find what needs to be patched without some

Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-15 Thread Radim Krčmář
2018-03-15 18:02+0100, Radim Krčmář: > We actually already have mov in the assembly: > > "cmp %%" _ASM_SP ", %c[host_rsp](%0) \n\t" Oh hell, I didn't pay attention to this line before. > "je 1f \n\t" > "mov %%" _ASM_SP ", %c[

Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-15 Thread Radim Krčmář
2018-03-15 18:02+0100, Radim Krčmář: > We actually already have mov in the assembly: > > "cmp %%" _ASM_SP ", %c[host_rsp](%0) \n\t" Oh hell, I didn't pay attention to this line before. > "je 1f \n\t" > "mov %%" _ASM_SP ", %c[

Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-15 Thread Radim Krčmář
2018-03-15 16:19+0100, Vitaly Kuznetsov: > Paolo Bonzini writes: > > > On 09/03/2018 15:02, Vitaly Kuznetsov wrote: > >> Enlightened VMCS is just a structure in memory, the main benefit > >> besides avoiding somewhat slower VMREAD/VMWRITE is using clean field > >> mask: we

Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-15 Thread Radim Krčmář
2018-03-15 16:19+0100, Vitaly Kuznetsov: > Paolo Bonzini writes: > > > On 09/03/2018 15:02, Vitaly Kuznetsov wrote: > >> Enlightened VMCS is just a structure in memory, the main benefit > >> besides avoiding somewhat slower VMREAD/VMWRITE is using clean field > >> mask: we tell the underlying

Re: [RFC 3/3] arch/x86/kvm: SVM: Introduce pause loop exit logic in SVM

2018-03-14 Thread Radim Krčmář
2018-03-10 05:07+, Moger, Babu: > Radim, > Thanks for the comments. Taken care of most of the comments. > I have few questions/comments. Please see inline. > > > -Original Message----- > > From: Radim Krčmář <rkrc...@redhat.com> > > Sent: Friday,

Re: [RFC 3/3] arch/x86/kvm: SVM: Introduce pause loop exit logic in SVM

2018-03-14 Thread Radim Krčmář
2018-03-10 05:07+, Moger, Babu: > Radim, > Thanks for the comments. Taken care of most of the comments. > I have few questions/comments. Please see inline. > > > -Original Message----- > > From: Radim Krčmář > > Sent: Friday, March 9, 2018 12:13 PM

Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-13 Thread Radim Krčmář
2018-03-12 15:19+0100, Vitaly Kuznetsov: > Thomas Gleixner writes: > > > On Fri, 9 Mar 2018, Vitaly Kuznetsov wrote: > > > >> Enlightened VMCS is just a structure in memory, the main benefit > >> besides avoiding somewhat slower VMREAD/VMWRITE is using clean field > >> mask:

Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-13 Thread Radim Krčmář
2018-03-12 15:19+0100, Vitaly Kuznetsov: > Thomas Gleixner writes: > > > On Fri, 9 Mar 2018, Vitaly Kuznetsov wrote: > > > >> Enlightened VMCS is just a structure in memory, the main benefit > >> besides avoiding somewhat slower VMREAD/VMWRITE is using clean field > >> mask: we tell the

[GIT PULL] KVM fixes for Linux 4.16-rc5

2018-03-09 Thread Radim Krčmář
fault handler KVM: PPC: Book3S HV: Fix VRMA initialization with 2MB or 1GB memory backing Radim Krčmář (2): Merge tag 'kvm-ppc-fixes-4.16-1' of git://git.kernel.org/.../paulus/powerpc Merge tag 'kvm-s390-master-4.16-3' of git://git.kernel.org/.../kvms390/linux arch/powerpc

[GIT PULL] KVM fixes for Linux 4.16-rc5

2018-03-09 Thread Radim Krčmář
fault handler KVM: PPC: Book3S HV: Fix VRMA initialization with 2MB or 1GB memory backing Radim Krčmář (2): Merge tag 'kvm-ppc-fixes-4.16-1' of git://git.kernel.org/.../paulus/powerpc Merge tag 'kvm-s390-master-4.16-3' of git://git.kernel.org/.../kvms390/linux arch/powerpc

Re: [RFC 3/3] arch/x86/kvm: SVM: Introduce pause loop exit logic in SVM

2018-03-09 Thread Radim Krčmář
2018-03-02 11:17-0500, Babu Moger: > Bring the PLE(pause loop exit) logic to AMD svm driver. > We have noticed it help in situations where numerous pauses are generated > due to spinlock or other scenarios. Tested it with idle=poll and noticed > pause interceptions go down considerably. > >

Re: [RFC 3/3] arch/x86/kvm: SVM: Introduce pause loop exit logic in SVM

2018-03-09 Thread Radim Krčmář
2018-03-02 11:17-0500, Babu Moger: > Bring the PLE(pause loop exit) logic to AMD svm driver. > We have noticed it help in situations where numerous pauses are generated > due to spinlock or other scenarios. Tested it with idle=poll and noticed > pause interceptions go down considerably. > >

Re: [PATCH v2 2/3] x86/kvm/hyper-v: remove stale entries from vec_bitmap/auto_eoi_bitmap on vector change

2018-03-09 Thread Radim Krčmář
2018-03-09 16:21+0100, Vitaly Kuznetsov: > Radim Krčmář <rkrc...@redhat.com> writes: > > This looks like it solves the problem when we get two SINTs with the > > same vector back-to-back , but shouldn't these bits really be cleared on > > EOI (either auto or manual)?

Re: [PATCH v2 2/3] x86/kvm/hyper-v: remove stale entries from vec_bitmap/auto_eoi_bitmap on vector change

2018-03-09 Thread Radim Krčmář
2018-03-09 16:21+0100, Vitaly Kuznetsov: > Radim Krčmář writes: > > This looks like it solves the problem when we get two SINTs with the > > same vector back-to-back , but shouldn't these bits really be cleared on > > EOI (either auto or manual)? > > Hmm, &

Re: [PATCH v2 2/3] x86/kvm/hyper-v: remove stale entries from vec_bitmap/auto_eoi_bitmap on vector change

2018-03-08 Thread Radim Krčmář
2018-03-01 15:15+0100, Vitaly Kuznetsov: > When a new vector is written to SINx we update vec_bitmap/auto_eoi_bitmap > but we forget to remove old vector from these masks (in case it is not > present in some other SINTx). > > Signed-off-by: Vitaly Kuznetsov > Reviewed-by:

Re: [PATCH v2 2/3] x86/kvm/hyper-v: remove stale entries from vec_bitmap/auto_eoi_bitmap on vector change

2018-03-08 Thread Radim Krčmář
2018-03-01 15:15+0100, Vitaly Kuznetsov: > When a new vector is written to SINx we update vec_bitmap/auto_eoi_bitmap > but we forget to remove old vector from these masks (in case it is not > present in some other SINTx). > > Signed-off-by: Vitaly Kuznetsov > Reviewed-by: Roman Kagan > --- >

Re: [PATCH 1/3] KVM: X86: Provides userspace with a capability to not intercept MWAIT

2018-03-08 Thread Radim Krčmář
2018-03-08 21:31+0100, Radim Krčmář: > 2018-03-01 17:49+0800, Wanpeng Li: > > @@ -264,10 +262,12 @@ static inline u64 nsec_to_cycles(struct kvm_vcpu > > *vcpu, u64 nsec) > > __rem; \ > > }) > > > >

Re: [PATCH 1/3] KVM: X86: Provides userspace with a capability to not intercept MWAIT

2018-03-08 Thread Radim Krčmář
2018-03-08 21:31+0100, Radim Krčmář: > 2018-03-01 17:49+0800, Wanpeng Li: > > @@ -264,10 +262,12 @@ static inline u64 nsec_to_cycles(struct kvm_vcpu > > *vcpu, u64 nsec) > > __rem; \ > > }) > > > >

Re: [PATCH 3/3] KVM: X86: Provides userspace with a capability to not intercept PAUSE

2018-03-08 Thread Radim Krčmář
2018-03-01 17:49+0800, Wanpeng Li: > From: Wanpeng Li > > Allow to disable pause loop exit/pause filtering on a per VM basis. > > If some VMs have dedicated host CPUs, they won't be negatively affected > due to needlessly intercepted PAUSE instructions. > > Thanks to Jan

Re: [PATCH 3/3] KVM: X86: Provides userspace with a capability to not intercept PAUSE

2018-03-08 Thread Radim Krčmář
2018-03-01 17:49+0800, Wanpeng Li: > From: Wanpeng Li > > Allow to disable pause loop exit/pause filtering on a per VM basis. > > If some VMs have dedicated host CPUs, they won't be negatively affected > due to needlessly intercepted PAUSE instructions. > > Thanks to Jan H. Schönherr's initial

Re: [PATCH 2/3] KVM: X86: Provides userspace with a capability to not intercept HLT

2018-03-08 Thread Radim Krčmář
2018-03-01 17:49+0800, Wanpeng Li: > From: Wanpeng Li <wanpen...@tencent.com> > > If host CPUs are dedicated to a VM, we can avoid VM exits on HLT. > This patch adds the per-VM non-HLT-exiting capability. > > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc:

Re: [PATCH 2/3] KVM: X86: Provides userspace with a capability to not intercept HLT

2018-03-08 Thread Radim Krčmář
2018-03-01 17:49+0800, Wanpeng Li: > From: Wanpeng Li > > If host CPUs are dedicated to a VM, we can avoid VM exits on HLT. > This patch adds the per-VM non-HLT-exiting capability. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-off-by: Wanpeng Li > --- > dif

Re: [PATCH 1/3] KVM: X86: Provides userspace with a capability to not intercept MWAIT

2018-03-08 Thread Radim Krčmář
the host. > > Don't give a guest that power over a host by default. (Especially, > since nothing prevents a guest from using MWAIT even when it is not > advertised via CPUID.) > > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Radim Krčmář <rkrc...@redhat.com&

Re: [PATCH 1/3] KVM: X86: Provides userspace with a capability to not intercept MWAIT

2018-03-08 Thread Radim Krčmář
ve a guest that power over a host by default. (Especially, > since nothing prevents a guest from using MWAIT even when it is not > advertised via CPUID.) > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-off-by: Wanpeng Li > --- > diff --git a/Documentation/virtual/kvm/a

Re: [PATCH v2 5/5] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-08 Thread Radim Krčmář
2018-03-08 11:23+0100, Vitaly Kuznetsov: > Radim Krčmář <rkrc...@redhat.com> writes: > > 2018-02-26 18:11+0100, Vitaly Kuznetsov: > >> @@ -3828,7 +4302,12 @@ static __init int setup_vmcs_config(struct > >> vmcs_config *vmcs_conf) > >>vmcs_conf->si

Re: [PATCH v2 5/5] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-08 Thread Radim Krčmář
2018-03-08 11:23+0100, Vitaly Kuznetsov: > Radim Krčmář writes: > > 2018-02-26 18:11+0100, Vitaly Kuznetsov: > >> @@ -3828,7 +4302,12 @@ static __init int setup_vmcs_config(struct > >> vmcs_config *vmcs_conf) > >>vmcs_conf->size = vmx_msr_high & 0

Re: [PATCH] KVM: x86: Make enum conversion explicit in kvm_pdptr_read()

2018-03-07 Thread Radim Krčmář
2018-02-26 14:42-0800, Matthias Kaehlcke: > The type 'enum kvm_reg_ex' is an extension of 'enum kvm_reg', however > the extension is only semantical and the compiler doesn't know about the > relationship between the two types. In kvm_pdptr_read() a value of the > extended type is passed to

Re: [PATCH] KVM: x86: Make enum conversion explicit in kvm_pdptr_read()

2018-03-07 Thread Radim Krčmář
2018-02-26 14:42-0800, Matthias Kaehlcke: > The type 'enum kvm_reg_ex' is an extension of 'enum kvm_reg', however > the extension is only semantical and the compiler doesn't know about the > relationship between the two types. In kvm_pdptr_read() a value of the > extended type is passed to

Re: [PATCH v2 1/5] x86/kvm: rename HV_X64_MSR_APIC_ASSIST_PAGE to HV_X64_MSR_VP_ASSIST_PAGE

2018-03-07 Thread Radim Krčmář
2018-03-07 19:48+0300, Roman Kagan: > On Wed, Mar 07, 2018 at 05:19:44PM +0100, Radim Krčmář wrote: > > 2018-02-26 18:11+0100, Vitaly Kuznetsov: > > > diff --git a/arch/x86/include/uapi/asm/hyperv.h > > > b/arch/x86/include/uapi/asm/hyperv.h > &g

Re: [PATCH v2 1/5] x86/kvm: rename HV_X64_MSR_APIC_ASSIST_PAGE to HV_X64_MSR_VP_ASSIST_PAGE

2018-03-07 Thread Radim Krčmář
2018-03-07 19:48+0300, Roman Kagan: > On Wed, Mar 07, 2018 at 05:19:44PM +0100, Radim Krčmář wrote: > > 2018-02-26 18:11+0100, Vitaly Kuznetsov: > > > diff --git a/arch/x86/include/uapi/asm/hyperv.h > > > b/arch/x86/include/uapi/asm/hyperv.h > &g

Re: [PATCH v2 5/5] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-07 Thread Radim Krčmář
2018-02-26 18:11+0100, Vitaly Kuznetsov: > Enlightened VMCS is just a structure in memory, the main benefit > besides avoiding somewhat slower VMREAD/VMWRITE is using clean field > mask: we tell the underlying hypervisor which fields were modified > since VMEXIT so there's no need to inspect them

Re: [PATCH v2 5/5] x86/kvm: use Enlightened VMCS when running on Hyper-V

2018-03-07 Thread Radim Krčmář
2018-02-26 18:11+0100, Vitaly Kuznetsov: > Enlightened VMCS is just a structure in memory, the main benefit > besides avoiding somewhat slower VMREAD/VMWRITE is using clean field > mask: we tell the underlying hypervisor which fields were modified > since VMEXIT so there's no need to inspect them

Re: [PATCH v2 1/5] x86/kvm: rename HV_X64_MSR_APIC_ASSIST_PAGE to HV_X64_MSR_VP_ASSIST_PAGE

2018-03-07 Thread Radim Krčmář
2018-02-26 18:11+0100, Vitaly Kuznetsov: > From: Ladi Prosek > > The assist page has been used only for the paravirtual EOI so far, hence > the "APIC" in the MSR name. Renaming to match the Hyper-V TLFS where it's > called "Virtual VP Assist MSR". > > Signed-off-by: Ladi

Re: [PATCH v2 1/5] x86/kvm: rename HV_X64_MSR_APIC_ASSIST_PAGE to HV_X64_MSR_VP_ASSIST_PAGE

2018-03-07 Thread Radim Krčmář
2018-02-26 18:11+0100, Vitaly Kuznetsov: > From: Ladi Prosek > > The assist page has been used only for the paravirtual EOI so far, hence > the "APIC" in the MSR name. Renaming to match the Hyper-V TLFS where it's > called "Virtual VP Assist MSR". > > Signed-off-by: Ladi Prosek >

Re: [PATCH 0/2] KVM: nVMX: expose VMX capabilities as MSR features

2018-03-07 Thread Radim Krčmář
2018-02-26 13:40+0100, Paolo Bonzini: > These patches add the VMX capability MSRs to the /dev/kvm ioctls > KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS, so that userspace > can easily probe which VMX features are actually supported by KVM. > > This will help the implementation of nested

Re: [PATCH 0/2] KVM: nVMX: expose VMX capabilities as MSR features

2018-03-07 Thread Radim Krčmář
2018-02-26 13:40+0100, Paolo Bonzini: > These patches add the VMX capability MSRs to the /dev/kvm ioctls > KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS, so that userspace > can easily probe which VMX features are actually supported by KVM. > > This will help the implementation of nested

Re: [PATCH] KVM: VMX: expose the host's ARCH_CAPABILITIES MSR to userspace

2018-03-07 Thread Radim Krčmář
2018-03-07 16:10+0100, Paolo Bonzini: > On 07/03/2018 15:56, Radim Krčmář wrote: > > The MSR_F10H_DECFG default is questionable -- MSR_F10H_DECFG is an > > architectural MSR, so we'd be changing the guest under the sight of > > existing userspaces. > > A potential se

Re: [PATCH] KVM: VMX: expose the host's ARCH_CAPABILITIES MSR to userspace

2018-03-07 Thread Radim Krčmář
2018-03-07 16:10+0100, Paolo Bonzini: > On 07/03/2018 15:56, Radim Krčmář wrote: > > The MSR_F10H_DECFG default is questionable -- MSR_F10H_DECFG is an > > architectural MSR, so we'd be changing the guest under the sight of > > existing userspaces. > > A potential se

Re: [PATCH] KVM: VMX: expose the host's ARCH_CAPABILITIES MSR to userspace

2018-03-07 Thread Radim Krčmář
2018-03-07 12:53+0100, Paolo Bonzini: > On 02/03/2018 22:42, Radim Krčmář wrote: > > Ok, sounds good. I've deferred it to rc5 as I think we'll want to use > > this to replace the auto setting: I would not bet that it is going to > > be safe to expose future bits, so having

Re: [PATCH] KVM: VMX: expose the host's ARCH_CAPABILITIES MSR to userspace

2018-03-07 Thread Radim Krčmář
2018-03-07 12:53+0100, Paolo Bonzini: > On 02/03/2018 22:42, Radim Krčmář wrote: > > Ok, sounds good. I've deferred it to rc5 as I think we'll want to use > > this to replace the auto setting: I would not bet that it is going to > > be safe to expose future bits, so having

Re: [PATCH] KVM: lapic: stop advertising DIRECTED_EOI when in-kernel IOAPIC is in use

2018-03-07 Thread Radim Krčmář
2018-03-05 11:29+0100, Vitaly Kuznetsov: > Vitaly Kuznetsov writes: > > > Devices which use level-triggered interrupts under Windows 2016 with > > Hyper-V role enabled don't work: Windows disables EOI broadcast in SPIV > > unconditionally. Our in-kernel IOAPIC implementation

Re: [PATCH] KVM: lapic: stop advertising DIRECTED_EOI when in-kernel IOAPIC is in use

2018-03-07 Thread Radim Krčmář
2018-03-05 11:29+0100, Vitaly Kuznetsov: > Vitaly Kuznetsov writes: > > > Devices which use level-triggered interrupts under Windows 2016 with > > Hyper-V role enabled don't work: Windows disables EOI broadcast in SPIV > > unconditionally. Our in-kernel IOAPIC implementation emulates an old

Re: [PATCH] KVM: VMX: expose the host's ARCH_CAPABILITIES MSR to userspace

2018-03-02 Thread Radim Krčmář
2018-03-02 10:36+0100, Paolo Bonzini: > On 01/03/2018 22:39, Radim Krčmář wrote: > > [Resent after removing g...@char.us.oracle.com.] > > > > 2018-02-26 17:13-0500, Konrad Rzeszutek Wilk: > >> On Sat, Feb 24, 2018 at 01:52:26AM +0100, Paolo Bonzini wrote: > >

Re: [PATCH] KVM: VMX: expose the host's ARCH_CAPABILITIES MSR to userspace

2018-03-02 Thread Radim Krčmář
2018-03-02 10:36+0100, Paolo Bonzini: > On 01/03/2018 22:39, Radim Krčmář wrote: > > [Resent after removing g...@char.us.oracle.com.] > > > > 2018-02-26 17:13-0500, Konrad Rzeszutek Wilk: > >> On Sat, Feb 24, 2018 at 01:52:26AM +0100, Paolo Bonzini wrote: > >

[GIT PULL] KVM fixes for Linux 4.16-rc4

2018-03-02 Thread Radim Krčmář
- optimize spectre v1 mitigations by allowing guests to use LFENCE - make microcode revision configurable to prevent guests from unnecessarily blacklisting spectre v2 mitigation features Radim Krčmář (1): KVM: x86: fix vcpu

[GIT PULL] KVM fixes for Linux 4.16-rc4

2018-03-02 Thread Radim Krčmář
- optimize spectre v1 mitigations by allowing guests to use LFENCE - make microcode revision configurable to prevent guests from unnecessarily blacklisting spectre v2 mitigation features Radim Krčmář (1): KVM: x86: fix vcpu

Re: [PATCH RESEND v5 1/2] KVM: X86: Introduce kvm_get_msr_feature()

2018-03-02 Thread Radim Krčmář
2018-02-28 14:03+0800, Wanpeng Li: > From: Wanpeng Li <wanpen...@tencent.com> > > Introduce kvm_get_msr_feature() to handle the msrs which are supported > by different vendors and sharing the same emulation logic. > > Cc: Paolo Bonzini <pbonz...@redhat.co

Re: [PATCH RESEND v5 1/2] KVM: X86: Introduce kvm_get_msr_feature()

2018-03-02 Thread Radim Krčmář
2018-02-28 14:03+0800, Wanpeng Li: > From: Wanpeng Li > > Introduce kvm_get_msr_feature() to handle the msrs which are supported > by different vendors and sharing the same emulation logic. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Liran Alon > Cc: Nadav

Re: [PATCH] KVM: VMX: expose the host's ARCH_CAPABILITIES MSR to userspace

2018-03-01 Thread Radim Krčmář
[Resent after removing g...@char.us.oracle.com.] 2018-02-26 17:13-0500, Konrad Rzeszutek Wilk: > On Sat, Feb 24, 2018 at 01:52:26AM +0100, Paolo Bonzini wrote: > > Use the new MSR feature framework to expose the ARCH_CAPABILITIES MSR to > > userspace. This way, userspace can access the

Re: [PATCH] KVM: VMX: expose the host's ARCH_CAPABILITIES MSR to userspace

2018-03-01 Thread Radim Krčmář
[Resent after removing g...@char.us.oracle.com.] 2018-02-26 17:13-0500, Konrad Rzeszutek Wilk: > On Sat, Feb 24, 2018 at 01:52:26AM +0100, Paolo Bonzini wrote: > > Use the new MSR feature framework to expose the ARCH_CAPABILITIES MSR to > > userspace. This way, userspace can access the

[PATCH] KVM: x86: fix vcpu initialization with userspace lapic

2018-03-01 Thread Radim Krčmář
ter VMCS creation") Cc: sta...@vger.kernel.org Signed-off-by: Radim Krčmář <rkrc...@redhat.com> --- arch/x86/kvm/lapic.c | 10 -- arch/x86/kvm/x86.c | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index cc5fe

[PATCH] KVM: x86: fix vcpu initialization with userspace lapic

2018-03-01 Thread Radim Krčmář
Signed-off-by: Radim Krčmář --- arch/x86/kvm/lapic.c | 10 -- arch/x86/kvm/x86.c | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index cc5fe7a50dde..391dda8d43b7 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/k

[GIT PULL] KVM updates for Linux 4.16-rc1

2018-02-10 Thread Radim Krčmář
topic/ppc-kvm' into kvm-ppc-next KVM: PPC: Book3S HV: Drop locks before reading guest memory KVM: PPC: Book3S HV: Fix handling of secondary HPTEG in HPT resizing code Quan Xu (1): KVM: VMX: drop I/O permission bitmaps Radim Krčmář (11): KVM: x86: prevent MWAIT in gues

[GIT PULL] KVM updates for Linux 4.16-rc1

2018-02-10 Thread Radim Krčmář
topic/ppc-kvm' into kvm-ppc-next KVM: PPC: Book3S HV: Drop locks before reading guest memory KVM: PPC: Book3S HV: Fix handling of secondary HPTEG in HPT resizing code Quan Xu (1): KVM: VMX: drop I/O permission bitmaps Radim Krčmář (11): KVM: x86: prevent MWAIT in gues

Re: [PATCH 2/2] KVM: X86: Add per-VM no-HLT-exiting capability

2018-02-02 Thread Radim Krčmář
2018-02-01 23:11-0800, Wanpeng Li: > From: Wanpeng Li <wanpen...@tencent.com> > > If host CPUs are dedicated to a VM, we can avoid VM exits on HLT. > This patch adds the per-VM non-HLT-exiting capability. > > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc:

Re: [PATCH 2/2] KVM: X86: Add per-VM no-HLT-exiting capability

2018-02-02 Thread Radim Krčmář
2018-02-01 23:11-0800, Wanpeng Li: > From: Wanpeng Li > > If host CPUs are dedicated to a VM, we can avoid VM exits on HLT. > This patch adds the per-VM non-HLT-exiting capability. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-off-by: Wanpeng Li > --- SMM

Re: linux-next: manual merge of the kvm tree with Linus' tree

2018-02-02 Thread Radim Krčmář
2018-02-02 11:20+1100, Stephen Rothwell: > Hi Radim, > > On Thu, 1 Feb 2018 16:22:44 +0100 Radim Krčmář <rkrc...@redhat.com> wrote: > > > > I wasn't sure if the pti top branch is final, so I pulled hyper-v topic > > branch that also also contains v4.15. This

Re: linux-next: manual merge of the kvm tree with Linus' tree

2018-02-02 Thread Radim Krčmář
2018-02-02 11:20+1100, Stephen Rothwell: > Hi Radim, > > On Thu, 1 Feb 2018 16:22:44 +0100 Radim Krčmář wrote: > > > > I wasn't sure if the pti top branch is final, so I pulled hyper-v topic > > branch that also also contains v4.15. This and the SEV feature >

[PATCH v2] KVM: x86: fix backward migration with async_PF

2018-02-01 Thread Radim Krčmář
and nothing else. Fixes: 52a5c155cf79 ("KVM: async_pf: Let guest support delivery of async_pf from guest mode") Cc: <sta...@vger.kernel.org> Signed-off-by: Radim Krčmář <rkrc...@redhat.com> --- v2: * added documentation [Paolo] * retained compatibility recent kernels [Paolo] --- Doc

[PATCH v2] KVM: x86: fix backward migration with async_PF

2018-02-01 Thread Radim Krčmář
and nothing else. Fixes: 52a5c155cf79 ("KVM: async_pf: Let guest support delivery of async_pf from guest mode") Cc: Signed-off-by: Radim Krčmář --- v2: * added documentation [Paolo] * retained compatibility recent kernels [Paolo] --- Documentation/virtual/kvm/cpuid.txt | 4 Documentati

Re: [PATCH] KVM: x86: fix backward migration with async_PF

2018-02-01 Thread Radim Krčmář
2018-02-01 13:09-0500, Paolo Bonzini: > On 01/02/2018 12:50, Radim Krčmář wrote: > > Guests on new hypersiors might set KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT > > bit when enabling async_PF, but this bit is reserved on old hypervisors, > > which results in a failure upon migra

Re: [PATCH] KVM: x86: fix backward migration with async_PF

2018-02-01 Thread Radim Krčmář
2018-02-01 13:09-0500, Paolo Bonzini: > On 01/02/2018 12:50, Radim Krčmář wrote: > > Guests on new hypersiors might set KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT > > bit when enabling async_PF, but this bit is reserved on old hypervisors, > > which results in a failure upon migra

[PATCH] KVM: x86: fix backward migration with async_PF

2018-02-01 Thread Radim Krčmář
userspace to handle migration compatibility by adding a KVM CPUID flag that determines the presence of KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT. Fixes: 52a5c155cf79 ("KVM: async_pf: Let guest support delivery of async_pf from guest mode") Cc: <sta...@vger.kernel.org> Signed-off-by: Ra

[PATCH] KVM: x86: fix backward migration with async_PF

2018-02-01 Thread Radim Krčmář
userspace to handle migration compatibility by adding a KVM CPUID flag that determines the presence of KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT. Fixes: 52a5c155cf79 ("KVM: async_pf: Let guest support delivery of async_pf from guest mode") Cc: Signed-off-by: Radim Krčmář --- arch/x86/includ

Re: [PATCH v3 0/3] Per-VCPU MSR bitmaps patches - topic branch for x86/pti

2018-02-01 Thread Radim Krčmář
2018-01-31 20:48-0500, Konrad Rzeszutek Wilk: > On Wed, Jan 31, 2018 at 04:09:21PM -0500, Paolo Bonzini wrote: > > David and others, > > > > the following changes since commit ba804bb4b72e57374b5f567b783aa0298fba0ce6: > > > > Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Re: [PATCH v3 0/3] Per-VCPU MSR bitmaps patches - topic branch for x86/pti

2018-02-01 Thread Radim Krčmář
2018-01-31 20:48-0500, Konrad Rzeszutek Wilk: > On Wed, Jan 31, 2018 at 04:09:21PM -0500, Paolo Bonzini wrote: > > David and others, > > > > the following changes since commit ba804bb4b72e57374b5f567b783aa0298fba0ce6: > > > > Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Re: [PATCH] KVM/x86: remove WARN_ON() for when vm_munmap() fails

2018-02-01 Thread Radim Krčmář
2018-01-31 17:30-0800, Eric Biggers: > From: Eric Biggers > > On x86, special KVM memslots such as the TSS region have anonymous > memory mappings created on behalf of userspace, and these mappings are > removed when the VM is destroyed. > > It is however possible for

<    1   2   3   4   5   6   7   8   9   10   >