All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] hw/arm/smmuv3: Check 31st bit to see if CD is valid
@ 2021-07-19 20:57 Joe Komlodi
  2021-07-19 20:57 ` [PATCH 1/1] " Joe Komlodi
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Komlodi @ 2021-07-19 20:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: eric.auger

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(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] hw/arm/smmuv3: Check 31st bit to see if CD is valid
  2021-07-19 20:57 [PATCH 0/1] hw/arm/smmuv3: Check 31st bit to see if CD is valid Joe Komlodi
@ 2021-07-19 20:57 ` Joe Komlodi
  2021-07-22 15:00   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Komlodi @ 2021-07-19 20:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: eric.auger

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 <joe.komlodi@xilinx.com>
---
 hw/arm/smmuv3-internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h
index 3dac576..d1885ae 100644
--- a/hw/arm/smmuv3-internal.h
+++ b/hw/arm/smmuv3-internal.h
@@ -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)                                      \
     ({                                                      \
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] hw/arm/smmuv3: Check 31st bit to see if CD is valid
  2021-07-19 20:57 ` [PATCH 1/1] " Joe Komlodi
@ 2021-07-22 15:00   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2021-07-22 15:00 UTC (permalink / raw)
  To: Joe Komlodi; +Cc: Eric Auger, QEMU Developers

On Mon, 19 Jul 2021 at 22:03, Joe Komlodi <joe.komlodi@xilinx.com> wrote:
>
> 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 <joe.komlodi@xilinx.com>
> ---
>  hw/arm/smmuv3-internal.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h
> index 3dac576..d1885ae 100644
> --- a/hw/arm/smmuv3-internal.h
> +++ b/hw/arm/smmuv3-internal.h
> @@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-22 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 20:57 [PATCH 0/1] hw/arm/smmuv3: Check 31st bit to see if CD is valid Joe Komlodi
2021-07-19 20:57 ` [PATCH 1/1] " Joe Komlodi
2021-07-22 15:00   ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.