Skip to content

Commit bb0fd7a

Browse files
committed
Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: "Included in this update are both some long term fixes and some new features. Fixes: - An integer overflow in the calculation of ELF_ET_DYN_BASE. - Avoiding OOMs for high-order IOMMU allocations - SMP requires the data cache to be enabled for synchronisation primitives to work, so prevent the CPU_DCACHE_DISABLE option being visible on SMP builds. - A bug going back 10+ years in the noMMU ARM94* CPU support code, where it corrupts registers. Found by folk getting Linux running on their cameras. - Versatile Express needs an errata workaround enabled for CPU hot-unplug to work. Features: - Clean up module linker by handling out of range relocations separately from relocation cases we don't handle. - Fix a long term bug in the pci_mmap_page_range() code, which we hope won't impact userspace (we hope there's no users of the existing broken interface.) - Don't map DMA coherent allocations when we don't have a MMU. - Drop experimental status for SMP_ON_UP. - Warn when DT doesn't specify ePAPR mandatory cache properties. - Add documentation concerning how we find the start of physical memory for AUTO_ZRELADDR kernels, detailing why we have chosen the mask and the implications of changing it. - Updates from Ard Biesheuvel to address some issues with large kernels (such as allyesconfig) failing to link. - Allow hibernation to work on modern (ARMv7) CPUs - this appears to have never worked in the past on these CPUs. - Enable IRQ_SHOW_LEVEL, which changes the /proc/interrupts output format (hopefully without userspace breaking... let's hope that if it causes someone a problem, they tell us.) - Fix tegra-ahb DT offsets. - Rework ARM errata 643719 code (and ARMv7 flush_cache_louis()/ flush_dcache_all()) code to be more efficient, and enable this errata workaround by default for ARMv7+SMP CPUs. This complements the Versatile Express fix above. - Rework ARMv7 context code for errata 430973, so that only Cortex A8 CPUs are impacted by the branch target buffer flush when this errata is enabled. Also update the help text to indicate that all r1p* A8 CPUs are impacted. - Switch ARM to the generic show_mem() implementation, it conveys all the information which we were already reporting. - Prevent slow timer sources being used for udelay() - timers running at less than 1MHz are not useful for this, and can cause udelay() to return immediately, without any wait. Using such a slow timer is silly. - VDSO support for 32-bit ARM, mainly for gettimeofday() using the ARM architected timer. - Perf support for Scorpion performance monitoring units" vdso semantic conflict fixed up as per linux-next. * 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (52 commits) ARM: update errata 430973 documentation to cover Cortex A8 r1p* ARM: ensure delay timer has sufficient accuracy for delays ARM: switch to use the generic show_mem() implementation ARM: proc-v7: avoid errata 430973 workaround for non-Cortex A8 CPUs ARM: enable ARM errata 643719 workaround by default ARM: cache-v7: optimise test for Cortex A9 r0pX devices ARM: cache-v7: optimise branches in v7_flush_cache_louis ARM: cache-v7: consolidate initialisation of cache level index ARM: cache-v7: shift CLIDR to extract appropriate field before masking ARM: cache-v7: use movw/movt instructions ARM: allow 16-bit instructions in ALT_UP() ARM: proc-arm94*.S: fix setup function ARM: vexpress: fix CPU hotplug with CT9x4 tile. ARM: 8276/1: Make CPU_DCACHE_DISABLE depend on !SMP ARM: 8335/1: Documentation: DT bindings: Tegra AHB: document the legacy base address ARM: 8334/1: amba: tegra-ahb: detect and correct bogus base address ARM: 8333/1: amba: tegra-ahb: fix register offsets in the macros ARM: 8339/1: Enable CONFIG_GENERIC_IRQ_SHOW_LEVEL ARM: 8338/1: kexec: Relax SMP validation to improve DT compatibility ARM: 8337/1: mm: Do not invoke OOM for higher order IOMMU DMA allocations ...
2 parents bdfa54d + 4b2f883 commit bb0fd7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2429
-604
lines changed

