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 removing these mappings

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

2018-02-01 Thread Radim Krčmář
2018-02-01 09:21-0500, Paolo Bonzini: > On 01/02/2018 08:22, Stephen Rothwell wrote: > > Hi Christoffer, > > > > On Thu, 1 Feb 2018 11:47:07 +0100 Christoffer Dall > > wrote: > >> > >> While the suggested fix is functional it does result in some code > >>

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

2018-02-01 Thread Radim Krčmář
2018-02-01 09:21-0500, Paolo Bonzini: > On 01/02/2018 08:22, Stephen Rothwell wrote: > > Hi Christoffer, > > > > On Thu, 1 Feb 2018 11:47:07 +0100 Christoffer Dall > > wrote: > >> > >> While the suggested fix is functional it does result in some code > >> duplication, and the better resolution

Re: [PATCH v2 3/3] KVM: VMX: make MSR bitmaps per-VCPU

2018-01-31 Thread Radim Krčmář
2018-01-31 12:37-0500, Paolo Bonzini: > On 30/01/2018 11:23, Radim Krčmář wrote: > > 2018-01-27 09:50+0100, Paolo Bonzini: > >> Place the MSR bitmap in struct loaded_vmcs, and update it in place > >> every time the x2apic or APICv state can change. This is rare and

Re: [PATCH v2 3/3] KVM: VMX: make MSR bitmaps per-VCPU

2018-01-31 Thread Radim Krčmář
2018-01-31 12:37-0500, Paolo Bonzini: > On 30/01/2018 11:23, Radim Krčmář wrote: > > 2018-01-27 09:50+0100, Paolo Bonzini: > >> Place the MSR bitmap in struct loaded_vmcs, and update it in place > >> every time the x2apic or APICv state can change. This is rare and

[PATCH] KVM: nVMX: preserve SECONDARY_EXEC_DESC without UMIP

2018-01-31 Thread Radim Krčmář
if UMIP is disabled. Fixes: 0367f205a3b7 ("KVM: vmx: add support for emulating UMIP") Signed-off-by: Radim Krčmář <rkrc...@redhat.com> --- I haven't tested emulated UMIP (yet) nor machines with UMIP, but at least kvm-unit-tests don't throw an error anymore. arch/x86/kvm/vmx.c | 3 ++-

[PATCH] KVM: nVMX: preserve SECONDARY_EXEC_DESC without UMIP

2018-01-31 Thread Radim Krčmář
if UMIP is disabled. Fixes: 0367f205a3b7 ("KVM: vmx: add support for emulating UMIP") Signed-off-by: Radim Krčmář --- I haven't tested emulated UMIP (yet) nor machines with UMIP, but at least kvm-unit-tests don't throw an error anymore. arch/x86/kvm/vmx.c | 3 ++- 1 file changed, 2 insert

Re: [PATCH v2 3/3] KVM: VMX: make MSR bitmaps per-VCPU

2018-01-30 Thread Radim Krčmář
2018-01-27 09:50+0100, Paolo Bonzini: > Place the MSR bitmap in struct loaded_vmcs, and update it in place > every time the x2apic or APICv state can change. This is rare and > the loop can handle 64 MSRs per iteration, in a similar fashion as > nested_vmx_prepare_msr_bitmap. > > This prepares

Re: [PATCH v2 3/3] KVM: VMX: make MSR bitmaps per-VCPU

2018-01-30 Thread Radim Krčmář
2018-01-27 09:50+0100, Paolo Bonzini: > Place the MSR bitmap in struct loaded_vmcs, and update it in place > every time the x2apic or APICv state can change. This is rare and > the loop can handle 64 MSRs per iteration, in a similar fashion as > nested_vmx_prepare_msr_bitmap. > > This prepares

Re: [PATCH] kvm: x86: remove efer_reload entry in kvm_vcpu_stat

2018-01-30 Thread Radim Krčmář
2018-01-26 17:34+0800, Longpeng(Mike): > The efer_reload is never used since > commit 26bb0981b3ff ("KVM: VMX: Use shared msr infrastructure"), > so remove it. > > Signed-off-by: Longpeng(Mike) > --- Queued, thanks.

Re: [PATCH] kvm: x86: remove efer_reload entry in kvm_vcpu_stat

2018-01-30 Thread Radim Krčmář
2018-01-26 17:34+0800, Longpeng(Mike): > The efer_reload is never used since > commit 26bb0981b3ff ("KVM: VMX: Use shared msr infrastructure"), > so remove it. > > Signed-off-by: Longpeng(Mike) > --- Queued, thanks.

Re: [PATCH v4 5/7] x86/irq: Count Hyper-V reenlightenment interrupts

2018-01-30 Thread Radim Krčmář
2018-01-29 22:48+0100, Thomas Gleixner: > On Wed, 24 Jan 2018, Radim Krčmář wrote: > > 2018-01-24 14:23+0100, Vitaly Kuznetsov: > > > Hyper-V reenlightenment interrupts arrive when the VM is migrated, we're > > > not supposed to see many of them. However,

