From: Linus Torvalds Date: Fri, 6 Jun 2014 17:43:28 +0000 (-0700) Subject: Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cc07aabc53978ae09a1d539237189f7c9841060a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Merge tag 'arm64-upstream' of git://git./linux/kernel/git/arm64/linux into next Pull arm64 updates from Catalin Marinas: - Optimised assembly string/memory routines (based on the AArch64 Cortex Strings library contributed to glibc but re-licensed under GPLv2) - Optimised crypto algorithms making use of the ARMv8 crypto extensions (together with kernel API for using FPSIMD instructions in interrupt context) - Ftrace support - CPU topology parsing from DT - ESR_EL1 (Exception Syndrome Register) exposed to user space signal handlers for SIGSEGV/SIGBUS (useful to emulation tools like Qemu) - 1GB section linear mapping if applicable - Barriers usage clean-up - Default pgprot clean-up Conflicts as per Catalin. * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (57 commits) arm64: kernel: initialize broadcast hrtimer based clock event device arm64: ftrace: Add system call tracepoint arm64: ftrace: Add CALLER_ADDRx macros arm64: ftrace: Add dynamic ftrace support arm64: Add ftrace support ftrace: Add arm64 support to recordmcount arm64: Add 'notrace' attribute to unwind_frame() for ftrace arm64: add __ASSEMBLY__ in asm/insn.h arm64: Fix linker script entry point arm64: lib: Implement optimized string length routines arm64: lib: Implement optimized string compare routines arm64: lib: Implement optimized memcmp routine arm64: lib: Implement optimized memset routine arm64: lib: Implement optimized memmove routine arm64: lib: Implement optimized memcpy routine arm64: defconfig: enable a few more common/useful options in defconfig ftrace: Make CALLER_ADDRx macros more generic arm64: Fix deadlock scenario with smp_send_stop() arm64: Fix machine_shutdown() definition arm64: Support arch_irq_work_raise() via self IPIs ... --- cc07aabc53978ae09a1d539237189f7c9841060a diff --cc arch/arm64/include/asm/pgtable.h index e2f96748859b,aa150ed99f22..598cc384fc1c --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@@ -265,8 -258,9 +258,9 @@@ static inline pmd_t pte_pmd(pte_t pte #define mk_pmd(page,prot) pfn_pmd(page_to_pfn(page),prot) #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) + #define pud_pfn(pud) (((pud_val(pud) & PUD_MASK) & PHYS_MASK) >> PAGE_SHIFT) -#define set_pmd_at(mm, addr, pmdp, pmd) set_pmd(pmdp, pmd) +#define set_pmd_at(mm, addr, pmdp, pmd) set_pte_at(mm, addr, (pte_t *)pmdp, pmd_pte(pmd)) static inline int has_transparent_hugepage(void) { diff --cc arch/arm64/include/asm/thread_info.h index 7b8e3a2a00fb,9c086c63f911..e40b6d06d515 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@@ -99,7 -103,12 +102,11 @@@ static inline struct thread_info *curre #define TIF_SIGPENDING 0 #define TIF_NEED_RESCHED 1 #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ + #define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */ #define TIF_SYSCALL_TRACE 8 + #define TIF_SYSCALL_AUDIT 9 + #define TIF_SYSCALL_TRACEPOINT 10 + #define TIF_SECCOMP 11 -#define TIF_POLLING_NRFLAG 16 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ #define TIF_FREEZE 19 #define TIF_RESTORE_SIGMASK 20 diff --cc arch/arm64/kernel/Makefile index ba5e17a522d5,1f4d8913ceb3..cdaedad3afe5 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@@ -4,9 -4,11 +4,13 @@@ CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET) AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET) +CFLAGS_efi-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) \ + -I$(src)/../../../scripts/dtc/libfdt + CFLAGS_REMOVE_ftrace.o = -pg + CFLAGS_REMOVE_insn.o = -pg + CFLAGS_REMOVE_return_address.o = -pg + # Object file lists. arm64-obj-y := cputable.o debug-monitors.o entry.o irq.o fpsimd.o \ entry-fpsimd.o process.o ptrace.o setup.o signal.o \ diff --cc arch/arm64/mm/mmu.c index 4a829a210bb6,3a729de96f15..c43f1dd19489 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@@ -192,17 -158,6 +160,16 @@@ static void __init alloc_init_pmd(pud_ { pmd_t *pmd; unsigned long next; + pmdval_t prot_sect; + pgprot_t prot_pte; + + if (map_io) { - prot_sect = PMD_TYPE_SECT | PMD_SECT_AF | - PMD_ATTRINDX(MT_DEVICE_nGnRE); ++ prot_sect = PROT_SECT_DEVICE_nGnRE; + prot_pte = __pgprot(PROT_DEVICE_nGnRE); + } else { - prot_sect = prot_sect_kernel; ++ prot_sect = PROT_SECT_NORMAL_EXEC; + prot_pte = PAGE_KERNEL_EXEC; + } /* * Check for initial section mappings in the pgd/pud and remove them. @@@ -242,7 -195,30 +209,30 @@@ static void __init alloc_init_pud(pgd_ do { next = pud_addr_end(addr, end); - alloc_init_pmd(pud, addr, next, phys, map_io); + + /* + * For 4K granule only, attempt to put down a 1GB block + */ - if ((PAGE_SHIFT == 12) && ++ if (!map_io && (PAGE_SHIFT == 12) && + ((addr | next | phys) & ~PUD_MASK) == 0) { + pud_t old_pud = *pud; + set_pud(pud, __pud(phys | PROT_SECT_NORMAL_EXEC)); + + /* + * If we have an old value for a pud, it will + * be pointing to a pmd table that we no longer + * need (from swapper_pg_dir). + * + * Look up the old pmd table and free it. + */ + if (!pud_none(old_pud)) { + phys_addr_t table = __pa(pmd_offset(&old_pud, 0)); + memblock_free(table, PAGE_SIZE); + flush_tlb_all(); + } + } else { - alloc_init_pmd(pud, addr, next, phys); ++ alloc_init_pmd(pud, addr, next, phys, map_io); + } phys += next - addr; } while (pud++, addr = next, addr != end); }