From: "Jan Beulich" Subject: Re: [PATCH] xen: disable reporting hw virtualized lapic availability on PVH guests Date: Wed, 04 Jun 2014 13:13:00 +0100 Message-ID: <538F296C0200007800017BB0@mail.emea.novell.com> References: <1401876773-43100-1-git-send-email-roger.pau@citrix.com> <538F14E40200007800017B18@mail.emea.novell.com> <538EFAB1.3030503@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WsA42-0005ht-8u for xen-devel@lists.xenproject.org; Wed, 04 Jun 2014 12:13:06 +0000 In-Reply-To: <538EFAB1.3030503@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?UTF-8?Q?Roger=20Pau=20Monn=C3=A9?= Cc: xen-devel@lists.xenproject.org, Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org >>> On 04.06.14 at 12:53, wrote: > On 04/06/14 12:45, Jan Beulich wrote: >>>>> On 04.06.14 at 12:12, wrote: >>> --- a/xen/arch/x86/hvm/vmx/vmx.c >>> +++ b/xen/arch/x86/hvm/vmx/vmx.c >>> @@ -1660,7 +1660,7 @@ 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 ) >>> + if ( sub_idx != 0 || is_pvh_vcpu(current) ) >>> return; >>> if ( cpu_has_vmx_apic_reg_virt ) >> >> The addition would belong on this line imo (in the && !is_pvh form). > > Then I would also have to add another is_pvh gate on the next if: > > if ( cpu_has_vmx_virtualize_x2apic_mode && cpu_has_vmx_apic_reg_virt && > cpu_has_vmx_virtual_intr_delivery && !is_pvh_vcpu(current) ) > *eax |= XEN_HVM_CPUID_X2APIC_VIRT; > > IMHO it seems easier to gate it on the first if and just > return, although I understand it is more correct to gate > it on a feature by feature basis. Right, also to avoid unnecessary future code churn. Jan