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

Commit cfc77e37 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: 8275/1: mm: fix PMD_SECT_RDONLY undeclared compile error"

parents 2c052825 af041d01
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -75,19 +75,6 @@ config DEBUG_USER
	      8 - SIGSEGV faults
	     16 - SIGBUS faults

config KERNEL_TEXT_RDONLY
	bool "Set kernel text section pages as read only"
	depends on FREE_PAGES_RDONLY
	help
	  The kernel text pages are always mapped in the kernel.
	  This means that anyone can write to the page if they have
	  the address. Enable this option to mark the kernel text pages
	  as read only to trigger a fault if any code attempts to write
	  to a page part of the kernel text section. This may have a
	  performance impact.

	  If unsure, say N.

# These options are only for real kernel hackers who want to get their hands dirty.
config DEBUG_LL
	bool "Kernel low-level debugging functions (read help!)"
+7 −4
Original line number Diff line number Diff line
@@ -508,13 +508,16 @@ int set_memory_rw(unsigned long addr, int numpages);
int set_memory_x(unsigned long addr, int numpages);
int set_memory_nx(unsigned long addr, int numpages);

void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
			     void *kaddr, unsigned long len);

#ifdef CONFIG_KERNEL_TEXT_RDONLY
#ifdef CONFIG_DEBUG_RODATA
void mark_rodata_ro(void);
void set_kernel_text_rw(void);
void set_kernel_text_ro(void);
#else
static inline void set_kernel_text_rw(void) { }
static inline void set_kernel_text_ro(void) { }
#endif

void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
			     void *kaddr, unsigned long len);

#endif
+6 −2
Original line number Diff line number Diff line
@@ -28,6 +28,10 @@ enum fixed_addresses {

	FIX_KMAP_BEGIN = __end_of_permanent_fixed_addresses,
	FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1,
	/* Support writing RO kernel text via kprobes, jump labels, etc. */
	FIX_TEXT_POKE0,
	FIX_TEXT_POKE1,

	__end_of_fixed_addresses = (FIXADDR_END - FIXADDR_START) >> PAGE_SHIFT,
};

@@ -40,7 +44,7 @@ enum fixed_addresses {
extern void __early_set_fixmap(enum fixed_addresses idx,
					phys_addr_t phys, pgprot_t flags);

#define __set_fixmap __early_set_fixmap
void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot);

#include <asm-generic/fixmap.h>

+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ test-kprobes-objs += kprobes-test-arm.o
endif
obj-$(CONFIG_OABI_COMPAT)	+= sys_oabi-compat.o
obj-$(CONFIG_ARM_THUMBEE)	+= thumbee.o
obj-$(CONFIG_KGDB)		+= kgdb.o
obj-$(CONFIG_KGDB)		+= kgdb.o patch.o
obj-$(CONFIG_ARM_UNWIND)	+= unwind.o
obj-$(CONFIG_HAVE_TCM)		+= tcm.o
obj-$(CONFIG_OF)		+= devtree.o
+19 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/ftrace.h>
#include <linux/uaccess.h>
#include <linux/module.h>
#include <linux/stop_machine.h>

#include <asm/cacheflush.h>
#include <asm/opcodes.h>
@@ -35,6 +36,22 @@

#define	OLD_NOP		0xe1a00000	/* mov r0, r0 */

static int __ftrace_modify_code(void *data)
{
	int *command = data;

	set_kernel_text_rw();
	ftrace_modify_all_code(*command);
	set_kernel_text_ro();

	return 0;
}

void arch_ftrace_update_code(int command)
{
	stop_machine(__ftrace_modify_code, &command, NULL);
}

static unsigned long ftrace_nop_replace(struct dyn_ftrace *rec)
{
	return rec->arch.old_mcount ? OLD_NOP : NOP;
@@ -73,6 +90,8 @@ int ftrace_arch_code_modify_prepare(void)
int ftrace_arch_code_modify_post_process(void)
{
	set_all_modules_text_ro();
	/* Make sure any TLB misses during machine stop are cleared. */
	flush_tlb_all();
	return 0;
}

Loading