iommu/ipmmu-vmsa: Don't truncate ttbr if LPAE is not enabled
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 22 Dec 2015 19:01:06 +0000 (20:01 +0100)
committerJoerg Roedel <jroedel@suse.de>
Mon, 28 Dec 2015 16:10:52 +0000 (17:10 +0100)
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>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/ipmmu-vmsa.c

index 8cf605fa9946013642b2a88f500beb285cc55cfc..dfb868e2d129005d7a7401cea7c6109e7720559d 100644 (file)
@@ -295,7 +295,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;
 
        /*
         * Allocate the page table operations.