Re: [PATCH v4 5/7] x86/irq: Count Hyper-V reenlightenment interrupts

2018-01-30 Thread Radim Krčmář
2018-01-29 22:48+0100, Thomas Gleixner: > On Wed, 24 Jan 2018, Radim Krčmář wrote: > > 2018-01-24 14:23+0100, Vitaly Kuznetsov: > > > Hyper-V reenlightenment interrupts arrive when the VM is migrated, we're > > > not supposed to see many of them. However,

Re: [PATCH] KVM:x86: AMD Processor Topology Information

2018-01-30 Thread Radim Krčmář
2018-01-29 11:39-0500, Babu Moger: > From: Stanislav Lanci > > This patch allow to enable x86 feature TOPOEXT. This is needed to provide > information about SMT on AMD Zen CPUs to the guest. > > Signed-off-by: Stanislav Lanci > Tested-by: Nick Sarnie

Re: [PATCH] KVM:x86: AMD Processor Topology Information

2018-01-30 Thread Radim Krčmář
2018-01-29 11:39-0500, Babu Moger: > From: Stanislav Lanci > > This patch allow to enable x86 feature TOPOEXT. This is needed to provide > information about SMT on AMD Zen CPUs to the guest. > > Signed-off-by: Stanislav Lanci > Tested-by: Nick Sarnie > Reviewed-by: Paolo Bonzini >

Re: [PATCH v2] x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested

2018-01-25 Thread Radim Krčmář
confirmed they don't fill > > VM_EXIT_INSTRUCTION_LEN on EPT MISCONFIG. > > > > Fix the issue by doing instruction skip through emulator when running > > nested. > > > > Fixes: 68c3b4d1676d870f0453c31d5a52e7e65c7448ae > > Suggested-by: Radim Krčmář <r

Re: [PATCH v2] x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested

2018-01-25 Thread Radim Krčmář
confirmed they don't fill > > VM_EXIT_INSTRUCTION_LEN on EPT MISCONFIG. > > > > Fix the issue by doing instruction skip through emulator when running > > nested. > > > > Fixes: 68c3b4d1676d870f0453c31d5a52e7e65c7448ae > > Suggested-by: Radim Krčmář >

[GIT PULL] KVM fixes for Linux 4.15(-rc10)

2018-01-25 Thread Radim Krčmář
. Christian Borntraeger (1): KVM: s390: add proper locking for CMMA migration bitmap Radim Krčmář (1): Merge tag 'kvm-s390-master-4.15-3' of git://git.kernel.org/.../kvms390/linux arch/s390/kvm/kvm-s390.c | 18

[GIT PULL] KVM fixes for Linux 4.15(-rc10)

2018-01-25 Thread Radim Krčmář
. Christian Borntraeger (1): KVM: s390: add proper locking for CMMA migration bitmap Radim Krčmář (1): Merge tag 'kvm-s390-master-4.15-3' of git://git.kernel.org/.../kvms390/linux arch/s390/kvm/kvm-s390.c | 18

Re: [PATCH] x86/kvm: disable fast MMIO when running nested

2018-01-25 Thread Radim Krčmář
2018-01-24 16:12+0100, Vitaly Kuznetsov: > I was investigating an issue with seabios >= 1.10 which stopped working > for nested KVM on Hyper-V. The problem appears to be in > handle_ept_violation() function: when we do fast mmio we need to skip > the instruction so we do

Re: [PATCH] x86/kvm: disable fast MMIO when running nested

2018-01-25 Thread Radim Krčmář
2018-01-24 16:12+0100, Vitaly Kuznetsov: > I was investigating an issue with seabios >= 1.10 which stopped working > for nested KVM on Hyper-V. The problem appears to be in > handle_ept_violation() function: when we do fast mmio we need to skip > the instruction so we do

Re: [PATCH] x86/kvm: disable fast MMIO when running nested

2018-01-25 Thread Radim Krčmář
2018-01-25 01:55-0800, Liran Alon: > - vkuzn...@redhat.com wrote: > > I was investigating an issue with seabios >= 1.10 which stopped > > working > > for nested KVM on Hyper-V. The problem appears to be in > > handle_ept_violation() function: when we do fast mmio we need to skip > > the

Re: [PATCH] x86/kvm: disable fast MMIO when running nested

2018-01-25 Thread Radim Krčmář
2018-01-25 01:55-0800, Liran Alon: > - vkuzn...@redhat.com wrote: > > I was investigating an issue with seabios >= 1.10 which stopped > > working > > for nested KVM on Hyper-V. The problem appears to be in > > handle_ept_violation() function: when we do fast mmio we need to skip > > the

Re: [PATCH v4 5/7] x86/irq: Count Hyper-V reenlightenment interrupts

2018-01-24 Thread Radim Krčmář
2018-01-24 14:23+0100, Vitaly Kuznetsov: > Hyper-V reenlightenment interrupts arrive when the VM is migrated, we're > not supposed to see many of them. However, it may be important to know > that the event has happened in case we have L2 nested guests. > > Signed-off-by: Vitaly Kuznetsov

