03 Jul, 2017

1 commit

  • This work adds a helper that can be used to adjust net room of an
    skb. The helper is generic and can be further extended in future.
    Main use case is for having a programmatic way to add/remove room to
    v4/v6 header options along with cls_bpf on egress and ingress hook
    of the data path. It reuses most of the infrastructure that we added
    for the bpf_skb_change_type() helper which can be used in nat64
    translations. Similarly, the helper only takes care of adjusting the
    room so that related data is populated and csum adapted out of the
    BPF program using it.

    Signed-off-by: Daniel Borkmann
    Acked-by: John Fastabend
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

02 Jul, 2017

1 commit


11 Jun, 2017

1 commit

  • Allow for tc BPF programs to set a skb->hash, apart from clearing
    and triggering a recalc that we have right now. It allows for BPF
    to implement a custom hashing routine for skb_get_hash().

    Signed-off-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

07 Jun, 2017

2 commits


05 Jun, 2017

1 commit


24 May, 2017

1 commit

  • Sync (copy) the following v4.12 kernel headers to the tooling headers:

    arch/x86/include/asm/disabled-features.h:
    arch/x86/include/uapi/asm/kvm.h:
    arch/powerpc/include/uapi/asm/kvm.h:
    arch/s390/include/uapi/asm/kvm.h:
    arch/arm/include/uapi/asm/kvm.h:
    arch/arm64/include/uapi/asm/kvm.h:

    - 'struct kvm_sync_regs' got changed in an ABI-incompatible way,
    fortunately none of the (in-kernel) tooling relied on it

    - new KVM_DEV calls added

    arch/x86/include/asm/required-features.h:

    - 5-level paging hardware ABI detail added

    arch/x86/include/asm/cpufeatures.h:

    - new CPU feature added

    arch/x86/include/uapi/asm/vmx.h:

    - new VMX exit conditions

    None of the changes requires fixes in the tooling source code.

    This addresses the following warnings:

    Warning: include/uapi/linux/stat.h differs from kernel
    Warning: arch/x86/include/asm/disabled-features.h differs from kernel
    Warning: arch/x86/include/asm/required-features.h differs from kernel
    Warning: arch/x86/include/asm/cpufeatures.h differs from kernel
    Warning: arch/x86/include/uapi/asm/kvm.h differs from kernel
    Warning: arch/x86/include/uapi/asm/vmx.h differs from kernel
    Warning: arch/powerpc/include/uapi/asm/kvm.h differs from kernel
    Warning: arch/s390/include/uapi/asm/kvm.h differs from kernel
    Warning: arch/arm/include/uapi/asm/kvm.h differs from kernel
    Warning: arch/arm64/include/uapi/asm/kvm.h differs from kernel

    Cc: Arnaldo Carvalho de Melo
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Yao Jin
    Cc: kernel-team@lge.com
    Link: http://lkml.kernel.org/r/20170524065721.j2mlch6bgk5klgbc@gmail.com
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

12 May, 2017

1 commit

  • Add a new field, "prog_flags", and an initial flag value
    BPF_F_STRICT_ALIGNMENT.

    When set, the verifier will enforce strict pointer alignment
    regardless of the setting of CONFIG_EFFICIENT_UNALIGNED_ACCESS.

    The verifier, in this mode, will also use a fixed value of "2" in
    place of NET_IP_ALIGN.

    This facilitates test cases that will exercise and validate this part
    of the verifier even when run on architectures where alignment doesn't
    matter.

    Signed-off-by: David S. Miller
    Acked-by: Daniel Borkmann

    David S. Miller
     

06 May, 2017

