From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= Subject: Re: [PATCH v4 13/31] xen/x86: allow disabling the emulated local apic Date: Fri, 7 Aug 2015 17:41:17 +0200 Message-ID: <55C4D19D.1090005@citrix.com> References: <1438942688-7610-1-git-send-email-roger.pau@citrix.com> <1438942688-7610-14-git-send-email-roger.pau@citrix.com> <55C4BC2F.9010408@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZNjlr-0006zB-QL for xen-devel@lists.xenproject.org; Fri, 07 Aug 2015 15:41:23 +0000 In-Reply-To: <55C4BC2F.9010408@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky , xen-devel@lists.xenproject.org Cc: Kevin Tian , Suravee Suthikulpanit , Andrew Cooper , Eddie Dong , Jan Beulich , Aravind Gopalakrishnan , Jun Nakajima List-Id: xen-devel@lists.xenproject.org El 07/08/15 a les 16.09, Boris Ostrovsky ha escrit: > On 08/07/2015 06:17 AM, Roger Pau Monne wrote: >> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c >> index a0a97e7..5acb246 100644 >> --- a/xen/arch/x86/hvm/vmx/vmcs.c >> +++ b/xen/arch/x86/hvm/vmx/vmcs.c >> @@ -1027,6 +1027,20 @@ static int construct_vmcs(struct vcpu *v) >> ASSERT(!(v->arch.hvm_vmx.exec_control & >> CPU_BASED_RDTSC_EXITING)); >> } >> + if ( !has_vlapic(d) ) >> + { >> + /* Disable virtual apics, TPR */ >> + v->arch.hvm_vmx.secondary_exec_control &= >> + ~(SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES >> + | SECONDARY_EXEC_APIC_REGISTER_VIRT >> + | SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY); >> + v->arch.hvm_vmx.exec_control &= ~CPU_BASED_TPR_SHADOW; >> + >> + /* In turn, disable posted interrupts. */ >> + __vmwrite(PIN_BASED_VM_EXEC_CONTROL, >> + vmx_pin_based_exec_control & >> ~PIN_BASED_POSTED_INTERRUPT); >> + } >> + >> vmx_update_cpu_exec_control(v); > > This is the same code as the one used right above, in 'if ( > is_pvh_domain(d) )' clause. Can you combine the two? No, it's not the same code. The PVH code disables unrestricted guest and sets the entry of the VM to be in long mode, which is not true for HVMlite. Roger.