linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/ipmmu-vmsa: Don't truncate ttbr if LPAE is not enabled
@ 2015-12-22 19:01 Geert Uytterhoeven
  2015-12-28 16:12 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2015-12-22 19:01 UTC (permalink / raw)
  To: Joerg Roedel, Magnus Damm; +Cc: iommu, linux-sh, Geert Uytterhoeven

If CONFIG_PHYS_ADDR_T_64BIT=n:

    drivers/iommu/ipmmu-vmsa.c: In function 'ipmmu_domain_init_context':
    drivers/iommu/ipmmu-vmsa.c:434:2: warning: right shift count >= width of type
      ipmmu_ctx_write(domain, IMTTUBR0, ttbr >> 32);
      ^

As io_pgtable_cfg.arm_lpae_s1_cfg.ttbr[] is an array of u64s, assigning
it to a phys_addr_t may truncates it.  Make ttbr u64 to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/iommu/ipmmu-vmsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index e08f4945cd5abb0c..83d7f0c7f47f1296 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -385,7 +385,7 @@ static struct iommu_gather_ops ipmmu_gather_ops = {
 
 static int ipmmu_domain_init_context(struct ipmmu_vmsa_domain *domain)
 {
-	phys_addr_t ttbr;
+	u64 ttbr;
 	u32 tmp;
 	int ret;
 
-- 
1.9.1


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

* Re: [PATCH] iommu/ipmmu-vmsa: Don't truncate ttbr if LPAE is not enabled
  2015-12-22 19:01 [PATCH] iommu/ipmmu-vmsa: Don't truncate ttbr if LPAE is not enabled Geert Uytterhoeven
@ 2015-12-28 16:12 ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2015-12-28 16:12 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Magnus Damm, iommu, linux-sh

On Tue, Dec 22, 2015 at 08:01:06PM +0100, Geert Uytterhoeven wrote:
>  static int ipmmu_domain_init_context(struct ipmmu_vmsa_domain *domain)
>  {
> -	phys_addr_t ttbr;
> +	u64 ttbr;
>  	u32 tmp;
>  	int ret;

Didn't apply cleanly to v4.4-rc7, but fixed it up and queued it to
iommu/fixes.

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

end of thread, other threads:[~2015-12-28 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-22 19:01 [PATCH] iommu/ipmmu-vmsa: Don't truncate ttbr if LPAE is not enabled Geert Uytterhoeven
2015-12-28 16:12 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).