summaryrefslogtreecommitdiff
path: root/arch/arm64 (follow)
Commit message (Collapse)AuthorAge
...
* | | configs: Set panic timeout to 5Davide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * Doing so the device waits 5 seconds from the panic before rebooting Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable MAGIC_SYSRQDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * Without this you can't test and reproduce a kernel panic... Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Disable DEVPORT config for msm8996Swetha Chikkaboraiah2022-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable CONFIG_DEVPORT config for msm8996. As selinux policy requires this node to be not accessible to userspace. CRs-Fixed: 2077590 Change-Id: I302d71a56764504ec246ddb6a98d8c07094846e4 Signed-off-by: Mohammed Khajapasha <mkhaja@codeaurora.org> Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org> Signed-off-by: Subhajeet Muhuri <kenny3fcb@gmail.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable CONFIG_SCHED_HMP_CSTATE_AWAREJoonwoo Park2022-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable CONFIG_SCHED_HMP_CSTATE_AWARE in order to optimize task placement with CPUs C-state. This brings better system performance. CRs-fixed: 1006303 Change-Id: I18e62015371143bca56396c747eaad3b22c5e3a3 Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org> Signed-off-by: Subhajeet Muhuri <kenny3fcb@gmail.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Use RCU_NOCB for RCU subsystemImran Khan2022-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use per CPU NOCB threads to process RCU callbacks, rather than processing the callbacks in softirq context. Processing large number of callbacks in softirq context may result in delayed execution of other softirqs, so remove processing of callbacks from softirq context. Change-Id: I96faf1e5c8e786a2cb2410bb1265875410f74ae3 Signed-off-by: Imran Khan <kimran@codeaurora.org> Signed-off-by: Subhajeet Muhuri <kenny3fcb@gmail.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: msm8996 specific changesYaroslav Furman2022-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove QBT1000 as it isn't used * Remove erratum fixes as they aren't needed * Add a few configs for security * Add CONFIG_INET_IPCOMP - for VPN Signed-off-by: Yaroslav Furman <yaro330@gmail.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: msm8996: Enable and disable few configsRahul Shahare2022-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change will enables and disables below list of configs in defconfig and perf_deconfig to address the pop-up issue. Enable configs: CONFIG_HARDENED_USERCOPY CONFIG_CRYPTO_GCM CONFIG_IPV6_VTI CONFIG_NET_IPVTI CONFIG_SECURITY_PERF_EVENTS_RESTRICT CONFIG_USB_CONFIGFS_F_AUDIO_SRC CONFIG_USB_CONFIGFS_F_MIDI CONFIG_CP15_BARRIER_EMULATION CONFIG_SETEND_EMULATION Disable configs: CONFIG_USELIB Change-Id: I7135d8a41bd34018c3d8f7c2342b2c2a12a9e07b Signed-off-by: Rahul Shahare <rshaha@codeaurora.org>
* | | configs: Enable app specific setting on MSM8996Sarangdhar Joshi2022-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable support for app specific setting on MSM8996. This is required for providing an interface so that app specific settings can be applied / cleared. CRs-Fixed: 981519 Change-Id: Ice69a77b40dbd98bfff0c8095d78a25424527a2f Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
* | | configs: Enable FP settings for msm8996Sarangdhar Joshi2022-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enable FP(Floating Point) and SIMD settings required during execution of AArch32 processes. CRs-Fixed: 952837 Change-Id: I71c9294a59053aad2abfd359f9d3035cf493307a Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
* | | configs: Disable SMB135X_CHARGERDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * We're not using this in 3.18 and it's useless for us Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable USB_CONFIGFS_RNDISDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | | | | * Fixes usb tethering * Depends on https://github.com/DD3Boh/android_kernel_zuk_msm8996/commit/120991fe0830555988da869c6b4f0a518f301bc8 Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | z2_row_defconfig: Enable DRV2605L_HAPTICSDavide Garberi2022-07-27
| | | | | | | | | | | | Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | z2_row_defconfig: Enable NXP_TFA98xxDavide Garberi2022-07-27
| | | | | | | | | | | | Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable cclogicDavide Garberi2022-07-27
| | | | | | | | | | | | Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable CONFIG_FPC1020_REESubhajeet Muhuri2022-07-27
| | | | | | | | | | | | Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Don't build synaptics we don't useYaroslav Furman2022-07-27
| | | | | | | | | | | | | | | Signed-off-by: Yaroslav Furman <yaro330@gmail.com> Signed-off-by: Subhajeet Muhuri <kenny3fcb@gmail.com>
* | | configs: Disable TOUCHPANEL_UPDATEYaroslav Furman2022-07-27
| | | | | | | | | | | | | | | | | | Signed-off-by: Yaroslav Furman <yaro330@gmail.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com> Change-Id: I950bff72a36bf425253089d8cb42c749db42acf6
* | | configs: Build touchscreen driversDavide Garberi2022-07-27
| | | | | | | | | | | | Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable CRYPTO_SHA512Davide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * This is a requirement when setting manifest level 3 Change-Id: I718c74467da82c08752a39d40f4f6387e2b29ea7
* | | configs: Enable RPM_STATS_LOGDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * Needed to not make various userspace things fail Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Big cleanupYaroslav Furman2022-07-27
| | | | | | | | | | | | | | | | | | | | | * Fixes booting when built with Clang 8 and -O3 Signed-off-by: Yaroslav Furman <yaro330@gmail.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Set LineageOS as kernel nameDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * I liked Pepper, BUT... Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: enable F2FSYaroslav Furman2022-07-27
| | | | | | | | | | | | | | | | | | Signed-off-by: Yaroslav Furman <yaro330@gmail.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com> Change-Id: Ia3a4ee44adb056f8e2931caf18c8203dd3a3b1b4
* | | configs: Disable FB_MSM_MDSS_HDMI_PANELDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * Known for breaking OTG Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable ARM_GIC_V3_ACLSubhajeet Muhuri2022-07-27
| | | | | | | | | | | | | | | | | | * Without this the device just randomly kernel panics at boot Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Set the cpu number to 4Davide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * MSM8996/8996pro is quad core Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable cpusetsDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * We use this frequently in the ramdisk so let's enable it at kernel level Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable pstoreDavide Garberi2022-07-27
| | | | | | | | | | | | Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable sdcardfsDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * This is being used as default since Oreo, so let's enable it in kernel Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Disable DEBUG_ALIGN_RODATADavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * This config makes the kernel panic when qcacld-2.0 is being built inline Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Disable EXT2 and EXT3Davide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * It just doesn't make sense to keep them Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable qcacld wlan driverSubhajeet Muhuri2022-07-27
| | | | | | | | | | | | Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Set HZ to 300Davide Garberi2022-07-27
| | | | | | | | | | | | Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | z2_plus_defconfig: Disable USFHDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | | | | * z2_plus uses MMC so let's remove ufsh because it's unused * z2_row uses ufsh so let's keep that but still not remove MMC because it would give building problems with cnss Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Enable the correct mach for each boardDavide Garberi2022-07-27
| | | | | | | | | | | | Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | configs: Remove MSM_SMP2P_TESTDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * This config doesn't exist anymore, automatically deleted by savedefconfig Change-Id: I14641c09b28eda7bc00e4072d03a228e539fdd2c
* | | configs: Add initial z2 defconfigsDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | | | * Just a copy of msm-perf_defconfig Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | | soc: qcom: Remove now unused MSM_SMP2P_TESTAlbert I2022-07-27
|/ / | | | | | | | | | | | | | | | | All related codes have been removed since commit c457926b166c introduced by LA.UM.7.2.r1-05400-sdm660.0 CAF tag. Signed-off-by: Albert I <krascgq@outlook.co.id> Signed-off-by: Davide Garberi <dade.garberi@gmail.com> Change-Id: I3d8e6ac169e2f2712ae839c6a67f8e288a4511de
* | BACKPORT: ANDROID: Remove xt_qtaguid module from new kernels.Chenbo Feng2022-04-19
| | | | | | | | | | | | | | | | | | | | | | | | For new devices ship with 4.9 kernel, the eBPF replacement should cover all the functionalities of xt_qtaguid and it is safe now to remove this android only module from the kernel. Signed-off-by: Chenbo Feng <fengc@google.com> Signed-off-by: Bruno Martins <bgcngm@gmail.com> Bug: 79938294 Test: kernel build Change-Id: I032aecc048f7349f6a0c5192dd381f286fc7e5bf
* | arm64: bpf: optimize LD_ABS, LD_INDZi Shen Lim2022-04-19
| | | | | | | | | | | | | | | | Remove superfluous stack frame, saving us 3 instructions for every LD_ABS or LD_IND. Signed-off-by: Zi Shen Lim <zlim.lnx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | arm64: bpf: optimize JMP_CALLZi Shen Lim2022-04-19
| | | | | | | | | | | | | | | | Remove superfluous stack frame, saving us 3 instructions for every JMP_CALL. Signed-off-by: Zi Shen Lim <zlim.lnx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | ANDROID: arm64: bpf: implement arch_bpf_jit_check_funcSami Tolvanen2022-04-19
| | | | | | | | | | | | | | | | | | | | Implement arch_bpf_jit_check_func to check that pointers to jited BPF functions are correctly aligned and point to the BPF JIT region. This narrows down the attack surface on the stored pointer. Bug: 140377409 Change-Id: I10c448eda6a8b0bf4c16ee591fc65974696216b9 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
* | bpf, arm64: fix out of bounds access in tail callDaniel Borkmann2022-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ upstream commit 16338a9b3ac30740d49f5dfed81bac0ffa53b9c7 ] I recently noticed a crash on arm64 when feeding a bogus index into BPF tail call helper. The crash would not occur when the interpreter is used, but only in case of JIT. Output looks as follows: [ 347.007486] Unable to handle kernel paging request at virtual address fffb850e96492510 [...] [ 347.043065] [fffb850e96492510] address between user and kernel address ranges [ 347.050205] Internal error: Oops: 96000004 [#1] SMP [...] [ 347.190829] x13: 0000000000000000 x12: 0000000000000000 [ 347.196128] x11: fffc047ebe782800 x10: ffff808fd7d0fd10 [ 347.201427] x9 : 0000000000000000 x8 : 0000000000000000 [ 347.206726] x7 : 0000000000000000 x6 : 001c991738000000 [ 347.212025] x5 : 0000000000000018 x4 : 000000000000ba5a [ 347.217325] x3 : 00000000000329c4 x2 : ffff808fd7cf0500 [ 347.222625] x1 : ffff808fd7d0fc00 x0 : ffff808fd7cf0500 [ 347.227926] Process test_verifier (pid: 4548, stack limit = 0x000000007467fa61) [ 347.235221] Call trace: [ 347.237656] 0xffff000002f3a4fc [ 347.240784] bpf_test_run+0x78/0xf8 [ 347.244260] bpf_prog_test_run_skb+0x148/0x230 [ 347.248694] SyS_bpf+0x77c/0x1110 [ 347.251999] el0_svc_naked+0x30/0x34 [ 347.255564] Code: 9100075a d280220a 8b0a002a d37df04b (f86b694b) [...] In this case the index used in BPF r3 is the same as in r1 at the time of the call, meaning we fed a pointer as index; here, it had the value 0xffff808fd7cf0500 which sits in x2. While I found tail calls to be working in general (also for hitting the error cases), I noticed the following in the code emission: # bpftool p d j i 988 [...] 38: ldr w10, [x1,x10] 3c: cmp w2, w10 40: b.ge 0x000000000000007c <-- signed cmp 44: mov x10, #0x20 // #32 48: cmp x26, x10 4c: b.gt 0x000000000000007c 50: add x26, x26, #0x1 54: mov x10, #0x110 // #272 58: add x10, x1, x10 5c: lsl x11, x2, #3 60: ldr x11, [x10,x11] <-- faulting insn (f86b694b) 64: cbz x11, 0x000000000000007c [...] Meaning, the tests passed because commit ddb55992b04d ("arm64: bpf: implement bpf_tail_call() helper") was using signed compares instead of unsigned which as a result had the test wrongly passing. Change this but also the tail call count test both into unsigned and cap the index as u32. Latter we did as well in 90caccdd8cc0 ("bpf: fix bpf_tail_call() x64 JIT") and is needed in addition here, too. Tested on HiSilicon Hi1616. Result after patch: # bpftool p d j i 268 [...] 38: ldr w10, [x1,x10] 3c: add w2, w2, #0x0 40: cmp w2, w10 44: b.cs 0x0000000000000080 48: mov x10, #0x20 // #32 4c: cmp x26, x10 50: b.hi 0x0000000000000080 54: add x26, x26, #0x1 58: mov x10, #0x110 // #272 5c: add x10, x1, x10 60: lsl x11, x2, #3 64: ldr x11, [x10,x11] 68: cbz x11, 0x0000000000000080 [...] Fixes: ddb55992b04d ("arm64: bpf: implement bpf_tail_call() helper") Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | bpf, arm64: fix faulty emission of map access in tail callsDaniel Borkmann2022-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Upstream commit d8b54110ee944de522ccd3531191f39986ec20f9 ] Shubham was recently asking on netdev why in arm64 JIT we don't multiply the index for accessing the tail call map by 8. That led me into testing out arm64 JIT wrt tail calls and it turned out I got a NULL pointer dereference on the tail call. The buggy access is at: prog = array->ptrs[index]; if (prog == NULL) goto out; [...] 00000060: d2800e0a mov x10, #0x70 // #112 00000064: f86a682a ldr x10, [x1,x10] 00000068: f862694b ldr x11, [x10,x2] 0000006c: b40000ab cbz x11, 0x00000080 [...] The code triggering the crash is f862694b. x1 at the time contains the address of the bpf array, x10 offsetof(struct bpf_array, ptrs). Meaning, above we load the pointer to the program at map slot 0 into x10. x10 can then be NULL if the slot is not occupied, which we later on try to access with a user given offset in x2 that is the map index. Fix this by emitting the following instead: [...] 00000060: d2800e0a mov x10, #0x70 // #112 00000064: 8b0a002a add x10, x1, x10 00000068: d37df04b lsl x11, x2, #3 0000006c: f86b694b ldr x11, [x10,x11] 00000070: b40000ab cbz x11, 0x00000084 [...] This basically adds the offset to ptrs to the base address of the bpf array we got and we later on access the map with an index * 8 offset relative to that. The tail call map itself is basically one large area with meta data at the head followed by the array of prog pointers. This makes tail calls working again, tested on Cavium ThunderX ARMv8. Fixes: ddb55992b04d ("arm64: bpf: implement bpf_tail_call() helper") Reported-by: Shubham Bansal <illusionist.neo@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | arm64: bpf_jit_comp: drop artifactAnay Wadhera2022-04-19
| | | | | | | | Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
* | bpf: get rid of pure_initcall dependency to enable jitsDaniel Borkmann2022-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit fa9dd599b4dae841924b022768354cfde9affecb upstream. Having a pure_initcall() callback just to permanently enable BPF JITs under CONFIG_BPF_JIT_ALWAYS_ON is unnecessary and could leave a small race window in future where JIT is still disabled on boot. Since we know about the setting at compilation time anyway, just initialize it properly there. Also consolidate all the individual bpf_jit_enable variables into a single one and move them under one location. Moreover, don't allow for setting unspecified garbage values on them. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> [bwh: Backported to 4.9 as dependency of commit 2e4a30983b0f "bpf: restrict access to core bpf sysctls": - Drop change in arch/mips/net/ebpf_jit.c - Drop change to bpf_jit_kallsyms - Adjust filenames, context] Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
* | arm64: bpf: implement bpf_tail_call() helperZi Shen Lim2022-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for JMP_CALL_X (tail call) introduced by commit 04fd61ab36ec ("bpf: allow bpf programs to tail-call other bpf programs"). bpf_tail_call() arguments: ctx - context pointer passed to next program array - pointer to map which type is BPF_MAP_TYPE_PROG_ARRAY index - index inside array that selects specific program to run In this implementation arm64 JIT jumps into callee program after prologue, so callee program reuses the same stack. For tail_call_cnt, we use the callee-saved R26 (which was already saved/restored but previously unused by JIT). With this patch a tail call generates the following code on arm64: if (index >= array->map.max_entries) goto out; 34: mov x10, #0x10 // #16 38: ldr w10, [x1,x10] 3c: cmp w2, w10 40: b.ge 0x0000000000000074 if (tail_call_cnt > MAX_TAIL_CALL_CNT) goto out; tail_call_cnt++; 44: mov x10, #0x20 // #32 48: cmp x26, x10 4c: b.gt 0x0000000000000074 50: add x26, x26, #0x1 prog = array->ptrs[index]; if (prog == NULL) goto out; 54: mov x10, #0x68 // #104 58: ldr x10, [x1,x10] 5c: ldr x11, [x10,x2] 60: cbz x11, 0x0000000000000074 goto *(prog->bpf_func + prologue_size); 64: mov x10, #0x20 // #32 68: ldr x10, [x11,x10] 6c: add x10, x10, #0x20 70: br x10 74: Signed-off-by: Zi Shen Lim <zlim.lnx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
* | bpf: arm64: remove callee-save registers use for tmp registersYang Shi2022-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current implementation of ARM64 eBPF JIT, R23 and R24 are used for tmp registers, which are callee-saved registers. This leads to variable size of JIT prologue and epilogue. The latest blinding constant change prefers to constant size of prologue and epilogue. AAPCS reserves R9 ~ R15 for temp registers which not need to be saved/restored during function call. So, replace R23 and R24 to R10 and R11, and remove tmp_used flag to save 2 instructions for some jited BPF program. CC: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Zi Shen Lim <zlim.lnx@gmail.com> Signed-off-by: Yang Shi <yang.shi@linaro.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
* | bpf, arm64: add support for constant blindingDaniel Borkmann2022-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds recently added constant blinding helpers into the arm64 eBPF JIT. In the bpf_int_jit_compile() path, requirements are to utilize bpf_jit_blind_constants()/bpf_jit_prog_release_other() pair for rewriting the program into a blinded one, and to map the BPF_REG_AX register to a CPU register. The mapping is on x9. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Zi Shen Lim <zlim.lnx@gmail.com> Acked-by: Yang Shi <yang.shi@linaro.org> Tested-by: Yang Shi <yang.shi@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
* | arm64: bpf: add extra pass to handle faulty codegenZi Shen Lim2022-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code generation functions in arch/arm64/kernel/insn.c previously BUG_ON invalid parameters. Following change of that behavior, now we need to handle the error case where AARCH64_BREAK_FAULT is returned. Instead of error-handling on every emit() in JIT, we add a new validation pass at the end of JIT compilation. There's no point in running JITed code at run-time only to trap due to AARCH64_BREAK_FAULT. Instead, we drop this failed JIT compilation and allow the system to gracefully fallback on the BPF interpreter. Signed-off-by: Zi Shen Lim <zlim.lnx@gmail.com> Suggested-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Chatur27 <jasonbright2709@gmail.com>