Skip to content

Commit

Permalink
iommu/ipmmu-vmsa: Don't truncate ttbr if LPAE is not enabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geert Uytterhoeven authored and Joerg Roedel committed Dec 28, 2015
1 parent 0a9afed commit f64232e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/ipmmu-vmsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f64232e

Please sign in to comment.