mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/arm: check read handler behavior
We expect mmio read handlers to leave the bits above the access size zeroed. Add an ASSERT to check this aspect of read handler behavior. Suggested-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com> Acked-by: Julien Grall <jgrall@amazon.com>
This commit is contained in:
1 parent
43afe6f030
commit
9a5e22b642
1 file changed
+2
@@ -37,6 +37,8 @@ static enum io_state handle_read(const struct mmio_handler *handler,
|
||||
if ( !handler->ops->read(v, info, &r, handler->priv) )
|
||||
return IO_ABORT;
|
||||
|
||||
ASSERT((r & ~GENMASK((1U << info->dabt.size) * 8 - 1, 0)) == 0);
|
||||
|
||||
r = sign_extend(dabt, r);
|
||||
|
||||
set_user_reg(regs, dabt.reg, r);
|
||||
|
||||