Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: VDSO: Drop gic_get_usm_range() usage

We don't really need gic_get_usm_range() to abstract discovery of the
address of the GIC user-visible section now that we have access to its
base address globally.

Switch to calculating it ourselves, which will allow us to stop
requiring the irqchip driver to care about a counter exposed to userland
for use via the VDSO.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17040/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Paul Burton and committed by
Ralf Baechle
00578cd8 b11d4c1f

+5 -10
+5 -10
arch/mips/kernel/vdso.c
··· 13 13 #include <linux/err.h> 14 14 #include <linux/init.h> 15 15 #include <linux/ioport.h> 16 - #include <linux/irqchip/mips-gic.h> 17 16 #include <linux/mm.h> 18 17 #include <linux/sched.h> 19 18 #include <linux/slab.h> 20 19 #include <linux/timekeeper_internal.h> 21 20 22 21 #include <asm/abi.h> 22 + #include <asm/mips-cps.h> 23 23 #include <asm/vdso.h> 24 24 25 25 /* Kernel-provided data used by the VDSO. */ ··· 99 99 { 100 100 struct mips_vdso_image *image = current->thread.abi->vdso; 101 101 struct mm_struct *mm = current->mm; 102 - unsigned long gic_size, vvar_size, size, base, data_addr, vdso_addr; 102 + unsigned long gic_size, vvar_size, size, base, data_addr, vdso_addr, gic_pfn; 103 103 struct vm_area_struct *vma; 104 - struct resource gic_res; 105 104 int ret; 106 105 107 106 if (down_write_killable(&mm->mmap_sem)) ··· 124 125 * only map a page even though the total area is 64K, as we only need 125 126 * the counter registers at the start. 126 127 */ 127 - gic_size = gic_present ? PAGE_SIZE : 0; 128 + gic_size = mips_gic_present() ? PAGE_SIZE : 0; 128 129 vvar_size = gic_size + PAGE_SIZE; 129 130 size = vvar_size + image->size; 130 131 ··· 147 148 148 149 /* Map GIC user page. */ 149 150 if (gic_size) { 150 - ret = gic_get_usm_range(&gic_res); 151 - if (ret) 152 - goto out; 151 + gic_pfn = virt_to_phys(mips_gic_base + MIPS_GIC_USER_OFS) >> PAGE_SHIFT; 153 152 154 - ret = io_remap_pfn_range(vma, base, 155 - gic_res.start >> PAGE_SHIFT, 156 - gic_size, 153 + ret = io_remap_pfn_range(vma, base, gic_pfn, gic_size, 157 154 pgprot_noncached(PAGE_READONLY)); 158 155 if (ret) 159 156 goto out;