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

Re: [PATCH] x86/CPUID: unconditionally set XEN_HVM_CPUID_IOMMU_MAPPINGS


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 18 Jan 2021 16:54:26 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=v225mOYrgURIWcbJPrDz4g3r/oIu2ammJXZGzgSQivs=; b=K0Ubc7jTCeefFal2deC2uaoX03C9Ok/99b1NI9ddTDA3tr/gEKvWgZ4mfgrbwqKK+gG9CdE5Q0e0TXlcKsOCqajrKh8pE/LA2O1DVn3E4aujVHLgXoQRWJgxpa6DlBIpiQOSwqEDV2qVv0o9Hk2cfe8/CpxQ+ghICDRl6NJC8qX4fN4Fi+EI+jnzYGVdAZXj3qjuH+tisToHJ8Bnw9YMqJSdOQUjH2U2OBZt84ZXyDDDOKT9+FHJ3AYS9dOHH55I91b4swPkXj+zr4VR0OueanfpnglbnjtuLmRop2RwDNwfng22NaN1uNpnvvY7CNNE6nkdC89Is9dz2WjKIPDUoQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VCotVNOUwl9yLFeVQ6y1nNrMM20fKNdJ465ZE5HmGdoDQWB/h24abCgN+LisruDWLLgacj+YMYnx/BqU2p+KS4mxDbSFqn7p7PlL61ZfWV8lKibEr2g9tYxHvV/J5zcPqnIq1bonTd4ALWiyY7DK2/NsnjADku0rtBUCGSJubVQSDeebgW2VgkjBVVHgSewvXzCwzh2jxlJRoUJUS0i2CPlhESyxNZW74FhXmO1dU07sqH2tsXKMoaJvN2lUmd7kmQvrRwFCBiNjmuxisbMUYiqFvGnG6BNBXGjeQzBmOg5Wl8QLTkU1Wv4Qvo11G13ZJa9d4tF6dSVPlcpmZjLq5w==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 18 Jan 2021 15:54:42 +0000
  • Ironport-sdr: v79t6nKWOaWsMwJB5iMgVIFNowytB+mnjts1SnvcG4phufEZbPxqM3+BXetDvQ9w2mEFLfUSx3 VtUV/WWKVOupe1n7tOzXgVrgrPmoGngFiqwT28CpG4oyDbzh/0cl5+3xMxpDXZ+q5BIFL2heWg wiM+xYebz+xU11/m/GO8KPIsUGVCh8BdNNSVPvSteqsPYBzMJ5wmE7xn49paw57lzyu96ZorbU DBWL7C8ZDOcMsPMsBubSD15qaz5JafrAvwMy6OSnbQbY3/bXhcHcnyFeOttYC1yDbO1u3cCkCW VuI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Jan 18, 2021 at 12:05:12PM +0100, Jan Beulich wrote:
> On 15.01.2021 16:01, Roger Pau Monne wrote:
> > This is a revert of f5cfa0985673 plus a rework of the comment that
> > accompanies the setting of the flag so we don't forget why it needs to
> > be unconditionally set: it's indicating whether the version of Xen has
> > the original issue fixed and IOMMU entries are created for
> > grant/foreign maps.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Despite my earlier ack I came to think that the description and
> comment still don't make it quite clear what was actually wrong
> with the prior change, and hence they also don't really guard
> against the same getting done again (perhaps even by me). May I
> ask that you add a paragraph above and ...

What about adding:

"If the flag is only exposed when the IOMMU is enabled the guest could
resort to use bounce buffers when running backends as it would assume
the underlying Xen version still has the bug present and thus
grant/foreign maps cannot be used with devices."

To the commit log?

> > --- a/xen/arch/x86/traps.c
> > +++ b/xen/arch/x86/traps.c
> > @@ -1049,11 +1049,10 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, 
> > uint32_t leaf,
> >              res->a |= XEN_HVM_CPUID_X2APIC_VIRT;
> >  
> >          /*
> > -         * Indicate that memory mapped from other domains (either grants or
> > -         * foreign pages) has valid IOMMU entries.
> > +         * Unconditionally set the flag to indicate this version of Xen has
> > +         * been fixed to create IOMMU mappings for grant/foreign maps.
> >           */
> > -        if ( is_iommu_enabled(d) )
> > -            res->a |= XEN_HVM_CPUID_IOMMU_MAPPINGS;
> > +        res->a |= XEN_HVM_CPUID_IOMMU_MAPPINGS;
> 
> ... try to clarify the "Unconditionally" here?

I guess Unconditionally doesn't make much sense, so would be better to
start the sentence with 'Set ...' instead?

Thanks, Roger.



 


Rackspace

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