[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] xen/arm: Don't mix GFN and MFN when using iomem_deny_access
commit ac94372254232a3ba0ecbb5ae8034cbcc0eeac00 Author: Julien Grall <julien.grall@xxxxxxx> AuthorDate: Tue Jan 17 15:52:53 2017 +0000 Commit: Stefano Stabellini <sstabellini@xxxxxxxxxx> CommitDate: Tue Jan 17 15:50:46 2017 -0800 xen/arm: Don't mix GFN and MFN when using iomem_deny_access iomem_deny_access is working on MFN and not GFN. Make it clear by renaming the local variables. Signed-off-by: Julien Grall <julien.grall@xxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> --- xen/arch/arm/domain_build.c | 6 +++--- xen/arch/arm/gic-v2.c | 18 +++++++++--------- xen/arch/arm/gic-v3.c | 18 +++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 07b868d..63301e6 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1373,7 +1373,7 @@ static int acpi_iomem_deny_access(struct domain *d) { acpi_status status; struct acpi_table_spcr *spcr = NULL; - unsigned long gfn; + unsigned long mfn; int rc; /* Firstly permit full MMIO capabilities. */ @@ -1391,9 +1391,9 @@ static int acpi_iomem_deny_access(struct domain *d) return -EINVAL; } - gfn = spcr->serial_port.address >> PAGE_SHIFT; + mfn = spcr->serial_port.address >> PAGE_SHIFT; /* Deny MMIO access for UART */ - rc = iomem_deny_access(d, gfn, gfn + 1); + rc = iomem_deny_access(d, mfn, mfn + 1); if ( rc ) return rc; diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index 9245e7d..cd8e504 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c @@ -991,26 +991,26 @@ static void __init gicv2_dt_init(void) static int gicv2_iomem_deny_access(const struct domain *d) { int rc; - unsigned long gfn, nr; + unsigned long mfn, nr; - gfn = dbase >> PAGE_SHIFT; - rc = iomem_deny_access(d, gfn, gfn + 1); + mfn = dbase >> PAGE_SHIFT; + rc = iomem_deny_access(d, mfn, mfn + 1); if ( rc ) return rc; - gfn = hbase >> PAGE_SHIFT; - rc = iomem_deny_access(d, gfn, gfn + 1); + mfn = hbase >> PAGE_SHIFT; + rc = iomem_deny_access(d, mfn, mfn + 1); if ( rc ) return rc; - gfn = cbase >> PAGE_SHIFT; + mfn = cbase >> PAGE_SHIFT; nr = DIV_ROUND_UP(csize, PAGE_SIZE); - rc = iomem_deny_access(d, gfn, gfn + nr); + rc = iomem_deny_access(d, mfn, mfn + nr); if ( rc ) return rc; - gfn = vbase >> PAGE_SHIFT; - return iomem_deny_access(d, gfn, gfn + nr); + mfn = vbase >> PAGE_SHIFT; + return iomem_deny_access(d, mfn, mfn + nr); } #ifdef CONFIG_ACPI diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index b8be395..57ed9d9 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1234,37 +1234,37 @@ static void __init gicv3_dt_init(void) static int gicv3_iomem_deny_access(const struct domain *d) { int rc, i; - unsigned long gfn, nr; + unsigned long mfn, nr; - gfn = dbase >> PAGE_SHIFT; + mfn = dbase >> PAGE_SHIFT; nr = DIV_ROUND_UP(SZ_64K, PAGE_SIZE); - rc = iomem_deny_access(d, gfn, gfn + nr); + rc = iomem_deny_access(d, mfn, mfn + nr); if ( rc ) return rc; for ( i = 0; i < gicv3.rdist_count; i++ ) { - gfn = gicv3.rdist_regions[i].base >> PAGE_SHIFT; + mfn = gicv3.rdist_regions[i].base >> PAGE_SHIFT; nr = DIV_ROUND_UP(gicv3.rdist_regions[i].size, PAGE_SIZE); - rc = iomem_deny_access(d, gfn, gfn + nr); + rc = iomem_deny_access(d, mfn, mfn + nr); if ( rc ) return rc; } if ( cbase != INVALID_PADDR ) { - gfn = cbase >> PAGE_SHIFT; + mfn = cbase >> PAGE_SHIFT; nr = DIV_ROUND_UP(csize, PAGE_SIZE); - rc = iomem_deny_access(d, gfn, gfn + nr); + rc = iomem_deny_access(d, mfn, mfn + nr); if ( rc ) return rc; } if ( vbase != INVALID_PADDR ) { - gfn = vbase >> PAGE_SHIFT; + mfn = vbase >> PAGE_SHIFT; nr = DIV_ROUND_UP(csize, PAGE_SIZE); - return iomem_deny_access(d, gfn, gfn + nr); + return iomem_deny_access(d, mfn, mfn + nr); } return 0; -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |