From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v7 3/3] x86/hvm: Indicate avaliability of HW support of APIC virtualization to HVM guests Date: Tue, 25 Mar 2014 09:34:07 -0400 Message-ID: <533185CF.1090704@oracle.com> References: <1395703119-11502-1-git-send-email-boris.ostrovsky@oracle.com> <1395703119-11502-4-git-send-email-boris.ostrovsky@oracle.com> <53315E450200007800001A43@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53315E450200007800001A43@nat28.tlf.novell.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: Jan Beulich , yang.z.zhang@intel.com Cc: keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 03/25/2014 05:45 AM, Jan Beulich wrote: >>>> On 25.03.14 at 00:18, wrote: >> +void vmx_hypervisor_cpuid_leaf(uint32_t sub_idx, >> + uint32_t *eax, uint32_t *ebx, >> + uint32_t *ecx, uint32_t *edx) >> +{ >> + if ( sub_idx != 0 ) >> + return; >> + >> + if ( cpu_has_vmx_apic_reg_virt ) >> + *eax |= XEN_HVM_CPUID_APIC_ACCESS_VIRT; >> + if ( cpu_has_vmx_virtualize_x2apic_mode ) >> + *eax |= XEN_HVM_CPUID_X2APIC_VIRT; >> +} > So did the two of you then settle on (a) needing to expose two bits > rather than just one and (b) these being the two relevant features > to expose? My argument is that we can't know which APIC model a guest uses and so both are needed. For PVHVM we default to APIC (MMIO accesses), I can't remember what unenlightened HVM Linux would do. And then there are other OSs. For (b) having either (or both) of these two seems to be sufficient to bring down the number of VMEXITs when switching from pirqs to APIC. It's more important to agree on (a) since for (b) we can always add another bit. -boris