forked from luck/tmp_suning_uos_patched
213c550deb
commit b21bd5a4b130f8370861478d2880985daace5913 upstream.
Trying to build a .c file that includes <linux/bpf_perf_event.h>:
$ cat test_bpf_headers.c
#include <linux/bpf_perf_event.h>
throws the below error:
/usr/include/linux/bpf_perf_event.h:14:28: error: field ‘regs’ has incomplete type
14 | bpf_user_pt_regs_t regs;
| ^~~~
This is because we typedef bpf_user_pt_regs_t to 'struct user_pt_regs'
in arch/powerpc/include/uaps/asm/bpf_perf_event.h, but 'struct
user_pt_regs' is not exposed to userspace.
Powerpc has both pt_regs and user_pt_regs structures. However, unlike
arm64 and s390, we expose user_pt_regs to userspace as just 'pt_regs'.
As such, we should typedef bpf_user_pt_regs_t to 'struct pt_regs' for
userspace.
Within the kernel though, we want to typedef bpf_user_pt_regs_t to
'struct user_pt_regs'.
Remove arch/powerpc/include/uapi/asm/bpf_perf_event.h so that the
uapi/asm-generic version of the header is exposed to userspace.
Introduce arch/powerpc/include/asm/bpf_perf_event.h so that we can
typedef bpf_user_pt_regs_t to 'struct user_pt_regs' for use within the
kernel.
Note that this was not showing up with the bpf selftest build since
tools/include/uapi/asm/bpf_perf_event.h didn't include the powerpc
variant.
Fixes:
|
||
---|---|---|
.. | ||
book3s | ||
nohash | ||
8xx_immap.h | ||
accounting.h | ||
agp.h | ||
archrandom.h | ||
asm-compat.h | ||
asm-const.h | ||
asm-offsets.h | ||
asm-prototypes.h | ||
async_tx.h | ||
atomic.h | ||
backlight.h | ||
barrier.h | ||
bitops.h | ||
bootx.h | ||
bpf_perf_event.h | ||
btext.h | ||
bug.h | ||
bugs.h | ||
cache.h | ||
cacheflush.h | ||
cell-pmu.h | ||
cell-regs.h | ||
checksum.h | ||
cmpxchg.h | ||
code-patching-asm.h | ||
code-patching.h | ||
compat.h | ||
context_tracking.h | ||
copro.h | ||
cpm.h | ||
cpm1.h | ||
cpm2.h | ||
cpu_has_feature.h | ||
cpu_setup_power.h | ||
cpufeature.h | ||
cpuidle.h | ||
cputable.h | ||
cputhreads.h | ||
cputime.h | ||
crashdump-ppc64.h | ||
current.h | ||
dbdma.h | ||
dbell.h | ||
dcr-generic.h | ||
dcr-mmio.h | ||
dcr-native.h | ||
dcr-regs.h | ||
dcr.h | ||
debug.h | ||
debugfs.h | ||
delay.h | ||
device.h | ||
disassemble.h | ||
dma-direct.h | ||
dma.h | ||
drmem.h | ||
dt_cpu_ftrs.h | ||
dtl.h | ||
edac.h | ||
eeh_event.h | ||
eeh.h | ||
ehv_pic.h | ||
elf.h | ||
elfnote.h | ||
emergency-restart.h | ||
emulated_ops.h | ||
epapr_hcalls.h | ||
exception-64e.h | ||
exception-64s.h | ||
exec.h | ||
extable.h | ||
fadump-internal.h | ||
fadump.h | ||
fb.h | ||
feature-fixups.h | ||
firmware.h | ||
fixmap.h | ||
floppy.h | ||
fs_pd.h | ||
fsl_85xx_cache_sram.h | ||
fsl_gtm.h | ||
fsl_hcalls.h | ||
fsl_lbc.h | ||
fsl_pamu_stash.h | ||
fsl_pm.h | ||
ftrace.h | ||
futex.h | ||
grackle.h | ||
hardirq.h | ||
head-64.h | ||
heathrow.h | ||
highmem.h | ||
hmi.h | ||
hugetlb.h | ||
hvcall.h | ||
hvconsole.h | ||
hvcserver.h | ||
hvsi.h | ||
hw_breakpoint.h | ||
hw_irq.h | ||
hydra.h | ||
i8259.h | ||
ibmebus.h | ||
icswx.h | ||
ide.h | ||
idle.h | ||
ima.h | ||
imc-pmu.h | ||
immap_cpm2.h | ||
inst.h | ||
io_event_irq.h | ||
io-defs.h | ||
io-workarounds.h | ||
io.h | ||
iommu.h | ||
ipic.h | ||
irq_work.h | ||
irq.h | ||
irqflags.h | ||
isa-bridge.h | ||
jump_label.h | ||
kasan.h | ||
Kbuild | ||
kdebug.h | ||
kdump.h | ||
kexec_ranges.h | ||
kexec.h | ||
keylargo.h | ||
kgdb.h | ||
kmap_types.h | ||
kprobes.h | ||
kup.h | ||
kvm_asm.h | ||
kvm_book3s_32.h | ||
kvm_book3s_64.h | ||
kvm_book3s_asm.h | ||
kvm_book3s_uvmem.h | ||
kvm_book3s.h | ||
kvm_booke_hv_asm.h | ||
kvm_booke.h | ||
kvm_fpu.h | ||
kvm_guest.h | ||
kvm_host.h | ||
kvm_para.h | ||
kvm_ppc.h | ||
libata-portmap.h | ||
linkage.h | ||
livepatch.h | ||
local.h | ||
lppaca.h | ||
lv1call.h | ||
machdep.h | ||
macio.h | ||
mc146818rtc.h | ||
mce.h | ||
mediabay.h | ||
mem_encrypt.h | ||
membarrier.h | ||
mm-arch-hooks.h | ||
mman.h | ||
mmiowb.h | ||
mmu_context.h | ||
mmu.h | ||
mmzone.h | ||
module.h | ||
module.lds.h | ||
mpc5xxx.h | ||
mpc6xx.h | ||
mpc52xx_psc.h | ||
mpc52xx.h | ||
mpc85xx.h | ||
mpc5121.h | ||
mpc8260.h | ||
mpic_msgr.h | ||
mpic_timer.h | ||
mpic.h | ||
msi_bitmap.h | ||
nmi.h | ||
nvram.h | ||
ohare.h | ||
opal-api.h | ||
opal.h | ||
oprofile_impl.h | ||
paca.h | ||
page_32.h | ||
page_64.h | ||
page.h | ||
paravirt.h | ||
parport.h | ||
pasemi_dma.h | ||
pci-bridge.h | ||
pci.h | ||
percpu.h | ||
perf_event_fsl_emb.h | ||
perf_event_server.h | ||
perf_event.h | ||
pgalloc.h | ||
pgtable-be-types.h | ||
pgtable-types.h | ||
pgtable.h | ||
pkeys.h | ||
plpar_wrappers.h | ||
pmac_feature.h | ||
pmac_low_i2c.h | ||
pmac_pfunc.h | ||
pmc.h | ||
pmi.h | ||
pnv-ocxl.h | ||
pnv-pci.h | ||
powernv.h | ||
ppc_asm.h | ||
ppc-opcode.h | ||
ppc-pci.h | ||
ppc4xx.h | ||
probes.h | ||
processor.h | ||
prom.h | ||
ps3.h | ||
ps3av.h | ||
ps3gpu.h | ||
ps3stor.h | ||
pte-walk.h | ||
ptrace.h | ||
qspinlock_paravirt.h | ||
qspinlock.h | ||
reg_8xx.h | ||
reg_a2.h | ||
reg_booke.h | ||
reg_fsl_emb.h | ||
reg.h | ||
rheap.h | ||
rio.h | ||
rtas-types.h | ||
rtas.h | ||
runlatch.h | ||
seccomp.h | ||
sections.h | ||
secure_boot.h | ||
security_features.h | ||
secvar.h | ||
serial.h | ||
setjmp.h | ||
setup.h | ||
sfp-machine.h | ||
shmparam.h | ||
signal.h | ||
simple_spinlock_types.h | ||
simple_spinlock.h | ||
slice.h | ||
smp.h | ||
smu.h | ||
sparsemem.h | ||
spinlock_types.h | ||
spinlock.h | ||
spu_csa.h | ||
spu_info.h | ||
spu_priv1.h | ||
spu.h | ||
sstep.h | ||
stackprotector.h | ||
stacktrace.h | ||
string.h | ||
svm.h | ||
swab.h | ||
swiotlb.h | ||
switch_to.h | ||
synch.h | ||
syscall.h | ||
syscalls.h | ||
task_size_32.h | ||
task_size_64.h | ||
tce.h | ||
termios.h | ||
thread_info.h | ||
time.h | ||
timex.h | ||
tlb.h | ||
tlbflush.h | ||
tm.h | ||
topology.h | ||
trace_clock.h | ||
trace.h | ||
tsi108_irq.h | ||
tsi108_pci.h | ||
tsi108.h | ||
types.h | ||
uaccess.h | ||
udbg.h | ||
uic.h | ||
ultravisor-api.h | ||
ultravisor.h | ||
unaligned.h | ||
uninorth.h | ||
unistd.h | ||
uprobes.h | ||
user.h | ||
vas.h | ||
vdso_datapage.h | ||
vdso.h | ||
vermagic.h | ||
vga.h | ||
vio.h | ||
vmalloc.h | ||
word-at-a-time.h | ||
xics.h | ||
xive-regs.h | ||
xive.h | ||
xmon.h | ||
xor_altivec.h | ||
xor.h |