1 commit

  • Pull powerpc updates from Michael Ellerman:
    "Highlights include:

    - Larger virtual address space on 64-bit server CPUs. By default we
    use a 128TB virtual address space, but a process can request access
    to the full 512TB by passing a hint to mmap().

    - Support for the new Power9 "XIVE" interrupt controller.

    - TLB flushing optimisations for the radix MMU on Power9.

    - Support for CAPI cards on Power9, using the "Coherent Accelerator
    Interface Architecture 2.0".

    - The ability to configure the mmap randomisation limits at build and
    runtime.

    - Several small fixes and cleanups to the kprobes code, as well as
    support for KPROBES_ON_FTRACE.

    - Major improvements to handling of system reset interrupts,
    correctly treating them as NMIs, giving them a dedicated stack and
    using a new hypervisor call to trigger them, all of which should
    aid debugging and robustness.

    - Many fixes and other minor enhancements.

    Thanks to: Alastair D'Silva, Alexey Kardashevskiy, Alistair Popple,
    Andrew Donnellan, Aneesh Kumar K.V, Anshuman Khandual, Anton
    Blanchard, Balbir Singh, Ben Hutchings, Benjamin Herrenschmidt,
    Bhupesh Sharma, Chris Packham, Christian Zigotzky, Christophe Leroy,
    Christophe Lombard, Daniel Axtens, David Gibson, Gautham R. Shenoy,
    Gavin Shan, Geert Uytterhoeven, Guilherme G. Piccoli, Hamish Martin,
    Hari Bathini, Kees Cook, Laurent Dufour, Madhavan Srinivasan, Mahesh J
    Salgaonkar, Mahesh Salgaonkar, Masami Hiramatsu, Matt Brown, Matthew
    R. Ochs, Michael Neuling, Naveen N. Rao, Nicholas Piggin, Oliver
    O'Halloran, Pan Xinhui, Paul Mackerras, Rashmica Gupta, Russell
    Currey, Sukadev Bhattiprolu, Thadeu Lima de Souza Cascardo, Tobin C.
    Harding, Tyrel Datwyler, Uma Krishnan, Vaibhav Jain, Vipin K Parashar,
    Yang Shi"

    * tag 'powerpc-4.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (214 commits)
    powerpc/64s: Power9 has no LPCR[VRMASD] field so don't set it
    powerpc/powernv: Fix TCE kill on NVLink2
    powerpc/mm/radix: Drop support for CPUs without lockless tlbie
    powerpc/book3s/mce: Move add_taint() later in virtual mode
    powerpc/sysfs: Move #ifdef CONFIG_HOTPLUG_CPU out of the function body
    powerpc/smp: Document irq enable/disable after migrating IRQs
    powerpc/mpc52xx: Don't select user-visible RTAS_PROC
    powerpc/powernv: Document cxl dependency on special case in pnv_eeh_reset()
    powerpc/eeh: Clean up and document event handling functions
    powerpc/eeh: Avoid use after free in eeh_handle_special_event()
    cxl: Mask slice error interrupts after first occurrence
    cxl: Route eeh events to all drivers in cxl_pci_error_detected()
    cxl: Force context lock during EEH flow
    powerpc/64: Allow CONFIG_RELOCATABLE if COMPILE_TEST
    powerpc/xmon: Teach xmon oops about radix vectors
    powerpc/mm/hash: Fix off-by-one in comment about kernel contexts ids
    powerpc/pseries: Enable VFIO
    powerpc/powernv: Fix iommu table size calculation hook for small tables
    powerpc/powernv: Check kzalloc() return value in pnv_pci_table_alloc
    powerpc: Add arch/powerpc/tools directory
    ...

    Linus Torvalds
     

03 May, 2017

