mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-20 22:25:23 +00:00
x86/tdx: Fix early #VE handling
tdx_early_handle_ve() does not increment RIP after successfully
handling the exception. That leads to infinite loop of exceptions.
Move RIP when exceptions are successfully handled.
[ dhansen: make problem statement more clear ]
Fixes: 32e72854fa
("x86/tdx: Port I/O: Add early boot support")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://lkml.kernel.org/r/20220614120135.14812-2-kirill.shutemov@linux.intel.com
This commit is contained in:
parent
e32683c6f7
commit
60428d8bc2
1 changed files with 5 additions and 1 deletions
|
@ -447,13 +447,17 @@ static bool handle_io(struct pt_regs *regs, u32 exit_qual)
|
||||||
__init bool tdx_early_handle_ve(struct pt_regs *regs)
|
__init bool tdx_early_handle_ve(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
struct ve_info ve;
|
struct ve_info ve;
|
||||||
|
bool ret;
|
||||||
|
|
||||||
tdx_get_ve_info(&ve);
|
tdx_get_ve_info(&ve);
|
||||||
|
|
||||||
if (ve.exit_reason != EXIT_REASON_IO_INSTRUCTION)
|
if (ve.exit_reason != EXIT_REASON_IO_INSTRUCTION)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return handle_io(regs, ve.exit_qual);
|
ret = handle_io(regs, ve.exit_qual);
|
||||||
|
if (ret)
|
||||||
|
regs->ip += ve.instr_len;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tdx_get_ve_info(struct ve_info *ve)
|
void tdx_get_ve_info(struct ve_info *ve)
|
||||||
|
|
Loading…
Add table
Reference in a new issue