mmu.c (d21bd6898336a7892914d308d5e0868f0b863571) mmu.c (51a0048beb449682d632d0af52a515adb9f9882e)
1/*
2 * Based on arch/arm/mm/mmu.c
3 *
4 * Copyright (C) 1995-2005 Russell King
5 * Copyright (C) 2012 ARM Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 511 unchanged lines hidden (view full) ---

520}
521
522static int __init parse_rodata(char *arg)
523{
524 return strtobool(arg, &rodata_enabled);
525}
526early_param("rodata", parse_rodata);
527
1/*
2 * Based on arch/arm/mm/mmu.c
3 *
4 * Copyright (C) 1995-2005 Russell King
5 * Copyright (C) 2012 ARM Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 511 unchanged lines hidden (view full) ---

520}
521
522static int __init parse_rodata(char *arg)
523{
524 return strtobool(arg, &rodata_enabled);
525}
526early_param("rodata", parse_rodata);
527
528#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
529static int __init map_entry_trampoline(void)
530{
531 extern char __entry_tramp_text_start[];
532
533 pgprot_t prot = rodata_enabled ? PAGE_KERNEL_ROX : PAGE_KERNEL_EXEC;
534 phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
535
536 /* The trampoline is always mapped and can therefore be global */
537 pgprot_val(prot) &= ~PTE_NG;
538
539 /* Map only the text into the trampoline page table */
540 memset(tramp_pg_dir, 0, PGD_SIZE);
541 __create_pgd_mapping(tramp_pg_dir, pa_start, TRAMP_VALIAS, PAGE_SIZE,
542 prot, pgd_pgtable_alloc, 0);
543
544 /* ...as well as the kernel page table */
545 __set_fixmap(FIX_ENTRY_TRAMP_TEXT, pa_start, prot);
546 return 0;
547}
548core_initcall(map_entry_trampoline);
549#endif
550
528/*
529 * Create fine-grained mappings for the kernel.
530 */
531static void __init map_kernel(pgd_t *pgd)
532{
533 static struct vm_struct vmlinux_text, vmlinux_rodata, vmlinux_inittext,
534 vmlinux_initdata, vmlinux_data;
535

--- 373 unchanged lines hidden ---
551/*
552 * Create fine-grained mappings for the kernel.
553 */
554static void __init map_kernel(pgd_t *pgd)
555{
556 static struct vm_struct vmlinux_text, vmlinux_rodata, vmlinux_inittext,
557 vmlinux_initdata, vmlinux_data;
558

--- 373 unchanged lines hidden ---