Messages in this thread | | | Date | Thu, 30 Dec 2021 11:53:39 +0100 | From | Borislav Petkov <> | Subject | Re: [PATCH 04/26] x86/traps: Add #VE support for TDX guest |
| |
On Thu, Dec 30, 2021 at 11:05:00AM +0300, Kirill A. Shutemov wrote: > Hm. Two sentance above the one you quoted describes (maybe badly? I donno) > why #VE doesn't happen in entry paths. Maybe it's not clear it covers NMI > entry path too. > > What if I replace the paragraph with these two: > > Kernel avoids #VEs during syscall gap and NMI entry code.
because? Explain why here.
> Entry code > paths do not access TD-shared memory, MMIO regions, use #VE triggering > MSRs, instructions, or CPUID leaves that might generate #VE. Similarly, > to page faults and breakpoints, #VEs are allowed in NMI handlers once > kernel is ready to deal with nested NMIs. > > During #VE delivery, all interrupts, including NMIs, are blocked until > TDGETVEINFO is called. It prevents #VE nesting until kernel reads the VE > info.
This alludes somewhat to the why above.
Now, I hear that TDX doesn't generate #VE anymore for the case where the HV might have unmapped/made non-private the page which contains the NMI entry code.
Explain that here too pls.
And then stick that text over exc_virtualization_exception() so that it is clear what's going on and that it can be easily found.
And then you still need to deal with
"(and should eventually be a panic, as it is expected panic_on_oops is set to 1 for TDX guests)."
You can say what is expected to be done by the TDX guest owner in some how-to doc but if those expectations are not met, then the guest should simply die. Not we expect this and hope that users will do it, but actually enforce it.
> Commit message already has this: > > Add basic infrastructure to handle any #VE which occurs in the kernel > or userspace. Later patches will add handling for specific #VE > scenarios. > > I'm not sure what need to be changed.
That:
+ * Return True on success and False on failure. + */ +static bool tdx_virt_exception_user(struct pt_regs *regs, struct ve_info *ve) +{ + pr_warn("Unexpected #VE: %lld\n", ve->exit_reason); + return false;
Kill the wrong comment.
-- Regards/Gruss, Boris.
https://people.kernel.org/tglx/notes-about-netiquette
| |