From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/2] VMX: unifdef the EFER specific code Date: Wed, 30 Jan 2008 15:05:30 +0200 Message-ID: <47A0761A.2090307@qumranet.com> References: <1201697269-8705-1-git-send-email-joerg.roedel@amd.com> <1201697269-8705-2-git-send-email-joerg.roedel@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Joerg Roedel Return-path: In-Reply-To: <1201697269-8705-2-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Joerg Roedel wrote: > To allow access to the EFER register in 32bit KVM the EFER specific code has to > be exported to the x86 generic code. This patch does this in a backwards > compatible manner. > > Signed-off-by: Joerg Roedel > --- > arch/x86/kvm/vmx.c | 10 ++++++---- > 1 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 3d8949a..2ca24ac 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -759,6 +759,9 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) > break; > case MSR_EFER: > return kvm_get_msr_common(vcpu, msr_index, pdata); > +#else > + case MSR_EFER: > + return 1; > #endif > You're leaving *pdata uninitialized, which would confuse guests that read EFER. But the better solution is to call kvm_get_msr_common(). > case MSR_IA32_TIME_STAMP_COUNTER: > data = guest_read_tsc(); > @@ -811,6 +814,9 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) > case MSR_GS_BASE: > vmcs_writel(GUEST_GS_BASE, data); > break; > +#else > + case MSR_EFER: > + return 1; > #endif > And kvm_set_msr_common() here. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/