RISC-V WorldGuard will add 5-bit world_id (WID) to the each memory transaction on the bus. The wgChecker in front of RAM or peripherals MMIO could do the access control based on the WID. It is similar to ARM TrustZone NS bit, but the WID is 5-bit.
The common implementation of WID is AXI4 AxUSER signal. Signed-off-by: Jim Shu <jim....@sifive.com> --- include/exec/memattrs.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index 8db1d30464..7a6866fa41 100644 --- a/include/exec/memattrs.h +++ b/include/exec/memattrs.h @@ -54,6 +54,11 @@ typedef struct MemTxAttrs { */ unsigned int pid:8; + /* + * RISC-V WorldGuard: the 5-bit WID field of memory access. + */ + unsigned int world_id:5; + /* * Bus masters which don't specify any attributes will get this * (via the MEMTXATTRS_UNSPECIFIED constant), so that we can @@ -63,8 +68,7 @@ typedef struct MemTxAttrs { */ bool unspecified; - uint8_t _reserved1; - uint16_t _reserved2; + uint16_t _reserved1; } MemTxAttrs; QEMU_BUILD_BUG_ON(sizeof(MemTxAttrs) > 8); -- 2.17.1