Documentation/devicetree/bindings/arm/pmu.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Required properties:
1818
"arm,arm11mpcore-pmu"
1919
"arm,arm1176-pmu"
2020
"arm,arm1136-pmu"
21+
"qcom,scorpion-pmu"
22+
"qcom,scorpion-mp-pmu"
2123
"qcom,krait-pmu"
2224
- interrupts : 1 combined interrupt or 1 per core. If the interrupt is a per-cpu
2325
interrupt (PPI) then 1 interrupt should be specified.

Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ Required properties:
55
Tegra30, must contain "nvidia,tegra30-ahb". Otherwise, must contain
66
'"nvidia,<chip>-ahb", "nvidia,tegra30-ahb"' where <chip> is tegra124,
77
tegra132, or tegra210.
8-
- reg : Should contain 1 register ranges(address and length)
8+
- reg : Should contain 1 register ranges(address and length). For
9+
Tegra20, Tegra30, and Tegra114 chips, the value must be <0x6000c004
10+
0x10c>. For Tegra124, Tegra132 and Tegra210 chips, the value should
11+
be be <0x6000c000 0x150>.
912

10-
Example:
13+
Example (for a Tegra20 chip):
1114
ahb: ahb@6000c004 {
1215
compatible = "nvidia,tegra20-ahb";
1316
reg = <0x6000c004 0x10c>; /* AHB Arbitration + Gizmo Controller */

arch/arm/Kconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ config ARM
2121
select GENERIC_IDLE_POLL_SETUP
2222
select GENERIC_IRQ_PROBE
2323
select GENERIC_IRQ_SHOW
24+
select GENERIC_IRQ_SHOW_LEVEL
2425
select GENERIC_PCI_IOMAP
2526
select GENERIC_SCHED_CLOCK
2627
select GENERIC_SMP_IDLE_THREAD
@@ -1063,7 +1064,7 @@ config ARM_ERRATA_430973
10631064
depends on CPU_V7
10641065
help
10651066
This option enables the workaround for the 430973 Cortex-A8
1066-
(r1p0..r1p2) erratum. If a code sequence containing an ARM/Thumb
1067+
r1p* erratum. If a code sequence containing an ARM/Thumb
10671068
interworking branch is replaced with another code sequence at the
10681069
same virtual address, whether due to self-modifying code or virtual
10691070
to physical address re-mapping, Cortex-A8 does not recover from the
@@ -1132,6 +1133,7 @@ config ARM_ERRATA_742231
11321133
config ARM_ERRATA_643719
11331134
bool "ARM errata: LoUIS bit field in CLIDR register is incorrect"
11341135
depends on CPU_V7 && SMP
1136+
default y
11351137
help
11361138
This option enables the workaround for the 643719 Cortex-A9 (prior to
11371139
r1p0) erratum. On affected cores the LoUIS bit field of the CLIDR
@@ -1349,7 +1351,7 @@ config SMP
13491351
If you don't know what to do here, say N.
13501352

13511353
config SMP_ON_UP
1352-
bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)"
1354+
bool "Allow booting SMP kernel on uniprocessor systems"
13531355
depends on SMP && !XIP_KERNEL && MMU
13541356
default y
13551357
help

arch/arm/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Ensure linker flags are correct
1414
LDFLAGS :=
1515

16-
LDFLAGS_vmlinux :=-p --no-undefined -X
16+
LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer
1717
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
1818
LDFLAGS_vmlinux += --be8
1919
LDFLAGS_MODULE += --be8
@@ -264,6 +264,7 @@ core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ)
264264
core-$(CONFIG_VFP) += arch/arm/vfp/
265265
core-$(CONFIG_XEN) += arch/arm/xen/
266266
core-$(CONFIG_KVM_ARM_HOST) += arch/arm/kvm/
267+
core-$(CONFIG_VDSO) += arch/arm/vdso/
267268

268269
# If we have a machine-specific directory, then include it in the build.
269270
core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
@@ -321,6 +322,12 @@ dtbs: prepare scripts
321322
dtbs_install:
322323
$(Q)$(MAKE) $(dtbinst)=$(boot)/dts
323324

