qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH-for-7.0 v4] target/i386/kvm: Free xsave_buf when destroyi


From: Mark Kanda
Subject: Re: [RFC PATCH-for-7.0 v4] target/i386/kvm: Free xsave_buf when destroying vCPU
Date: Tue, 22 Mar 2022 09:01:54 -0500
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 3/22/2022 8:29 AM, Philippe Mathieu-Daudé wrote:
On 22/3/22 13:05, Philippe Mathieu-Daudé wrote:
From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Fix vCPU hot-unplug related leak reported by Valgrind:

   ==132362== 4,096 bytes in 1 blocks are definitely lost in loss record 8,440 of 8,549
   ==132362==    at 0x4C3B15F: memalign (vg_replace_malloc.c:1265)
   ==132362==    by 0x4C3B288: posix_memalign (vg_replace_malloc.c:1429)
   ==132362==    by 0xB41195: qemu_try_memalign (memalign.c:53)
   ==132362==    by 0xB41204: qemu_memalign (memalign.c:73)
   ==132362==    by 0x7131CB: kvm_init_xsave (kvm.c:1601)
   ==132362==    by 0x7148ED: kvm_arch_init_vcpu (kvm.c:2031)
   ==132362==    by 0x91D224: kvm_init_vcpu (kvm-all.c:516)
   ==132362==    by 0x9242C9: kvm_vcpu_thread_fn (kvm-accel-ops.c:40)
   ==132362==    by 0xB2EB26: qemu_thread_start (qemu-thread-posix.c:556)
   ==132362==    by 0x7EB2159: start_thread (in /usr/lib64/libpthread-2.28.so)
   ==132362==    by 0x9D45DD2: clone (in /usr/lib64/libc-2.28.so)

Reported-by: Mark Kanda <mark.kanda@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Based on a series from Mark:
20220321141409.3112932-1-mark.kanda@oracle.com/">https://lore.kernel.org/qemu-devel/20220321141409.3112932-1-mark.kanda@oracle.com/

RFC because currently no time to test

Mark, do you mind testing this patch?
Sanity tested with x86_64 KVM. Valgrind confirms the leak is fixed upon the vCPU hotplug.

Tested-by: Mark Kanda <mark.kanda@oracle.com>

Thanks/regards,
-Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]