On 4/11/2025 3:42 PM, Ewan Hai wrote:
On 4/11/25 11:22 AM, Zhao Liu wrote:
On Thu, Apr 10, 2025 at 10:07:15PM +0800, Ewan Hai wrote:
Date: Thu, 10 Apr 2025 22:07:15 +0800
From: Ewan Hai
Subject: Re: [PATCH v2] target/i386: Fix model number of Zhaoxin
YongFeng
vCPU template
On 4/10/25 8
On 4/2/2025 7:56 PM, Daniel P. Berrangé wrote:
On Tue, Apr 01, 2025 at 09:01:24AM -0400, Xiaoyao Li wrote:
TDX advertises core crystal clock with cpuid[0x15] as 25MHz for TD
guests and it's unchangeable from VMM. As a result, TDX guest reads
the APIC timer as the same frequency, 25MHz.
On 4/7/2025 3:49 PM, Chenyi Qiang wrote:
Modify memory_region_set_ram_discard_manager() to return false if a
RamDiscardManager is already set in the MemoryRegion.
It doesn't return false, but -EBUSY.
The caller must
handle this failure, such as having virtio-mem undo its actions and fail
the
On 4/2/2025 6:41 PM, Daniel P. Berrangé wrote:
On Tue, Apr 01, 2025 at 09:01:48AM -0400, Xiaoyao Li wrote:
KVM mandates kernel_irqchip to be split mode.
Set it to split mode automatically when users don't provide an explicit
value, otherwise check it to be the split mode.
Suggested-by: D
On 4/2/2025 7:41 PM, Daniel P. Berrangé wrote:
On Tue, Apr 01, 2025 at 09:01:18AM -0400, Xiaoyao Li wrote:
Invoke KVM_TDX_INIT_VM in kvm_arch_pre_create_vcpu() that
KVM_TDX_INIT_VM configures global TD configurations, e.g. the canonical
CPUID config, and must be executed prior to creating vCPUs
On 4/2/2025 6:50 PM, Daniel P. Berrangé wrote:
CC libvirt / Jiri, for confirmation about whether the CPUID restrictions
listed below will have any possible impact on libvirt CPUID handling...
On Tue, Apr 01, 2025 at 09:02:05AM -0400, Xiaoyao Li wrote:
Add docs/system/i386/tdx.rst for TDX
On 4/2/2025 8:08 PM, Daniel P. Berrangé wrote:
On Tue, Apr 01, 2025 at 09:01:27AM -0400, Xiaoyao Li wrote:
From: Isaku Yamahata
TDX VM needs to boot with its specialized firmware, Trusted Domain
Virtual Firmware (TDVF). QEMU needs to parse TDVF and map it in TD
guest memory prior to running
On 4/2/2025 7:47 PM, Daniel P. Berrangé wrote:
On Tue, Apr 01, 2025 at 09:01:22AM -0400, Xiaoyao Li wrote:
Validate TD attributes with tdx_caps that only supported bits are
allowed by KVM.
Besides, sanity check the attribute bits that have not been supported by
QEMU yet. e.g., debug bit, it
On 4/2/2025 6:50 PM, Daniel P. Berrangé wrote:
CC libvirt / Jiri, for confirmation about whether the CPUID restrictions
listed below will have any possible impact on libvirt CPUID handling...
On Tue, Apr 01, 2025 at 09:02:05AM -0400, Xiaoyao Li wrote:
Add docs/system/i386/tdx.rst for TDX
On 4/2/2025 7:51 PM, Daniel P. Berrangé wrote:
On Tue, Apr 01, 2025 at 09:01:23AM -0400, Xiaoyao Li wrote:
From: Isaku Yamahata
Three sha384 hash values, mrconfigid, mrowner and mrownerconfig, of a TD
can be provided for TDX attestation. Detailed meaning of them can be
found:
https
On 4/3/2025 4:10 PM, Daniel P. Berrangé wrote:
On Thu, Apr 03, 2025 at 03:28:43PM +0800, Xiaoyao Li wrote:
On 4/2/2025 11:49 PM, Daniel P. Berrangé wrote:
On Wed, Apr 02, 2025 at 11:26:11PM +0800, Xiaoyao Li wrote:
I guess the raw mode was introduced due to the design was changed to let
On 3/27/2025 8:27 PM, Steven Sistare wrote:
On 3/26/2025 5:34 PM, Michael Roth wrote:
On Wed, Mar 26, 2025 at 05:13:50PM -0300, Fabiano Rosas wrote:
Michael Roth writes:
Quoting Tom Lendacky (2025-03-26 14:21:31)
On 3/26/25 13:46, Tom Lendacky wrote:
On 3/7/25 12:15, Fabiano Rosas wrote:
On 4/2/2025 11:49 PM, Daniel P. Berrangé wrote:
On Wed, Apr 02, 2025 at 11:26:11PM +0800, Xiaoyao Li wrote:
Sorry for the late response.
KVM part of TDX attestation support is submitting again. QEMU part will
follow and we need to settle dowm this topic before QEMU patches submission.
On 10/4
ITIES, QEMU chooses to try starting with a known number
and abort when it exceeds KVM_MAX_CPUID_ENTRIES.
Besides, introduce the interfaces to invoke TDX "ioctls" at VCPU scope
in preparation.
Signed-off-by: Xiaoyao Li
---
Changes in v7:
- refine and unifiy the error handling; (Daniel)
TDX only supports readonly for shared memory but not for private memory.
In the view of QEMU, it has no idea whether a memslot is used as shared
memory of private. Thus just mark kvm_readonly_mem_enabled to false to
TDX VM for simplicity.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
Add docs/system/i386/tdx.rst for TDX support, and add tdx in
confidential-guest-support.rst
Signed-off-by: Xiaoyao Li
---
Changes in v6:
- Add more information of "Feature configuration"
- Mark TD Attestation as future work because KVM now drops the support
of it.
Changes in v5:
From: Isaku Yamahata
TSC of TDs is not accessible and KVM doesn't allow access of
MSR_IA32_TSC for TDs. To avoid the assert() in kvm_get_tsc, make
kvm_synchronize_all_tsc() noop for TDs,
Signed-off-by: Isaku Yamahata
Reviewed-by: Connor Kuehl
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hof
se it needs to be located at private memory.
Also store the MemoryRegion pointer of TDVF since the shared ramblock of
it can be discared after it gets copied to private ramblock.
Signed-off-by: Chao Peng
Co-developed-by: Xiaoyao Li
Signed-off-by: Xiaoyao Li
---
hw/i386/x86-common.c
Pull in recent TDX updates, which are not backwards compatible.
It's just to make this series runnable. It will be updated by script
scripts/update-linux-headers.sh
once TDX support is upstreamed in linux kernel
Signed-off-by: Xiaoyao Li
---
linux-headers/asm-x86/kvm.h
QEMU calls kvm_arch_put_registers() when vcpu_dirty is true in
kvm_vcpu_exec(). However, for confidential guest, like TDX, putting
registers is disallowed due to guest state is protected.
Only set vcpu_dirty to true with guest state is not protected when
creating the vcpu.
Signed-off-by: Xiaoyao
Sorry for the late response.
KVM part of TDX attestation support is submitting again. QEMU part will
follow and we need to settle dowm this topic before QEMU patches submission.
On 10/4/2024 2:08 AM, Daniel P. Berrangé wrote:
On Thu, Feb 29, 2024 at 01:37:10AM -0500, Xiaoyao Li wrote:
From
On 4/2/2025 7:00 PM, Daniel P. Berrangé wrote:
On Tue, Apr 01, 2025 at 09:01:15AM -0400, Xiaoyao Li wrote:
KVM provides TDX capabilities via sub command KVM_TDX_CAPABILITIES of
IOCTL(KVM_MEMORY_ENCRYPT_OP). Get the capabilities when initializing
TDX context. It will be used to validate user
TD guest can use TDG.VP.VMCALL to request
termination. KVM translates such request into KVM_EXIT_SYSTEM_EVENT with
type of KVM_SYSTEM_EVENT_TDX_FATAL.
Add hanlder for such exit. Parse and print the error message, and
terminate the TD guest in the handler.
Signed-off-by: Xiaoyao Li
---
Changes
tdx_supported_cpuid. Besides, set all the fixed1
bits to the initial set of KVM's support since KVM might not report them
as supported.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.h | 2 +
target/i386/kvm/kvm_i386.h | 7 ++
target/i386/kvm/tdx.c
For TDX, only limited KVM PV features are supported.
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/tdx.c | 20
1 file changed, 20 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index e07cd9a1ee15..7382b53fcc51 100644
--- a/target/i386/kvm/tdx.c
TDX doesn't support SMM and VMM cannot emulate SMM for TDX VMs because
VMM cannot manipulate TDX VM's memory.
Disable SMM for TDX VMs and error out if user requests to enable SMM.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
target/i386/kvm/tdx.c | 9 +
1 file
existing
configuration interfaces of 'cpu' for TD's attributes.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
target/i386/kvm/tdx.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 592fb9cbbf0b..1202b2111ba8 1
ON
i386/tdx: Don't synchronize guest tsc for TDs
Xiaoyao Li (49):
*** HACK *** linux-headers: Update headers to pull in TDX API changes
i386: Introduce tdx-guest object
i386/tdx: Implement tdx_kvm_type() for TDX
i386/tdx: Implement tdx_kvm_init() to initialize TDX VM context
i386/
To allow execute confidential guest specific cpu init operations.
Signed-off-by: Xiaoyao Li
---
Changes in v6:
- new patch;
---
target/i386/confidential-guest.h | 11 +++
target/i386/cpu.c| 10 ++
2 files changed, 21 insertions(+)
diff --git a/target/i386
Implement TDX specific ConfidentialGuestSupportClass::kvm_init()
callback, tdx_kvm_init().
Mark guest state is proctected for TDX VM. More TDX specific
initialization will be added later.
Signed-off-by: Xiaoyao Li
---
Changes in v6:
- remove Acked-by from Gerd since the patch changed due to
that QEMU may change the CPUID
configuration when creating vCPUs, i.e. punts on refactoring QEMU to
provide a stable CPUID config prior to kvm_arch_init().
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
Acked-by: Markus Armbruster
---
Changes in v8:
- Drop the code that initializes cpu->k
KVM mandates kernel_irqchip to be split mode.
Set it to split mode automatically when users don't provide an explicit
value, otherwise check it to be the split mode.
Suggested-by: Daniel P. Berrangé
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/tdx.c | 8
1 file changed, 8 inser
Reuse "-cpu,tsc-frequency=" to get user wanted tsc frequency and call VM
scope VM_SET_TSC_KHZ to set the tsc frequency of TD before KVM_TDX_INIT_VM.
Besides, sanity check the tsc frequency to be in the legal range and
legal granularity (required by TDX module).
Signed-off-by: Xiaoyao
=ASNFZ4mrze8BI0VniavN7wEjRWeJq83vASNFZ4mrze8BI0VniavN7wEjRWeJq83v
Signed-off-by: Isaku Yamahata
Co-developed-by: Xiaoyao Li
Signed-off-by: Xiaoyao Li
---
Changes in v8:
- it gets squashed into previous patch in v7. So split it out in v8;
Changes in v6:
- refine the doc comment of QAPI properties;
Changes in v5
KVM translates TDG.VP.VMCALL to KVM_HC_MAP_GPA_RANGE, and QEMU
needs to enable user exit on KVM_HC_MAP_GPA_RANGE in order to handle the
memory conversion requested by TD guest.
Signed-off-by: Xiaoyao Li
---
changes in v6:
- new patch;
---
target/i386/kvm/tdx.c | 7 +++
1 file changed, 7
e the CPUID bits related to QEMU's feature word.
Only mask the CPUID leafs which are feature word leaf.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.c | 18 ++
target/i386/cpu.h | 1 +
target/i386/kvm/kvm.c | 2 +-
target/i386/kvm/kvm_i386.h | 1 +
t
d-off-by: Isaku Yamahata
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
Changes in v7:
- use SPDX tag for license info;
- clean up the included headers;
Changes in v1:
- drop the code of adding mmio resources
Integrate TDX's TDX_REPORT_FATAL_ERROR into QEMU GuestPanic facility
Originated-from: Isaku Yamahata
Signed-off-by: Xiaoyao Li
Acked-by: Markus Armbruster
---
Changes in v8:
- use g_strdup() for copy string;
- use the new data ABI of KVM_SYSTEM_EVENT_TDX_FATAL to grab gpa info;
Changes
.
Besides, incorporate the supported_xfam into the supported CPUID leaf of
0xD.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.c | 12 ---
target/i386/cpu.h | 16 ++
target/i386/kvm/tdx.c | 73 +++
3 files changed, 89 insertions(+), 12
onfidential guest through
guest_state_protected.
[*] https://lore.kernel.org/all/z3w4ku4jq0crt...@google.com/
Signed-off-by: Xiaoyao Li
---
Changes in v8:
- Fix the coding style; (Francesco)
---
hw/i386/kvm/apic.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw/i386/kvm/apic.c b/hw/i386
Invoke KVM_TDX_FINALIZE_VM to finalize the TD's measurement and make
the TD vCPUs runnable once machine initialization is complete.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
target/i386/kvm/tdx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/t
To do cgs specific feature checking. Note the feature checking in
x86_cpu_filter_features() is valid for non-cgs VMs. For cgs VMs like
TDX, what features can be supported has more restrictions.
Signed-off-by: Xiaoyao Li
---
target/i386/confidential-guest.h | 13 +
target/i386/kvm
For TDs, only MSR_IA32_UCODE_REV in kvm_init_msrs() can be configured
by VMM, while the features enumerated/controlled by other MSRs except
MSR_IA32_UCODE_REV in kvm_init_msrs() are not under control of VMM.
Only configure MSR_IA32_UCODE_REV for TDs.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd
Because it's fixed1 bit that enforced by TDX module.
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/tdx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index cd8e96d476b8..8f075ba5a4de 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i38
Just mark XFD as always supported for TDX. This simple solution relies
on the fact KVM will report XFD as 0 when it's not supported by the
hardware.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.h | 1 +
target/i386/kvm/tdx.c | 5 +
2 files changed, 6 insertions(+)
diff --git a/t
TDX uses CPUID 0x1f to configure TD guest's CPU topology. So set
enable_cpuid_0x1f for TDs.
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/tdx.c | 4
1 file changed, 4 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 49e748af3949..b0616eb3d371 100644
Because for TDX case, there are also fixed-1 bits that enfored by TDX
module.
Signed-off-by: Xiaoyao Li
---
target/i386/confidential-guest.h | 20 ++--
target/i386/kvm/kvm.c| 2 +-
target/i386/sev.c| 4 ++--
3 files changed, 13 insertions(+), 13
s enforced
enabled.
- If cpu->enforced_cpuid is not set, prints the warning message of both
1) and 2) and tweak QEMU's configuration.
- If cpu->enforced_cpuid is set, quit if any case of 1) or 2).
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.c | 33 ++-
targe
TDX vcpu needs to be initialized by SEAMCALL(TDH.VP.INIT) and KVM
provides vcpu level IOCTL KVM_TDX_INIT_VCPU for it.
KVM_TDX_INIT_VCPU needs the address of the HOB as input. Invoke it for
each vcpu after HOB list is created.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
target/i386
For TDX guest, the phys_bits is not configurable and can only be
host/native value.
Validate phys_bits inside tdx_check_features().
Signed-off-by: Xiaoyao Li
---
target/i386/host-cpu.c | 2 +-
target/i386/host-cpu.h | 1 +
target/i386/kvm/tdx.c | 8
3 files changed, 10 insertions
It will need special handling for TDX VMs all around the QEMU.
Introduce is_tdx_vm() helper to query if it's a TDX VM.
Cache tdx_guest object thus no need to cast from ms->cgs every time.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
Reviewed-by: Isaku Yamahata
---
chang
After TDVF is loaded to bios MemoryRegion, it needs parse TDVF metadata.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
hw/i386/pc_sysfw.c | 7 +++
target/i386/kvm/tdx-stub.c | 5 +
target/i386/kvm/tdx.c | 5 +
target/i386/kvm/tdx.h | 3 +++
4 files changed
TDX VM requires VM type to be KVM_X86_TDX_VM. Implement tdx_kvm_type()
as X86ConfidentialGuestClass->kvm_type.
Signed-off-by: Xiaoyao Li
---
Changes in v6:
- new added patch;
---
target/i386/kvm/kvm.c | 1 +
target/i386/kvm/tdx.c | 12
2 files changed, 13 insertions(+)
d
s and error out if user wants PIC.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
target/i386/kvm/tdx.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 0eefd058f7a2..0d30506c2021 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i38
After populating the TDVF memory, the original image located in shared
ramblock can be discarded.
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
Changes in v6:
- switch back to use KVM_TDX_INIT_MEM_REGION according to KVM's change;
---
target/i386/kvm/
From: Isaku Yamahata
For TDX KVM use case, Linux guest is the most major one. It requires
sept_ve_disable set. Make it default for the main use case. For other use
case, it can be enabled/disabled via qemu command line.
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
target
Signed-off-by: Xiaoyao Li
---
Changes in v7:
- fix CPUID_EXT2_SYSCALL by adding it to actual;
---
target/i386/kvm/tdx.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 58797470ba7e..cd8e96d476b8 100644
--- a/target/i386/kvm
est.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.c | 4 ++--
target/i386/cpu.h | 9 +
target/i386/kvm/kvm.c | 2 +-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 5c69d1489365..f219961b62cd 100644
--- a/target/i386/cpu.c
++
Introduce kvm_arch_pre_create_vcpu(), to perform arch-dependent
work prior to create any vcpu. This is for i386 TDX because it needs
call TDX_INIT_VM before creating any vcpu.
The specific implemnet of i386 will be added in the future patch.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
For TDX, some CPUID feature bit is configured via TD attributes. They
are not covered by tdx_caps.cpuid (which only contians the configurable
bits), but they are actually supported when the related attributre bit
is supported.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.h | 4 +++
target
KVM with TDX support starts to report different KVM_CAP_MAX_VCPUS per
different VM types. So switch to check the KVM_CAP_MAX_VCPUS at vm level.
KVM still returns the global KVM_CAP_MAX_VCPUS when the KVM is old that
doesn't report different value at vm level.
Signed-off-by: Xiaoy
;ed before TD runs and no need to be accepted runtime.
The TdxRamEntries[] are later used to setup the memory TD resource HOB
that passes memory info from QEMU to TDVF.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
Changes in v3:
- use enum TdxRamType in struct TdxRamEntry; (Isaku)
Currently, pmu is not supported for TDX by KVM.
Signed-off-by: Xiaoyao Li
---
chanegs in v6:
- new patch;
---
target/i386/kvm/tdx.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 282cdbd775c5..49e748af3949 100644
--- a/target/i386
do the stuff.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
Changes in v8:
- Remove the duplicated header include;
- Add error handling for qemu_ram_mmap() failure;
---
hw/i386/tdvf.c | 1 +
include/hw/i386/tdvf.h | 7 +++
target/i386/kvm/tdx.c | 37
offset of TDX metadata to the end
of firmware file.
Select X86_FW_OVMF when TDX is enable to leverage existing functions
to parse and search OVMF's GUID-ed structures.
Signed-off-by: Isaku Yamahata
Co-developed-by: Xiaoyao Li
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
Changes
For TDX, the address below 1MB are entirely general RAM. No need to
initialize pc.rom memory region for TDs.
Signed-off-by: Xiaoyao Li
---
This is more as a workaround of the issue that for q35 machine type, the
real memslot update (which requires memslot deletion )for pc.rom happens
after
ibutes directly.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
Acked-by: Markus Armbruster
---
Changes in v7:
- update QAPI version to 10.0;
- update to use SPDX tags for license info;
- update copyright to 2025;
Chanegs in v6:
- Make tdx-guest inherits X86_CONFIDENTIAL_GU
.pdf
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
Changes in v7:
- use SPDX tag;
---
include/standard-headers/uefi/uefi.h | 187 +++
1 file changed, 187 insertions(+)
create mode 100644 include/standard-headers/uefi/uefi.h
diff --git a/include/standard-headers
licitly to ensure KVM provide correct
emulated APIC timer for TD guest.
Signed-off-by: Xiaoyao Li
---
Changes in v6:
- new patch;
---
target/i386/kvm/tdx.c | 13 +
target/i386/kvm/tdx.h | 3 +++
2 files changed, 16 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/t
configure
this bit.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
Acked-by: Markus Armbruster
---
Changes in v4:
- collect Acked-by from Markus
Changes in v3:
- update the comment of property @sept-ve-disable to make it more
descriptive and use new format. (Daniel and Markus)
---
qapi
Validate TD attributes with tdx_caps that only supported bits are
allowed by KVM.
Besides, sanity check the attribute bits that have not been supported by
QEMU yet. e.g., debug bit, it will be allowed in the future when debug
TD support lands in QEMU.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd
On 3/26/2025 11:36 AM, Xiaoyao Li wrote:
On 3/26/2025 2:46 AM, Daniel P. Berrangé wrote:
On Fri, Jan 24, 2025 at 08:20:48AM -0500, Xiaoyao Li wrote:
Add docs/system/i386/tdx.rst for TDX support, and add tdx in
confidential-guest-support.rst
Signed-off-by: Xiaoyao Li
---
---
docs/system
On 3/26/2025 2:46 AM, Daniel P. Berrangé wrote:
On Fri, Jan 24, 2025 at 08:20:48AM -0500, Xiaoyao Li wrote:
Add docs/system/i386/tdx.rst for TDX support, and add tdx in
confidential-guest-support.rst
Signed-off-by: Xiaoyao Li
---
---
docs/system/confidential-guest-support.rst | 1
On 3/7/2025 3:52 PM, Zhao Liu wrote:
I didn't know if I would need to wait until this patch is merged into
mainline QEMU. That's why I didn't add my signed-off.
No problem if Xiaoyao is okay with it (copyright of patches need to
honor the original author & signed-off). IMO, if your series is ac
On 3/7/2025 12:22 AM, Zhao Liu wrote:
Hi Xiaoyao,
First, it's not a good practice that values in env->features[] cannot be
directly used for guest CPUID in void cpu_x86_cpuid(), but require further
adjustment there. env->features[] are supposed to be finalized at cpu
realization, so that after
On 3/5/2025 6:53 AM, dongli.zh...@oracle.com wrote:
Hi Xiaoyao,
On 3/4/25 6:40 AM, Xiaoyao Li wrote:
On 3/3/2025 6:00 AM, Dongli Zhang wrote:
When the PERFCORE is disabled with "-cpu host,-perfctr-core", it is
reflected in in guest dmesg.
[ 0.285136] Performance Events: AMD
On 3/5/2025 9:22 AM, Sean Christopherson wrote:
On Tue, Mar 04, 2025, Xiaoyao Li wrote:
On 3/3/2025 6:00 AM, Dongli Zhang wrote:
Although AMD PERFCORE and PerfMonV2 are removed when "-pmu" is configured,
there is no way to fully disable KVM AMD PMU virtualization. Neither
"-cpu
= 0x0
Disable PerfMonV2 in CPUID when PERFCORE is disabled.
Suggested-by: Zhao Liu
Though I have above confusion of the description, the change itself
looks good to me. So
Reviewed-by: Xiaoyao Li
Fixes: 209b0ac12074 ("target/i386: Add PerfMonV2 feature bit")
Signed-off-by: Do
Anyway, since QEMU can achieve its goal with KVM_PMU_CAP_DISABLE with
current KVM, I'm fine with it.
I have one nit below, otherwise
Reviewed-by: Xiaoyao Li
As a result, the following message still appears in the VM dmesg:
[0.263615] Performance Events: AMD PMU driver.
How
On 3/4/2025 2:45 AM, dongli.zh...@oracle.com wrote:
Hi Xiaoyao,
On 3/2/25 5:59 PM, Xiaoyao Li wrote:
On 3/3/2025 6:00 AM, Dongli Zhang wrote:
Currently, AMD PMU support isn't determined based on CPUID, that is, the
"-pmu" option does not fully disable KVM AMD PMU virtualizatio
There is one entry relates to CPUID_EXT_PDCM in feature_dependencies[].
So it needs to get correct value of CPUID_EXT_PDCM before using
feature_dependencies[] to apply dependencies.
Besides, it also ensures CPUID_EXT_PDCM value is tracked in
env->features[FEAT_1_ECX].
Signed-off-by: Xiaoyao
they request pdcm
explicitly while PMU disabled.
Xiaoyao Li (2):
i386/cpu: Move adjustment of CPUID_EXT_PDCM before
feature_dependencies[] check
i386/cpu: Warn about why CPUID_EXT_PDCM is not available
target/i386/cpu.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
--
2.34.1
When user requests PDCM explicitly via "+pdcm" without PMU enabled, emit
a warning to inform the user.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 2bf6495140a0..2aa2bab12100 10
On 2/28/2025 12:57 AM, Francesco Lavra wrote:
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote:
KVM neithers allow writing to MSR_IA32_APICBASE for TDs, nor allow
for
KVM_SET_LAPIC[*].
Note, KVM_GET_LAPIC is also disallowed for TDX. It is called in the
path
do_kvm_cpu_synchronize_state
On 2/28/2025 12:30 AM, Francesco Lavra wrote:
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote:
diff --git a/system/runstate.c b/system/runstate.c
index 272801d30769..c4244c8915c6 100644
--- a/system/runstate.c
+++ b/system/runstate.c
@@ -565,6 +565,60 @@ static void qemu_system_wakeup(void
On 3/3/2025 6:00 AM, Dongli Zhang wrote:
Currently, AMD PMU support isn't determined based on CPUID, that is, the
"-pmu" option does not fully disable KVM AMD PMU virtualization.
To minimize AMD PMU features, remove PERFCORE when "-pmu" is configured.
To completely disable AMD PMU virtualizatio
the future, check and honor the maximum value for EAX[14:25] as
well.
In addition, for host-cache-info case, also apply the same checks and
fixes.
Signed-off-by: Qian Wen
Signed-off-by: Zhao Liu
Reviewed-by: Xiaoyao Li
---
Changes since original v4 [*]:
* Rebase on addressable ID fixup
sue caused by overflow, limit the max value written to
EBX[23:16] to 255 as the HW does.
Cc: qemu-sta...@nongnu.org
Signed-off-by: Qian Wen
Signed-off-by: Zhao Liu
Reviewed-by: Xiaoyao Li
---
Changes since original v4 [*]:
* Rebase on addressable ID fixup.
* Drop R/b tags since the c
On 2/19/2025 7:26 PM, Francesco Lavra wrote:
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote:
+static void tdx_finalize_vm(Notifier *notifier, void *unused)
+{
+ TdxFirmware *tdvf = &tdx_guest->tdvf;
+ TdxFirmwareEntry *entry;
+
+ for_each_tdx_fw_entry(tdvf
On 2/20/2025 2:40 AM, Francesco Lavra wrote:
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote:
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 73f90b0a2217..8564b3ae905d 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
@@ -12,10 +12,14 @@
#include "
On 2/19/2025 6:58 PM, Francesco Lavra wrote:
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote:
+int tdvf_parse_metadata(TdxFirmware *fw, void *flash_ptr, int size)
+{
+ g_autofree TdvfSectionEntry *sections = NULL;
+ TdvfMetadata *metadata;
+ ssize_t entries_size;
+ int i
On 2/19/2025 6:14 PM, Francesco Lavra wrote:
On Fri, 2025-01-24 at 08:20 -0500, Xiaoyao Li wrote:
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 45867dbe0839..e35a9fbd687e 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -540,8 +540,15 @@ int kvm_init_vcpu(CPUState
On 2/19/2025 3:21 AM, Francesco Lavra wrote:
On Fri, 24 Jan 2025 08:20:01 -0500, Xiaoyao Li wrote:
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 4ff94860815d..bd212abab865 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
@@ -10,17 +10,122 @@
*/
#include
6_64 -m 512 -nographic -object
sev-snp-guest,reduced-phys-bits=48,id=sev0 \
-M q35,kernel-irqchip=split,confidential-guest-support=sev0
qemu-system-x86_64: ../system/physmem.c:1871: ram_block_add: Assertion
`kvm_enabled()' failed.
Cc: Xiaoyao Li
Cc: qemu-sta...@nongnu.org
Signed-o
On 1/24/2025 9:20 PM, Xiaoyao Li wrote:
Validate TD attributes with tdx_caps that only supported bits arer
allowed by KVM.
Besides, sanity check the attribute bits that have not been supported by
QEMU yet. e.g., debug bit, it will be allowed in the future when debug
TD support lands in QEMU
On 2/5/2025 5:28 PM, Markus Armbruster wrote:
Xiaoyao Li writes:
Use KVM_TDX_GET_CPUID to get the CPUIDs that are managed and enfored
by TDX module for TD guest. Check QEMU's configuration against the
fetched data.
Print wanring message when 1. a feature is not supported but request
On 2/5/2025 5:06 PM, Markus Armbruster wrote:
Xiaoyao Li writes:
Validate TD attributes with tdx_caps that only supported bits arer
allowed by KVM.
Besides, sanity check the attribute bits that have not been supported by
QEMU yet. e.g., debug bit, it will be allowed in the future when debug
On 2/5/2025 5:19 PM, Markus Armbruster wrote:
Xiaoyao Li writes:
Integrate TDX's TDX_REPORT_FATAL_ERROR into QEMU GuestPanic facility
Originated-from: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
Changes in v6:
- change error_code of GuestPanicInformationTdx from uint64_t to
uin
On 2/1/2025 2:27 AM, Paolo Bonzini wrote:
On Fri, Jan 24, 2025 at 2:40 PM Xiaoyao Li wrote:
For TDX guest, the phys_bits is not configurable and can only be
host/native value.
Validate phys_bits inside tdx_check_features().
Hi Xiaoyao,
to avoid
qemu-kvm: TDX requires guest CPU physical
They will be used by TDX.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.c | 3 ---
target/i386/cpu.h | 5 +
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 4088bf63c48f..f1330627adbb 100644
--- a/target/i386/cpu.c
+++ b/target/i386
1 - 100 of 1312 matches
Mail list logo