[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31
- To: Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Tue, 12 Jan 2021 09:51:17 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ck4ALEouIpBpOvDLMVT4DlldZFAuFcYI51aYDiAyw40=; b=fJWStcgFN8RimM5/8vQsoL26s41JLFKij5YL214pRu4EKskK3aQ343acOHX7ibquONMhWGzJZzyjjhiHlMBIUyF7cSUJ+37f5wtkPpz8vXg+ROr3dclxqTwugRj388bIR4xaTE4UneWm4VL7war+/tKh7vBvmk1u4BmNGJQ7p9IUaBy6T7lOdGBhj91BH/L5Tq5OrsiY+PpahwVzJBeoo5pizmOgNbdyJrgRkPcKzxQXQTj5pUxcHzNvVw2Uz17qLAKdoN/4Ye7pZiumVqgQlZQQYUXXkdV4/B7KK/JyW1i0/cycfilHEbgm7PnXj7SnEIfpjwb9yYaAgGZ9ewC/Sg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EB1qFtIiin7bre3E1tDtRA+1jRuCypg6cS3JxWxnqFoumqk7bHzvasZzKmd2jH+1od+ZdjD0E10LPG0Cgx22Y59SUBpT+gikeWp3PKGo5oSoz0CTMvqWZU7DcPFhkjUkFSWcwdteTh6lixSTvYy3pXGqDZUEuIbkTHAol+Wo+42yCKcJQc3aTLwa356suGqreGc7QZDmZ2cPn+jxFcbCVqbxfduZx8q27k7Hrwe2x1X76eKYRJkNyRnhP3PvlgbhDKqMBQO/fj1GVovlAcFrTCKhzHyPGmUVvegDIbmPRoCerJVXq4NqusbmXNgMDmDNuq8BdaG8X6XDRWg5bAQE3A==
- Authentication-results-original: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com;
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Tue, 12 Jan 2021 09:51:35 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com;
- Thread-index: AQHW6AVuxFxs65/4skyKik2n+IboV6ojwOaA
- Thread-topic: [PATCH] iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31
> On 11 Jan 2021, at 10:33, Oleksandr Tyshchenko <olekstysh@xxxxxxxxx> wrote:
>
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
>
> 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@xxxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
Cheers
Bertrand
> ---
> This is a follow-up to
> https://patchew.org/Xen/20201224152419.22453-1-julien@xxxxxxx/
> ---
> 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
>
>
|