On 6/7/2022 7:16 PM, Gerd Hoffmann wrote:
Hi,
I guess it could be helpful for the discussion when you can outine the
'big picture' for tdx initialization. How does kvm accel setup look
like without TDX, and what additional actions are needed for TDX? What
ordering requirements and other co
Hi,
> > I guess it could be helpful for the discussion when you can outine the
> > 'big picture' for tdx initialization. How does kvm accel setup look
> > like without TDX, and what additional actions are needed for TDX? What
> > ordering requirements and other constrains exist?
>
> To boot a
On 6/1/2022 3:54 PM, Gerd Hoffmann wrote:
On Wed, Jun 01, 2022 at 03:20:46PM +0800, Xiaoyao Li wrote:
On 5/24/2022 2:57 PM, Gerd Hoffmann wrote:
Hi,
Maybe it's a bit more work to add VM-scope initialization support to
qemu.
If just introducing VM-scope initialization to QEMU, it would be
On Wed, Jun 01, 2022 at 03:20:46PM +0800, Xiaoyao Li wrote:
> On 5/24/2022 2:57 PM, Gerd Hoffmann wrote:
> >Hi,
> > Maybe it's a bit more work to add VM-scope initialization support to
> > qemu.
>
> If just introducing VM-scope initialization to QEMU, it would be easy. What
> matters is what n
On 5/24/2022 2:57 PM, Gerd Hoffmann wrote:
Hi,
Hmm, hooking *vm* initialization into *vcpu* creation looks wrong to me.
That's because for TDX, it has to do VM-scope (feature) initialization
before creating vcpu. This is new to KVM and QEMU, that every feature is
vcpu-scope and configured
Hi,
> > Hmm, hooking *vm* initialization into *vcpu* creation looks wrong to me.
>
> That's because for TDX, it has to do VM-scope (feature) initialization
> before creating vcpu. This is new to KVM and QEMU, that every feature is
> vcpu-scope and configured per-vcpu before.
>
> To minimize th
On 5/23/2022 5:20 PM, Gerd Hoffmann wrote:
+int tdx_pre_create_vcpu(CPUState *cpu)
+{
+MachineState *ms = MACHINE(qdev_get_machine());
+X86CPU *x86cpu = X86_CPU(cpu);
+CPUX86State *env = &x86cpu->env;
+struct kvm_tdx_init_vm init_vm;
+int r = 0;
+
+qemu_mutex_lock(&tdx_gue
> +int tdx_pre_create_vcpu(CPUState *cpu)
> +{
> +MachineState *ms = MACHINE(qdev_get_machine());
> +X86CPU *x86cpu = X86_CPU(cpu);
> +CPUX86State *env = &x86cpu->env;
> +struct kvm_tdx_init_vm init_vm;
> +int r = 0;
> +
> +qemu_mutex_lock(&tdx_guest->lock);
> +if (tdx_g
Invoke KVM_TDX_INIT in kvm_arch_pre_create_vcpu() that KVM_TDX_INIT
configures global TD state, e.g. the canonical CPUID config, and must
be executed prior to creating vCPUs.
Use kvm_x86_arch_cpuid() to setup the CPUID settings for TDX VM and
tie x86cpu->enable_pmu with TD's attributes.
Note, thi