[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ping: [PATCH] VT-d: fix !HVM build


  • To: Kevin Tian <kevin.tian@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 19 May 2022 14:20:17 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ETlAfvDhBrJt5SXvFZKOMq749xzBtSdwwfx+GCo+p4Q=; b=eL791kY2ZCt9QnFwLqLv5IMVJfexm/gck9o4F6buF+fAa1NKUyI5JHLJ33CY+UVcX4z91MVLSHU9y4qR09pp8q687mna0HWcMr6clF2yF3XHHOz4V00fpOJdZsd9SKugLdArBleiAuIUQoBH60yEuET/zm0n4zfVZvOjK3f/eTtBv1izgRoBvEWP1KTUm1z36Ce7ldBoXTPE2vIXa/363XZQG5YtJUuAAxce6w7Gy+B+6a9CS2uzPD400GmcZBqPCtTbm4BZPXBBECPaXuGomn5OhWgIaJx3fYONsDfC++j9efwS5De0q/NnfvyU016RfFgtcmX0bFokaUqScWDu1Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gvPAbAG65YWy4h78BJMqpXcCWDxItSkmThjUbhECxz03lm+S7pgssfLJHlKmDFLNRyQt2GrfJdHAWZXxYsrEsp2VeD6kEdIy0MV7peCyfYvmpIokNo/ulfxRCYyCxKkV5mOK9mFZT25jbaMQMRds5OuobGVVwPmJXCkd4Hp7CSzvfOBZ/fkxWoVtF6rqBUe9A4FBjzRmSutX8/FpDMobZByg79eL+irtIod2RfinqBaSF4n0VeB0DRF3v3SQR6tQc4hN7an2jffQYSD/x4fjs+NI6ZWBByOHv/Bd2bllA9YLuRYERp+AA97aIZb4MHyZJpYiJrKeB/wnJsPdPzVr9g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 19 May 2022 12:20:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.04.2022 11:58, Jan Beulich wrote:
> EPT is of no interest when !HVM. While I'm observing gcc11 to fully
> eliminate the function, older gcc's DCE looks to not be as good. Aid the
> compiler in eliminating the accesses of opt_hap_{2mb,1gb}, which
> otherwise cause undefined symbol errors when linking.
> 
> While there adjust types.
> 
> Fixes: c479415610f0 ("x86/P2M: p2m.c is HVM-only")
> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

I guess I'll put this in (as being simple enough) if I don't hear
anything back by the end of the week.

Jan

> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -2155,14 +2155,17 @@ static int cf_check intel_iommu_lookup_p
>      return 0;
>  }
>  
> -static int __init vtd_ept_page_compatible(struct vtd_iommu *iommu)
> +static bool __init vtd_ept_page_compatible(const struct vtd_iommu *iommu)
>  {
> -    u64 ept_cap, vtd_cap = iommu->cap;
> +    uint64_t ept_cap, vtd_cap = iommu->cap;
> +
> +    if ( !IS_ENABLED(CONFIG_HVM) )
> +        return false;
>  
>      /* EPT is not initialised yet, so we must check the capability in
>       * the MSR explicitly rather than use cpu_has_vmx_ept_*() */
>      if ( rdmsr_safe(MSR_IA32_VMX_EPT_VPID_CAP, ept_cap) != 0 ) 
> -        return 0;
> +        return false;
>  
>      return (ept_has_2mb(ept_cap) && opt_hap_2mb) <= cap_sps_2mb(vtd_cap) &&
>             (ept_has_1gb(ept_cap) && opt_hap_1gb) <= cap_sps_1gb(vtd_cap);
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.