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:
Stewart Hildebrand authored and Stefano Stabellini committed 2025-05-05 14:38:59 -07:00
1 parent 43afe6f030
commit 9a5e22b642
1 file changed
+2
+2
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.