All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31
@ 2021-01-11 10:33 Oleksandr Tyshchenko
  2021-01-12  0:31 ` Stefano Stabellini
  2021-01-12  9:51 ` Bertrand Marquis
  0 siblings, 2 replies; 3+ messages in thread
From: Oleksandr Tyshchenko @ 2021-01-11 10:33 UTC (permalink / raw)
  To: xen-devel
  Cc: Oleksandr Tyshchenko, Stefano Stabellini, Julien Grall,
	Volodymyr Babchuk

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Replace all the use of 1 << 31 with 1U << 31 to prevent undefined
behavior in the IPMMU-VMSA driver.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
This is a follow-up to
https://patchew.org/Xen/20201224152419.22453-1-julien@xen.org/
---
 xen/drivers/passthrough/arm/ipmmu-vmsa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
index 346165c..aef358d 100644
--- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
+++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
@@ -187,7 +187,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
 #define IMCAAR               0x0004
 
 #define IMTTBCR                        0x0008
-#define IMTTBCR_EAE                    (1 << 31)
+#define IMTTBCR_EAE                    (1U << 31)
 #define IMTTBCR_PMB                    (1 << 30)
 #define IMTTBCR_SH1_NON_SHAREABLE      (0 << 28)
 #define IMTTBCR_SH1_OUTER_SHAREABLE    (2 << 28)
@@ -251,7 +251,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
 #define IMUCTR(n)              ((n) < 32 ? IMUCTR0(n) : IMUCTR32(n))
 #define IMUCTR0(n)             (0x0300 + ((n) * 16))
 #define IMUCTR32(n)            (0x0600 + (((n) - 32) * 16))
-#define IMUCTR_FIXADDEN        (1 << 31)
+#define IMUCTR_FIXADDEN        (1U << 31)
 #define IMUCTR_FIXADD_MASK     (0xff << 16)
 #define IMUCTR_FIXADD_SHIFT    16
 #define IMUCTR_TTSEL_MMU(n)    ((n) << 4)
-- 
2.7.4



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

* Re: [PATCH] iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31
  2021-01-11 10:33 [PATCH] iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31 Oleksandr Tyshchenko
@ 2021-01-12  0:31 ` Stefano Stabellini
  2021-01-12  9:51 ` Bertrand Marquis
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Stabellini @ 2021-01-12  0:31 UTC (permalink / raw)
  To: Oleksandr Tyshchenko
  Cc: xen-devel, Oleksandr Tyshchenko, Stefano Stabellini,
	Julien Grall, Volodymyr Babchuk

On Mon, 11 Jan 2021, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> Replace all the use of 1 << 31 with 1U << 31 to prevent undefined
> behavior in the IPMMU-VMSA driver.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> This is a follow-up to
> https://patchew.org/Xen/20201224152419.22453-1-julien@xen.org/
> ---
>  xen/drivers/passthrough/arm/ipmmu-vmsa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> index 346165c..aef358d 100644
> --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> @@ -187,7 +187,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
>  #define IMCAAR               0x0004
>  
>  #define IMTTBCR                        0x0008
> -#define IMTTBCR_EAE                    (1 << 31)
> +#define IMTTBCR_EAE                    (1U << 31)
>  #define IMTTBCR_PMB                    (1 << 30)
>  #define IMTTBCR_SH1_NON_SHAREABLE      (0 << 28)
>  #define IMTTBCR_SH1_OUTER_SHAREABLE    (2 << 28)
> @@ -251,7 +251,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
>  #define IMUCTR(n)              ((n) < 32 ? IMUCTR0(n) : IMUCTR32(n))
>  #define IMUCTR0(n)             (0x0300 + ((n) * 16))
>  #define IMUCTR32(n)            (0x0600 + (((n) - 32) * 16))
> -#define IMUCTR_FIXADDEN        (1 << 31)
> +#define IMUCTR_FIXADDEN        (1U << 31)
>  #define IMUCTR_FIXADD_MASK     (0xff << 16)
>  #define IMUCTR_FIXADD_SHIFT    16
>  #define IMUCTR_TTSEL_MMU(n)    ((n) << 4)
> -- 
> 2.7.4
> 


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

* Re: [PATCH] iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31
  2021-01-11 10:33 [PATCH] iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31 Oleksandr Tyshchenko
  2021-01-12  0:31 ` Stefano Stabellini
@ 2021-01-12  9:51 ` Bertrand Marquis
  1 sibling, 0 replies; 3+ messages in thread
From: Bertrand Marquis @ 2021-01-12  9:51 UTC (permalink / raw)
  To: Oleksandr Tyshchenko
  Cc: Xen-devel, Oleksandr Tyshchenko, Stefano Stabellini,
	Julien Grall, Volodymyr Babchuk



> On 11 Jan 2021, at 10:33, Oleksandr Tyshchenko <olekstysh@gmail.com> wrote:
> 
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> Replace all the use of 1 << 31 with 1U << 31 to prevent undefined
> behavior in the IPMMU-VMSA driver.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> This is a follow-up to
> https://patchew.org/Xen/20201224152419.22453-1-julien@xen.org/
> ---
> xen/drivers/passthrough/arm/ipmmu-vmsa.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> index 346165c..aef358d 100644
> --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> @@ -187,7 +187,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
> #define IMCAAR               0x0004
> 
> #define IMTTBCR                        0x0008
> -#define IMTTBCR_EAE                    (1 << 31)
> +#define IMTTBCR_EAE                    (1U << 31)
> #define IMTTBCR_PMB                    (1 << 30)
> #define IMTTBCR_SH1_NON_SHAREABLE      (0 << 28)
> #define IMTTBCR_SH1_OUTER_SHAREABLE    (2 << 28)
> @@ -251,7 +251,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
> #define IMUCTR(n)              ((n) < 32 ? IMUCTR0(n) : IMUCTR32(n))
> #define IMUCTR0(n)             (0x0300 + ((n) * 16))
> #define IMUCTR32(n)            (0x0600 + (((n) - 32) * 16))
> -#define IMUCTR_FIXADDEN        (1 << 31)
> +#define IMUCTR_FIXADDEN        (1U << 31)
> #define IMUCTR_FIXADD_MASK     (0xff << 16)
> #define IMUCTR_FIXADD_SHIFT    16
> #define IMUCTR_TTSEL_MMU(n)    ((n) << 4)
> -- 
> 2.7.4
> 
> 



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

end of thread, other threads:[~2021-01-12  9:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 10:33 [PATCH] iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31 Oleksandr Tyshchenko
2021-01-12  0:31 ` Stefano Stabellini
2021-01-12  9:51 ` Bertrand Marquis

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.