Re: [PATCH v2] kvm: nVMX: fix entry with pending interrupt if APICv is enabled

2018-10-04 Thread Nikita Leshenko
it is > not enough to check the CPU execution controls: the same scenario can also > happen if RVI>0. > > Fixes: b5861e5cf2fcf83031ea3e26b0a69d887adf7d21 > Cc: Nikita Leshchenko > Cc: Sean Christopherson > Cc: Liran Alon > Cc: Radim Krčmář > Signed-off-by: Paolo Bon

Re: [PATCH] kvm: nVMX: fix entry with pending interrupt if APICv is enabled

2018-10-03 Thread Nikita Leshenko
MI_PENDING); > + if (enable_apicv && kvm_vcpu_apicv_active(vcpu)) > + evaluate_pending_interrupts |= vmx_get_rvi() > 0; You should check for RVI > VPPR, similarly to how it is done in vmx_guest_apic_has_interrupt(). Also, now that you introduced vmx_get_rvi(),

Re: [RFC][PATCH 3/5] [PATCH 3/5] kvm-ept-idle: HVA indexed EPT read

2018-09-04 Thread Nikita Leshenko
On 1 Sep 2018, at 13:28, Fengguang Wu wrote: > +static ssize_t ept_idle_read(struct file *file, char *buf, > + size_t count, loff_t *ppos) > +{ > + struct task_struct *task = file->private_data; > + struct ept_idle_ctrl *eic; > + unsigned long hva_start = *ppos

Re: [RFC][PATCH 1/5] [PATCH 1/5] kvm: register in task_struct

2018-09-03 Thread Nikita Leshenko
On 4 Sep 2018, at 2:46, Fengguang Wu wrote: > > Here it goes: > > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 99ce070e7dcb..27c5446f3deb 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -27,6 +27,7 @@ typedef int vm_fault_t; > struct addr

Re: [RFC][PATCH 1/5] [PATCH 1/5] kvm: register in task_struct

2018-09-03 Thread Nikita Leshenko
On September 2, 2018 5:21:15 AM, fengguang...@intel.com wrote: > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 8b47507faab5..0c483720de8d 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -3892,6 +3892,7 @@ static void kvm_uevent_notify_change(unsigned int type,

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

2018-03-27 Thread Nikita Leshenko
What you are essentially trying to do is create a PV interface to access the x86 emulator. Why not use a simple hypercall (VMCALL) to accomplish this instead of inventing yet another PV method? Something like “KVM_HC_EMULATE_NEXT_INSTRUCTION” in kvm_emulate_hypercall should do the trick (however i

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

2018-02-09 Thread Nikita Leshenko
The patch looks correct, however I’m confused about why you consider this to be a bug in the guest rather than a bug in KVM. The spec for x2APIC states: "The support for Directed EOI capability can be detected by means of bit 24 in the Local APIC Version Register” (Intel’s x2APIC spec, 2.5.1 Direc