This is the 3rd version of preparing KVM to handle TIF_NOTIFY_RESUME before exiting to guest mode. The first attempt is available here: https://lore.kernel.org/r/20190801143250.370326052@xxxxxxxxxxxxx The second version which tried to provide generic infrastructure for KVM can be found here: https://lore.kernel.org/r/20191023122705.198339581@xxxxxxxxxxxxx This started the whole discussion about entry code correctness which led to the complete overhaul of the x86 entry code, non-instrumentable sections and the other goodies which are in 5.8. The remaining bits are rather straight forward: 1) Move the entry/exit handling from x86 into generic code so other architectures can reuse the already proven to be correct code instead of duplicating the whole maze and creating slightly different beasts again. This utilizes the noinstr sections. The correctness of the confinement of non-instrumentable code can be verified with objtool on architectures which support it. The code code itself is clean. 2) Provide generic work handling functionality for KVM 3) Convert x86 over to use the generic entry/exit code 4) Convert x86/KVM to use the generic work handling functionality. #4 finally paves the way to move POSIX CPU timer heavy lifting out of interrupt context into task work. Several hundred patches after the initial attempt which was small and simple :) The patches depend on: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/entry The lot is also available from git: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/entry The posix timer patches will be posted seperately as they are mostly independent (except for the KVM task work detail). The stub functions for the architecture specific parts which need to be provided by architectures utilizing this are completely documented in the corresponding header file which explains the diffstat. Thanks, tglx ---- arch/Kconfig | 3 arch/x86/Kconfig | 1 arch/x86/entry/common.c | 632 ++---------------------------------- arch/x86/entry/entry_32.S | 2 arch/x86/entry/entry_64.S | 2 arch/x86/include/asm/entry-common.h | 135 +++++++ arch/x86/include/asm/idtentry.h | 39 -- arch/x86/include/asm/ptrace.h | 15 arch/x86/include/asm/signal.h | 1 arch/x86/include/asm/thread_info.h | 5 arch/x86/kernel/cpu/mce/core.c | 4 arch/x86/kernel/kvm.c | 6 arch/x86/kernel/signal.c | 2 arch/x86/kernel/traps.c | 24 - arch/x86/kvm/Kconfig | 1 arch/x86/kvm/vmx/vmx.c | 11 arch/x86/kvm/x86.c | 15 arch/x86/mm/fault.c | 6 include/linux/entry-common.h | 398 ++++++++++++++++++++++ include/linux/entry-kvm.h | 80 ++++ include/linux/kvm_host.h | 8 kernel/Makefile | 1 kernel/entry/Makefile | 4 kernel/entry/common.c | 364 ++++++++++++++++++++ kernel/entry/kvm.c | 51 ++ virt/kvm/Kconfig | 3 26 files changed, 1150 insertions(+), 663 deletions(-)