325+
PHONY += vdso_install
326+
vdso_install:
327+
ifeq ($(CONFIG_VDSO),y)
328+
$(Q)$(MAKE) $(build)=arch/arm/vdso $@
329+
endif
330+
324331
# We use MRPROPER_FILES and CLEAN_FILES now
325332
archclean:
326333
$(Q)$(MAKE) $(clean)=$(boot)
@@ -345,4 +352,5 @@ define archhelp
345352
echo ' Install using (your) ~/bin/$(INSTALLKERNEL) or'
346353
echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
347354
echo ' install to $$(INSTALL_PATH) and run lilo'
355+
echo ' vdso_install - Install unstripped vdso.so to $$(INSTALL_MOD_PATH)/vdso'
348356
endef

arch/arm/boot/compressed/head.S

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
*/
1111
#include <linux/linkage.h>
1212
#include <asm/assembler.h>
13+
#include <asm/v7m.h>
14+
15+
AR_CLASS( .arch armv7-a )
16+
M_CLASS( .arch armv7-m )
1317

14-
.arch armv7-a
1518
/*
1619
* Debugging stuff
1720
*
@@ -114,7 +117,12 @@
114117
* sort out different calling conventions
115118
*/
116119
.align
117-
.arm @ Always enter in ARM state
120+
/*
121+
* Always enter in ARM state for CPUs that support the ARM ISA.
122+
* As of today (2014) that's exactly the members of the A and R
123+
* classes.
124+
*/
125+
AR_CLASS( .arm )
118126
start:
119127
.type start,#function
120128
.rept 7
@@ -132,14 +140,15 @@ start:
132140

133141
THUMB( .thumb )
134142
1:
135-
ARM_BE8( setend be ) @ go BE8 if compiled for BE8
136-
mrs r9, cpsr
143+
ARM_BE8( setend be ) @ go BE8 if compiled for BE8
144+
AR_CLASS( mrs r9, cpsr )
137145
#ifdef CONFIG_ARM_VIRT_EXT
138146
bl __hyp_stub_install @ get into SVC mode, reversibly
139147
#endif
140148
mov r7, r1 @ save architecture ID
141149
mov r8, r2 @ save atags pointer
142150

151+
#ifndef CONFIG_CPU_V7M
143152
/*
144153
* Booting from Angel - need to enter SVC mode and disable
145154
* FIQs/IRQs (numeric definitions from angel arm.h source).
@@ -155,6 +164,7 @@ not_angel:
155164
safe_svcmode_maskall r0
156165
msr spsr_cxsf, r9 @ Save the CPU boot mode in
157166
@ SPSR
167+
#endif
158168
/*
159169
* Note that some cache flushing and other stuff may
160170
* be needed here - is there an Angel SWI call for this?
@@ -168,9 +178,26 @@ not_angel:
168178
.text
169179

170180
#ifdef CONFIG_AUTO_ZRELADDR
171-
@ determine final kernel image address
181+
/*
182+
* Find the start of physical memory. As we are executing
183+
* without the MMU on, we are in the physical address space.
184+
* We just need to get rid of any offset by aligning the
185+
* address.
186+
*
187+
* This alignment is a balance between the requirements of
188+
* different platforms - we have chosen 128MB to allow
189+
* platforms which align the start of their physical memory
190+
* to 128MB to use this feature, while allowing the zImage
191+
* to be placed within the first 128MB of memory on other
192+
* platforms. Increasing the alignment means we place
193+
* stricter alignment requirements on the start of physical
194+
* memory, but relaxing it means that we break people who
195+
* are already placing their zImage in (eg) the top 64MB
196+
* of this range.
197+
*/
172198
mov r4, pc
173199
and r4, r4, #0xf8000000
200+
/* Determine final kernel image address. */
174201
add r4, r4, #TEXT_OFFSET
175202
#else
176203
ldr r4, =zreladdr
@@ -810,6 +837,16 @@ __common_mmu_cache_on:
810837
call_cache_fn: adr r12, proc_types
811838
#ifdef CONFIG_CPU_CP15
812839
mrc p15, 0, r9, c0, c0 @ get processor ID
840+
#elif defined(CONFIG_CPU_V7M)
841+
/*
842+
* On v7-M the processor id is located in the V7M_SCB_CPUID
843+
* register, but as cache handling is IMPLEMENTATION DEFINED on
844+
* v7-M (if existant at all) we just return early here.
845+
* If V7M_SCB_CPUID were used the cpu ID functions (i.e.
846+
* __armv7_mmu_cache_{on,off,flush}) would be selected which
847+
* use cp15 registers that are not implemented on v7-M.
848+
*/
849+
bx lr
813850
#else
814851
ldr r9, =CONFIG_PROCESSOR_ID
815852
#endif
@@ -1310,8 +1347,9 @@ __hyp_reentry_vectors:
13101347

