]> git.baikalelectronics.ru Git - kernel.git/commit
x86/tdx: Clarify RIP adjustments in #VE handler
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tue, 14 Jun 2022 12:01:34 +0000 (15:01 +0300)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 15 Jun 2022 18:05:16 +0000 (11:05 -0700)
commit83b0371b0c6410c58a9820ec7fd6db2bd7fdcd80
treea770af9367b80aba7fce9477b3b48678f1b60d26
parent0482c91e900ee65f10d2134a2b386842124b6542
x86/tdx: Clarify RIP adjustments in #VE handler

After successful #VE handling, tdx_handle_virt_exception() has to move
RIP to the next instruction. The handler needs to know the length of the
instruction.

If the #VE happened due to instruction execution, the GET_VEINFO TDX
module call provides info on the instruction in R10, including its length.

For #VE due to EPT violation, the info in R10 is not populand and the
kernel must decode the instruction manually to find out its length.

Restructure the code to make it explicit that the instruction length
depends on the type of #VE. Make individual #VE handlers return
the instruction length on success or -errno on failure.

[ dhansen: fix up changelog and comments ]

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lkml.kernel.org/r/20220614120135.14812-3-kirill.shutemov@linux.intel.com
arch/x86/coco/tdx/tdx.c