Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932295AbbEUOzy (ORCPT ); Thu, 21 May 2015 10:55:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40491 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753041AbbEUOzw (ORCPT ); Thu, 21 May 2015 10:55:52 -0400 Date: Thu, 21 May 2015 16:55:48 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, bsd@redhat.com Subject: Re: [PATCH 07/12] KVM: x86: stubs for SMM support 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 Content-Disposition: inline In-Reply-To: <1431084034-8425-8-git-send-email-pbonzini@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1849 Lines: 48 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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/