hw/arm/smmuv3: Check 31st bit to see if CD is valid
cover hw/arm/smmuv3: Check 31st bit to see if CD is valid
Hi all,
This fixes an off-by-1 error when checking to see if a context descriptor is valid in SMMUv3.
I think it hasn't caused problems yet because Linux will also set the 30th bit, which is the bit CD_VALID currently checks.
Thanks!
Joe
Joe Komlodi (1):
hw/arm/smmuv3: Check 31st bit to see if CD is valid
hw/arm/smmuv3-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.7.4
PATCH 1/1 hw/arm/smmuv3: Check 31st bit to see if CD is valid
The bit to see if a CD is valid is the last bit of the first word of the CD.
Signed-off-by Joe Komlodi <[email protected]>
--- hw/arm/smmuv3-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/smmuv3-internal.h +1 -1
@@ -570,7 +570,7 @@ static inline int pa_range(STE *ste)/* CD fields */ -#define CD_VALID (x) extract32((x)->word[0], 30, 1) +#define CD_VALID (x) extract32((x)->word[0], 31, 1)#define CD_ASID (x) extract32((x)->word[1], 16, 16)#define CD_TTB (x, sel) \ ({ \
Signature · 1 line
2.7.4
Peter Maydell
AppliedQuoted 13 lines · Joe Komlodi
The bit to see if a CD is valid is the last bit of the first word of the CD.
Signed-off-by Joe Komlodi <[email protected]>--- hw/arm/smmuv3-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/arm/smmuv3-internal.h +0
-0
hw/arm/smmuv3-internal.h static inline int pa_range(STE *ste) · line 576
Quoted 8 lines
hw/arm/smmuv3-internal.h +1
-1@@ -570,7 +570,7 @@ static inline int pa_range(STE *ste)/* CD fields */ -#define CD_VALID (x) extract32((x)->word[0], 30, 1) +#define CD_VALID (x) extract32((x)->word[0], 31, 1)#define CD_ASID (x) extract32((x)->word[1], 16, 16)#define CD_TTB (x, sel) \ ({ \
Applied to target-arm.next (should get into rc1), thanks.
-- PMM