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

Re: [Xen-devel] [PATCH 1/6] x86/vtd: Don't include control register state in the table pointers

On Fri, Feb 22, 2019 at 7:15 PM Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> iremap_maddr and qinval_maddr point to the base of a block of contiguous RAM,
> allocated by the driver, holding the Interrupt Remapping table, and the Queued
> Invalidation ring.
> Despite their name, they are actually the values of the hardware register,
> including control metadata in the lower 12 bits.  While uses of these fields
> do appear to correctly shift out the metadata, this is very subtle behaviour
> and confusing to follow.

Could I suggest that we add an ASSERT() to that macro, that maddr is
page aligned?

The algorithm used certainly assumes that's the case, and would
produce incorrect results if it were ever validly true.  Such an
ASSERT() would also have detected the storing-garbage-in-maddr issue
almost immediately.


Xen-devel mailing list



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