Re: [PATCH v4 5/7] x86/irq: Count Hyper-V reenlightenment interrupts

2018-01-24 Thread Radim Krčmář
2018-01-24 14:23+0100, Vitaly Kuznetsov: > Hyper-V reenlightenment interrupts arrive when the VM is migrated, we're > not supposed to see many of them. However, it may be important to know > that the event has happened in case we have L2 nested guests. > > Signed-off-by: Vitaly Kuznetsov >

Re: [PATCH 4/5] s390: define ISOLATE_BP to run tasks with modified branch prediction

2018-01-24 Thread Radim Krčmář
2018-01-24 07:36+0100, Martin Schwidefsky: > On Tue, 23 Jan 2018 21:32:24 +0100 > Radim Krčmář <rkrc...@redhat.com> wrote: > > > 2018-01-23 15:21+0100, Christian Borntraeger: > > > Paolo, Radim, > > > > > > this patch not only allows to isola

Re: [PATCH 4/5] s390: define ISOLATE_BP to run tasks with modified branch prediction

2018-01-24 Thread Radim Krčmář
2018-01-24 07:36+0100, Martin Schwidefsky: > On Tue, 23 Jan 2018 21:32:24 +0100 > Radim Krčmář wrote: > > > 2018-01-23 15:21+0100, Christian Borntraeger: > > > Paolo, Radim, > > > > > > this patch not only allows to isolate a userspace process, i

Re: [PATCH 4/5] s390: define ISOLATE_BP to run tasks with modified branch prediction

2018-01-23 Thread Radim Krčmář
2018-01-23 15:21+0100, Christian Borntraeger: > Paolo, Radim, > > this patch not only allows to isolate a userspace process, it also allows us > to add a new interface for KVM that would allow us to isolate a KVM guest CPU > to no longer being able to inject branches in any host or other guests.

Re: [PATCH 4/5] s390: define ISOLATE_BP to run tasks with modified branch prediction

2018-01-23 Thread Radim Krčmář
2018-01-23 15:21+0100, Christian Borntraeger: > Paolo, Radim, > > this patch not only allows to isolate a userspace process, it also allows us > to add a new interface for KVM that would allow us to isolate a KVM guest CPU > to no longer being able to inject branches in any host or other guests.

[GIT PULL] KVM fixes for Linux 4.15(-rc9)

2018-01-20 Thread Radim Krčmář
of unimplemented SMC/HVC calls Paul Mackerras (1): KVM: PPC: Book3S: Provide information about hardware/firmware CVE workarounds Punit Agrawal (1): KVM: arm/arm64: Check pagesize when allocating a hugepage at Stage 2 Radim Krčmář (2): Merge tag 'kvm-arm-fixes-for-v4.15-3-v2' of git

[GIT PULL] KVM fixes for Linux 4.15(-rc9)

2018-01-20 Thread Radim Krčmář
of unimplemented SMC/HVC calls Paul Mackerras (1): KVM: PPC: Book3S: Provide information about hardware/firmware CVE workarounds Punit Agrawal (1): KVM: arm/arm64: Check pagesize when allocating a hugepage at Stage 2 Radim Krčmář (2): Merge tag 'kvm-arm-fixes-for-v4.15-3-v2' of git

Re: [RFC 0/6] Enlightened VMCS support for KVM on Hyper-V

2018-01-16 Thread Radim Krčmář
2018-01-15 18:30+0100, Vitaly Kuznetsov: > Early RFC. I'll refer to this patchset in my DevConf/FOSDEM > presentations. > > When running nested KVM on Hyper-V it's possible to use so called > 'Enlightened VMCS' and do normal memory reads/writes instead of > doing VMWRITE/VMREAD instructions.

Re: [RFC 0/6] Enlightened VMCS support for KVM on Hyper-V

2018-01-16 Thread Radim Krčmář
2018-01-15 18:30+0100, Vitaly Kuznetsov: > Early RFC. I'll refer to this patchset in my DevConf/FOSDEM > presentations. > > When running nested KVM on Hyper-V it's possible to use so called > 'Enlightened VMCS' and do normal memory reads/writes instead of > doing VMWRITE/VMREAD instructions.

[GIT PULL] KVM fixes for Linux 4.15-rc7

2018-01-06 Thread Radim Krčmář
overrun on memory hotplug during migration Jim Mattson (1): kvm: vmx: Scrub hardware GPRs at VM-exit Radim Krčmář (1): Merge tag 'kvm-s390-master-4.15-2' of git://git.kernel.org/.../kvms390/linux arch/s390/kvm/kvm-s390.c | 9 + arch/s390/kvm/priv.c | 2 +- arch/x86/kvm

[GIT PULL] KVM fixes for Linux 4.15-rc7

2018-01-06 Thread Radim Krčmář
overrun on memory hotplug during migration Jim Mattson (1): kvm: vmx: Scrub hardware GPRs at VM-exit Radim Krčmář (1): Merge tag 'kvm-s390-master-4.15-2' of git://git.kernel.org/.../kvms390/linux arch/s390/kvm/kvm-s390.c | 9 + arch/s390/kvm/priv.c | 2 +- arch/x86/kvm

