Skip to content

Commit 2821e26

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King: - fix ftrace relocation type filtering - relax arch timer version check * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8955/1: virt: Relax arch timer version check during early boot ARM: 8950/1: ftrace/recordmcount: filter relocation types
2 parents 84809aa + 6849b5e commit 2821e26

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

arch/arm/kernel/hyp-stub.S

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,9 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE
146146
#if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER)
147147
@ make CNTP_* and CNTPCT accessible from PL1
148148
mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1
149-
lsr r7, #16
150-
and r7, #0xf
151-
cmp r7, #1
152-
bne 1f
149+
ubfx r7, r7, #16, #4
150+
teq r7, #0
151+
beq 1f
153152
mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL
154153
orr r7, r7, #3 @ PL1PCEN | PL1PCTEN
155154
mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL

scripts/recordmcount.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
#define R_AARCH64_ABS64 257
3939
#endif
4040

41+
#define R_ARM_PC24 1
42+
#define R_ARM_THM_CALL 10
43+
#define R_ARM_CALL 28
44+
4145
static int fd_map; /* File descriptor for file being modified. */
4246
static int mmap_failed; /* Boolean flag. */
4347
static char gpfx; /* prefix for global symbol name (sometimes '_') */
@@ -418,6 +422,18 @@ static char const *already_has_rel_mcount = "success"; /* our work here is done!
418422
#define RECORD_MCOUNT_64
419423
#include "recordmcount.h"
420424

425+
static int arm_is_fake_mcount(Elf32_Rel const *rp)
426+
{
427+
switch (ELF32_R_TYPE(w(rp->r_info))) {
428+
case R_ARM_THM_CALL:
429+
case R_ARM_CALL:
430+
case R_ARM_PC24:
431+
return 0;
432+
}
433+
434+
return 1;
435+
}
436+
421437
/* 64-bit EM_MIPS has weird ELF64_Rela.r_info.
422438
* http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf
423439
* We interpret Table 29 Relocation Operation (Elf64_Rel, Elf64_Rela) [p.40]
@@ -523,6 +539,7 @@ static int do_file(char const *const fname)
523539
altmcount = "__gnu_mcount_nc";
524540
make_nop = make_nop_arm;
525541
rel_type_nop = R_ARM_NONE;
542+
is_fake_mcount32 = arm_is_fake_mcount;
526543
gpfx = 0;
527544
break;
528545
case EM_AARCH64:

0 commit comments

Comments
 (0)