From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 07/12] KVM: x86: stubs for SMM support Date: Thu, 21 May 2015 16:55:48 +0200 Message-ID: <20150521145548.GA7525@potion.brq.redhat.com> References: <1431084034-8425-1-git-send-email-pbonzini@redhat.com> <1431084034-8425-8-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, bsd@redhat.com To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <1431084034-8425-8-git-send-email-pbonzini@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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 > -- > 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;