@@ -3192,17 +3192,26 @@ class CompartmentReportWriter {
3192
3192
static constexpr uint32_t ImportPermitsLoadStoreCapabilities =
3193
3193
(1UL << 29 );
3194
3194
static constexpr uint32_t ImportPermitsLoadMutable = (1UL << 28 );
3195
+ static constexpr uint32_t ImportPermitsLoadGlobal = (1UL << 27 );
3195
3196
3196
3197
imports.push_back (json::Object{
3197
3198
{" kind" , " MMIO" },
3198
3199
{" start" , entry.start },
3199
- {" length" , entry.length & 0xfffffff },
3200
+ /*
3201
+ * Length and permissions are bit-stuffed into the same 32-bit
3202
+ * word, with the top 8 bits reserved for permission flags and
3203
+ * the bottom 24 for length. See CHERIoT-RTOS's
3204
+ * sdk/core/loader/types.h ReservedPermissionsMask
3205
+ */
3206
+ {" length" , entry.length & 0x00ffffff },
3200
3207
{" permits_load" , (entry.length & ImportPermitsLoad) != 0 },
3201
3208
{" permits_store" , (entry.length & ImportPermitsStore) != 0 },
3202
3209
{" permits_load_store_capabilities" ,
3203
3210
(entry.length & ImportPermitsLoadStoreCapabilities) != 0 },
3204
3211
{" permits_load_mutable" ,
3205
- (entry.length & ImportPermitsLoadMutable) != 0 }});
3212
+ (entry.length & ImportPermitsLoadMutable) != 0 },
3213
+ {" permits_load_global" ,
3214
+ (entry.length & ImportPermitsLoadGlobal) != 0 }});
3206
3215
}
3207
3216
continue ;
3208
3217
}
0 commit comments