~hectorcao/+git/linux-tdx:master-tdx

Last commit made on 2023-09-26
Get this branch:
git clone -b master-tdx https://git.launchpad.net/~hectorcao/+git/linux-tdx
Only Hector CAO can upload to this branch. If you are Hector CAO please log in for upload directions.

Branch merges

Branch information

Name:
master-tdx
Repository:
lp:~hectorcao/+git/linux-tdx

Recent commits

eff5b13... by Hector CAO

Enable libtraceevent for kernel perf tools

Without libtraceevent, perf kvm stat will not work

969eeb0... by Hector CAO

Do not erase changelog file in ./debian/rules clean

a52a81a... by Hector CAO

Populate debian folder

With fakeroot ./debian/rules clean
That will generate some necessary files for git-build-recipe

8275c36... by Hector CAO

Fix ubsan runtime error

The cpuid_values array is dynamically allocated (declared 0-size array).
This make ubsan raising an runtime error array-index-out-of-bounds:

[ 392.138526] UBSAN: array-index-out-of-bounds in /build/linux-unstable-kzfBPB/linux-unstable-6.5.0/arch/x86/kvm/vmx/tdx.c:2609:59
[ 392.139283] index 1 is out of range for type 'tdx_cpuid_value [*]'

daba577... by Hector CAO

Enable config TDX guest driver

CONFIG_TDX_GUEST_DRIVER should be set to y to enable the tdx-guest and
/dev/tdx-guest char device

15cce61... by Hector CAO

Config annotations file for TDX

742ede9... by "Kirill A. Shutemov" <email address hidden>

x86/tdx: Mark TSC reliable

In x86 virtualization environments, including TDX, RDTSC instruction is
handled without causing a VM exit, resulting in minimal overhead and
jitters. On the other hand, other clock sources (such as HPET, ACPI
timer, APIC, etc.) necessitate VM exits to implement, resulting in more
fluctuating measurements compared to TSC. Thus, those clock sources are
not effective for calibrating TSC.

In TD guests, TSC is virtualized by the TDX module, which ensures:

  - Virtual TSC values are consistent among all the TD’s VCPUs;
  - Monotonously incrementing for any single VCPU;
  - The frequency is determined by TD configuration. The host TSC is
    invariant on platforms where TDX is available.

Reliable TSC is architectural guarantee for the TDX platform and it must
work for any sane TDX implementation.

Use TSC as the only reliable clock source in TD guests, bypassing
unstable calibration.

Signed-off-by: Kirill A. Shutemov <email address hidden>

7577b41... by Tina Zhang <email address hidden>

KVM: TDX: x86: Return success when no error occurs

Initialize ret with 0, otherwise tdx_get_capabilities() will return
garbage when no error occurs.

Fixes: 73c6305c6088 ("KVM: TDX: x86: Add ioctl to get TDX systemwide parameters")

Reported-by: Xiaoyao Li <email address hidden>
Signed-off-by: Tina Zhang <email address hidden>

772bc70... by Isaku Yamahata

bump KVM_EXIT_MEMORY_FAULT to avoid merge conflict

To avoid merge conflict with the upstream, bump KVM_EXIT_MEMORY_FAULT
instead of using the next unused value.
TODO: once the patch is upstreamed, remove this patch and correct
KVM_EXIT_MEMORY_FAULT.

Signed-off-by: Isaku Yamahata <email address hidden>

81d9959... by Isaku Yamahata

KVM: TDX: handle exception when debug attribute is enabled

When debug attribute is enabled, VMM can get exception in TD. KVM_EXIT
with DEBUG reason instead of making it -EFAULT.

Signed-off-by: Isaku Yamahata <email address hidden>