[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v4 11/36] i386/tdx: Initialize TDX before creating TD vcp
From: |
Gerd Hoffmann |
Subject: |
Re: [RFC PATCH v4 11/36] i386/tdx: Initialize TDX before creating TD vcpus |
Date: |
Tue, 24 May 2022 08:57:19 +0200 |
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 the change to QEMU, we want to utilize @cpu and @cpu->env to
> grab the configuration info. That's why it goes this way.
>
> Do you have any better idea on it?
Maybe it's a bit more work to add VM-scope initialization support to
qemu. But I expect that approach will work better long-term. You need
this mutex and the 'initialized' variable in your code to make sure it
runs only once because the way you hook it in is not ideal ...
[ disclaimer: I'm not that familiar with the kvm interface in qemu ]
take care,
Gerd
- [RFC PATCH v4 08/36] i386/tdx: Adjust get_supported_cpuid() for TDX VM, (continued)
- [RFC PATCH v4 12/36] i386/tdx: Wire CPU features up with attributes of TD guest, Xiaoyao Li, 2022/05/11
- [RFC PATCH v4 13/36] i386/tdx: Validate TD attributes, Xiaoyao Li, 2022/05/11
- Re: [RFC PATCH v4 13/36] i386/tdx: Validate TD attributes, Gerd Hoffmann, 2022/05/23
- Re: [RFC PATCH v4 13/36] i386/tdx: Validate TD attributes, Xiaoyao Li, 2022/05/24
- Re: [RFC PATCH v4 13/36] i386/tdx: Validate TD attributes, Gerd Hoffmann, 2022/05/24
- Re: [RFC PATCH v4 13/36] i386/tdx: Validate TD attributes, Xiaoyao Li, 2022/05/24
- Re: [RFC PATCH v4 13/36] i386/tdx: Validate TD attributes, Gerd Hoffmann, 2022/05/24
- Re: [RFC PATCH v4 13/36] i386/tdx: Validate TD attributes, Xiaoyao Li, 2022/05/25
[RFC PATCH v4 14/36] i386/tdx: Implement user specified tsc frequency, Xiaoyao Li, 2022/05/11