From: Marc Zyngier <maz@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: oliver.upton@linux.dev, james.morse@arm.com,
suzuki.poulose@arm.com, yuzenghui@huawei.com,
catalin.marinas@arm.com, will@kernel.org,
christoffer.dall@arm.com, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: free kvm->arch.nested_mmus with kvfree()
Date: Tue, 23 Jul 2024 16:00:04 +0100 [thread overview]
Message-ID: <86ed7k2lxn.wl-maz@kernel.org> (raw)
In-Reply-To: <20240723142204.758796-1-dakr@kernel.org>
On Tue, 23 Jul 2024 15:20:52 +0100,
Danilo Krummrich <dakr@kernel.org> wrote:
>
> kvm->arch.nested_mmus is allocated with kvrealloc(), hence free it with
> kvfree() instead of kfree().
>
> Fixes: 4f128f8e1aaa ("KVM: arm64: nv: Support multiple nested Stage-2 mmu structures")
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
> arch/arm64/kvm/nested.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
> index de789e0f1ae9..bab27f9d8cc6 100644
> --- a/arch/arm64/kvm/nested.c
> +++ b/arch/arm64/kvm/nested.c
> @@ -786,7 +786,7 @@ void kvm_arch_flush_shadow_all(struct kvm *kvm)
> if (!WARN_ON(atomic_read(&mmu->refcnt)))
> kvm_free_stage2_pgd(mmu);
> }
> - kfree(kvm->arch.nested_mmus);
> + kvfree(kvm->arch.nested_mmus);
> kvm->arch.nested_mmus = NULL;
> kvm->arch.nested_mmus_size = 0;
> kvm_uninit_stage2_mmu(kvm);
>
Ah, nice catch. Thanks for fixing it.
Reviewed-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2024-07-23 15:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 14:20 [PATCH] KVM: arm64: free kvm->arch.nested_mmus with kvfree() Danilo Krummrich
2024-07-23 15:00 ` Marc Zyngier [this message]
2024-08-05 22:11 ` Oliver Upton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ed7k2lxn.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=christoffer.dall@arm.com \
--cc=dakr@kernel.org \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).