summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* io_uring: split network related opcodes into its own fileJens Axboe2022-07-255-835/+884
| | | | | | | While at it, convert the handlers to just use io_eopnotsupp_prep() if CONFIG_NET isn't set. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: move statx handling to its own fileJens Axboe2022-07-254-62/+82
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: move epoll handler to its own fileJens Axboe2022-07-254-50/+70
| | | | | | | Would be nice to sort out Kconfig for this and don't even compile epoll.c if we don't have epoll configured. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: add a dummy -EOPNOTSUPP prep handlerJens Axboe2022-07-251-9/+14
| | | | | | Add it and use it for the epoll handling, if epoll isn't configured. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: move uring_cmd handling to its own fileJens Axboe2022-07-255-124/+142
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: split out open/close operationsJens Axboe2022-07-255-298/+345
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: separate out file table handling codeJens Axboe2022-07-255-93/+117
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: split out fadvise/madvise operationsJens Axboe2022-07-254-85/+109
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: split out fs related sync/fallocate functionsJens Axboe2022-07-254-97/+124
| | | | | | This splits out sync_file_range, fsync, and fallocate. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: split out splice related operationsJens Axboe2022-07-255-130/+154
| | | | | | This splits out splice and tee support. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: split out filesystem related operationsJens Axboe2022-07-254-283/+316
| | | | | | This splits out renameat, unlinkat, mkdirat, symlinkat, and linkat. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: move nop into its own fileJens Axboe2022-07-254-15/+32
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: move xattr related opcodes to its own fileJens Axboe2022-07-254-247/+277
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: handle completions in the coreJens Axboe2022-07-252-134/+142
| | | | | | | | | | | | | | | Normally request handlers complete requests themselves, if they don't return an error. For the latter case, the core will complete it for them. This is unhandy for pushing opcode handlers further out, as we don't want a bunch of inline completion code and we don't want to make the completion path slower than it is now. Let the core handle any completion, unless the handler explicitly asks us not to. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: set completion results upfrontJens Axboe2022-07-252-12/+22
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: add io_uring_types.hJens Axboe2022-07-252-488/+499
| | | | | | | This adds definitions of structs that both the core and the various opcode handlers need to know about. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: define a request type cleanup handlerJens Axboe2022-07-251-69/+86
| | | | | | | | This can move request type specific cleanup into a private handler, removing the need for the core io_uring parts to know what types they are dealing with. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: unify struct io_symlink and io_hardlinkJens Axboe2022-07-251-20/+7
| | | | | | They are really just a subset of each other, just use the one type. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert iouring_cmd to io_cmd_typeJens Axboe2022-07-251-8/+10
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert xattr to use io_cmd_typeJens Axboe2022-07-251-10/+9
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert rsrc_update to io_cmd_typeJens Axboe2022-07-251-16/+19
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert msg and nop to io_cmd_typeJens Axboe2022-07-251-9/+9
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert splice to use io_cmd_typeJens Axboe2022-07-251-5/+4
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert epoll to io_cmd_typeJens Axboe2022-07-251-7/+8
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert file system request types to use io_cmd_typeJens Axboe2022-07-251-45/+57
| | | | | | | This converts statx, rename, unlink, mkdir, symlink, and hardlink to use io_cmd_type. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert madvise/fadvise to use io_cmd_typeJens Axboe2022-07-251-10/+12
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert open/close path to use io_cmd_typeJens Axboe2022-07-251-32/+40
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert timeout path to use io_cmd_typeJens Axboe2022-07-251-49/+68
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert cancel path to use io_cmd_typeJens Axboe2022-07-251-11/+13
| | | | Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert the sync and fallocate paths to use io_cmd_typeJens Axboe2022-07-251-19/+24
| | | | | | | They all share the same struct io_sync, convert them to use the io_cmd_type approach instead. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert net related opcodes to use io_cmd_typeJens Axboe2022-07-251-26/+27
| | | | | | | This converts accept, connect, send/recv, sendmsg/recvmsg, shutdown, and socket to use io_cmd_type. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: remove recvmsg knowledge from io_arm_poll_handler()Jens Axboe2022-07-251-2/+6
| | | | | | | | | | There's a special case for recvmsg with MSG_ERRQUEUE set. This is problematic as it means the core needs to know about this special request type. For now, just add a generic flag for it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert poll_update path to use io_cmd_typeJens Axboe2022-07-251-8/+8
| | | | | | | Remove struct io_poll_update from io_kiocb, and convert the poll path to use the io_cmd_type approach instead. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert poll path to use io_cmd_typeJens Axboe2022-07-251-25/+28
| | | | | | | | | | Remove struct io_poll_iocb from io_kiocb, and convert the poll path to use the io_cmd_type approach instead. While at it, rename io_poll_iocb to io_poll which is consistent with the other request type private structures. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: convert read/write path to use io_cmd_typeJens Axboe2022-07-251-88/+106
| | | | | | | Remove struct io_rw from io_kiocb, and convert the read/write path to use the io_cmd_type approach instead. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: add generic command payload type to struct io_kiocbJens Axboe2022-07-251-4/+17
| | | | | | | | | | | Each opcode generally has a command structure in io_kiocb which it can use to store data associated with that request. In preparation for having the core layer not know about what's inside these fields, add a generic io_cmd_data type and put in the union as well. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: move req async preparation into opcode handlerJens Axboe2022-07-251-28/+10
| | | | | | | | Define an io_op_def->prep_async() handler and push the async preparation to there. Since we now have that, we can drop ->needs_async_setup, as they mean the same thing. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: move to separate directoryJens Axboe2022-07-258-10/+10
| | | | | | | | | | | In preparation for splitting io_uring up a bit, move it into its own top level directory. It didn't really belong in fs/ anyway, as it's not a file system only API. This adds io_uring/ and moves the core files in there, and updates the MAINTAINERS file for the new location. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* io_uring: define a 'prep' and 'issue' handler for each opcodeJens Axboe2022-07-251-458/+350
| | | | | | | | Rather than have two giant switches for doing request preparation and then for doing request issue, add a prep and issue handler for each of them in the io_op_defs[] request definition. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* Linux 5.19-rc8v5.19-rc8Linus Torvalds2022-07-241-1/+1
|
* certs: make system keyring depend on x509 parserAdam Borowski2022-07-241-0/+1
| | | | | | | | | | | | This code requires x509_load_certificate_list() to be built-in. Fixes: 60050ffe3d77 ("certs: Move load_certificate_list() to be with the asymmetric keys code") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Steven Rostedt <rostedt@goodmis.org> Link: https://lore.kernel.org/all/202206221515.DqpUuvbQ-lkp@intel.com/ Link: https://lore.kernel.org/all/20220712104554.408dbf42@gandalf.local.home/ Signed-off-by: Adam Borowski <kilobyte@angband.pl> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge tag 'perf_urgent_for_v5.19_rc8' of ↵Linus Torvalds2022-07-241-9/+10
|\ | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Borislav Petkov: - Reorganize the perf LBR init code so that a TSX quirk is applied early enough in order for the LBR MSR access to not #GP * tag 'perf_urgent_for_v5.19_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/lbr: Fix unchecked MSR access error on HSW
| * perf/x86/intel/lbr: Fix unchecked MSR access error on HSWKan Liang2022-07-201-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fuzzer triggers the below trace. [ 7763.384369] unchecked MSR access error: WRMSR to 0x689 (tried to write 0x1fffffff8101349e) at rIP: 0xffffffff810704a4 (native_write_msr+0x4/0x20) [ 7763.397420] Call Trace: [ 7763.399881] <TASK> [ 7763.401994] intel_pmu_lbr_restore+0x9a/0x1f0 [ 7763.406363] intel_pmu_lbr_sched_task+0x91/0x1c0 [ 7763.410992] __perf_event_task_sched_in+0x1cd/0x240 On a machine with the LBR format LBR_FORMAT_EIP_FLAGS2, when the TSX is disabled, a TSX quirk is required to access LBR from registers. The lbr_from_signext_quirk_needed() is introduced to determine whether the TSX quirk should be applied. However, the lbr_from_signext_quirk_needed() is invoked before the intel_pmu_lbr_init(), which parses the LBR format information. Without the correct LBR format information, the TSX quirk never be applied. Move the lbr_from_signext_quirk_needed() into the intel_pmu_lbr_init(). Checking x86_pmu.lbr_has_tsx in the lbr_from_signext_quirk_needed() is not required anymore. Both LBR_FORMAT_EIP_FLAGS2 and LBR_FORMAT_INFO have LBR_TSX flag, but only the LBR_FORMAT_EIP_FLAGS2 requirs the quirk. Update the comments accordingly. Fixes: 1ac7fd8159a8 ("perf/x86/intel/lbr: Support LBR format V7") Reported-by: Vince Weaver <vincent.weaver@maine.edu> Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20220714182630.342107-1-kan.liang@linux.intel.com
* | Merge tag 'sched_urgent_for_v5.19_rc8' of ↵Linus Torvalds2022-07-241-1/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Borislav Petkov: "A single fix to correct a wrong BUG_ON() condition for deboosted tasks" * tag 'sched_urgent_for_v5.19_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/deadline: Fix BUG_ON condition for deboosted tasks
| * | sched/deadline: Fix BUG_ON condition for deboosted tasksJuri Lelli2022-07-211-1/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tasks the are being deboosted from SCHED_DEADLINE might enter enqueue_task_dl() one last time and hit an erroneous BUG_ON condition: since they are not boosted anymore, the if (is_dl_boosted()) branch is not taken, but the else if (!dl_prio) is and inside this one we BUG_ON(!is_dl_boosted), which is of course false (BUG_ON triggered) otherwise we had entered the if branch above. Long story short, the current condition doesn't make sense and always leads to triggering of a BUG. Fix this by only checking enqueue flags, properly: ENQUEUE_REPLENISH has to be present, but additional flags are not a problem. Fixes: 64be6f1f5f71 ("sched/deadline: Don't replenish from a !SCHED_DEADLINE entity") Signed-off-by: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20220714151908.533052-1-juri.lelli@redhat.com
* | Merge tag 'x86_urgent_for_v5.19_rc8' of ↵Linus Torvalds2022-07-248-12/+36
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: "A couple more retbleed fallout fixes. It looks like their urgency is decreasing so it seems like we've managed to catch whatever snafus the limited -rc testing has exposed. Maybe we're getting ready... :) - Make retbleed mitigations 64-bit only (32-bit will need a bit more work if even needed, at all). - Prevent return thunks patching of the LKDTM modules as it is not needed there - Avoid writing the SPEC_CTRL MSR on every kernel entry on eIBRS parts - Enhance error output of apply_returns() when it fails to patch a return thunk - A sparse fix to the sev-guest module - Protect EFI fw calls by issuing an IBPB on AMD" * tag 'x86_urgent_for_v5.19_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/speculation: Make all RETbleed mitigations 64-bit only lkdtm: Disable return thunks in rodata.c x86/bugs: Warn when "ibrs" mitigation is selected on Enhanced IBRS parts x86/alternative: Report missing return thunk details virt: sev-guest: Pass the appropriate argument type to iounmap() x86/amd: Use IBPB for firmware calls
| * | x86/speculation: Make all RETbleed mitigations 64-bit onlyBen Hutchings2022-07-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mitigations for RETBleed are currently ineffective on x86_32 since entry_32.S does not use the required macros. However, for an x86_32 target, the kconfig symbols for them are still enabled by default and /sys/devices/system/cpu/vulnerabilities/retbleed will wrongly report that mitigations are in place. Make all of these symbols depend on X86_64, and only enable RETHUNK by default on X86_64. Fixes: f43b9876e857 ("x86/retbleed: Add fine grained Kconfig knobs") Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/YtwSR3NNsWp1ohfV@decadent.org.uk
| * | lkdtm: Disable return thunks in rodata.cJosh Poimboeuf2022-07-202-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following warning was seen: WARNING: CPU: 0 PID: 0 at arch/x86/kernel/alternative.c:557 apply_returns (arch/x86/kernel/alternative.c:557 (discriminator 1)) Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc4-00008-gee88d363d156 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-debian-1.16.0-4 04/01/2014 RIP: 0010:apply_returns (arch/x86/kernel/alternative.c:557 (discriminator 1)) Code: ff ff 74 cb 48 83 c5 04 49 39 ee 0f 87 81 fe ff ff e9 22 ff ff ff 0f 0b 48 83 c5 04 49 39 ee 0f 87 6d fe ff ff e9 0e ff ff ff <0f> 0b 48 83 c5 04 49 39 ee 0f 87 59 fe ff ff e9 fa fe ff ff 48 89 The warning happened when apply_returns() failed to convert "JMP __x86_return_thunk" to RET. It was instead a JMP to nowhere, due to the thunk relocation not getting resolved. That rodata.o code is objcopy'd to .rodata, and later memcpy'd, so relocations don't work (and are apparently silently ignored). LKDTM is only used for testing, so the naked RET should be fine. So just disable return thunks for that file. While at it, disable objtool and KCSAN for the file. Fixes: 0b53c374b9ef ("x86/retpoline: Use -mfunction-return") Reported-by: kernel test robot <oliver.sang@intel.com> Debugged-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/lkml/Ys58BxHxoDZ7rfpr@xsang-OptiPlex-9020/
| * | x86/bugs: Warn when "ibrs" mitigation is selected on Enhanced IBRS partsPawan Gupta2022-07-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IBRS mitigation for spectre_v2 forces write to MSR_IA32_SPEC_CTRL at every kernel entry/exit. On Enhanced IBRS parts setting MSR_IA32_SPEC_CTRL[IBRS] only once at boot is sufficient. MSR writes at every kernel entry/exit incur unnecessary performance loss. When Enhanced IBRS feature is present, print a warning about this unnecessary performance loss. Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/2a5eaf54583c2bfe0edc4fea64006656256cca17.1657814857.git.pawan.kumar.gupta@linux.intel.com
| * | x86/alternative: Report missing return thunk detailsKees Cook2022-07-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Debugging missing return thunks is easier if we can see where they're happening. Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/lkml/Ys66hwtFcGbYmoiZ@hirez.programming.kicks-ass.net/