PAM initialization above SMRAM initialization
q35: Introduce smm_ranges property for q35-pci-host
hw/i386: add option to forcibly report edge trigger in acpi tables
i386/tdx: Don't synchronize guest tsc for TDs
Sean Christopherson (2):
i386/kvm: Move architectural CPUID leaf generati
KVM_FEATURE_ASYNC_PF_VMEXIT has been introduced for years, however QEMU
doesn't support expose it to guest. Add support for it.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
On 10/19/2023 4:26 PM, David Hildenbrand wrote:
On 18.10.23 18:27, Xiaoyao Li wrote:
On 10/18/2023 5:26 PM, David Hildenbrand wrote:
On 18.10.23 11:02, Xiaoyao Li wrote:
On 10/18/2023 3:42 PM, David Hildenbrand wrote:
On 18.10.23 05:02, Xiaoyao Li wrote:
David,
On 7/6/2023 3:56 PM, David
On 10/18/2023 9:27 PM, Michael S. Tsirkin wrote:
On Sat, Oct 07, 2023 at 02:58:19AM -0400, Xiaoyao Li wrote:
pc_machine_kvm_type() was introduced by commit e21be724eaf5 ("i386/xen:
add pc_machine_kvm_type to initialize XEN_EMULATE mode") to do Xen
specific initialization by utilizin
On 10/18/2023 5:26 PM, David Hildenbrand wrote:
On 18.10.23 11:02, Xiaoyao Li wrote:
On 10/18/2023 3:42 PM, David Hildenbrand wrote:
On 18.10.23 05:02, Xiaoyao Li wrote:
David,
On 7/6/2023 3:56 PM, David Hildenbrand wrote:
ram_block_discard_range() cannot possibly do the right thing in
On 10/18/2023 3:42 PM, David Hildenbrand wrote:
On 18.10.23 05:02, Xiaoyao Li wrote:
David,
On 7/6/2023 3:56 PM, David Hildenbrand wrote:
ram_block_discard_range() cannot possibly do the right thing in
MAP_PRIVATE file mappings in the general case.
To achieve the documented semantics, we
David,
On 7/6/2023 3:56 PM, David Hildenbrand wrote:
ram_block_discard_range() cannot possibly do the right thing in
MAP_PRIVATE file mappings in the general case.
To achieve the documented semantics, we also have to punch a hole into
the file, possibly messing with other MAP_PRIVATE/MAP_SHARED
ose CPUID_HT to
guest when "-cpu host/max" with only 1 vcpu. To fix this, need mark
CPUID_HT as the no_autoenable_flags.
Signed-off-by: Xiaoyao Li
---
target/i386/cpu.c | 1 +
target/i386/kvm/kvm.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386
On 10/10/2023 9:02 AM, Tina Zhang wrote:
Hi,
On 8/18/23 17:49, Xiaoyao Li wrote:
According to Chapter "CPUID Virtualization" in TDX module spec, CPUID
bits of TD can be classified into 6 types:
1 | As
On 9/22/2023 3:08 PM, David Hildenbrand wrote:
On 22.09.23 02:22, Xiaoyao Li wrote:
On 9/21/2023 4:55 PM, David Hildenbrand wrote:
On 14.09.23 05:50, Xiaoyao Li wrote:
From: Chao Peng
Add KVM gmem support to RAMBlock so both normal hva based memory
and kvm gmem fd based private memory can
ves the Xen specific initialization to pc_basic_device_init().
There is no need to keep the PC specific kvm_type() implementation
anymore. So we'll fallback to kvm_arch_get_default_type(), which
simply returns 0.
Signed-off-by: Xiaoyao Li
Reviewed-by: Isaku Yamahata
Reviewed-by: David Hildenbrand
On 9/21/2023 5:11 PM, David Hildenbrand wrote:
3. What is KVM_X86_SW_PROTECTED_VM going to look like? and do we
need it?
Why implement it when you have to ask others for a motivation? đ
Personally, I'm not sure if it is really useful, especially in this
state.
Yeah, as of today, KVM_X86_S
On 9/21/2023 4:51 PM, David Hildenbrand wrote:
On 14.09.23 05:51, Xiaoyao Li wrote:
pc_machine_kvm_type() was introduced by commit e21be724eaf5 ("i386/xen:
add pc_machine_kvm_type to initialize XEN_EMULATE mode") to do Xen
specific initialization by utilizing kvm_type metho
On 9/21/2023 4:56 PM, David Hildenbrand wrote:
On 14.09.23 05:51, Xiaoyao Li wrote:
From: Chao Peng
Switch to KVM_SET_USER_MEMORY_REGION2 when supported by KVM.
With KVM_SET_USER_MEMORY_REGION2, QEMU can set up memory region that
backend'ed both by hva-based shared memory and gmem fd
On 9/21/2023 4:46 PM, David Hildenbrand wrote:
On 14.09.23 05:51, Xiaoyao Li wrote:
Introduce memory_region_has_gmem_fd() to query if the MemoryRegion has
KVM gmem fd allocated.
*probably* best to just squash that into patch #2.
Sure, I will do it.
On 9/21/2023 4:55 PM, David Hildenbrand wrote:
On 14.09.23 05:50, Xiaoyao Li wrote:
From: Chao Peng
Add KVM gmem support to RAMBlock so both normal hva based memory
and kvm gmem fd based private memory can be associated in one RAMBlock.
Introduce new flag RAM_KVM_GMEM. It calls KVM ioctl to
On 9/20/2023 11:42 PM, Markus Armbruster wrote:
David Hildenbrand writes:
On 20.09.23 16:35, Xiaoyao Li wrote:
On 9/20/2023 3:30 PM, Markus Armbruster wrote:
Xiaoyao Li writes:
On 9/19/2023 5:46 PM, Markus Armbruster wrote:
Xiaoyao Li writes:
From: Isaku Yamahata
Add a new property
On 9/20/2023 3:30 PM, Markus Armbruster wrote:
Xiaoyao Li writes:
On 9/19/2023 5:46 PM, Markus Armbruster wrote:
Xiaoyao Li writes:
From: Isaku Yamahata
Add a new property "private" to memory backends. When it's set to true,
it indicates the RAMblock of the backend al
On 9/19/2023 5:46 PM, Markus Armbruster wrote:
Xiaoyao Li writes:
From: Isaku Yamahata
Add a new property "private" to memory backends. When it's set to true,
it indicates the RAMblock of the backend also requires kvm gmem.
Can you add a brief explanation why you need the
On 9/15/2023 10:04 AM, Wang, Lei wrote:
On 9/14/2023 11:50, Xiaoyao Li wrote:
From: Chao Peng
Add KVM gmem support to RAMBlock so both normal hva based memory
and kvm gmem fd based private memory can be associated in one RAMBlock.
Introduce new flag RAM_KVM_GMEM. It calls KVM ioctl to create
On 9/14/2023 9:09 PM, David Hildenbrand wrote:
On 14.09.23 05:50, Xiaoyao Li wrote:
It's the v2 RFC of enabling KVM gmem[1] as the backend for private
memory.
For confidential-computing, KVM provides gmem/guest_mem interfaces for
userspace, like QEMU, to allocate user-unaccesible pr
ves the Xen specific initialization to pc_basic_device_init().
There is no need to keep the PC specific kvm_type() implementation
anymore. On the other hand, later patch will implement kvm_type()
method for all x86/i386 machines to support KVM_X86_SW_PROTECTED_VM.
Signed-off-by: Xiaoyao Li
Reviewed-by: Isa
From: Isaku Yamahata
In mch_realize(), process PAM initialization before SMRAM initialization so
that later patch can skill all the SMRAM related with a single check.
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
hw/pci-host/q35.c | 19 ++-
1 file changed, 10
Register a memory listener for KVM_X86_SW_PROVTED_VM. It set RAM to
private by default.
Signed-off-by: Xiaoyao Li
---
include/exec/memory.h | 1 +
target/i386/kvm/sw-protected-vm.c | 18 ++
2 files changed, 19 insertions(+)
diff --git a/include/exec/memory.h b
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/kvm.c | 2 ++
target/i386/kvm/sw-protected-vm.c | 10 ++
target/i386/kvm/sw-protected-vm.h | 2 ++
3 files changed, 14 insertions(+)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index fb1be16471b4..e126bf4e7ddd
From: Isaku Yamahata
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
accel/kvm/kvm-all.c| 1 +
accel/kvm/trace-events | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index c67aa66b0559..229b7038a4c2 100644
--- a
. When doing private memory <-> shared
memory conversion, it requires 4KB alignment instead of
RamBlock.page_size.
Signed-off-by: Xiaoyao Li
---
softmmu/physmem.c | 192 --
1 file changed, 100 insertions(+), 92 deletions(-)
diff --git a/s
stopherson
Signed-off-by: Sean Christopherson
Signed-off-by: Xiaoyao Li
---
hw/i386/pc_q35.c | 3 ++-
hw/pci-host/q35.c | 42 +++
include/hw/i386/pc.h | 1 +
include/hw/pci-host/q35.h | 1 +
4 files changed, 33 insertions(+), 14
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/sw-protected-vm.c | 8
1 file changed, 8 insertions(+)
diff --git a/target/i386/kvm/sw-protected-vm.c
b/target/i386/kvm/sw-protected-vm.c
index f47ac383e1dd..65347067aa03 100644
--- a/target/i386/kvm/sw-protected-vm.c
+++ b/target/i386/kvm
It's used for discarding oppsite memory after memory conversion to
shared/private.
Note, private-shared page conversion is done at 4KB granularity. Don't
check alignment with rb->page_size, instead qemu_host_page_size, which
is 4K.
Originally-from: Isaku Yamahata
Signed-off-b
Introcude the helper functions to set the attributes of a range of
memory to private and shared.
Signed-off-by: Xiaoyao Li
---
accel/kvm/kvm-all.c | 43 +++
include/sysemu/kvm.h | 3 +++
2 files changed, 46 insertions(+)
diff --git a/accel/kvm/kvm
From: Chao Peng
Switch to KVM_SET_USER_MEMORY_REGION2 when supported by KVM.
With KVM_SET_USER_MEMORY_REGION2, QEMU can set up memory region that
backend'ed both by hva-based shared memory and gmem fd based private
memory.
Signed-off-by: Chao Peng
Codeveloped-by: Xiaoyao Li
Signed-o
From: Chao Peng
Add KVM gmem support to RAMBlock so both normal hva based memory
and kvm gmem fd based private memory can be associated in one RAMBlock.
Introduce new flag RAM_KVM_GMEM. It calls KVM ioctl to create private
gmem for the RAMBlock when it's set.
Signed-off-by: Xiaoy
only when the RAMBlock has
gmem memory backend.
Signed-off-by: Chao Peng
Signed-off-by: Xiaoyao Li
---
accel/kvm/kvm-all.c | 54 +
1 file changed, 54 insertions(+)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 7e32ee83b258..c67aa66b0559
Introduce new flag RAM_DEFAULT_PRIVATE for RAMBlock. It's used to
indicate the default attribute, private or not.
Set the RAM range to private explicitly when it's default private.
Originated-from: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
accel/kvm/kvm-all.c | 10 +
This patch needs to be updated by script
scripts/update-linux-headers.sh
once gmem fd support is upstreamed in Linux kernel.
Signed-off-by: Xiaoyao Li
---
linux-headers/asm-x86/kvm.h | 3 +++
linux-headers/linux/kvm.h | 50 +
2 files changed, 53
Signed-off-by: Xiaoyao Li
---
softmmu/physmem.c | 34 +++---
1 file changed, 15 insertions(+), 19 deletions(-)
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 2d98a88f41f0..34d580ec0d39 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -3440,16
Introduce a separate function kvm_confidential_guest_init(), which
dispatches specific confidential guest initialization function by
ms->cgs type.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
Reviewed-by: Philippe Mathieu-Daudé
---
target/i386/kvm/kvm.c | 11 ++-
target/i
Implement mc->kvm_type() for i386 machines. It provides a way for user
to create SW_PROTECTE_VM.
Also store the vm_type in machinestate to other code to query what the
VM type is.
Signed-off-by: Xiaoyao Li
---
hw/i386/x86.c | 12
include/hw/i386/x86.h |
From: Isaku Yamahata
Add a new property "private" to memory backends. When it's set to true,
it indicates the RAMblock of the backend also requires kvm gmem.
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
backends/hostmem-file.c | 1 +
backends/hostmem-memfd.c |
d and private
pci-host/q35: Move PAM initialization above SMRAM initialization
q35: Introduce smm_ranges property for q35-pci-host
Xiaoyao Li (14):
*** HACK *** linux-headers: Update headers to pull in gmem APIs
memory: Introduce memory_region_has_gmem_fd()
i386: Add support for sw-protec
Introduce sw-protected-vm object which implements the interface of
CONFIDENTIAL_GUEST_SUPPORT, and will be used to create
X86_SW_PROTECTED_VM via
$qemu -machine ...,confidential-guest-support=sp-vm0 \
-object sw-protected-vm,id=sp-vm0
Signed-off-by: Xiaoyao Li
---
qapi/qom.json
Introduce memory_region_has_gmem_fd() to query if the MemoryRegion has
KVM gmem fd allocated.
Signed-off-by: Xiaoyao Li
---
include/exec/memory.h | 10 ++
softmmu/memory.c | 5 +
2 files changed, 15 insertions(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
On 8/9/2023 11:02 PM, Xu Yilun wrote:
On 2023-07-31 at 12:21:57 -0400, Xiaoyao Li wrote:
From: Chao Peng
Currently only KVM_MEMORY_EXIT_FLAG_PRIVATE in flags is valid when
KVM_EXIT_MEMORY_FAULT happens. It indicates userspace needs to do
the memory conversion on the RAMBlock to turn the
On 8/3/2023 6:25 AM, Isaku Yamahata wrote:
On Mon, Jul 31, 2023 at 12:21:57PM -0400,
Xiaoyao Li wrote:
From: Chao Peng
Currently only KVM_MEMORY_EXIT_FLAG_PRIVATE in flags is valid when
KVM_EXIT_MEMORY_FAULT happens. It indicates userspace needs to do
the memory conversion on the RAMBlock
On 8/30/2023 3:48 PM, Daniel P. Berrangé wrote:
On Wed, Aug 30, 2023 at 01:57:59PM +0800, Xiaoyao Li wrote:
On 8/30/2023 1:18 PM, Chenyi Qiang wrote:
On 8/29/2023 6:25 PM, Daniel P. Berrangé wrote:
On Tue, Aug 29, 2023 at 01:31:37PM +0800, Chenyi Qiang wrote:
On 8/22/2023 4:24 PM, Daniel
On 8/30/2023 1:18 PM, Chenyi Qiang wrote:
On 8/29/2023 6:25 PM, Daniel P. Berrangé wrote:
On Tue, Aug 29, 2023 at 01:31:37PM +0800, Chenyi Qiang wrote:
On 8/22/2023 4:24 PM, Daniel P. Berrangé wrote:
On Tue, Aug 22, 2023 at 08:52:30AM +0200, Markus Armbruster wrote:
Xiaoyao Li writes
On 8/29/2023 6:28 PM, Daniel P. Berrangé wrote:
On Mon, Aug 28, 2023 at 09:14:41PM +0800, Xiaoyao Li wrote:
On 8/21/2023 5:58 PM, Daniel P. Berrangé wrote:
On Fri, Aug 18, 2023 at 05:50:30AM -0400, Xiaoyao Li wrote:
Originated-from: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
qapi/run
On 8/29/2023 10:33 PM, Philippe Mathieu-Daudé wrote:
On 18/8/23 11:50, Xiaoyao Li wrote:
Introduce memory_region_init_ram_gmem() to allocate private gmem on the
MemoryRegion initialization. It's for the usercase of TDVF, which must
be private on TDX case.
Signed-off-by: Xiaoy
On 8/29/2023 10:40 PM, Philippe Mathieu-Daudé wrote:
On 18/8/23 11:49, Xiaoyao Li wrote:
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.
Signed-off-by: Xiaoyao Li
On 8/21/2023 5:58 PM, Daniel P. Berrangé wrote:
On Fri, Aug 18, 2023 at 05:50:30AM -0400, Xiaoyao Li wrote:
Originated-from: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
qapi/run-state.json | 17 +--
softmmu/runstate.c| 49
On 8/24/2023 3:21 PM, Chenyi Qiang wrote:
On 8/18/2023 5:50 PM, Xiaoyao Li wrote:
From: Chenyi Qiang
To avoid no response from QGS server, setup a timer for the transaction. If
timeout, make it an error and interrupt guest. Define the threshold of time
to 30s at present, maybe change to
On 8/24/2023 3:50 PM, Xiaoyao Li wrote:
On 8/24/2023 3:41 AM, Isaku Yamahata wrote:
On Fri, Aug 18, 2023 at 05:50:16AM -0400,
Xiaoyao Li wrote:
Add UEFI definitions for literals, enums, structs, GUIDs, etc... that
will be used by TDX to build the UEFI Hand-Off Block (HOB) that is
passed
to
On 8/24/2023 3:41 AM, Isaku Yamahata wrote:
On Fri, Aug 18, 2023 at 05:50:16AM -0400,
Xiaoyao Li wrote:
Add UEFI definitions for literals, enums, structs, GUIDs, etc... that
will be used by TDX to build the UEFI Hand-Off Block (HOB) that is passed
to the Trusted Domain Virtual Firmware (TDVF
On 8/22/2023 10:42 PM, Daniel P. Berrangé wrote:
On Tue, Aug 22, 2023 at 10:30:47PM +0800, Xiaoyao Li wrote:
On 8/21/2023 5:16 PM, Daniel P. Berrangé wrote:
On Fri, Aug 18, 2023 at 05:50:01AM -0400, Xiaoyao Li wrote:
Validate TD attributes with tdx_caps that fixed-0 bits must be zero and
On 8/22/2023 2:22 PM, Markus Armbruster wrote:
Xiaoyao Li writes:
Introduce tdx-guest object which implements the interface of
CONFIDENTIAL_GUEST_SUPPORT, and will be used to create TDX VMs (TDs) by
qemu -machine ...,confidential-guest-support=tdx0\
-object tdx-guset,id=tdx0
On 8/22/2023 7:00 AM, Isaku Yamahata wrote:
On Fri, Aug 18, 2023 at 05:49:51AM -0400,
Xiaoyao Li wrote:
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 56cb826f6125..3198bc9fd5fb 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
...
+static inline uint32_t
On 8/22/2023 7:40 AM, Isaku Yamahata wrote:
On Fri, Aug 18, 2023 at 05:50:15AM -0400,
Xiaoyao Li wrote:
diff --git a/target/i386/kvm/tdx.h b/target/i386/kvm/tdx.h
index e9d2888162ce..9b3c427766ef 100644
--- a/target/i386/kvm/tdx.h
+++ b/target/i386/kvm/tdx.h
@@ -15,6 +15,17 @@ typedef struct
On 8/21/2023 5:38 PM, Daniel P. Berrangé wrote:
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index bb806736b4ff..ed617ebab266 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
+static int tdx_accept_ram_range(uint64_t address, uint64_t length)
+{
+uint64_t head_star
On 8/21/2023 5:16 PM, Daniel P. Berrangé wrote:
On Fri, Aug 18, 2023 at 05:50:01AM -0400, Xiaoyao Li wrote:
Validate TD attributes with tdx_caps that fixed-0 bits must be zero and
fixed-1 bits must be set.
Besides, sanity check the attribute bits that have not been supported by
QEMU yet. e.g
On 8/21/2023 5:16 PM, Daniel P. Berrangé wrote:
On Fri, Aug 18, 2023 at 05:50:01AM -0400, Xiaoyao Li wrote:
Validate TD attributes with tdx_caps that fixed-0 bits must be zero and
fixed-1 bits must be set.
Besides, sanity check the attribute bits that have not been supported by
QEMU yet. e.g
On 8/22/2023 2:27 PM, Markus Armbruster wrote:
Daniel P. Berrangé writes:
On Fri, Aug 18, 2023 at 05:49:58AM -0400, Xiaoyao Li wrote:
Bit 28 of TD attribute, named SEPT_VE_DISABLE. When set to 1, it disables
EPT violation conversion to #VE on guest TD access of PENDING pages.
Some guest OS
On 8/21/2023 4:48 PM, Daniel P. Berrangé wrote:
On Fri, Aug 18, 2023 at 05:49:50AM -0400, Xiaoyao Li wrote:
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 ev
On 8/21/2023 4:46 PM, Daniel P. Berrangé wrote:
On Fri, Aug 18, 2023 at 05:49:49AM -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
On 8/21/2023 4:27 PM, Daniel P. Berrangé wrote:
On Fri, Aug 18, 2023 at 05:49:46AM -0400, Xiaoyao Li wrote:
TDX VM requires VM type KVM_X86_TDX_VM to be passed to
kvm_ioctl(KVM_CREATE_VM).
If tdx-guest object is specified to confidential-guest-support, like,
qemu -machine ...,confidential
KVM doesn't allow wirting to MSR_IA32_APICBASE for TDs.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
target/i386/kvm/kvm.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 53d8d65f6667..d542351983cd 100644
--- a/target
TDX CPU state is protected and thus vcpu state cann't be reset by VMM.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
target/i386/kvm/kvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 601683d836c8..50b0218
Originated-from: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
qapi/run-state.json | 17 +--
softmmu/runstate.c| 49 +++
target/i386/kvm/tdx.c | 24 -
3 files changed, 87 insertions(+), 3 deletions(-)
diff --git a
the server
returns.
Set the io channel non-blocking and register the socket fd with the main
loop. Move the read operation into the callback. When the fd is readable,
inovke the callback to handle the quote data.
Signed-off-by: Chenyi Qiang
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/tdx.c
.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
hw/i386/x86.c | 1 +
include/hw/i386/x86.h | 1 +
target/i386/kvm/tdx.c | 2 ++
3 files changed, 4 insertions(+)
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index a0c9f4d646e2..567384484244 100644
--- a/hw/i386/x86.c
+++ b/hw/i386
Add docs/system/i386/tdx.rst for TDX support, and add tdx in
confidential-guest-support.rst
Signed-off-by: Xiaoyao Li
---
Changes since v1:
- Add prerequisite of private gmem;
- update example command to launch TD;
Changes since RFC v4:
- add the restriction that kernel-irqchip must be
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 | 8
1 file
Sean Christopherson
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
target/i386/kvm/kvm.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index d542351983cd..1422c79aca40 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/
igned-off-by: Xiaoyao Li
---
target/i386/kvm/tdx.c | 19 ++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 0c43c1f7759f..ced55be506d1 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
@@ -994,12 +9
: Xiaoyao Li
---
target/i386/kvm/kvm.c | 9 ++
target/i386/kvm/tdx-stub.c | 4 +++
target/i386/kvm/tdx.c | 61 ++
target/i386/kvm/tdx.h | 6
4 files changed, 80 insertions(+)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index
LMCE is not supported TDX since KVM doesn't provide emulation for
MSR_IA32_FEAT_CTL.
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/kvm-cpu.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c
index 7237378a7d4e..bec8b5f918e7 1
mmand line example:
qemu-system-x86_64 \
-object 'tdx-guest,id=tdx0,quote-generation-service=localhost:1234' \
-machine confidential-guest-support=tdx0
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
qapi/qom.json | 5 +-
target/i386/kvm/tdx.c | 380 +
From: Chao Peng
Allocate private gmem memory for BIOS if it's TD VM.
Signed-off-by: Chao Peng
Co-developed-by: Xiaoyao Li
Signed-off-by: Xiaoyao Li
---
hw/i386/x86.c | 9 -
target/i386/kvm/tdx.c | 17 +
target/i386/kvm/tdx.h | 2 ++
3 files change
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
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/tdx.c | 40
1 file changed, 40 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index ced55be506d1..f111b46dac92 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
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 f9d03ab0f461..23ecd84a9e21 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i38
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 | 7 +++
1 file changed, 7 insertions(+)
diff --git a/target/i386/kvm/td
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
From: Isaku Yamahata
When level trigger isn't supported on x86 platform,
forcibly report edge trigger in acpi tables.
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
hw/i386/acpi-build.c | 99 ---
hw/i386
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
onfig=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
TODO:
- community requests to use base64 encoding if no special reason
---
qapi/qom.json | 11 ++-
target/i386/kvm/tdx.c
TDX doesn't support map different GPAs to same private memory. Thus,
aliasing top 128KB of BIOS as isa-bios is not supported.
On the other hand, TDX guest cannot go to real mode, it can work fine
without isa-bios.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
Changes from R
do the stuff.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
hw/i386/tdvf.c | 1 +
include/hw/i386/tdvf.h | 7 +++
target/i386/kvm/tdx.c | 31 +++
3 files changed, 39 insertions(+)
diff --git a/hw/i386/tdvf.c b/hw/i386/tdvf.c
index ff51f40088f0
Introduce tdx_kvm_init() and invoke it in kvm_confidential_guest_init()
if it's a TDX VM. More initialization will be added later.
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
target/i386/kvm/kvm.c | 15 ++-
target/i386/kvm/meson.build | 2 +-
target/i386/kv
iolation
Originated-from: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/tdx.c | 22 ++
1 file changed, 22 insertions(+)
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 8a2491ed03c2..775110f8bd02 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/
Introduce memory_region_init_ram_gmem() to allocate private gmem on the
MemoryRegion initialization. It's for the usercase of TDVF, which must
be private on TDX case.
Signed-off-by: Xiaoyao Li
---
include/exec/memory.h | 6 +
softmmu/memory.c
From: Isaku Yamahata
Allocate private gmem for TD guest, if the MemoryRegion is memory
backend and has private property on.
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
target/i386/kvm/tdx.c | 27 +--
1 file changed, 25 insertions(+), 2 deletions
Validate TD attributes with tdx_caps that fixed-0 bits must be zero and
fixed-1 bits must be set.
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
, EFI_RESOURCE_MEMORY_UNACCEPTED will be added in future UEFI spec.
[1]
https://software.intel.com/content/dam/develop/external/us/en/documents/tdx-virtual-firmware-design-guide-rev-1.pdf
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
include/standard-headers/uefi/uefi.h | 198 +++
1 file
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
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 from RFC v4:
- drop the code of adding mmio resources since OVMF prepares all the
MMIO hob itself.
---
hw/i386/meson.build
From: Isaku Yamahata
TDVF firmware (CODE and VARS) needs to be added/copied to TD's private
memory via KVM_TDX_INIT_MEM_REGION, as well as TD HOB and TEMP memory.
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
Acked-by: Gerd Hoffmann
---
Changes from RFC v4:
- rename var
From: Isaku Yamahata
Because vMMIO region needs to be shared region, guest TD may explicitly
convert such region from private to shared. Don't complain such
conversion.
Signed-off-by: Isaku Yamahata
Signed-off-by: Xiaoyao Li
---
accel/kvm/kvm-all.c | 20 ++--
1 file ch
;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 from RFC v4:
- simplify the algorithm of tdx_accept
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
401 - 500 of 901 matches
Mail list logo