> From: Paul Durrant
> Sent: Tuesday, August 4, 2020 9:42 PM
>
> From: Paul Durrant
>
> This removes the need for much shifting, masking and several magic
> numbers.
> On the whole it makes the code quite a bit more readable.
similarly, I feel the readability is worse such as slptp. We may use
> -Original Message-
> From: Jan Beulich
> Sent: 06 August 2020 13:47
> To: Paul Durrant
> Cc: xen-devel@lists.xenproject.org; Paul Durrant ; Kevin
> Tian
>
> Subject: Re: [PATCH v4 13/14] vtd: use a bit field for context_entry
>
> On 04.08.
On 04.08.2020 15:42, Paul Durrant wrote:
> @@ -208,35 +209,53 @@ struct root_entry {
> do { (r).ctp = ((val) >> PAGE_SHIFT_4K); } while (0)
>
> struct context_entry {
> -u64 lo;
> -u64 hi;
> +union {
> +__uint128_t val;
> +struct { uint64_t lo, hi; };
> +
From: Paul Durrant
This removes the need for much shifting, masking and several magic numbers.
On the whole it makes the code quite a bit more readable.
Signed-off-by: Paul Durrant
---
Cc: Kevin Tian
v4:
- New in v4
---
xen/drivers/passthrough/vtd/iommu.c | 8 ++--
xen/drivers/passthroug