Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: - add support for ELF fdpic binaries on both MMU and noMMU platforms - linker script cleanups - support for compressed .data section for XIP images - discard memblock arrays when possible - various cleanups - atomic DMA pool updates - better diagnostics of missing/corrupt device tree - export information to allow userspace kexec tool to place images more inteligently, so that the device tree isn't overwritten by the booting kernel - make early_printk more efficient on semihosted systems - noMMU cleanups - SA1111 PCMCIA update in preparation for further cleanups * 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: (38 commits) ARM: 8719/1: NOMMU: work around maybe-uninitialized warning ARM: 8717/2: debug printch/printascii: translate '\n' to "\r\n" not "\n\r" ARM: 8713/1: NOMMU: Support MPU in XIP configuration ARM: 8712/1: NOMMU: Use more MPU regions to cover memory ARM: 8711/1: V7M: Add support for MPU to M-class ARM: 8710/1: Kconfig: Kill CONFIG_VECTORS_BASE ARM: 8709/1: NOMMU: Disallow MPU for XIP ARM: 8708/1: NOMMU: Rework MPU to be mostly done in C ARM: 8707/1: NOMMU: Update MPU accessors to use cp15 helpers ARM: 8706/1: NOMMU: Move out MPU setup in separate module ARM: 8702/1: head-common.S: Clear lr before jumping to start_kernel() ARM: 8705/1: early_printk: use printascii() rather than printch() ARM: 8703/1: debug.S: move hexbuf to a writable section ARM: add additional table to compressed kernel ARM: decompressor: fix BSS size calculation pcmcia: sa1111: remove special sa1111 mmio accessors pcmcia: sa1111: use sa1111_get_irq() to obtain IRQ resources ARM: better diagnostics with missing/corrupt dtb ARM: 8699/1: dma-mapping: Remove init_dma_coherent_pool_size() ARM: 8698/1: dma-mapping: Mark atomic_pool as __ro_after_init ..
This commit is contained in:
@@ -174,6 +174,11 @@ static inline unsigned int __attribute_const__ read_cpuid_cachetype(void)
|
||||
return read_cpuid(CPUID_CACHETYPE);
|
||||
}
|
||||
|
||||
static inline unsigned int __attribute_const__ read_cpuid_mputype(void)
|
||||
{
|
||||
return read_cpuid(CPUID_MPUIR);
|
||||
}
|
||||
|
||||
#elif defined(CONFIG_CPU_V7M)
|
||||
|
||||
static inline unsigned int __attribute_const__ read_cpuid_id(void)
|
||||
@@ -186,6 +191,11 @@ static inline unsigned int __attribute_const__ read_cpuid_cachetype(void)
|
||||
return readl(BASEADDR_V7M_SCB + V7M_SCB_CTR);
|
||||
}
|
||||
|
||||
static inline unsigned int __attribute_const__ read_cpuid_mputype(void)
|
||||
{
|
||||
return readl(BASEADDR_V7M_SCB + MPU_TYPE);
|
||||
}
|
||||
|
||||
#else /* ifdef CONFIG_CPU_CP15 / elif defined(CONFIG_CPU_V7M) */
|
||||
|
||||
static inline unsigned int __attribute_const__ read_cpuid_id(void)
|
||||
|
@@ -190,13 +190,6 @@ extern int arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
|
||||
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
||||
unsigned long attrs);
|
||||
|
||||
/*
|
||||
* This can be called during early boot to increase the size of the atomic
|
||||
* coherent DMA pool above the default value of 256KiB. It must be called
|
||||
* before postcore_initcall.
|
||||
*/
|
||||
extern void __init init_dma_coherent_pool_size(unsigned long size);
|
||||
|
||||
/*
|
||||
* For SA-1111, IXP425, and ADI systems the dma-mapping functions are "magic"
|
||||
* and utilize bounce buffers as needed to work around limited DMA windows.
|
||||
|
@@ -101,10 +101,15 @@ struct elf32_hdr;
|
||||
extern int elf_check_arch(const struct elf32_hdr *);
|
||||
#define elf_check_arch elf_check_arch
|
||||
|
||||
#define ELFOSABI_ARM_FDPIC 65 /* ARM FDPIC platform */
|
||||
#define elf_check_fdpic(x) ((x)->e_ident[EI_OSABI] == ELFOSABI_ARM_FDPIC)
|
||||
#define elf_check_const_displacement(x) ((x)->e_flags & EF_ARM_PIC)
|
||||
#define ELF_FDPIC_CORE_EFLAGS 0
|
||||
|
||||
#define vmcore_elf64_check_arch(x) (0)
|
||||
|
||||
extern int arm_elf_read_implies_exec(const struct elf32_hdr *, int);
|
||||
#define elf_read_implies_exec(ex,stk) arm_elf_read_implies_exec(&(ex), stk)
|
||||
extern int arm_elf_read_implies_exec(int);
|
||||
#define elf_read_implies_exec(ex,stk) arm_elf_read_implies_exec(stk)
|
||||
|
||||
struct task_struct;
|
||||
int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
|
||||
@@ -121,6 +126,13 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
|
||||
have no such handler. */
|
||||
#define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0
|
||||
|
||||
#define ELF_FDPIC_PLAT_INIT(_r, _exec_map_addr, _interp_map_addr, dynamic_addr) \
|
||||
do { \
|
||||
(_r)->ARM_r7 = _exec_map_addr; \
|
||||
(_r)->ARM_r8 = _interp_map_addr; \
|
||||
(_r)->ARM_r9 = dynamic_addr; \
|
||||
} while(0)
|
||||
|
||||
extern void elf_set_personality(const struct elf32_hdr *);
|
||||
#define SET_PERSONALITY(ex) elf_set_personality(&(ex))
|
||||
|
||||
|
@@ -19,7 +19,6 @@
|
||||
} while (0)
|
||||
|
||||
extern pte_t *pkmap_page_table;
|
||||
extern pte_t *fixmap_page_table;
|
||||
|
||||
extern void *kmap_high(struct page *page);
|
||||
extern void kunmap_high(struct page *page);
|
||||
|
@@ -15,6 +15,10 @@ typedef struct {
|
||||
#ifdef CONFIG_VDSO
|
||||
unsigned long vdso;
|
||||
#endif
|
||||
#ifdef CONFIG_BINFMT_ELF_FDPIC
|
||||
unsigned long exec_fdpic_loadmap;
|
||||
unsigned long interp_fdpic_loadmap;
|
||||
#endif
|
||||
} mm_context_t;
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_ASID
|
||||
@@ -34,6 +38,10 @@ typedef struct {
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned long end_brk;
|
||||
#ifdef CONFIG_BINFMT_ELF_FDPIC
|
||||
unsigned long exec_fdpic_loadmap;
|
||||
unsigned long interp_fdpic_loadmap;
|
||||
#endif
|
||||
} mm_context_t;
|
||||
|
||||
#endif
|
||||
|
@@ -2,8 +2,6 @@
|
||||
#ifndef __ARM_MPU_H
|
||||
#define __ARM_MPU_H
|
||||
|
||||
#ifdef CONFIG_ARM_MPU
|
||||
|
||||
/* MPUIR layout */
|
||||
#define MPUIR_nU 1
|
||||
#define MPUIR_DREGION 8
|
||||
@@ -18,6 +16,11 @@
|
||||
/* MPU D/I Size Register fields */
|
||||
#define MPU_RSR_SZ 1
|
||||
#define MPU_RSR_EN 0
|
||||
#define MPU_RSR_SD 8
|
||||
|
||||
/* Number of subregions (SD) */
|
||||
#define MPU_NR_SUBREGS 8
|
||||
#define MPU_MIN_SUBREG_SIZE 256
|
||||
|
||||
/* The D/I RSR value for an enabled region spanning the whole of memory */
|
||||
#define MPU_RSR_ALL_MEM 63
|
||||
@@ -39,6 +42,7 @@
|
||||
#endif
|
||||
|
||||
/* Access permission bits of ACR (only define those that we use)*/
|
||||
#define MPU_AP_PL1RO_PL0NA (0x5 << 8)
|
||||
#define MPU_AP_PL1RW_PL0RW (0x3 << 8)
|
||||
#define MPU_AP_PL1RW_PL0R0 (0x2 << 8)
|
||||
#define MPU_AP_PL1RW_PL0NA (0x1 << 8)
|
||||
@@ -47,7 +51,7 @@
|
||||
#define MPU_PROBE_REGION 0
|
||||
#define MPU_BG_REGION 1
|
||||
#define MPU_RAM_REGION 2
|
||||
#define MPU_VECTORS_REGION 3
|
||||
#define MPU_ROM_REGION 3
|
||||
|
||||
/* Maximum number of regions Linux is interested in */
|
||||
#define MPU_MAX_REGIONS 16
|
||||
@@ -65,13 +69,23 @@ struct mpu_rgn {
|
||||
};
|
||||
|
||||
struct mpu_rgn_info {
|
||||
u32 mpuir;
|
||||
unsigned int used;
|
||||
struct mpu_rgn rgns[MPU_MAX_REGIONS];
|
||||
};
|
||||
extern struct mpu_rgn_info mpu_rgn_info;
|
||||
|
||||
#ifdef CONFIG_ARM_MPU
|
||||
|
||||
extern void __init adjust_lowmem_bounds_mpu(void);
|
||||
extern void __init mpu_setup(void);
|
||||
|
||||
#else
|
||||
|
||||
static inline void adjust_lowmem_bounds_mpu(void) {}
|
||||
static inline void mpu_setup(void) {}
|
||||
|
||||
#endif /* !CONFIG_ARM_MPU */
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* CONFIG_ARM_MPU */
|
||||
|
||||
#endif
|
||||
|
@@ -47,15 +47,24 @@ struct thread_struct {
|
||||
|
||||
#define INIT_THREAD { }
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
#define nommu_start_thread(regs) do { } while (0)
|
||||
#else
|
||||
#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data
|
||||
#endif
|
||||
|
||||
#define start_thread(regs,pc,sp) \
|
||||
({ \
|
||||
unsigned long r7, r8, r9; \
|
||||
\
|
||||
if (IS_ENABLED(CONFIG_BINFMT_ELF_FDPIC)) { \
|
||||
r7 = regs->ARM_r7; \
|
||||
r8 = regs->ARM_r8; \
|
||||
r9 = regs->ARM_r9; \
|
||||
} \
|
||||
memset(regs->uregs, 0, sizeof(regs->uregs)); \
|
||||
if (IS_ENABLED(CONFIG_BINFMT_ELF_FDPIC) && \
|
||||
current->personality & FDPIC_FUNCPTRS) { \
|
||||
regs->ARM_r7 = r7; \
|
||||
regs->ARM_r8 = r8; \
|
||||
regs->ARM_r9 = r9; \
|
||||
regs->ARM_r10 = current->mm->start_data; \
|
||||
} else if (!IS_ENABLED(CONFIG_MMU)) \
|
||||
regs->ARM_r10 = current->mm->start_data; \
|
||||
if (current->personality & ADDR_LIMIT_32BIT) \
|
||||
regs->ARM_cpsr = USR_MODE; \
|
||||
else \
|
||||
@@ -65,7 +74,6 @@ struct thread_struct {
|
||||
regs->ARM_cpsr |= PSR_ENDSTATE; \
|
||||
regs->ARM_pc = pc & ~1; /* pc */ \
|
||||
regs->ARM_sp = sp; /* sp */ \
|
||||
nommu_start_thread(regs); \
|
||||
})
|
||||
|
||||
/* Forward declaration, a strange C thing */
|
||||
|
@@ -60,7 +60,7 @@ asmlinkage void secondary_start_kernel(void);
|
||||
*/
|
||||
struct secondary_data {
|
||||
union {
|
||||
unsigned long mpu_rgn_szr;
|
||||
struct mpu_rgn_info *mpu_rgn_info;
|
||||
u64 pgdir;
|
||||
};
|
||||
unsigned long swapper_pg_dir;
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#define _ASMARM_UCONTEXT_H
|
||||
|
||||
#include <asm/fpstate.h>
|
||||
#include <asm/user.h>
|
||||
|
||||
/*
|
||||
* struct sigcontext only has room for the basic registers, but struct
|
||||
|
@@ -58,6 +58,16 @@
|
||||
#define V7M_SCB_CCSIDR 0x80 /* Cache size ID register */
|
||||
#define V7M_SCB_CSSELR 0x84 /* Cache size selection register */
|
||||
|
||||
/* Memory-mapped MPU registers for M-class */
|
||||
#define MPU_TYPE 0x90
|
||||
#define MPU_CTRL 0x94
|
||||
#define MPU_CTRL_ENABLE 1
|
||||
#define MPU_CTRL_PRIVDEFENA (1 << 2)
|
||||
|
||||
#define MPU_RNR 0x98
|
||||
#define MPU_RBAR 0x9c
|
||||
#define MPU_RASR 0xa0
|
||||
|
||||
/* Cache opeartions */
|
||||
#define V7M_SCB_ICIALLU 0x250 /* I-cache invalidate all to PoU */
|
||||
#define V7M_SCB_ICIMVAU 0x258 /* I-cache invalidate by MVA to PoU */
|
||||
|
@@ -32,6 +32,10 @@
|
||||
#define PTRACE_SETVFPREGS 28
|
||||
#define PTRACE_GETHBPREGS 29
|
||||
#define PTRACE_SETHBPREGS 30
|
||||
#define PTRACE_GETFDPIC 31
|
||||
|
||||
#define PTRACE_GETFDPIC_EXEC 0
|
||||
#define PTRACE_GETFDPIC_INTERP 1
|
||||
|
||||
/*
|
||||
* PSR bits
|
||||
|
@@ -36,5 +36,6 @@
|
||||
#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
|
||||
#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
|
||||
#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
|
||||
#define __ARM_NR_get_tls (__ARM_NR_BASE+6)
|
||||
|
||||
#endif /* _UAPI__ASM_ARM_UNISTD_H */
|
||||
|
Reference in New Issue
Block a user