All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@au1.ibm.com>,
	linuxppc-dev@lists.ozlabs.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	Anton Blanchard <anton@samba.org>
Subject: [PATCH 2/2] powerpc: bpf: use memset32() to pre-fill traps in BPF page(s)
Date: Tue, 28 Mar 2017 01:07:41 +0530	[thread overview]
Message-ID: <b8df164016428d3313925cbb223416da71e81171.1490641759.git.naveen.n.rao@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1490641759.git.naveen.n.rao@linux.vnet.ibm.com>
In-Reply-To: <cover.1490641759.git.naveen.n.rao@linux.vnet.ibm.com>

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>
---
 arch/powerpc/net/bpf_jit_comp64.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
index aee2bb817ac6..1a92ab6c245f 100644
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -25,11 +25,7 @@ int bpf_jit_enable __read_mostly;
 
 static void bpf_jit_fill_ill_insns(void *area, unsigned int size)
 {
-	int *p = area;
-
-	/* Fill whole space with trap instructions */
-	while (p < (int *)((char *)area + size))
-		*p++ = BREAKPOINT_INSTRUCTION;
+	memset32(area, BREAKPOINT_INSTRUCTION, size/4);
 }
 
 static inline void bpf_flush_icache(void *start, void *end)
-- 
2.11.1

      parent reply	other threads:[~2017-03-27 19:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 21:14 Optimised memset64/memset32 for powerpc Matthew Wilcox
2017-03-20 21:23 ` Benjamin Herrenschmidt
2017-03-21 12:23 ` Christophe LEROY
2017-03-21 13:29   ` Matthew Wilcox
2017-03-21 16:45     ` Segher Boessenkool
2017-03-21 21:26     ` Benjamin Herrenschmidt
2017-03-22 13:18       ` Matthew Wilcox
2017-03-22 19:30         ` Matthew Wilcox
2017-03-27 19:37           ` Naveen N. Rao
2017-03-27 19:37             ` [PATCH 1/2] powerpc: string: implement optimized memset variants Naveen N. Rao
2017-03-28  0:44               ` Michael Ellerman
2017-03-28 10:21                 ` Naveen N. Rao
2017-03-29 11:36                   ` Michael Ellerman
2017-03-30  7:16                     ` Naveen N. Rao
2017-04-04 12:00                       ` Michael Ellerman
2017-04-18  6:45                         ` Michael Ellerman
2017-04-05  5:51                       ` PrasannaKumar Muralidharan
2017-04-12 15:05                         ` Naveen N. Rao
2017-08-18 12:50               ` [1/2] " Michael Ellerman
2017-03-27 19:37             ` Naveen N. Rao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b8df164016428d3313925cbb223416da71e81171.1490641759.git.naveen.n.rao@linux.vnet.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@au1.ibm.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.