[GIT PULL] KVM fixes for v4.15-rc3

2017-12-09 Thread Radim Krčmář
before use KVM: arm/arm64: vgic-v4: Only perform an unmap for valid vLPIs arm: KVM: Fix VTTBR_BADDR_MASK BUG_ON off-by-one KVM: arm/arm64: Fix spinlock acquisition in vgic_set_owner Radim Krčmář (3): Merge tag 'kvm-arm-fixes-for-v4.15-1' of git://git.kernel.org/.../kvmarm/kvmarm

[GIT PULL] KVM fixes for v4.15-rc3

2017-12-09 Thread Radim Krčmář
before use KVM: arm/arm64: vgic-v4: Only perform an unmap for valid vLPIs arm: KVM: Fix VTTBR_BADDR_MASK BUG_ON off-by-one KVM: arm/arm64: Fix spinlock acquisition in vgic_set_owner Radim Krčmář (3): Merge tag 'kvm-arm-fixes-for-v4.15-1' of git://git.kernel.org/.../kvmarm/kvmarm

Re: [PATCH v2] KVM: VMX: Cache IA32_DEBUGCTL in memory

2017-12-05 Thread Radim Krčmář
ed-by: Jim Mattson <jmatt...@google.com> > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Radim Krčmář <rkrc...@redhat.com> > Cc: Jim Mattson <jmatt...@google.com> > Signed-off-by: Wanpeng Li <wanpeng...@hotmail.com> > --- Queued, thanks. And there is another

Re: [PATCH v2] KVM: VMX: Cache IA32_DEBUGCTL in memory

2017-12-05 Thread Radim Krčmář
f vmx_vcpu_run cpu time is occupied by get_debugctlmsr(). > This patch caches the host IA32_DEBUGCTL MSR and saves/restores > the host IA32_DEBUGCTL msr when guest/host switches to avoid to > save/restore each time during world switch. > > Suggested-by: Jim Mattson > Cc: Pao

Re: [PATCH RFC 5/6] x86/kvm: pass stable clocksource to guests when running nested on Hyper-V

2017-12-01 Thread Radim Krčmář
2017-12-01 14:13+0100, Vitaly Kuznetsov: > Currently, KVM is able to work in 'masterclock' mode passing > PVCLOCK_TSC_STABLE_BIT to guests when the clocksource we use on the host > is TSC. When running nested on Hyper-V we normally use a different one: > TSC page which is resistant to TSC

Re: [PATCH RFC 5/6] x86/kvm: pass stable clocksource to guests when running nested on Hyper-V

2017-12-01 Thread Radim Krčmář
2017-12-01 14:13+0100, Vitaly Kuznetsov: > Currently, KVM is able to work in 'masterclock' mode passing > PVCLOCK_TSC_STABLE_BIT to guests when the clocksource we use on the host > is TSC. When running nested on Hyper-V we normally use a different one: > TSC page which is resistant to TSC

[PATCH 1/2] KVM: x86: fix APIC page invalidation

2017-11-30 Thread Radim Krčmář
: vmx: Implement set_apic_access_page_addr") Fixes: 369ea8242c0f ("mm/rmap: update to new mmu_notifier semantic v2") Signed-off-by: Radim Krčmář <rkrc...@redhat.com> --- arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/x86.c | 14 ++ virt/kvm/k

[PATCH 2/2] TESTING! KVM: x86: add invalidate_range mmu notifier

2017-11-30 Thread Radim Krčmář
Does roughly what kvm_mmu_notifier_invalidate_page did before. I am not certain why this would be needed. It might mean that we have another bug with start/end or just that I missed something. Please try just [1/2] first and apply this one only if [1/2] still bugs, thanks! ---

[PATCH 1/2] KVM: x86: fix APIC page invalidation

2017-11-30 Thread Radim Krčmář
: vmx: Implement set_apic_access_page_addr") Fixes: 369ea8242c0f ("mm/rmap: update to new mmu_notifier semantic v2") Signed-off-by: Radim Krčmář --- arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/x86.c | 14 ++ virt/kvm/kvm_main.c | 8 +

[PATCH 2/2] TESTING! KVM: x86: add invalidate_range mmu notifier

2017-11-30 Thread Radim Krčmář
Does roughly what kvm_mmu_notifier_invalidate_page did before. I am not certain why this would be needed. It might mean that we have another bug with start/end or just that I missed something. Please try just [1/2] first and apply this one only if [1/2] still bugs, thanks! ---

Re: BSOD with [PATCH 00/13] mmu_notifier kill invalidate_page callback

2017-11-30 Thread Radim Krčmář
2017-11-30 12:20+0100, Paolo Bonzini: > On 30/11/2017 10:33, Fabian Grünbichler wrote: > > > > It was reverted in 785373b4c38719f4af6775845df6be1dfaea120f after which > > the symptoms disappeared until this series was merged, which contains > > > > 369ea8242c0fb5239b4ddf0dc568f694bd244de4

