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

Re: [Xen-devel] [PATCH v3 04/14] AMD/IOMMU: use bit field for IRTE


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Mon, 22 Jul 2019 12:50:20 +0000
  • Accept-language: en-US
  • 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-SenderADCheck; bh=fXFYzJjImpNG3ha7g45tA/xVfKREdt8D15+/KNgYZSM=; b=QXq91BQTGKsqVvvd1w5l1+OYyvKF4Ax68QO+3lhQUJzxBUeGZOQfXegjAXzoyzxW394xI0MsCGkrxwDIaortI127rHjAORs2tTueOHuSRRthhMUy8rjrvuhE/jjKsPMzOZvQ9XSc4pVbYmCu0fpXlVDdFJxUUq3p/SnFk/cCHdm8tXiKATixFQXAvbXV6k/d+HkdWU4WeMD60azYNfJzq+xQRL4euJJuHEoDNuS8oMzW0jjHMOuW5jXxTE+h/wsnb9Y54Jrumoxe3JzxYpAWzFhPn7QW6rCZOmI2A/Tuuth9QNbaahM30z9K0ePsrM84UzIKnoKntORs9eIm0EUCmw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z8S3X87lPLiNChFwK/8ahCAgBMoZ9UGFgSpe06sUB504eKTdCEjK2iqRqe3eAeUMMugeX58ASW7ftB2KY4e9VQbeI78L13Q1LHAk7a9s5JPemJbmm6TVIQeATw5BQ4bI1Uz3YweQQu5+7Ode+70nAmGvtRghiRf8qbxUpKTolHXFcNamcXEVDjQmxmxd93HnYqGlW51VeCp9aCtu8pLv2OvbE5dODmc9Kvxg9/eEBOQXQTUy/nsRmWUT1hK/TTNkk6LeAyI3EfLR8QKVhuktfrD9bDYu98h5sCVqZe76CIoVQlVVFt1WEQw+hGa2Lxq3nL7ppjpJiXxBOArOYRXJcw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, BrianWoods <brian.woods@xxxxxxx>, Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
  • Delivery-date: Mon, 22 Jul 2019 12:50:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVO/ShZ1XycBFTpEyE5AJFB9blPabSHS6jgAAFboCAACoBB4AEU3oA
  • Thread-topic: [PATCH v3 04/14] AMD/IOMMU: use bit field for IRTE

On 19.07.2019 20:44, Andrew Cooper wrote:
> On 19/07/2019 17:16, Jan Beulich wrote:
>> On 19.07.2019 17:56, Andrew Cooper wrote:
>>> On 16/07/2019 17:36, Jan Beulich wrote:
>>>> At the same time restrict its scope to just the single source file
>>>> actually using it, and abstract accesses by introducing a union of
>>>> pointers. (A union of the actual table entries is not used to make it
>>>> impossible to [wrongly, once the 128-bit form gets added] perform
>>>> pointer arithmetic / array accesses on derived types.)
>>>>
>>>> Also move away from updating the entries piecemeal: Construct a full new
>>>> entry, and write it out.
>>>>
>>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>> I'm still not entirely convinced by extra union and containerof(), but
>>> the result looks correct.
>> And I'm still open to going the other way, if you're convinced that
>> in update_intremap_entry() this
>>
>>       struct irte_basic basic = {
>>           .flds = {
>>               .remap_en = true,
>>               .int_type = int_type,
>>               .dm = dest_mode,
>>               .dest = dest,
>>               .vector = vector,
>>           }
>>       };
>>
>> (and similarly then for the 128-bit form, and of course .flds
>> inserted at other use sites) is overall better than the current
>> variant.
> 
> I've just experimented with the attached delta and it does compile in
> CentOS 6, which is the usual culprit for problems in this area.

Yeah, with the "flds" in place things ought to (and do) build fine for
me too (it was, after all, the question whether inserting that
intermediate field would be more or less ugly than the container_of()
"solution"). I've therefore mostly switched to what you've suggested.
But before re-posting we should really settle on the barrier kind to
use for the 128-bit IRTE writes.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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