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

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


  • To: "Beulich, Jan" <JBeulich@xxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Fri, 20 May 2022 00:30:11 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.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=uGbVWzwOUCqloBLTEE9qFy9a6PxFR60HT2g9mikyTZI=; b=IZBO2O5GBIF0wBOrxJUgAJ37+inNY7D2N3E3Ajx7GPchET6TE2xd8zBdwGmwmDKhscwBDtN5pbWnJl+BbtOyWEADDuTb1ZUuibprJWIBwauY4HAftrupVwh7cTXhM8AW/Ou1hJBUW+MuSxpKXg1fdmctTsjwscwvNg8W5vy5wk8MgsHDFD0nEAjE5NcHAZW5fhwfGzyW3FS0QZiTuwMFbhpG4bterQ1swerLHyngQvRnjdAc794lz2byADmhanM8u8f4+swJ8Xp+XBW+Ha6TiOc6pSY+Qc7h6DOuYMnWX/6GwlRA0ov0p9/XfUv7o9xFfdolENxcvx47hLc7nWLLVQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y6dJKP5OVzU8paOtAZfZ2xvzUG6ceshLkgT6cWRfqREiUBwfg/AZFUV2P43PJRKX6tze2DPG2VtoAAOUMllYQ1W9omnWoqql5fjP8zGcyCSKcJ4SO1PAYPDBpD4Ce9YI9yvJgUkASsVBz65Xz7l3pZKHowyk4CXCOMJl7q9emrL1q7+A1OxUZmvNPcxUN4C7JLzPsJnmrSyDb4YYT6ei+QPxVMNYf4ofBdgN1IidwVxnLPuI+XEeSc/pnVrnEVJSV8OwpwazwVGUoNAHIj6Q2zfhum/61366vx59xE+LCKqpfpyHsXo7ht2tCS2OU0Zct861GBfTnBlzy8Olak7nvQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com;
  • Cc: "Cooper, Andrew" <andrew.cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 20 May 2022 00:30:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYVi+q4CycUma8TECQ0Ag+stUm460mSTmAgADL0nA=
  • Thread-topic: Ping: [PATCH] VT-d: fix !HVM build

> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Thursday, May 19, 2022 8:20 PM
> 
> 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.

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>

> 
> 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®.