[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 15/40] i386/tdx: Add property sept-ve-disable for tdx-gues
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH v1 15/40] i386/tdx: Add property sept-ve-disable for tdx-guest object |
Date: |
Fri, 26 Aug 2022 07:57:11 +0200 |
Hi,
> For TD guest kernel, it has its own reason to turn SEPT_VE on or off. E.g.,
> linux TD guest requires SEPT_VE to be disabled to avoid #VE on syscall gap
> [1].
Why is that a problem for a TD guest kernel? Installing exception
handlers is done quite early in the boot process, certainly before any
userspace code runs. So I think we should never see a syscall without
a #VE handler being installed. /me is confused.
Or do you want tell me linux has no #VE handler?
> Frankly speaking, this bit is better to be configured by TD guest
> kernel, however current TDX architecture makes the design to let VMM
> configure.
Indeed. Requiring users to know guest kernel capabilities and manually
configuring the vmm accordingly looks fragile to me.
Even better would be to not have that bit in the first place and require
TD guests properly handle #VE exceptions.
> This can cause problems with the "system call gap": a malicious
> hypervisor might trigger a #VE for example on the system call entry
> code, and when a user process does a system call it would trigger a
> and SYSCALL relies on the kernel code to switch to the kernel stack,
> this would lead to kernel code running on the ring 3 stack.
Hmm? Exceptions switch to kernel context too ...
take care,
Gerd
- [PATCH v1 12/40] i386/kvm: Move architectural CPUID leaf generation to separate helper, (continued)
- [PATCH v1 12/40] i386/kvm: Move architectural CPUID leaf generation to separate helper, Xiaoyao Li, 2022/08/02
- [PATCH v1 10/40] i386/tdx: Integrate tdx_caps->xfam_fixed0/1 into tdx_cpuid_lookup, Xiaoyao Li, 2022/08/02
- [PATCH v1 11/40] i386/tdx: Integrate tdx_caps->attrs_fixed0/1 to tdx_cpuid_lookup, Xiaoyao Li, 2022/08/02
- [PATCH v1 13/40] KVM: Introduce kvm_arch_pre_create_vcpu(), Xiaoyao Li, 2022/08/02
- [PATCH v1 14/40] i386/tdx: Initialize TDX before creating TD vcpus, Xiaoyao Li, 2022/08/02
- [PATCH v1 15/40] i386/tdx: Add property sept-ve-disable for tdx-guest object, Xiaoyao Li, 2022/08/02
- [PATCH v1 16/40] i386/tdx: Wire CPU features up with attributes of TD guest, Xiaoyao Li, 2022/08/02
- [PATCH v1 17/40] i386/tdx: Validate TD attributes, Xiaoyao Li, 2022/08/02
- [PATCH v1 18/40] i386/tdx: Implement user specified tsc frequency, Xiaoyao Li, 2022/08/02
- [PATCH v1 19/40] i386/tdx: Set kvm_readonly_mem_enabled to false for TDX VM, Xiaoyao Li, 2022/08/02
- [PATCH v1 20/40] i386/tdvf: Introduce function to parse TDVF metadata, Xiaoyao Li, 2022/08/02
- [PATCH v1 22/40] i386/tdx: Skip BIOS shadowing setup, Xiaoyao Li, 2022/08/02