mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 08:48:48 +00:00
powerpc/bpf: Use memset32() to pre-fill traps in BPF page(s)
Use the newly introduced memset32() to pre-fill BPF page(s) with trap instructions. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
694fc88ce2
commit
6acdc9a6ba
@ -25,11 +25,7 @@ int bpf_jit_enable __read_mostly;
|
|||||||
|
|
||||||
static void bpf_jit_fill_ill_insns(void *area, unsigned int size)
|
static void bpf_jit_fill_ill_insns(void *area, unsigned int size)
|
||||||
{
|
{
|
||||||
int *p = area;
|
memset32(area, BREAKPOINT_INSTRUCTION, size/4);
|
||||||
|
|
||||||
/* Fill whole space with trap instructions */
|
|
||||||
while (p < (int *)((char *)area + size))
|
|
||||||
*p++ = BREAKPOINT_INSTRUCTION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void bpf_flush_icache(void *start, void *end)
|
static inline void bpf_flush_icache(void *start, void *end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user