[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 18:10:40 +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=r7xu1LlhvKfsXDGMd16BZ8HtDF6hukn+suFifYrRR6w=; b=UfaZGVF+Pi1hANCLBshsqfkNfJ9oKOmvEktg6tkvFJja5Mok01qr1OCwaMB/IUIUHiDmVjWjjlqxT9j4Ojk8fuQ2BPSYjqv4cdsO1tVOv2xohPJTadRob3AFo1wWW+EFbFmySRBdCG/CHfgKcR6ZFCfNYE+lTG8BEr1e7bHwndKezwAShdb0vZMYFqFswiogtSPdmSpjX6o9wB3tzTXV1C9xeTwG45psjvoBGYUy5BC/9Jbd9CS4DgXBmNIwI3XRcdfnvqqUo7YgmtjVCdGzw1wBcYoOniNL3AWV2GlplgCehh3hXCOmrIs8n/1CdAynaFGCrQex0ViwrWVbY85i1A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b52YMo3in5NfYRukQFFhZHULrmVCmd28i5TtC1p+7lvS1GjoQFFwSEEKOGugYyVoP8ZViy/jNgrz9d0Mi9nv+3GZLKGw6AqQjD4cpaeJDIQhaBRFRycPO+tI/4m0ZY3M4iU4VA6zb6QeIuJ3+u9ALKPJ3vvG4m5OD2KL7Q7wBHTyLN0rcpe6BEUlhUW2UY2zrUMyjGEvKzyaeX87MHtwkh3hzRTX6/5nkepDFQx95fJmmgs+6GAkBaFirf88jLD5Pwz1XUIWLt6jlIoEsvn1ZJFl5BTov0+Vdyy508q62VD8+/h5LN72IaK2iv52QNM8I/oX6AmnBXyeR/mWTajgsg==
  • 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 17:11:08 +0000
  • Ironport-sdr: x3rto33xYyPKk63QkBqvm3LZkILhM+Z1anan6ZdJrCyGpmE6qWq1dgMBL7YkF4m/hLf2I5Bcx0 3g6QQ4uxKzn+VF8xJgxPtkKJSXq0iW/0PMftT5K10mAA66qS/4jXU3Jg44q9VcbzsO8fmKugKk UjEAK0ak1cyGMEFFPG9XZK12MuXw9JqZBVkMuoF/O921Pm2ciRDVAL9j+WvuifLDJWRlcWmnQf LoLC/ulzwyRYabRm4uD/ApmFpofiY0a5Urb9U/Y7kqQIxk06hJNhOm3ZwDKtCLAbGZA9NLucRG O8I=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Jan 18, 2021 at 05:04:19PM +0100, Jan Beulich wrote:
> On 18.01.2021 16:54, Roger Pau Monné wrote:
> > On Mon, Jan 18, 2021 at 12:05:12PM +0100, Jan Beulich wrote:
> >> On 15.01.2021 16:01, Roger Pau Monne wrote:
> >>> --- 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?
> 
> Hmm, this would further move us away from the goal of the comment
> making sufficiently clear that a conditional shouldn't be (re-)
> introduced here, I would think. Since I can't seem to think of a
> good way to express this more briefly than in the description,
> and if maybe you can't either, perhaps there's no choice then to
> leave it as is, hoping that people would look at the commit before
> proposing a further change here.

/*
 * Unconditionally set the flag to indicate this version of Xen has
 * been fixed to create IOMMU mappings for grant/foreign maps.
 *
 * NB: this flag shouldn't be made conditional on IOMMU presence, as
 * it could force guests to resort to using bounce buffers when using
 * grant/foreign maps with devices.
 */

Would be better? (albeit too verbose maybe).

Thanks, Roger.



 


Rackspace

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