lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv4 10/30] x86/tdx: Handle CPUID via #VE
On 2/24/22 07:56, Kirill A. Shutemov wrote:
> static bool virt_exception_user(struct pt_regs *regs, struct ve_info *ve)
> {
> - pr_warn("Unexpected #VE: %lld\n", ve->exit_reason);
> - return false;
> + switch (ve->exit_reason) {
> + case EXIT_REASON_CPUID:
> + return handle_cpuid(regs);
> + default:
> + pr_warn("Unexpected #VE: %lld\n", ve->exit_reason);
> + return false;
> + }
> }

What does this mean for userspace? What kinds of things are we ceding
to the (untrusted) VMM to supply to userspace?

> /* Handle the kernel #VE */
> @@ -200,6 +235,8 @@ static bool virt_exception_kernel(struct pt_regs *regs, struct ve_info *ve)
> return read_msr(regs);
> case EXIT_REASON_MSR_WRITE:
> return write_msr(regs);
> + case EXIT_REASON_CPUID:
> + return handle_cpuid(regs);
> default:
> pr_warn("Unexpected #VE: %lld\n", ve->exit_reason);
> return false;
What kinds of random CPUID uses in the kernel at runtime need this
handling? Is it really OK that we let the VMM inject arbitrary CPUID
values into random CPUID uses in the kernel... silently?

Is this better than just returning 0's, for instance?

\
 
 \ /
  Last update: 2022-02-24 20:10    [W:0.443 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site