13111348
__enter_kernel:
13121349
mov r0, #0 @ must be 0
1313-
ARM( mov pc, r4 ) @ call kernel
1314-
THUMB( bx r4 ) @ entry point is always ARM
1350+
ARM( mov pc, r4 ) @ call kernel
1351+
M_CLASS( add r4, r4, #1 ) @ enter in Thumb mode for M class
1352+
THUMB( bx r4 ) @ entry point is always ARM for A/R classes
13151353

13161354
reloc_code_end:
13171355

arch/arm/include/asm/Kbuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22

3-
generic-y += auxvec.h
43
generic-y += bitsperlong.h
54
generic-y += cputime.h
65
generic-y += current.h

arch/arm/include/asm/assembler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@
237237
.pushsection ".alt.smp.init", "a" ;\
238238
.long 9998b ;\
239239
9997: instr ;\
240+
.if . - 9997b == 2 ;\
241+
nop ;\
242+
.endif ;\
240243
.if . - 9997b != 4 ;\
241244
.error "ALT_UP() content must assemble to exactly 4 bytes";\
242245
.endif ;\

arch/arm/include/asm/auxvec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include <uapi/asm/auxvec.h>

arch/arm/include/asm/cputype.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,20 @@ static inline int cpu_is_pj4(void)
253253
#else
254254
#define cpu_is_pj4() 0
255255
#endif
256+
257+
static inline int __attribute_const__ cpuid_feature_extract_field(u32 features,
258+
int field)
259+
{
260+
int feature = (features >> field) & 15;
261+
262+
/* feature registers are signed values */
263+
if (feature > 8)
264+
feature -= 16;
265+
266+
return feature;
267+
}
268+
269+
#define cpuid_feature_extract(reg, field) \
270+
cpuid_feature_extract_field(read_cpuid_ext(reg), field)
271+
256272
#endif

arch/arm/include/asm/elf.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#ifndef __ASMARM_ELF_H
22
#define __ASMARM_ELF_H
33

4+
#include <asm/auxvec.h>
45
#include <asm/hwcap.h>
6+
#include <asm/vdso_datapage.h>
57

68
/*
79
* ELF register definitions..
@@ -115,7 +117,7 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
115117
the loader. We need to make sure that it is out of the way of the program
116118
that it will "exec", and that there is sufficient room for the brk. */
117119

118-
#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
120+
#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
119121

120122
/* When the program starts, a1 contains a pointer to a function to be
121123
registered with atexit, as per the SVR4 ABI. A value of 0 means we
@@ -126,6 +128,13 @@ extern void elf_set_personality(const struct elf32_hdr *);
126128
#define SET_PERSONALITY(ex) elf_set_personality(&(ex))
127129

128130
#ifdef CONFIG_MMU
131+
#ifdef CONFIG_VDSO
132+
#define ARCH_DLINFO \
133+
do { \
134+
NEW_AUX_ENT(AT_SYSINFO_EHDR, \
135+
(elf_addr_t)current->mm->context.vdso); \
136+
} while (0)
137+
#endif
129138
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
130139
struct linux_binprm;
131140
int arch_setup_additional_pages(struct linux_binprm *, int);

arch/arm/include/asm/futex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
" .align 3\n" \
1414
" .long 1b, 4f, 2b, 4f\n" \
1515
" .popsection\n" \
16-
" .pushsection .fixup,\"ax\"\n" \
16+
" .pushsection .text.fixup,\"ax\"\n" \
1717
" .align 2\n" \
1818
"4: mov %0, " err_reg "\n" \
1919
" b 3b\n" \

arch/arm/include/asm/mmu.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ typedef struct {
1111
#endif
1212
unsigned int vmalloc_seq;
1313
unsigned long sigpage;
14+
#ifdef CONFIG_VDSO
15+
unsigned long vdso;
16+
#endif
1417
} mm_context_t;
1518

1619
#ifdef CONFIG_CPU_HAS_ASID

arch/arm/include/asm/pmu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ struct pmu_hw_events {
9292
struct arm_pmu {
9393
struct pmu pmu;
9494
cpumask_t active_irqs;
95+
int *irq_affinity;
9596
char *name;
9697
irqreturn_t (*handle_irq)(int irq_num, void *dev);
9798
void (*enable)(struct perf_event *event);

arch/arm/include/asm/smp_plat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ static inline u32 mpidr_hash_size(void)
104104
return 1 << mpidr_hash.bits;
105105
}
106106

107+
extern int platform_can_secondary_boot(void);
107108
extern int platform_can_cpu_hotplug(void);
108109

109110
#endif

arch/arm/include/asm/uaccess.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ do { \
315315
__asm__ __volatile__( \
316316
"1: " TUSER(ldrb) " %1,[%2],#0\n" \
317317
"2:\n" \
318-
" .pushsection .fixup,\"ax\"\n" \
318+
" .pushsection .text.fixup,\"ax\"\n" \
319319
" .align 2\n" \
320320
"3: mov %0, %3\n" \
321321
" mov %1, #0\n" \
@@ -351,7 +351,7 @@ do { \
351351
__asm__ __volatile__( \
352352
"1: " TUSER(ldr) " %1,[%2],#0\n" \
353353
"2:\n" \
354-
" .pushsection .fixup,\"ax\"\n" \
354+
" .pushsection .text.fixup,\"ax\"\n" \
355355
" .align 2\n" \
356356
"3: mov %0, %3\n" \
357357
" mov %1, #0\n" \
@@ -397,7 +397,7 @@ do { \
397397
__asm__ __volatile__( \
398398
"1: " TUSER(strb) " %1,[%2],#0\n" \
399399
"2:\n" \
400-
" .pushsection .fixup,\"ax\"\n" \
400+
" .pushsection .text.fixup,\"ax\"\n" \
401401
" .align 2\n" \
402402
"3: mov %0, %3\n" \
403403
" b 2b\n" \
@@ -430,7 +430,7 @@ do { \
430430
__asm__ __volatile__( \
431431
"1: " TUSER(str) " %1,[%2],#0\n" \
432432
"2:\n" \
433-
" .pushsection .fixup,\"ax\"\n" \
433+
" .pushsection .text.fixup,\"ax\"\n" \
434434
" .align 2\n" \
435435
"3: mov %0, %3\n" \
436436
" b 2b\n" \
@@ -458,7 +458,7 @@ do { \
458458
THUMB( "1: " TUSER(str) " " __reg_oper1 ", [%1]\n" ) \
459459
THUMB( "2: " TUSER(str) " " __reg_oper0 ", [%1, #4]\n" ) \
460460
"3:\n" \
461-
" .pushsection .fixup,\"ax\"\n" \
461+
" .pushsection .text.fixup,\"ax\"\n" \
462462
" .align 2\n" \
463463
"4: mov %0, %3\n" \
464464
" b 3b\n" \

arch/arm/include/asm/unified.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
.syntax unified
2525
#endif
2626

27+
#ifdef CONFIG_CPU_V7M
28+
#define AR_CLASS(x...)
29+
#define M_CLASS(x...) x
30+
#else
31+
#define AR_CLASS(x...) x
32+
#define M_CLASS(x...)
33+
#endif
34+
2735
#ifdef CONFIG_THUMB2_KERNEL
2836

2937
#if __GNUC__ < 4

0 commit comments

Comments
 (0)