linux-stable/arch/x86
Kirill A. Shutemov 70a81f99e4 x86/insn-eval: Introduce insn_decode_mmio()
In preparation for sharing MMIO instruction decode between SEV-ES and
TDX, factor out the common decode into a new insn_decode_mmio() helper.

For regular virtual machine, MMIO is handled by the VMM and KVM
emulates instructions that caused MMIO. But, this model doesn't work
for a secure VMs (like SEV or TDX) as VMM doesn't have access to the
guest memory and register state. So, for TDX or SEV VMM needs
assistance in handling MMIO. It induces exception in the guest. Guest
has to decode the instruction and handle it on its own.

The code is based on the current SEV MMIO implementation.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Tested-by: Joerg Roedel <jroedel@suse.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lkml.kernel.org/r/20211130184933.31005-4-kirill.shutemov@linux.intel.com
2021-11-30 14:53:19 -08:00
..
boot - Do not #GP on userspace use of CLI/STI but pretend it was a NOP to 2021-11-02 07:56:47 -07:00
configs configs: remove the obsolete CONFIG_INPUT_POLLDEV 2021-09-08 11:50:28 -07:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2021-11-01 21:24:02 -07:00
entry signal: Replace force_fatal_sig with force_exit_sig when in doubt 2021-11-19 09:15:58 -06:00
events x86/perf: Fix snapshot_branch_stack warning in VM 2021-11-17 14:48:43 +01:00
hyperv x86/hyperv: Move required MSRs check to initial platform probing 2021-11-15 12:37:08 +00:00
ia32 audit/stable-5.16 PR 20211101 2021-11-01 21:17:39 -07:00
include x86/insn-eval: Introduce insn_decode_mmio() 2021-11-30 14:53:19 -08:00
kernel x86/boot: Mark prepare_command_line() __init 2021-11-24 12:20:24 +01:00
kvm KVM: x86: Cap KVM_CAP_NR_VCPUS by KVM_CAP_MAX_VCPUS 2021-11-18 02:12:15 -05:00
lib x86/insn-eval: Introduce insn_decode_mmio() 2021-11-30 14:53:19 -08:00
math-emu x86/math-emu: Convert to fpstate 2021-10-20 23:57:54 +02:00
mm Merge branch 'kvm-guest-sev-migration' into kvm-master 2021-11-11 07:40:26 -05:00
net Core: 2021-11-02 06:20:58 -07:00
pci xen: branch for v5.16-rc1 2021-11-10 11:14:21 -08:00
platform Add an interface called cc_platform_has() which is supposed to be used 2021-11-01 15:16:52 -07:00
power x86/fpu: Replace the includes of fpu/internal.h 2021-10-20 15:27:29 +02:00
purgatory
ras
realmode x86/sev: Replace occurrences of sev_es_active() with cc_platform_has() 2021-10-04 11:47:09 +02:00
tools Driver core changes for 5.16-rc1 2021-11-04 08:32:38 -07:00
um um: fix stub location calculation 2021-08-26 22:28:03 +02:00
video
xen x86/smp: Factor out parts of native_smp_prepare_cpus() 2021-11-11 13:09:32 +01:00
.gitignore
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig ftrace/samples: add missing Kconfig option for ftrace direct multi sample 2021-11-18 17:50:54 +01:00
Kconfig.assembler
Kconfig.cpu x86/CPU: Add support for Vortex CPUs 2021-10-21 15:49:07 +02:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile Kbuild updates for v5.16 2021-11-08 09:15:45 -08:00
Makefile.um
Makefile_32.cpu x86/build: Do not add -falign flags unconditionally for clang 2021-09-19 10:35:53 +09:00