Go to file
Seth Forshee 3e684903a8 entry/kvm: Exit to user mode when TIF_NOTIFY_SIGNAL is set
A livepatch transition may stall indefinitely when a kvm vCPU is heavily
loaded. To the host, the vCPU task is a user thread which is spending a
very long time in the ioctl(KVM_RUN) syscall. During livepatch
transition, set_notify_signal() will be called on such tasks to
interrupt the syscall so that the task can be transitioned. This
interrupts guest execution, but when xfer_to_guest_mode_work() sees that
TIF_NOTIFY_SIGNAL is set but not TIF_SIGPENDING it concludes that an
exit to user mode is unnecessary, and guest execution is resumed without
transitioning the task for the livepatch.

This handling of TIF_NOTIFY_SIGNAL is incorrect, as set_notify_signal()
is expected to break tasks out of interruptible kernel loops and cause
them to return to userspace. Change xfer_to_guest_mode_work() to handle
TIF_NOTIFY_SIGNAL the same as TIF_SIGPENDING, signaling to the vCPU run
loop that an exit to userpsace is needed. Any pending task_work will be
run when get_signal() is called from exit_to_user_mode_loop(), so there
is no longer any need to run task work from xfer_to_guest_mode_work().

Suggested-by: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Petr Mladek <pmladek@suse.com>
Signed-off-by: Seth Forshee <sforshee@digitalocean.com>
Message-Id: <20220504180840.2907296-1-sforshee@digitalocean.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-07 11:19:00 -04:00
Documentation Documentation: kvm: reorder ARM-specific section about KVM_SYSTEM_EVENT_SUSPEND 2022-05-25 05:15:43 -04:00
LICENSES LICENSES/LGPL-2.1: Add LGPL-2.1-or-later as valid identifiers 2021-12-16 14:33:10 +01:00
arch KVM: x86: Fix the intel_pt PMI handling wrongly considered from guest 2022-05-25 05:18:27 -04:00
block Revert "block: release rq qos structures for queue without disk" 2022-05-02 10:06:40 -06:00
certs Kbuild updates for v5.18 2022-03-31 11:59:03 -07:00
crypto for-5.18/64bit-pi-2022-03-25 2022-03-26 12:01:35 -07:00
drivers s390/uv_uapi: depend on CONFIG_S390 2022-05-25 05:11:36 -04:00
fs gfs2 fixes 2022-05-13 14:32:53 -07:00
include KVM/riscv changes for 5.19 2022-05-25 05:09:49 -04:00
init Kconfig: Add option for asm goto w/ tied outputs to workaround clang-13 bug 2022-04-13 13:37:47 -04:00
ipc fs: allocate inode by using alloc_inode_sb() 2022-03-22 15:57:03 -07:00
kernel entry/kvm: Exit to user mode when TIF_NOTIFY_SIGNAL is set 2022-06-07 11:19:00 -04:00
lib dim: initialize all struct fields 2022-05-09 17:20:37 -07:00
mm hotfixes for 5.18-rc7 2022-05-13 10:22:37 -07:00
net NFS client bugfixes for Linux 5.18 2022-05-13 11:04:37 -07:00
samples sched/tracing: Append prev_state to tp args instead 2022-05-12 00:37:11 +02:00
scripts Merge branch kvm-arm64/hyp-stack-guard into kvmarm-master/next 2022-05-04 09:42:37 +01:00
security hardening updates for v5.18-rc1-fix1 2022-03-31 11:43:01 -07:00
sound ASoC: Fixes for v5.18 2022-05-08 10:49:25 +02:00
tools KVM: selftests: x86: Sync the new name of the test case to .gitignore 2022-05-25 05:15:48 -04:00
usr Kbuild updates for v5.18 2022-03-31 11:59:03 -07:00
virt KVM: Don't null dereference ops->destroy 2022-06-07 11:18:59 -04:00
.clang-format genirq/msi: Make interrupt allocation less convoluted 2021-12-16 22:22:20 +01:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap hotfixes for 5.18-rc7 2022-05-13 10:22:37 -07:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: replace a Microchip AT91 maintainer 2022-02-09 11:30:01 +01:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS KVM: s390: Fix and feature for 5.19 2022-05-25 05:11:21 -04:00
Makefile Linux 5.18-rc7 2022-05-15 18:08:58 -07:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.