[PATCH 5/5] hw/arm/smmuv3: Report F_STE_FETCH fault address in correct word position

Simon Veith posted 5 patches 6 years, 2 months ago
Maintainers: Eric Auger <eric.auger@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
There is a newer version of this series
[PATCH 5/5] hw/arm/smmuv3: Report F_STE_FETCH fault address in correct word position
Posted by Simon Veith 6 years, 2 months ago
The smmuv3_record_event() function that generates the F_STE_FETCH error
uses the EVT_SET_ADDR macro to record the fetch address, placing it in
32-bit words 4 and 5.

The correct position for this address is in words 6 and 7, per the
SMMUv3 Architecture Specification.

Update the function to use the EVT_SET_ADDR2 macro instead, which is the
macro intended for writing to these words.

ref. ARM IHI 0070C, section 7.3.4.

Signed-off-by: Simon Veith <sveith@amazon.de>
Cc: Eric Auger <eric.auger@redhat.com>
Cc: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org
---
 hw/arm/smmuv3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 2d6c275..125e47d 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -172,7 +172,7 @@ void smmuv3_record_event(SMMUv3State *s, SMMUEventInfo *info)
     case SMMU_EVT_F_STE_FETCH:
         EVT_SET_SSID(&evt, info->u.f_ste_fetch.ssid);
         EVT_SET_SSV(&evt,  info->u.f_ste_fetch.ssv);
-        EVT_SET_ADDR(&evt, info->u.f_ste_fetch.addr);
+        EVT_SET_ADDR2(&evt, info->u.f_ste_fetch.addr);
         break;
     case SMMU_EVT_C_BAD_STE:
         EVT_SET_SSID(&evt, info->u.c_bad_ste.ssid);
-- 
2.7.4


Re: [PATCH 5/5] hw/arm/smmuv3: Report F_STE_FETCH fault address in correct word position
Posted by Auger Eric 6 years, 2 months ago
Hi Simon,

On 12/4/19 2:55 PM, Simon Veith wrote:
> The smmuv3_record_event() function that generates the F_STE_FETCH error
> uses the EVT_SET_ADDR macro to record the fetch address, placing it in
> 32-bit words 4 and 5.
> 
> The correct position for this address is in words 6 and 7, per the
> SMMUv3 Architecture Specification.
> 
> Update the function to use the EVT_SET_ADDR2 macro instead, which is the
> macro intended for writing to these words.
> 
> ref. ARM IHI 0070C, section 7.3.4.
> 
> Signed-off-by: Simon Veith <sveith@amazon.de>
> Cc: Eric Auger <eric.auger@redhat.com>
> Cc: qemu-devel@nongnu.org
> Cc: qemu-arm@nongnu.org
> ---
>  hw/arm/smmuv3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index 2d6c275..125e47d 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -172,7 +172,7 @@ void smmuv3_record_event(SMMUv3State *s, SMMUEventInfo *info)
>      case SMMU_EVT_F_STE_FETCH:
>          EVT_SET_SSID(&evt, info->u.f_ste_fetch.ssid);
>          EVT_SET_SSV(&evt,  info->u.f_ste_fetch.ssv);
> -        EVT_SET_ADDR(&evt, info->u.f_ste_fetch.addr);
> +        EVT_SET_ADDR2(&evt, info->u.f_ste_fetch.addr);
>          break;
>      case SMMU_EVT_C_BAD_STE:
>          EVT_SET_SSID(&evt, info->u.c_bad_ste.ssid);
> 
Acked-by: Eric Auger <eric.auger@redhat.com>

Thanks

Eric