On 03/12/2020 17:39, Andrea Bastoni wrote:
...
> diff --git a/hypervisor/arch/arm64/smmu.c b/hypervisor/arch/arm64/smmu.c
> index df92fb7a..7869b66b 100644
> --- a/hypervisor/arch/arm64/smmu.c
> +++ b/hypervisor/arch/arm64/smmu.c
> @@ -84,6 +84,10 @@
> #define SMR_VALID (1 << 31)
> #define SMR_MASK_SHIFT 16
> #define SMR_ID_SHIFT 0
> +/* Ignore upper bit in ID and MASK */
> +#define SMR_GET_ID(smr) ((smr) & BIT_MASK(14, 0))
> +/* Mask is already specified from bit 0 in the configuration */
> +#define SMR_GET_MASK(smr) ((smr) & BIT_MASK(14, 0))
Note that by using BIT_MASK(),
...
>
> - for_each_stream_id(root_sid, root_cell.config, n) {
> - if (sid == root_sid) {
> - printk("Assigning StreamID 0x%x to cell \"%s\"\n",
> - sid, root_cell.config->name);
> + for_each_stream_id(rsid, root_cell.config, n) {
> + if (fsid.id == rsid.id) {
> + printk("Assigning SID 0x%llx Mask: 0x%llx to cell
> \"%s\"\n",
> + SMR_GET_ID(fsid.mmu500.id),
> + SMR_GET_MASK(fsid.mmu500.mask_out),
> + root_cell.config->name);
the type change. This is normally hidden when you explicitly assign back to an
unsigned int (because W(int-)conversion is not enabled), but e.g. not here.
I now remember why I used 0x7fff in the previous implementation. ;)
--
Thanks,
Andrea Bastoni
--
You received this message because you are subscribed to the Google Groups
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jailhouse-dev/18fc549b-6155-15b0-4886-2174209f6407%40tum.de.