From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v4 13/31] xen/x86: allow disabling the emulated local apic Date: Fri, 07 Aug 2015 10:09:51 -0400 Message-ID: <55C4BC2F.9010408@oracle.com> References: <1438942688-7610-1-git-send-email-roger.pau@citrix.com> <1438942688-7610-14-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" 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 1ZNiME-0006F1-4K for xen-devel@lists.xenproject.org; Fri, 07 Aug 2015 14:10:50 +0000 In-Reply-To: <1438942688-7610-14-git-send-email-roger.pau@citrix.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: Roger Pau Monne , 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 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? -boris