~hectorcao/+git/linux-tdx:noble-6.8

Last commit made on 2024-03-27
Get this branch:
git clone -b noble-6.8 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:
noble-6.8
Repository:
lp:~hectorcao/+git/linux-tdx

Recent commits

d25c96b... 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

21d66b1... by Hector CAO

Config annotations file for TDX

77a857e... by Hector CAO

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

653dcfd... by Hector CAO

Populate debian folder

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

4f62a05... by Chen, Fan

Update release_notes.rst, add known issue

8085405... by Henry Yuan

Release notes for Ubuntu 24.04 kernel v6.8 TDX patches

Introduce TDX patches upstream version, features and usage.

Signed-off-by: Hang Yuan <email address hidden>

b95bd2e... by Isaku Yamahata

KVM: TDX: Don't use NO_RBP_MOD for backward compatibility

Currently NO_RBP_MOD requires fixes to TDVF and the TDX module. As
workaround in transition period, don't use NO_RBP_MOD for now.

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

07cb471... by Isaku Yamahata

x86/virt/tdx: Explicitly save/restore RBP for seamcall_saved_ret()

The currently available version of TDX module that support NO_RBP_MOD
doesn't work with TDH.VP.ENTER(). As workaround, don't set NO_RBP_MOD
and make __seamcall_saved_ret() explicitly save/restore RBP.

TODO: Once the new version of the TDX module, or the corrected behavior of
TDH.VP.ENTER(), is available, drop this patch.

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

3ca0469... by Isaku Yamahata

KVM: TDX: Emulate Xen MTRR disablement

The TDX module doesn't allow VMM to disable CPUID.MTRR
(CPUID[EAX=1].EDX[12]) bit. It forcibly sets the bit to 1(MTRR available)
unconditionally and VMM can't change it. The v6.5 guest kernel doesn't
disable MTRR explicitly. It uses CPUID.MTRR and results in a kernel panic
when setting CR4.CD=1 to disable cache during programming MTRRs.

The guest kernel has Xen MTRR disablement.
  Commit f9626104a5b6 ("x86/mm/mtrr: Generalize runtime disabling of MTRRs")
When MTRR is available and MTRRdefType.enable = 0 as BIOS hand-off state,
the kernel pretends as MTRR isn't available. That is a deviation from SDM
because MTRRdefType.enable = 0 means all memory access is UC according to
the SDM.

Mimic the Xen guest MTRR disablement for the TD guest kernel to boot.

Other workaround is to pass "clearcpuid=mtrr" to the guest kernel command
line.

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

3087b23... by Isaku Yamahata

KVM: X86: Add a capability to configure bus frequency for APIC timer

Add KVM_CAP_X86_BUS_FREQUENCY_CONTROL capability to configure the core
crystal clock (or processor's bus clock) for APIC timer emulation. Allow
KVM_ENABLE_CAPABILITY(KVM_CAP_X86_BUS_FREQUENCY_CONTROL) to set the
frequency. When using this capability, the user space VMM may configure
CPUID[0x15] to advertise the frequency. The guest determine the frequency
based on CPUID[0x15] or other known clock.

TDX virtualizes CPUID[0x15] for the core crystal clock to be 25MHz. The
x86 KVM hardcodes its frequency for APIC timer to be 1GHz. This mismatch
causes the vAPIC timer to fire earlier than the guest expects. [1] The KVM
APIC timer emulation uses hrtimer, whose unit is nanosecond. Make the
parameter configurable for conversion from the TMICT value to nanosecond.

This patch doesn't affect the TSC deadline timer emulation. The TSC
deadline emulation path records its expiring TSC value and calculates the
expiring time in nanoseconds. The APIC timer emulation path calculates the
TSC value from the TMICT register value and uses the TSC deadline timer
path. This patch touches the APIC timer-specific code but doesn't touch
common logic.

[1] https://<email address hidden>/
Reported-by: Vishal Annapurve <email address hidden>
Signed-off-by: Isaku Yamahata <email address hidden>