]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm: Initialize debug capabilities only once
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Thu, 20 Apr 2023 09:21:15 +0000 (10:21 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 10 May 2023 17:50:38 +0000 (20:50 +0300)
commitf0c5a780292bd405bbce818b63757313cafcf262
tree0cc5f092a4d2e16e89f7df848e165c4eb98c3374
parent9448a0fa112e1e7b1cd11e3bf7b2b1711a89a90d
target/arm: Initialize debug capabilities only once

kvm_arm_init_debug() used to be called several times on a SMP system as
kvm_arch_init_vcpu() calls it. Move the call to kvm_arch_init() to make
sure it will be called only once; otherwise it will overwrite pointers
to memory allocated with the previous call and leak it.

Fixes: e4482ab7e3 ("target-arm: kvm - add support for HW assisted debug")
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-id: 20230405153644.25300-1-akihiko.odaki@daynix.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit ad5c6ddea327758daa9f0e6edd916be39dce7dca)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/arm/kvm.c
target/arm/kvm64.c
target/arm/kvm_arm.h