android_kernel_xiaomi_sm8350/arch/powerpc/include/asm
Naveen N. Rao b6125c5dc3 powerpc/bpf: Fix use of user_pt_regs in uapi
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: a6460b03f9 ("powerpc/bpf: Fix broken uapi for BPF_PROG_TYPE_PERF_EVENT")
Cc: stable@vger.kernel.org # v4.20+
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
[mpe: Use typical naming for header include guard]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220627191119.142867-1-naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-07 17:36:48 +02:00
..
book3s powerpc/64s: Fix pte update for kernel memory on radix 2021-05-14 09:44:27 +02:00
nohash
8xx_immap.h
accounting.h
agp.h
archrandom.h powerpc: Use bool in archrandom.h 2022-06-22 14:11:05 +02:00
asm-405.h
asm-compat.h
asm-const.h
asm-offsets.h
asm-prototypes.h
async_tx.h
atomic.h
backlight.h
barrier.h powerpc/barrier: Avoid collision with clang's __lwsync macro 2021-07-19 08:53:14 +02:00
bitops.h
bootx.h
bpf_perf_event.h powerpc/bpf: Fix use of user_pt_regs in uapi 2022-07-07 17:36:48 +02:00
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 powerpc/lib: Add helper to check if offset is within conditional branch range 2021-11-17 09:48:49 +01:00
compat.h
context_tracking.h
copro.h
cpm1.h
cpm2.h
cpm.h
cpu_has_feature.h powerpc: Force inlining of cpu_has_feature() to avoid build failure 2021-04-07 14:47:39 +02:00
cpufeature.h
cpuidle.h
cputable.h
cputhreads.h KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors 2021-07-14 16:53:14 +02:00
cputime.h
current.h
dbdma.h
dbell.h
dcr-generic.h
dcr-mmio.h
dcr-native.h powerpc/4xx: Fix build errors from mfdcr() 2021-03-30 14:35:20 +02:00
dcr-regs.h
dcr.h
debug.h
debugfs.h
delay.h
device.h
disassemble.h
dma-direct.h
dma-mapping.h
dma.h
drmem.h
dt_cpu_ftrs.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 powerpc/ftrace: Remove ftrace init tramp once kernel init is complete 2022-07-02 16:28:49 +02:00
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
ima.h
imc-pmu.h
immap_cpm2.h
io_event_irq.h
io-defs.h
io-workarounds.h
io.h powerpc: Fix build errors with newer binutils 2022-04-15 14:18:25 +02:00
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.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.h
kvm_booke_hv_asm.h
kvm_booke.h
kvm_fpu.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
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 powerpc/64: Only WARN if __pa()/__va() called with bad addresses 2022-06-14 18:11:42 +02:00
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 KVM: PPC: Book3S HV Nested: Reflect guest PMU in-use to L0 when guest SPRs are live 2021-09-22 12:26:25 +02:00
pmi.h
pnv-ocxl.h
pnv-pci.h
powernv.h
ppc4xx.h
ppc_asm.h
ppc-opcode.h powerpc/mm: Switch obsolete dssall to .long 2022-06-22 14:11:24 +02:00
ppc-pci.h
probes.h
processor.h
prom.h
ps3.h powerpc/ps3: Add dma_mask to ps3_dma_region 2021-07-20 16:10:44 +02:00
ps3av.h
ps3gpu.h
ps3stor.h
pte-walk.h
ptrace.h
reg_8xx.h
reg_a2.h
reg_booke.h
reg_fsl_emb.h
reg.h
rheap.h
rio.h
rtas.h
runlatch.h
seccomp.h
sections.h
security_features.h powerpc/security: Add a helper to query stf_barrier type 2021-11-17 09:48:49 +01:00
serial.h
setjmp.h
setup.h
sfp-machine.h
shmparam.h
signal.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 powerpc: define get_cycles macro for arch-override 2022-06-22 14:11:15 +02:00
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 powerpc: Fix build errors with newer binutils 2022-04-15 14:18:25 +02:00
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
vga.h
vio.h
word-at-a-time.h
xics.h
xilinx_intc.h
xilinx_pci.h
xive-regs.h
xive.h
xmon.h
xor_altivec.h
xor.h