[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 5/6] hw/arm/smmuv3: Use correct bit positions in EVT_SET_ADDR2
From: |
Simon Veith |
Subject: |
[PATCH v3 5/6] hw/arm/smmuv3: Use correct bit positions in EVT_SET_ADDR2 macro |
Date: |
Mon, 16 Dec 2019 16:15:11 +0100 |
The bit offsets in the EVT_SET_ADDR2 macro do not match those specified
in the ARM SMMUv3 Architecture Specification. In all events that use
this macro, e.g. F_WALK_EABT, the faulting fetch address or IPA actually
occupies the 32-bit words 6 and 7 in the event record contiguously, with
the upper and lower unused bits clear due to alignment or maximum
supported address bits. How many bits are clear depends on the
individual event type.
Update the macro to write to the correct words in the event record so
that guest drivers can obtain accurate address information on events.
ref. ARM IHI 0070C, sections 7.3.12 through 7.3.16.
Signed-off-by: Simon Veith <address@hidden>
Cc: Eric Auger <address@hidden>
Cc: address@hidden
Cc: address@hidden
Acked-by: Eric Auger <address@hidden>
---
hw/arm/smmuv3-internal.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h
index 042b435..4112394 100644
--- a/hw/arm/smmuv3-internal.h
+++ b/hw/arm/smmuv3-internal.h
@@ -461,8 +461,8 @@ typedef struct SMMUEventInfo {
} while (0)
#define EVT_SET_ADDR2(x, addr) \
do { \
- (x)->word[7] = deposit32((x)->word[7], 3, 29, addr >> 16); \
- (x)->word[7] = deposit32((x)->word[7], 0, 16, addr & 0xffff);\
+ (x)->word[7] = (uint32_t)(addr >> 32); \
+ (x)->word[6] = (uint32_t)(addr & 0xffffffff); \
} while (0)
void smmuv3_record_event(SMMUv3State *s, SMMUEventInfo *event);
--
2.7.4
- [PATCH v3 0/6] hw/arm/smmuv3: Correct stream ID and event address handling, Simon Veith, 2019/12/16
- [PATCH v3 2/6] hw/arm/smmuv3: Correct SMMU_BASE_ADDR_MASK value, Simon Veith, 2019/12/16
- [PATCH v3 1/6] hw/arm/smmuv3: Apply address mask to linear strtab base address, Simon Veith, 2019/12/16
- [PATCH v3 3/6] hw/arm/smmuv3: Check stream IDs against actual table LOG2SIZE, Simon Veith, 2019/12/16
- [PATCH v3 5/6] hw/arm/smmuv3: Use correct bit positions in EVT_SET_ADDR2 macro,
Simon Veith <=
- [PATCH v3 6/6] hw/arm/smmuv3: Report F_STE_FETCH fault address in correct word position, Simon Veith, 2019/12/16
- [PATCH v3 4/6] hw/arm/smmuv3: Align stream table base address to table size, Simon Veith, 2019/12/16
- Re: [PATCH v3 0/6] hw/arm/smmuv3: Correct stream ID and event address handling, Auger Eric, 2019/12/17