]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/net/bpf_jit_comp64.c
Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
[karo-tx-linux.git] / arch / powerpc / net / bpf_jit_comp64.c
index 73a5cf18fd84f3553f564456f0e482977afdfbe2..aee2bb817ac68c4a8dfa7a28b521ac73c0f77b3f 100644 (file)
@@ -961,8 +961,6 @@ common_load:
        return 0;
 }
 
-void bpf_jit_compile(struct bpf_prog *fp) { }
-
 struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 {
        u32 proglen;
@@ -1046,16 +1044,16 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
                 */
                bpf_jit_dump(flen, proglen, pass, code_base);
 
-       if (image) {
-               bpf_flush_icache(bpf_hdr, image + alloclen);
 #ifdef PPC64_ELF_ABI_v1
-               /* Function descriptor nastiness: Address + TOC */
-               ((u64 *)image)[0] = (u64)code_base;
-               ((u64 *)image)[1] = local_paca->kernel_toc;
+       /* Function descriptor nastiness: Address + TOC */
+       ((u64 *)image)[0] = (u64)code_base;
+       ((u64 *)image)[1] = local_paca->kernel_toc;
 #endif
-               fp->bpf_func = (void *)image;
-               fp->jited = 1;
-       }
+
+       fp->bpf_func = (void *)image;
+       fp->jited = 1;
+
+       bpf_flush_icache(bpf_hdr, (u8 *)bpf_hdr + (bpf_hdr->pages * PAGE_SIZE));
 
 out:
        kfree(addrs);
@@ -1066,6 +1064,7 @@ out:
        return fp;
 }
 
+/* Overriding bpf_jit_free() as we don't set images read-only. */
 void bpf_jit_free(struct bpf_prog *fp)
 {
        unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK;