From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v3] KVM: nVMX: Advertise IA32_PAT in VM exit control Date: Tue, 06 Aug 2013 12:59:06 +0200 Message-ID: <5200D6FA.1050304@siemens.com> References: <1375785705-6570-1-git-send-email-yzt356@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, jan.kiszka@web.de, gleb@redhat.com, pbonzini@redhat.com To: Arthur Chunqi Li Return-path: Received: from thoth.sbs.de ([192.35.17.2]:34624 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754483Ab3HFK7N (ORCPT ); Tue, 6 Aug 2013 06:59:13 -0400 In-Reply-To: <1375785705-6570-1-git-send-email-yzt356@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2013-08-06 12:41, Arthur Chunqi Li wrote: > Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT. > > Signed-off-by: Arthur Chunqi Li > --- > arch/x86/kvm/vmx.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 396572d..c45adea 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -2191,14 +2191,17 @@ static __init void nested_vmx_setup_ctls_msrs(void) > * If bit 55 of VMX_BASIC is off, bits 0-8 and 10, 11, 13, 14, 16 and > * 17 must be 1. > */ > + rdmsr(MSR_IA32_VMX_EXIT_CTLS, > + nested_vmx_exit_ctls_low, nested_vmx_exit_ctls_high); > nested_vmx_exit_ctls_low = VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR; > + nested_vmx_exit_ctls_high &= > + VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT; > + nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR | > + VM_EXIT_HOST_ADDR_SPACE_SIZE; I would suggest to align the pattern to [1]. Jan [1] http://thread.gmane.org/gmane.comp.emulators.kvm.devel/113629 > /* Note that guest use of VM_EXIT_ACK_INTR_ON_EXIT is not supported. */ > -#ifdef CONFIG_X86_64 > - nested_vmx_exit_ctls_high = VM_EXIT_HOST_ADDR_SPACE_SIZE; > -#else > - nested_vmx_exit_ctls_high = 0; > +#ifndef CONFIG_X86_64 > + nested_vmx_exit_ctls_high &= (~VM_EXIT_HOST_ADDR_SPACE_SIZE); > #endif > - nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR; > > /* entry controls */ > rdmsr(MSR_IA32_VMX_ENTRY_CTLS, > -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux