linux/arch/arm64
Daniel Borkmann 7005cade1b bpf, arm64: use separate register for state in stxr
Will reported that in BPF_XADD we must use a different register in stxr
instruction for the status flag due to otherwise CONSTRAINED UNPREDICTABLE
behavior per architecture. Reference manual says [1]:

  If s == t, then one of the following behaviors must occur:

   * The instruction is UNDEFINED.
   * The instruction executes as a NOP.
   * The instruction performs the store to the specified address, but
     the value stored is UNKNOWN.

Thus, use a different temporary register for the status flag to fix it.

Disassembly extract from test 226/STX_XADD_DW from test_bpf.ko:

  [...]
  0000003c:  c85f7d4b  ldxr x11, [x10]
  00000040:  8b07016b  add x11, x11, x7
  00000044:  c80c7d4b  stxr w12, x11, [x10]
  00000048:  35ffffac  cbnz w12, 0x0000003c
  [...]

  [1] https://static.docs.arm.com/ddi0487/b/DDI0487B_a_armv8_arm.pdf, p.6132

Fixes: 85f68fe898 ("bpf, arm64: implement jiting of BPF_XADD")
Reported-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-07 15:27:20 -04:00
..
boot arm64: dts: hikey: Fix WiFi support 2017-05-23 14:18:10 +02:00
configs arm64: defconfig: enable options needed for QCom DB410c board 2017-05-19 00:01:37 -07:00
crypto Revert "crypto: arm64/sha - Add constant operand modifier to ASM_EXPORT" 2017-04-24 16:09:50 +08:00
include ARM64/ACPI: Fix BAD_MADT_GICC_ENTRY() macro implementation 2017-06-02 15:13:52 +01:00
kernel ARM64: PCI: Fix struct acpi_pci_root_ops allocation failure path 2017-05-25 16:52:58 +01:00
kvm arm64: KVM: Do not use stack-protector to compile EL2 code 2017-05-15 11:31:16 +02:00
lib arm64: switch to RAW_COPY_USER 2017-03-28 18:23:24 -04:00
mm IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
net bpf, arm64: use separate register for state in stxr 2017-06-07 15:27:20 -04:00
xen xen/privcmd: Add IOCTL_PRIVCMD_DM_OP 2017-02-14 15:13:43 -05:00
Kconfig arm64 updates for 4.12: 2017-05-05 12:11:37 -07:00
Kconfig.debug arm64: relocation testing module 2017-04-04 17:03:32 +01:00
Kconfig.platforms mvebu arm64 for 4.12 2017-05-10 15:36:43 +02:00
Makefile Kbuild misc updates for 4.12 2017-05-10 20:41:43 -07:00