linux/arch/s390
Michael Holzheu 11a247e376 s390: Remove VLAIS in ptff() and clear_table()
The ptff() and clear_table() functions use the gcc extension "variable
length arrays in structures" (VLAIS) to define in the inline assembler
constraints the area of the clobbered memory. This extension will most
likely never be supported by LLVM/Clang.

Since currently BPF programs are compiled with LLVM, this leads to the
following compile errors:

 $ cd samples/bpf
 $ make

 In file included from /root/linux-master/samples/bpf/tracex1_kern.c:8:
 In file included from ./include/linux/netdevice.h:44:
 ...
 In file included from ./arch/s390/include/asm/mmu_context.h:10:
  ./arch/s390/include/asm/pgalloc.h:30:24: error: fields must have a
  constant size: 'variable length array in structure' extension will never
  be supported
         typedef struct { char _[n]; } addrtype;

 In file included from /root/linux-master/samples/bpf/tracex1_kern.c:7:
 In file included from ./include/linux/skbuff.h:18:
 ...
 In file included from ./include/linux/jiffies.h:8:
 In file included from ./include/linux/timex.h:65:
  ./arch/s390/include/asm/timex.h:105:24: error: fields must have a
  constant size: 'variable length array in structure' extension will never
  be supported
        typedef struct { char _[len]; } addrtype;

To fix this do the following:

 - Convert ptff() into a macro that then uses a fixed size array
   when expanded.
 - Convert the clear_table() function and use an inline assembly
   with fixed size array in a loop.
   The runtime performance of the new version is even better than
   the old version (tested with EC12/z13 and gcc 4.8.5/6.2.1 with
   "-march=z196 -O2").

Reported-by: Zvonko Kosic <zvonko.kosic@de.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2016-12-07 07:22:30 +01:00
..
appldata s390: Remove deprecated create_singlethread_workqueue 2016-09-06 10:59:57 +02:00
boot s390/thread_info: get rid of THREAD_ORDER define 2016-11-23 16:02:21 +01:00
configs s390: update defconfig 2016-11-23 16:02:24 +01:00
crypto s390/crypto: avoid returning garbage value 2016-09-06 11:00:00 +02:00
hypfs s390: hypfs: make inode explicitly non-modular 2016-10-31 17:55:40 +01:00
include s390: Remove VLAIS in ptff() and clear_table() 2016-12-07 07:22:30 +01:00
kernel s390: fix machine check panic stack switch 2016-12-07 07:22:13 +01:00
kvm KVM: s390: reject invalid modes for runtime instrumentation 2016-10-20 20:06:12 +02:00
lib Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-10-14 14:26:58 -07:00
mm s390: convert remaining bootmem allocations to memblock 2016-11-29 07:52:55 +01:00
net s390/bpf: fix recache skb->data/hlen for skb_vlan_push/pop 2016-05-19 09:14:27 +02:00
numa s390/numa: only set possible nodes within node_possible_map 2016-07-31 05:28:00 -04:00
oprofile s390/dumpstack: restore reliable indicator for call traces 2016-10-17 14:44:30 +02:00
pci s390/pci: use unique UIDs for domain enumeration 2016-11-23 16:02:26 +01:00
tools s390: remove unneeded dependency for gen_facilities 2016-11-08 10:30:28 +01:00
defconfig mm/usercopy: get rid of CONFIG_DEBUG_STRICT_USER_COPY_CHECKS 2016-08-30 10:10:21 -07:00
Kbuild s390/numa: add core infrastructure 2015-08-03 18:40:25 +02:00
Kconfig s390: add cma support 2016-11-23 16:02:23 +01:00
Kconfig.debug arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug 2016-01-09 06:30:49 -08:00
Makefile s390: add assembler include path for vx-insn.h 2016-09-06 11:00:04 +02:00