1 commit

  • Pull networking updates from David Millar:
    "Here are some highlights from the 2065 networking commits that
    happened this development cycle:

    1) XDP support for IXGBE (John Fastabend) and thunderx (Sunil Kowuri)

    2) Add a generic XDP driver, so that anyone can test XDP even if they
    lack a networking device whose driver has explicit XDP support
    (me).

    3) Sparc64 now has an eBPF JIT too (me)

    4) Add a BPF program testing framework via BPF_PROG_TEST_RUN (Alexei
    Starovoitov)

    5) Make netfitler network namespace teardown less expensive (Florian
    Westphal)

    6) Add symmetric hashing support to nft_hash (Laura Garcia Liebana)

    7) Implement NAPI and GRO in netvsc driver (Stephen Hemminger)

    8) Support TC flower offload statistics in mlxsw (Arkadi Sharshevsky)

    9) Multiqueue support in stmmac driver (Joao Pinto)

    10) Remove TCP timewait recycling, it never really could possibly work
    well in the real world and timestamp randomization really zaps any
    hint of usability this feature had (Soheil Hassas Yeganeh)

    11) Support level3 vs level4 ECMP route hashing in ipv4 (Nikolay
    Aleksandrov)

    12) Add socket busy poll support to epoll (Sridhar Samudrala)

    13) Netlink extended ACK support (Johannes Berg, Pablo Neira Ayuso,
    and several others)

    14) IPSEC hw offload infrastructure (Steffen Klassert)"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2065 commits)
    tipc: refactor function tipc_sk_recv_stream()
    tipc: refactor function tipc_sk_recvmsg()
    net: thunderx: Optimize page recycling for XDP
    net: thunderx: Support for XDP header adjustment
    net: thunderx: Add support for XDP_TX
    net: thunderx: Add support for XDP_DROP
    net: thunderx: Add basic XDP support
    net: thunderx: Cleanup receive buffer allocation
    net: thunderx: Optimize CQE_TX handling
    net: thunderx: Optimize RBDR descriptor handling
    net: thunderx: Support for page recycling
    ipx: call ipxitf_put() in ioctl error path
    net: sched: add helpers to handle extended actions
    qed*: Fix issues in the ptp filter config implementation.
    qede: Fix concurrency issue in PTP Tx path processing.
    stmmac: Add support for SIMATIC IOT2000 platform
    net: hns: fix ethtool_get_strings overflow in hns driver
    tcp: fix wraparound issue in tcp_lp
    bpf, arm64: fix jit branch offset related to ldimm64
    bpf, arm64: implement jiting of BPF_XADD
    ...

    Linus Torvalds
     

25 Apr, 2017

1 commit

  • To get the changes in the commit Fixes: 3209f68b3ca4 ("statx: Include a
    mask for stx_attributes in struct statx")

    Silencing this perf build warning:

    Warning: tools/include/uapi/linux/stat.h differs from kernel

    No need to change the statx syscall beautifiers in 'perf trace' at this
    time.

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

    Arnaldo Carvalho de Melo
     

22 Apr, 2017

1 commit

  • Add napi_id access to __sk_buff for socket filter program types, tc
    program types and other bpf_convert_ctx_access() users. Having access
    to skb->napi_id is useful for per RX queue listener siloing, f.e.
    in combination with SO_ATTACH_REUSEPORT_EBPF and when busy polling is
    used, meaning SO_REUSEPORT enabled listeners can then select the
    corresponding socket at SYN time already [1]. The skb is marked via
    skb_mark_napi_id() early in the receive path (e.g., napi_gro_receive()).

    Currently, sockets can only use SO_INCOMING_NAPI_ID from 6d4339028b35
    ("net: Introduce SO_INCOMING_NAPI_ID") as a socket option to look up
    the NAPI ID associated with the queue for steering, which requires a
    prior sk_mark_napi_id() after the socket was looked up.

    Semantics for the __sk_buff napi_id access are similar, meaning if
    skb->napi_id is < MIN_NAPI_ID (e.g. outgoing packets using sender_cpu),
    then an invalid napi_id of 0 is returned to the program, otherwise a
    valid non-zero napi_id.

    [1] http://netdevconf.org/2.1/slides/apr6/dumazet-BUSY-POLLING-Netdev-2.1.pdf

    Suggested-by: Eric Dumazet
    Signed-off-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

19 Apr, 2017

1 commit

  • perf_mem_data_src is a union that is initialized in the kernel via the ->val
    field and accessed by userspace via the mem_xxx bitfields. For this to work
    correctly on big endian platforms, we need a big-endian definition for the
    bitfields.

    Currently on a big endian system, if a user requests PERF_SAMPLE_DATA_SRC (perf
    report -d), they will get the default value from perf_sample_data_init(), which
    is PERF_MEM_NA. The value for PERF_MEM_NA is constructed using shifts:

    /* TLB access */
    #define PERF_MEM_TLB_NA 0x01 /* not available */
    ...
    #define PERF_MEM_TLB_SHIFT 26

    #define PERF_MEM_S(a, s) \
    (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)

    #define PERF_MEM_NA (PERF_MEM_S(OP, NA) |\
    PERF_MEM_S(LVL, NA) |\
    PERF_MEM_S(SNOOP, NA) |\
    PERF_MEM_S(LOCK, NA) |\
    PERF_MEM_S(TLB, NA))

    Which works out as:

    ((0x01 << 0) | (0x01 << 5) | (0x01 << 19) | (0x01 << 24) | (0x01 << 26))

    Which means the PERF_MEM_NA value comes out of the kernel as 0x5080021
    in CPU endian.

    But then in the perf tool, the code uses the bitfields to inspect the value, and
    currently the bitfields are defined using little endian ordering.

    So eg. in perf_mem__tlb_scnprintf() we see:
    data_src->val = 0x5080021
    op = 0x0
    lvl = 0x0
    snoop = 0x0
    lock = 0x0
    dtlb = 0x0
    rsvd = 0x5080021

    Because of the way the perf tool code is written this is still displayed to the
    user as "N/A", so there is no bug visible at the UI level.

    Currently there are no big endian architectures which export a meaningful
    value (ie. other than PERF_MEM_NA), so the extent of the bug on big endian
    platforms is that the PERF_MEM_NA value is exported incorrectly as described
    above. Subsequent patches will add support on big endian powerpc for populating
    the data source value.

    This patch does a minimal fix of adding big endian definition of the bitfields
    to match the values that are already exported by the kernel on big endian. And
    it makes no change on little endian.

    Signed-off-by: Sukadev Bhattiprolu
    Signed-off-by: Madhavan Srinivasan
    Acked-by: Peter Zijlstra (Intel)
    Signed-off-by: Michael Ellerman

    Sukadev Bhattiprolu
     

