lkml.org 
[lkml]   [2015]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 07/12] KVM: x86: stubs for SMM support
2015-05-08 13:20+0200, Paolo Bonzini:
> This patch adds the interface between x86.c and the emulator: the
> SMBASE register, a new emulator flag, the RSM instruction. It also
> adds a new request bit that will be used by the KVM_SMI ioctl.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> --
> RFC->v1: make SMBASE host-readable only
> add support for latching an SMI
> do not reset SMBASE on INIT
> ---
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> @@ -367,6 +367,7 @@ struct kvm_vcpu_arch {
> int32_t apic_arb_prio;
> int mp_state;
> u64 ia32_misc_enable_msr;
> + u64 smbase;

smbase is u32 in hardware.

> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> @@ -2504,7 +2504,7 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx)
> vmx->nested.nested_vmx_misc_low &= VMX_MISC_SAVE_EFER_LMA;
> vmx->nested.nested_vmx_misc_low |=
> VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE |
> - VMX_MISC_ACTIVITY_HLT;
> + VMX_MISC_ACTIVITY_HLT | VMX_MISC_IA32_SMBASE_MSR;

No need to expose this feature when the MSR isn't readable.

> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> @@ -2220,6 +2221,11 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> + case MSR_IA32_SMBASE:
> + if (!msr_info->host_initiated)
> + return 1;
> + vcpu->arch.smbase = data;
> + break;
> @@ -2615,6 +2621,11 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> + case MSR_IA32_SMBASE:
> + if (!msr_info->host_initiated)
> + return 1;
> + msr_info->data = vcpu->arch.smbase;
> + break;


\
 
 \ /
  Last update: 2015-05-21 17:21    [W:0.121 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site