VT-d: prune super-page related capability macros
authorJan Beulich <jbeulich@suse.com>
Wed, 24 Nov 2021 10:03:52 +0000 (11:03 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 24 Nov 2021 10:03:52 +0000 (11:03 +0100)
commit0e74f62d038697d9f26052fb33bdd8325fcc4785
tree5b4edaa465ca6cccf2da71b5eab28a8b76f4806b
parente1e1da600b8ab4264f242fc735702f5425165923
VT-d: prune super-page related capability macros

cap_super_page_val() and cap_super_offset() are unused (apart from the
latter using the former). I don't see how cap_super_offset() can be
useful in its current shape: cap_super_page_val()'s result is not an
lvalue and hence can't have its address taken. Plus a user would have
to check the capability register field is non-zero, for
find_first_bit() (or find_first_set_bit(), if suitably corrected) to be
valid in the first place. Yet as per the spec when the field is non-zero
the low bit would always be set, so the result would be independent of
the actual value the field holds.

Further zap cap_sps_512gb() and cap_sps_1tb(). While earlier versions
of the spec had things spelled out that way, the current version marks
the two bits as reserved. And "48-bit offset to page frame" wasn't in
line with 1Tb pages anyway - clearly 256Tb pages would have been meant
here.

Finally properly parenthesize parameter uses in the remaining two
macros.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.h