Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6ef7607 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ARM fixes from Russell King:
 "A couple of small fixes this time around from Steven for an
  interaction between ftrace and kernel read-only protection, and
  Vladimir for nommu"

* 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
  ARM: 8780/1: ftrace: Only set kernel memory back to read-only after boot
  ARM: 8775/1: NOMMU: Use instr_sync instead of plain isb in common code
parents 35a84f34 b4c7e2bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ M_CLASS(streq r3, [r12, #PMSAv8_MAIR1])
	bic	r0, r0, #CR_I
#endif
	mcr	p15, 0, r0, c1, c0, 0		@ write control reg
	isb
	instr_sync
#elif defined (CONFIG_CPU_V7M)
#ifdef CONFIG_ARM_MPU
	ldreq	r3, [r12, MPU_CTRL]
+9 −0
Original line number Diff line number Diff line
@@ -736,20 +736,29 @@ static int __mark_rodata_ro(void *unused)
	return 0;
}

static int kernel_set_to_readonly __read_mostly;

void mark_rodata_ro(void)
{
	kernel_set_to_readonly = 1;
	stop_machine(__mark_rodata_ro, NULL, NULL);
	debug_checkwx();
}

void set_kernel_text_rw(void)
{
	if (!kernel_set_to_readonly)
		return;

	set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false,
				current->active_mm);
}

void set_kernel_text_ro(void)
{
	if (!kernel_set_to_readonly)
		return;

	set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true,
				current->active_mm);
}