Re: [PATCH 2/3 v2] KVM: nVMX: Enable VMFUNC for the L1 hypervisor

2017-07-10 Thread David Hildenbrand
On 10.07.2017 13:03, Paolo Bonzini wrote: > > > On 10/07/2017 11:17, David Hildenbrand wrote: >>> + >>> + vmcs12 = get_vmcs12(vcpu); >>> + if ((vmcs12->vm_function_control & (1 << function)) == 0) >> (learned that in c, shifting beyond the type size is undefined) >> >> Should we check for fun

Re: [PATCH 2/3 v2] KVM: nVMX: Enable VMFUNC for the L1 hypervisor

2017-07-10 Thread Paolo Bonzini
On 10/07/2017 11:17, David Hildenbrand wrote: >> + >> +vmcs12 = get_vmcs12(vcpu); >> +if ((vmcs12->vm_function_control & (1 << function)) == 0) > (learned that in c, shifting beyond the type size is undefined) > > Should we check for function < 64 here? (as SDM mentions) It should be al

Re: [PATCH 2/3 v2] KVM: nVMX: Enable VMFUNC for the L1 hypervisor

2017-07-10 Thread David Hildenbrand
> @@ -7752,7 +7769,29 @@ static int handle_preemption_timer(struct kvm_vcpu > *vcpu) > > static int handle_vmfunc(struct kvm_vcpu *vcpu) > { > - kvm_queue_exception(vcpu, UD_VECTOR); > + struct vcpu_vmx *vmx = to_vmx(vcpu); > + struct vmcs12 *vmcs12; > + u32 function = vcpu->a

[PATCH 2/3 v2] KVM: nVMX: Enable VMFUNC for the L1 hypervisor

2017-07-06 Thread Bandan Das
Expose VMFUNC in MSRs and VMCS fields. No actual VMFUNCs are enabled. Signed-off-by: Paolo Bonzini Signed-off-by: Bandan Das --- arch/x86/kvm/vmx.c | 53 +++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arc