20 Apr, 2017

1 commit

  • Removing it from util.h, part of an effort to disentangle the includes
    hell, that makes changes to util.h or something included by it to cause
    a complete rebuild of the tools.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-ztrjy52q1rqcchuy3rubfgt2@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

19 Nov, 2015

1 commit

  • This patch generates a prologue for a BPF program which fetches arguments for
    it. With this patch, the program can have arguments as follow:

    SEC("lock_page=__lock_page page->flags")
    int lock_page(struct pt_regs *ctx, int err, unsigned long flags)
    {
    return 1;
    }

    This patch passes at most 3 arguments from r3, r4 and r5. r1 is still the ctx
    pointer. r2 is used to indicate if dereferencing was done successfully.

    This patch uses r6 to hold ctx (struct pt_regs) and r7 to hold stack pointer
    for result. Result of each arguments first store on stack:

    low address
    BPF_REG_FP - 24 ARG3
    BPF_REG_FP - 16 ARG2
    BPF_REG_FP - 8 ARG1
    BPF_REG_FP
    high address

    Then loaded into r3, r4 and r5.

    The output prologue for offn(...off2(off1(reg)))) should be:

    r6
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexei Starovoitov
    Cc: Masami Hiramatsu
    Cc: Wang Nan
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1447675815-166222-11-git-send-email-wangnan0@huawei.com
    Signed-off-by: Wang Nan
    Signed-off-by: Arnaldo Carvalho de Melo

    He Kuang