VT-d: size qinval queue dynamically
authorJan Beulich <JBeulich@suse.com>
Tue, 8 Jun 2021 16:38:55 +0000 (17:38 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Jun 2021 16:43:06 +0000 (17:43 +0100)
commitcbfa62bb140c8f10a0ae96db3ce06e22b3b9d302
tree66f66ada8a98b7cfe3932e5e07492c54c57f5a75
parentfd5dc41ceaed9cfcfa011cdfd50f264c89277a90
VT-d: size qinval queue dynamically

With the present synchronous model, we need two slots for every
operation (the operation itself and a wait descriptor).  There can be
one such pair of requests pending per CPU. To ensure that under all
normal circumstances a slot is always available when one is requested,
size the queue ring according to the number of present CPUs.

This is part of XSA-373 / CVE-2021-28692.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
xen/drivers/passthrough/vtd/iommu.h
xen/drivers/passthrough/vtd/qinval.c