[PATCH] i386/tdx: Remove the redundant qemu_mutex_init(&tdx->lock)

Xiaoyao Li posted 1 patch 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250717103707.688929-1-xiaoyao.li@intel.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
target/i386/kvm/tdx.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] i386/tdx: Remove the redundant qemu_mutex_init(&tdx->lock)
Posted by Xiaoyao Li 4 months ago
Commit 40da501d8989 ("i386/tdx: handle TDG.VP.VMCALL<GetQuote>") added
redundant qemu_mutex_init(&tdx->lock) in tdx_guest_init by mistake.

Fix it by removing the redundant one.

Fixes: 40da501d8989 ("i386/tdx: handle TDG.VP.VMCALL<GetQuote>")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 target/i386/kvm/tdx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 7d69d6d7b066..107058ed794c 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
@@ -1523,8 +1523,6 @@ static void tdx_guest_init(Object *obj)
                             tdx_guest_set_qgs,
                             NULL, NULL);
 
-    qemu_mutex_init(&tdx->lock);
-
     tdx->event_notify_vector = -1;
     tdx->event_notify_apicid = -1;
 }
-- 
2.43.0
Re: [PATCH] i386/tdx: Remove the redundant qemu_mutex_init(&tdx->lock)
Posted by Paolo Bonzini 4 months ago
Queued, thanks.

Paolo
Re: [PATCH] i386/tdx: Remove the redundant qemu_mutex_init(&tdx->lock)
Posted by Daniel P. Berrangé 4 months ago
On Thu, Jul 17, 2025 at 06:37:07PM +0800, Xiaoyao Li wrote:
> Commit 40da501d8989 ("i386/tdx: handle TDG.VP.VMCALL<GetQuote>") added
> redundant qemu_mutex_init(&tdx->lock) in tdx_guest_init by mistake.
> 
> Fix it by removing the redundant one.
> 
> Fixes: 40da501d8989 ("i386/tdx: handle TDG.VP.VMCALL<GetQuote>")
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
> ---
>  target/i386/kvm/tdx.c | 2 --
>  1 file changed, 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|