Re: BSOD with [PATCH 00/13] mmu_notifier kill invalidate_page callback

2017-11-30 Thread Radim Krčmář
2017-11-30 12:20+0100, Paolo Bonzini: > On 30/11/2017 10:33, Fabian Grünbichler wrote: > > > > It was reverted in 785373b4c38719f4af6775845df6be1dfaea120f after which > > the symptoms disappeared until this series was merged, which contains > > > > 369ea8242c0fb5239b4ddf0dc568f694bd244de4

Re: [PATCH v7 2/4] KVM: X86: Add Paravirt TLB Shootdown

2017-11-30 Thread Radim Krčmář
2017-11-29 22:01-0800, Wanpeng Li: > From: Wanpeng Li > --- > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c > @@ -498,6 +498,34 @@ static void __init kvm_apf_trap_init(void) > update_intr_gate(X86_TRAP_PF, async_page_fault); > } > > +static

Re: [PATCH v7 2/4] KVM: X86: Add Paravirt TLB Shootdown

2017-11-30 Thread Radim Krčmář
2017-11-29 22:01-0800, Wanpeng Li: > From: Wanpeng Li > --- > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c > @@ -498,6 +498,34 @@ static void __init kvm_apf_trap_init(void) > update_intr_gate(X86_TRAP_PF, async_page_fault); > } > > +static DEFINE_PER_CPU(cpumask_var_t,

Re: [PATCH v6 2/4] KVM: X86: Add Paravirt TLB Shootdown

2017-11-30 Thread Radim Krčmář
2017-11-30 14:24+0800, Wanpeng Li: > 2017-11-30 0:21 GMT+08:00 Radim Krčmář <rkrc...@redhat.com>: > > 2017-11-27 20:05-0800, Wanpeng Li: > >> From: Wanpeng Li <wanpeng...@hotmail.com> > >> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c >

Re: [PATCH v6 2/4] KVM: X86: Add Paravirt TLB Shootdown

2017-11-30 Thread Radim Krčmář
2017-11-30 14:24+0800, Wanpeng Li: > 2017-11-30 0:21 GMT+08:00 Radim Krčmář : > > 2017-11-27 20:05-0800, Wanpeng Li: > >> From: Wanpeng Li > >> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c > >> @@ -498,6 +498,37 @@ stati

[PATCH v2 3/3] KVM: x86: simplify kvm_mwait_in_guest()

2017-11-29 Thread Radim Krčmář
_data," while at it. Signed-off-by: Radim Krčmář <rkrc...@redhat.com> --- arch/x86/kvm/x86.h | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index d15859ec5e92..c69f973111cb 100644 --- a/arch/x86/kvm/x86.h +++ b/

[PATCH v2 2/3] KVM: x86: drop bogus MWAIT check

2017-11-29 Thread Radim Krčmář
. Alternatively, we can return MWAIT exiting by default and let userspace toggle it. Signed-off-by: Radim Krčmář <rkrc...@redhat.com> --- arch/x86/kvm/x86.h | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h

[PATCH v2 3/3] KVM: x86: simplify kvm_mwait_in_guest()

2017-11-29 Thread Radim Krčmář
_data," while at it. Signed-off-by: Radim Krčmář --- arch/x86/kvm/x86.h | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index d15859ec5e92..c69f973111cb 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -265

[PATCH v2 2/3] KVM: x86: drop bogus MWAIT check

2017-11-29 Thread Radim Krčmář
. Alternatively, we can return MWAIT exiting by default and let userspace toggle it. Signed-off-by: Radim Krčmář --- arch/x86/kvm/x86.h | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index 81f5f50794f6

[PATCH v2 1/3] KVM: x86: prevent MWAIT in guest with buggy MONITOR

2017-11-29 Thread Radim Krčmář
ed-off-by: Radim Krčmář <rkrc...@redhat.com> --- arch/x86/kvm/x86.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index d0b95b7a90b4..81f5f50794f6 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -281,6 +281,9 @@ static

[PATCH v2 1/3] KVM: x86: prevent MWAIT in guest with buggy MONITOR

2017-11-29 Thread Radim Krčmář
The bug prevents MWAIT from waking up after a write to the monitored cache line. KVM might emulate a CPU model that shouldn't have the bug, so the guest would not employ a workaround and possibly miss wakeups. Better to avoid the situation. Reviewed-by: Alexander Graf Signed-off-by: Radim Krčmář

[PATCH v2 0/3] KVM: x86: kvm_mwait_in_guest() cleanup

2017-11-29 Thread Radim Krčmář
didn't drop support for ancient CPUs. Radim Krčmář (3): KVM: x86: prevent MWAIT in guest with buggy MONITOR KVM: x86: drop bogus MWAIT check KVM: x86: simplify kvm_mwait_in_guest() arch/x86/kvm/x86.h | 32 ++-- 1 file changed, 2 insertions(+), 30 deletions

[PATCH v2 0/3] KVM: x86: kvm_mwait_in_guest() cleanup

2017-11-29 Thread Radim Krčmář
didn't drop support for ancient CPUs. Radim Krčmář (3): KVM: x86: prevent MWAIT in guest with buggy MONITOR KVM: x86: drop bogus MWAIT check KVM: x86: simplify kvm_mwait_in_guest() arch/x86/kvm/x86.h | 32 ++-- 1 file changed, 2 insertions(+), 30 deletions

Re: [PATCH v6 2/4] KVM: X86: Add Paravirt TLB Shootdown

2017-11-29 Thread Radim Krčmář
PUs. > > ebizzy -M > vanillaoptimized boost > 1VM46799 486704% > 2VM23962 42691 78% > 3VM16152 37539 132% > > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Radim Krčmář &l

Re: [PATCH v6 2/4] KVM: X86: Add Paravirt TLB Shootdown

2017-11-29 Thread Radim Krčmář
-M > vanillaoptimized boost > 1VM46799 486704% > 2VM23962 42691 78% > 3VM 16152 37539 132% > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Peter Zijlstra > Signed-off-by: Wanpen

[GIT PULL] Trimmed second batch of KVM changes for Linux 4.15

2017-11-24 Thread Radim Krčmář
Linus, The following changes since commit cf9b0772f2e410645fece13b749bd56505b998b8: Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc (2017-11-16 16:05:01 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm

[GIT PULL] Trimmed second batch of KVM changes for Linux 4.15

2017-11-24 Thread Radim Krčmář
Linus, The following changes since commit cf9b0772f2e410645fece13b749bd56505b998b8: Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc (2017-11-16 16:05:01 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm

Re: VMs freezing when host is running 4.14

2017-11-23 Thread Radim Krčmář
2017-11-23 18:18+0200, Liran Alon: > On 23/11/17 17:59, Radim Krčmář wrote: > > Btw. there have been already many fixes from Liran Alon for that patch > > and your case could be the one adressed in > > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.spinics.net_lis

Re: VMs freezing when host is running 4.14

2017-11-23 Thread Radim Krčmář
2017-11-23 18:18+0200, Liran Alon: > On 23/11/17 17:59, Radim Krčmář wrote: > > Btw. there have been already many fixes from Liran Alon for that patch > > and your case could be the one adressed in > > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.spinics.net_lis

Re: VMs freezing when host is running 4.14

2017-11-23 Thread Radim Krčmář
2017-11-23 16:20+0100, Marc Haber: > On Wed, Nov 22, 2017 at 05:43:13PM +0100, Radim Krčmář wrote: > > 2017-11-22 16:52+0100, Marc Haber: > > > On Wed, Nov 22, 2017 at 04:04:42PM +0100, 王金浦 wrote: > > > > So all guest kernels are 4.14, or also other older kern

Re: VMs freezing when host is running 4.14

2017-11-23 Thread Radim Krčmář
2017-11-23 16:20+0100, Marc Haber: > On Wed, Nov 22, 2017 at 05:43:13PM +0100, Radim Krčmář wrote: > > 2017-11-22 16:52+0100, Marc Haber: > > > On Wed, Nov 22, 2017 at 04:04:42PM +0100, 王金浦 wrote: > > > > So all guest kernels are 4.14, or also other older kern

Re: VMs freezing when host is running 4.14

2017-11-22 Thread Radim Krčmář
2017-11-22 16:52+0100, Marc Haber: > On Wed, Nov 22, 2017 at 04:04:42PM +0100, 王金浦 wrote: > > So all guest kernels are 4.14, or also other older kernel? > > Guest kernels are also 4.14, but the issue disappears when the host is > downgraded to an older kernel. I therefore reckoned that the guest

Re: VMs freezing when host is running 4.14

2017-11-22 Thread Radim Krčmář
2017-11-22 16:52+0100, Marc Haber: > On Wed, Nov 22, 2017 at 04:04:42PM +0100, 王金浦 wrote: > > So all guest kernels are 4.14, or also other older kernel? > > Guest kernels are also 4.14, but the issue disappears when the host is > downgraded to an older kernel. I therefore reckoned that the guest

Re: [PATCH v3] KVM: X86: Fix softlockup when get the current kvmclock

2017-11-16 Thread Radim Krčmář
kvm-unit-tests/hyperv_stimer.flat and > > cpu-hotplug stress simultaneously. __this_cpu_read(cpu_tsc_khz) returns 0 > > (set in kvmclock_cpu_down_prep()) when the pCPU is unhotplug which results > > in kvm_get_time_scale() gets into an infinite loop. > > > > This patch fi

Re: [PATCH v3] KVM: X86: Fix softlockup when get the current kvmclock

2017-11-16 Thread Radim Krčmář
ss simultaneously. __this_cpu_read(cpu_tsc_khz) returns 0 > > (set in kvmclock_cpu_down_prep()) when the pCPU is unhotplug which results > > in kvm_get_time_scale() gets into an infinite loop. > > > > This patch fixes it by treating the unhotplug pCPU as not using master >

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-16 Thread Radim Krčmář
2017-11-13 09:32+0100, Paolo Bonzini: > On 13/11/2017 08:15, Wanpeng Li wrote: > > 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : > >> Sometimes, a processor might execute an instruction while another > >> processor is updating the page tables for that instruction's code page, >

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-16 Thread Radim Krčmář
2017-11-13 09:32+0100, Paolo Bonzini: > On 13/11/2017 08:15, Wanpeng Li wrote: > > 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : > >> Sometimes, a processor might execute an instruction while another > >> processor is updating the page tables for that instruction's code page, > >> but before the TLB

[GIT PULL] First batch of KVM changes for 4.15

2017-11-16 Thread Radim Krčmář
k3S HV: Add infrastructure for running HPT guests on radix host KVM: PPC: Book3S HV: Allow for running POWER9 host in single-threaded mode KVM: PPC: Book3S HV: Run HPT guests on POWER9 radix hosts Merge branch 'kvm-ppc-fixes' into kvm-ppc-next KVM: PPC: Book3S HV: Cosmetic post-merge

[GIT PULL] First batch of KVM changes for 4.15

2017-11-16 Thread Radim Krčmář
k3S HV: Add infrastructure for running HPT guests on radix host KVM: PPC: Book3S HV: Allow for running POWER9 host in single-threaded mode KVM: PPC: Book3S HV: Run HPT guests on POWER9 radix hosts Merge branch 'kvm-ppc-fixes' into kvm-ppc-next KVM: PPC: Book3S HV: Cosmetic post-merge

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-10 Thread Radim Krčmář
2017-11-10 10:49+0100, Paolo Bonzini: > Sometimes, a processor might execute an instruction while another > processor is updating the page tables for that instruction's code page, > but before the TLB shootdown completes. The interesting case happens > if the page is in the TLB. > > In general,

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-10 Thread Radim Krčmář
2017-11-10 10:49+0100, Paolo Bonzini: > Sometimes, a processor might execute an instruction while another > processor is updating the page tables for that instruction's code page, > but before the TLB shootdown completes. The interesting case happens > if the page is in the TLB. > > In general,

Re: [PATCH v6 1/3] KVM: X86: Fix operand/address-size during instruction decoding

2017-11-10 Thread Radim Krčmář
Applied all three, thanks.

Re: [PATCH v6 1/3] KVM: X86: Fix operand/address-size during instruction decoding

2017-11-10 Thread Radim Krčmář
Applied all three, thanks.

Re: [PATCH 0/2] kvm: vmx: CPUs without virtual NMIs

2017-11-10 Thread Radim Krčmář
2017-11-06 13:31+0100, Paolo Bonzini: > It turns out that Core 2 Duo machines only had virtual NMIs in some SKUs. > Patch 1 adds back emulation of the NMI window, patch 2 allows testing > it on modern processors as well. One eventinj.flat test (NMI after iret) > fails as expected. Applied,

Re: [PATCH 0/2] kvm: vmx: CPUs without virtual NMIs

2017-11-10 Thread Radim Krčmář
2017-11-06 13:31+0100, Paolo Bonzini: > It turns out that Core 2 Duo machines only had virtual NMIs in some SKUs. > Patch 1 adds back emulation of the NMI window, patch 2 allows testing > it on modern processors as well. One eventinj.flat test (NMI after iret) > fails as expected. Applied,

Re: [PATCH] KVM: SVM: obey guest PAT

2017-11-10 Thread Radim Krčmář
2017-10-26 09:13+0200, Paolo Bonzini: > For many years some users of assigned devices have reported worse > performance on AMD processors with NPT than on AMD without NPT, > Intel or bare metal. > > The reason turned out to be that SVM is discarding the guest PAT > setting and uses the default

Re: [PATCH] KVM: SVM: obey guest PAT

2017-11-10 Thread Radim Krčmář
2017-10-26 09:13+0200, Paolo Bonzini: > For many years some users of assigned devices have reported worse > performance on AMD processors with NPT than on AMD without NPT, > Intel or bare metal. > > The reason turned out to be that SVM is discarding the guest PAT > setting and uses the default

[GIT PULL] KVM fix for v4.14(-rc9)

2017-11-10 Thread Radim Krčmář
hashed page table. Paul Mackerras (1): KVM: PPC: Book3S HV: Fix exclusion between HPT resizing and other HPT updates Radim Krčmář (1): Merge tag 'kvm-ppc-fixes-4.14-2' of git://git.kernel.org/.../paulus/powerpc arch

[GIT PULL] KVM fix for v4.14(-rc9)

2017-11-10 Thread Radim Krčmář
hashed page table. Paul Mackerras (1): KVM: PPC: Book3S HV: Fix exclusion between HPT resizing and other HPT updates Radim Krčmář (1): Merge tag 'kvm-ppc-fixes-4.14-2' of git://git.kernel.org/.../paulus/powerpc arch

Re: [PATCH RESEND 2/3] KVM: Add paravirt remote TLB flush

2017-11-09 Thread Radim Krčmář
y -M > vanillaoptimized boost > 8 vCPUs 10152 10083 -0.68% > 16 vCPUs12244866 297.5% > 24 vCPUs11093871 249% > 32 vCPUs1025 3375 229.3% > > Cc: Paolo Bonzini <p

Re: [PATCH RESEND 2/3] KVM: Add paravirt remote TLB flush

2017-11-09 Thread Radim Krčmář
laoptimized boost > 8 vCPUs 10152 10083 -0.68% > 16 vCPUs12244866 297.5% > 24 vCPUs11093871 249% > 32 vCPUs 10253375 229.3% > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-of

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krčmář
2017-11-09 00:55-0800, Eduardo Valentin: > Hello, > > On Wed, Nov 08, 2017 at 06:36:52PM +0100, Radim Krčmář wrote: > > 2017-11-06 12:26-0800, Eduardo Valentin: > > > Currently, the existing qspinlock implementation will fallback to > > > test-and-set if the hyp

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krčmář
2017-11-09 00:55-0800, Eduardo Valentin: > Hello, > > On Wed, Nov 08, 2017 at 06:36:52PM +0100, Radim Krčmář wrote: > > 2017-11-06 12:26-0800, Eduardo Valentin: > > > Currently, the existing qspinlock implementation will fallback to > > > test-and-set if the hyp

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-08 Thread Radim Krčmář
2017-10-31 10:02-0700, Eduardo Valentin: > Hello Radim, > > On Tue, Oct 24, 2017 at 01:18:59PM +0200, Radim Krčmář wrote: > > 2017-10-23 17:44-0700, Eduardo Valentin: > > > Currently, the existing qspinlock implementation will fallback to > > > test-and-

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-08 Thread Radim Krčmář
2017-10-31 10:02-0700, Eduardo Valentin: > Hello Radim, > > On Tue, Oct 24, 2017 at 01:18:59PM +0200, Radim Krčmář wrote: > > 2017-10-23 17:44-0700, Eduardo Valentin: > > > Currently, the existing qspinlock implementation will fallback to > > > test-and-

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-08 Thread Radim Krčmář
T = 0: default is tas > > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: "Radim Krčmář" <rkrc...@redhat.com> > Cc: Jonathan Corbet <cor...@lwn.net> > Cc: Thomas Gleixner <t...@linutronix.de> > Cc: Ingo Molnar <mi...@redhat.com> > Cc: "

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-08 Thread Radim Krčmář
LT = 0: default is tas > > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Jonathan Corbet > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: x...@kernel.org > Cc: Peter Zijlstra > Cc: Waiman Long > Cc: k...@vger.kernel.org &

Re: [PATCH v2] KVM: X86: Fix softlockup when get the current kvmclock timestamp

2017-11-08 Thread Radim Krčmář
u_down_prep()) when the pCPU is unhotplug which results > in kvm_get_time_scale() gets into an infinite loop. > > This patch fixes it by skipping to fill the hv_clock when the pCPU is offline. > > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Radim Krčmář <rkrc...@redhat.c

Re: [PATCH v2] KVM: X86: Fix softlockup when get the current kvmclock timestamp

2017-11-08 Thread Radim Krčmář
is unhotplug which results > in kvm_get_time_scale() gets into an infinite loop. > > This patch fixes it by skipping to fill the hv_clock when the pCPU is offline. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-off-by: Wanpeng Li > --- > v1 -> v2: > * avoid infini

[GIT PULL] KVM fixes for v4.14-rc7

2017-10-24 Thread Radim Krčmář
Nicholas Piggin (1): KVM: PPC: Book3S HV: POWER9 more doorbell fixes Radim Krčmář (1): Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/.../paulus/powerpc arch/powerpc/kvm/book3s_64_vio.c| 23 ++- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 13

[GIT PULL] KVM fixes for v4.14-rc7

2017-10-24 Thread Radim Krčmář
Nicholas Piggin (1): KVM: PPC: Book3S HV: POWER9 more doorbell fixes Radim Krčmář (1): Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/.../paulus/powerpc arch/powerpc/kvm/book3s_64_vio.c| 23 ++- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 13

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Radim Krčmář
2017-10-23 17:44-0700, Eduardo Valentin: > Currently, the existing qspinlock implementation will fallback to > test-and-set if the hypervisor has not set the PV_UNHALT flag. Where have you detected the main source of overhead with pinned VCPUs? Makes me wonder if we couldn't improve general

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Radim Krčmář
2017-10-23 17:44-0700, Eduardo Valentin: > Currently, the existing qspinlock implementation will fallback to > test-and-set if the hypervisor has not set the PV_UNHALT flag. Where have you detected the main source of overhead with pinned VCPUs? Makes me wonder if we couldn't improve general

Re: [PATCH] KVM: LAPIC: Level-sensitive interrupts are not support for LINT1

2017-10-13 Thread Radim Krčmář
GGER? Thanks. > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Radim Krčmář <rkrc...@redhat.com> > Signed-off-by: Wanpeng Li <wanpeng...@hotmail.com> > --- > arch/x86/kvm/lapic.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/x86/kvm/lapic.c

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