10 Apr, 2017

1 commit


02 Apr, 2017

1 commit


31 Mar, 2017

1 commit


24 Mar, 2017

2 commits

  • Returns the owner uid of the socket inside a sk_buff. This is useful to
    perform per-UID accounting of network traffic or per-UID packet
    filtering. The socket need to be a fullsock otherwise overflowuid is
    returned.

    Signed-off-by: Chenbo Feng
    Signed-off-by: David S. Miller

    Chenbo Feng
     
  • Retrieve the socket cookie generated by sock_gen_cookie() from a sk_buff
    with a known socket. Generates a new cookie if one was not yet set.If
    the socket pointer inside sk_buff is NULL, 0 is returned. The helper
    function coud be useful in monitoring per socket networking traffic
    statistics and provide a unique socket identifier per namespace.

    Acked-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Acked-by: Willem de Bruijn
    Signed-off-by: Chenbo Feng
    Signed-off-by: David S. Miller

    Chenbo Feng
     

23 Mar, 2017

1 commit


17 Mar, 2017

1 commit

  • To get PERF_AUX_FLAG_PARTIAL, introduced in:

    ae0c2d995d64 ("perf/core: Add a flag for partial AUX records")

    and that will be used to warn the user about gaps in AUX records due
    to VMX being used in KVM guests.

    Silences the kernel/tools file copy detector:

    Warning: include/uapi/linux/perf_event.h differs from kernel

    Signed-off-by: Alexander Shishkin
    Cc: Adrian Hunter
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Vince Weaver
    Link: http://lkml.kernel.org/r/8760j941ig.fsf@ashishki-desk.ger.corp.intel.com
    [ Split from a larger patch ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexander Shishkin
     

16 Mar, 2017

1 commit


14 Mar, 2017

1 commit

  • Introduce a new option to record PERF_RECORD_NAMESPACES events emitted
    by the kernel when fork, clone, setns or unshare are invoked. And update
    perf-record documentation with the new option to record namespace
    events.

    Committer notes:

    Combined it with a later patch to allow printing it via 'perf report -D'
    and be able to test the feature introduced in this patch. Had to move
    here also perf_ns__name(), that was introduced in another later patch.

    Also used PRIu64 and PRIx64 to fix the build in some enfironments wrt:

    util/event.c:1129:39: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'long long unsigned int' [-Werror=format=]
    ret += fprintf(fp, "%u/%s: %lu/0x%lx%s", idx
    ^
    Testing it:

    # perf record --namespaces -a
    ^C[ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 1.083 MB perf.data (423 samples) ]
    #
    # perf report -D

    3 2028902078892 0x115140 [0xa0]: PERF_RECORD_NAMESPACES 14783/14783 - nr_namespaces: 7
    [0/net: 3/0xf0000081, 1/uts: 3/0xeffffffe, 2/ipc: 3/0xefffffff, 3/pid: 3/0xeffffffc,
    4/user: 3/0xeffffffd, 5/mnt: 3/0xf0000000, 6/cgroup: 3/0xeffffffb]

    0x1151e0 [0x30]: event: 9
    .
    . ... raw event: size 48 bytes
    . 0000: 09 00 00 00 02 00 30 00 c4 71 82 68 0c 7f 00 00 ......0..q.h....
    . 0010: a9 39 00 00 a9 39 00 00 94 28 fe 63 d8 01 00 00 .9...9...(.c....
    . 0020: 03 00 00 00 00 00 00 00 ce c4 02 00 00 00 00 00 ................

    NAMESPACES events: 1

    #

    Signed-off-by: Hari Bathini
    Acked-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Alexei Starovoitov
    Cc: Ananth N Mavinakayanahalli
    Cc: Aravinda Prasad
    Cc: Brendan Gregg
    Cc: Daniel Borkmann
    Cc: Eric Biederman
    Cc: Peter Zijlstra
    Cc: Sargun Dhillon
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/148891930386.25309.18412039920746995488.stgit@hbathini.in.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Hari Bathini
     

13 Mar, 2017

1 commit

  • Recent merge of 'linux-kselftest-4.11-rc1' tree broke bpf test build.
    None of the tests were building and test_verifier.c had tons of compiler errors.
    Fix it and add #ifdef CAP_IS_SUPPORTED to support old versions of libcap.
    Tested on centos 6.8 and 7

    Signed-off-by: Alexei Starovoitov
    Acked-by: Daniel Borkmann
    Tested-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Alexei Starovoitov
     

17 Feb, 2017

1 commit


15 Feb, 2017

1 commit


11 Feb, 2017

1 commit

  • The tools version of this header is out of date; update it to the latest
    version from kernel header.

    Synchronize with the following commits:
    * b95a5c4db09b ("bpf: add a longest prefix match trie map implementation")
    * a5e8c07059d0 ("bpf: add bpf_probe_read_str helper")
    * d1b662adcdb8 ("bpf: allow option for setting bpf_l4_csum_replace from scratch")

    Signed-off-by: Mickaël Salaün
    Cc: Alexei Starovoitov
    Cc: Arnaldo Carvalho de Melo
    Cc: Daniel Borkmann
    Cc: Daniel Mack
    Cc: David S. Miller
    Cc: Gianluca Borello
    Signed-off-by: David S. Miller

    Mickaël Salaün
     

24 Dec, 2016

1 commit

  • Pull perf fixes from Ingo Molnar:
    "On the kernel side there's two x86 PMU driver fixes and a uprobes fix,
    plus on the tooling side there's a number of fixes and some late
    updates"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits)
    perf sched timehist: Fix invalid period calculation
    perf sched timehist: Remove hardcoded 'comm_width' check at print_summary
    perf sched timehist: Enlarge default 'comm_width'
    perf sched timehist: Honour 'comm_width' when aligning the headers
    perf/x86: Fix overlap counter scheduling bug
    perf/x86/pebs: Fix handling of PEBS buffer overflows
    samples/bpf: Move open_raw_sock to separate header
    samples/bpf: Remove perf_event_open() declaration
    samples/bpf: Be consistent with bpf_load_program bpf_insn parameter
    tools lib bpf: Add bpf_prog_{attach,detach}
    samples/bpf: Switch over to libbpf
    perf diff: Do not overwrite valid build id
    perf annotate: Don't throw error for zero length symbols
    perf bench futex: Fix lock-pi help string
    perf trace: Check if MAP_32BIT is defined (again)
    samples/bpf: Make perf_event_read() static
    uprobes: Fix uprobes on MIPS, allow for a cache flush after ixol breakpoint creation
    samples/bpf: Make samples more libbpf-centric
    tools lib bpf: Add flags to bpf_create_map()
    tools lib bpf: use __u32 from linux/types.h
    ...

    Linus Torvalds
     

16 Dec, 2016

1 commit

  • The tools version of this header is out of date; update it to the latest
    version from the kernel headers.

    Signed-off-by: Joe Stringer
    Acked-by: Wang Nan
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Link: http://lkml.kernel.org/r/20161209024620.31660-2-joe@ovn.org
    [ Sync it harder, after merging with what was in net-next via perf/urgent via torvalds/master to get BPG_PROG_(AT|DE)TACH, etc ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Joe Stringer
     

14 Dec, 2016

1 commit

  • Pull arm64 updates from Catalin Marinas:

    - struct thread_info moved off-stack (also touching
    include/linux/thread_info.h and include/linux/restart_block.h)

    - cpus_have_cap() reworked to avoid __builtin_constant_p() for static
    key use (also touching drivers/irqchip/irq-gic-v3.c)

    - uprobes support (currently only for native 64-bit tasks)

    - Emulation of kernel Privileged Access Never (PAN) using TTBR0_EL1
    switching to a reserved page table

    - CPU capacity information passing via DT or sysfs (used by the
    scheduler)

    - support for systems without FP/SIMD (IOW, kernel avoids touching
    these registers; there is no soft-float ABI, nor kernel emulation for
    AArch64 FP/SIMD)

    - handling of hardware watchpoint with unaligned addresses, varied
    lengths and offsets from base

    - use of the page table contiguous hint for kernel mappings

    - hugetlb fixes for sizes involving the contiguous hint

    - remove unnecessary I-cache invalidation in flush_cache_range()

    - CNTHCTL_EL2 access fix for CPUs with VHE support (ARMv8.1)

    - boot-time checks for writable+executable kernel mappings

    - simplify asm/opcodes.h and avoid including the 32-bit ARM counterpart
    and make the arm64 kernel headers self-consistent (Xen headers patch
    merged separately)

    - Workaround for broken .inst support in certain binutils versions

    * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (60 commits)
    arm64: Disable PAN on uaccess_enable()
    arm64: Work around broken .inst when defective gas is detected
    arm64: Add detection code for broken .inst support in binutils
    arm64: Remove reference to asm/opcodes.h
    arm64: Get rid of asm/opcodes.h
    arm64: smp: Prevent raw_smp_processor_id() recursion
    arm64: head.S: Fix CNTHCTL_EL2 access on VHE system
    arm64: Remove I-cache invalidation from flush_cache_range()
    arm64: Enable HIBERNATION in defconfig
    arm64: Enable CONFIG_ARM64_SW_TTBR0_PAN
    arm64: xen: Enable user access before a privcmd hvc call
    arm64: Handle faults caused by inadvertent user access with PAN enabled
    arm64: Disable TTBR0_EL1 during normal kernel execution
    arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1
    arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro
    arm64: Factor out PAN enabling/disabling into separate uaccess_* macros
    arm64: Update the synchronous external abort fault description
    selftests: arm64: add test for unaligned/inexact watchpoint handling
    arm64: Allow hw watchpoint of length 3,5,6 and 7
    arm64: hw_breakpoint: Handle inexact watchpoint addresses
    ...

    Linus Torvalds
     

19 Nov, 2016

1 commit

  • We only support breakpoint/watchpoint of length 1, 2, 4 and 8. If we can
    support other length as well, then user may watch more data with less
    number of watchpoints (provided hardware supports it). For example: if we
    have to watch only 4th, 5th and 6th byte from a 64 bit aligned address, we
    will have to use two slots to implement it currently. One slot will watch a
    half word at offset 4 and other a byte at offset 6. If we can have a
    watchpoint of length 3 then we can watch it with single slot as well.

    ARM64 hardware does support such functionality, therefore adding these new
    definitions in generic layer.

    Signed-off-by: Pratyush Anand
    Signed-off-by: Will Deacon

    Pratyush Anand
     

28 Oct, 2016

1 commit

  • To get the defines introduced in the commit e8c24d3a23a4 ("x86/pkeys:
    Allocation/free syscalls")

    Silencing this perf build warning:

    Warning: tools/include/uapi/asm-generic/mman-common.h differs from kernel

    Need to change 'perf trace' to beautify those syscalls, as soon as
    booting with a kernel with it.

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

    Arnaldo Carvalho de Melo
     

06 Oct, 2016

1 commit

  • Commit 747ea55e4f78 ("bpf: fix bpf_skb_in_cgroup helper naming") renames
    BPF_FUNC_skb_in_cgroup to bpf_skb_under_cgroup, triggering this warning
    while building perf:

    Warning: tools/include/uapi/linux/bpf.h differs from kernel

    Update the copy to ack that, no changes needed, as
    BPF_FUNC_skb_in_cgroup isn't used so far.

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

    Arnaldo Carvalho de Melo
     

14 Sep, 2016

1 commit

  • Some mmap related macros have different values for different
    architectures. This patch introduces uapi mman.h for each
    architectures.

    Three headers are cloned from kernel include to tools/include:

    tools/include/uapi/asm-generic/mman-common.h
    tools/include/uapi/asm-generic/mman.h
    tools/include/uapi/linux/mman.h

    The main part of this patch is generated by following script:

    macros=`cat $0 | awk 'V==1 {print}; /^# start macro list/ {V=1}'`
    for arch in `ls tools/arch`
    do
    [ -d tools/arch/$arch/include/uapi/asm ] || mkdir -p tools/arch/$arch/include/uapi/asm
    src=arch/$arch/include/uapi/asm/mman.h
    target=tools/arch/$arch/include/uapi/asm/mman.h
    guard="TOOLS_ARCH_"`echo $arch | awk '{print toupper($0)}'`_UAPI_ASM_MMAN_FIX_H
    echo '#ifndef '$guard > $target
    echo '#define '$guard >> $target

    [ -f $src ] &&
    for m in $macros
    do
    if grep '#define[ \t]*'$m $src > /dev/null 2>&1
    then
    grep -h '#define[ \t]*'$m $src | sed 's/[ \t]*\/\*.*$//g' >> $target
    fi
    done

    if [ -f $src ]
    then
    grep '#include > $target
    echo "$target"
    done

    exit 0
    # Following macros are extracted from:
    # tools/perf/trace/beauty/mmap.c
    #
    # start macro list
    MADV_DODUMP
    MADV_DOFORK
    MADV_DONTDUMP
    MADV_DONTFORK
    MADV_DONTNEED
    MADV_HUGEPAGE
    MADV_HWPOISON
    MADV_MERGEABLE
    MADV_NOHUGEPAGE
    MADV_NORMAL
    MADV_RANDOM
    MADV_REMOVE
    MADV_SEQUENTIAL
    MADV_SOFT_OFFLINE
    MADV_UNMERGEABLE
    MADV_WILLNEED
    MAP_32BIT
    MAP_ANONYMOUS
    MAP_DENYWRITE
    MAP_EXECUTABLE
    MAP_FILE
    MAP_FIXED
    MAP_GROWSDOWN
    MAP_HUGETLB
    MAP_LOCKED
    MAP_NONBLOCK
    MAP_NORESERVE
    MAP_POPULATE
    MAP_PRIVATE
    MAP_SHARED
    MAP_STACK
    MAP_UNINITIALIZED
    MREMAP_FIXED
    MREMAP_MAYMOVE
    PROT_EXEC
    PROT_GROWSDOWN
    PROT_GROWSUP
    PROT_NONE
    PROT_READ
    PROT_SEM
    PROT_WRITE

    Signed-off-by: Wang Nan
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1473684871-209320-2-git-send-email-wangnan0@huawei.com
    [ Added new files to tools/perf/MANIFEST to fix the detached tarball build, add mman.h for ARC ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

09 Aug, 2016

1 commit

  • The way we're using kernel headers in tools/ now, with a copy that is
    made to the same path prefixed by "tools/" plus checking if that copy
    got stale, i.e. if the kernel counterpart changed, helps in keeping
    track with new features that may be useful for tools to exploit.

    For instance, looking at all the changes to bpf.h since it was last
    copied to tools/include brings this to toolers' attention:

    Need to investigate this one to check how to run a program via perf, setting up
    a BPF event, that will take advantage of the way perf already calls clang/LLVM,
    sets up the event and runs the workload in a single command line, helping in
    debugging such semi cooperative programs:

    96ae52279594 ("bpf: Add bpf_probe_write_user BPF helper to be called in tracers")

    This one needs further investigation about using the feature it improves
    in 'perf trace' to do some tcpdumpin' mixed with syscalls, tracepoints,
    probe points, callgraphs, etc:

    555c8a8623a3 ("bpf: avoid stack copy and use skb ctx for event output")

    Add tracing just packets that are related to some container to that mix:

    4a482f34afcc ("cgroup: bpf: Add bpf_skb_in_cgroup_proto")
    4ed8ec521ed5 ("cgroup: bpf: Add BPF_MAP_TYPE_CGROUP_ARRAY")

    Definetely needs to have example programs accessing task_struct from a bpf proggie
    started from 'perf trace':

    606274c5abd8 ("bpf: introduce bpf_get_current_task() helper")

    Core networking related, XDP:

    6ce96ca348a9 ("bpf: add XDP_TX xdp_action for direct forwarding")
    6a773a15a1e8 ("bpf: add XDP prog type for early driver filter")
    13c5c240f789 ("bpf: add bpf_get_hash_recalc helper")
    d2485c4242a8 ("bpf: add bpf_skb_change_type helper")
    6578171a7ff0 ("bpf: add bpf_skb_change_proto helper")

    Changes detected by the tools build system:

    $ make -C tools/perf O=/tmp/build/perf install-bin
    make: Entering directory '/home/acme/git/linux/tools/perf'
    BUILD: Doing 'make -j4' parallel build
    Warning: tools/include/uapi/linux/bpf.h differs from kernel
    INSTALL GTK UI
    CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o

    $

    Cc: Adrian Hunter
    Cc: Alexei Starovoitov
    Cc: Brenden Blanco
    Cc: Daniel Borkmann
    Cc: David Ahern
    Cc: David S. Miller
    Cc: Jiri Olsa
    Cc: Martin KaFai Lau
    Cc: Namhyung Kim
    Cc: Sargun Dhillon
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-difq4ts1xvww6eyfs9e7zlft@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

13 Jul, 2016

4 commits

  • We use it in bitops/__ffs.h and bitops/atomic.h, that we also got from
    the kernel, but were getting it from either newer systems that carry it
    in /usr/include, or from the kernel sources, that we decided not to
    touch from tools/ code. Fix it.

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

    Arnaldo Carvalho de Melo
     
  • To allow the build to complete on older systems, where those files are
    either not uptodate, lacking some recent additions or not present at
    all.

    And check if the copy drifts from the kernel.

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

    Arnaldo Carvalho de Melo
     
  • To allow the build to complete on older systems, where those files are
    either not uptodate, lacking some recent additions or not present at
    all.

    And check if the copy drifts from the kernel, as in this synthetic test:

    BUILD: Doing 'make -j4' parallel build
    Warning: tools/include/linux/bpf.h differs from kernel
    Warning: tools/include/linux/bpf_common.h differs from kernel

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

    Arnaldo Carvalho de Melo
     
  • We shouldn't use headers from the kernel sources directly, instead we
    should use the system's headers or in cases where that isn't possible,
    like with perf_event.h, where the introduction of kernel features such
    as perf_event_attr.{write_backwards,sample_max_stack} and
    PERF_EVENT_IOC_PAUSE_OUTPUT take some time to become available in
    /usr/include/linux/perf_event.h we need a copy.

    Do it and check for source code drift, emitting a warning when changes
    are detected.

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

    Arnaldo Carvalho de Melo