From: "Liju-clr Chen (陳麗如)" <Liju-clr.Chen@mediatek.com>
To: "hdanton@sina.com" <hdanton@sina.com>
Cc: "Ze-yu Wang (王澤宇)" <Ze-yu.Wang@mediatek.com>,
"will@kernel.org" <will@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Yingshiuan Pan (潘穎軒)" <Yingshiuan.Pan@mediatek.com>
Subject: Re: [PATCH v12 05/24] virt: geniezone: Add vm support
Date: Tue, 22 Oct 2024 03:10:36 +0000 [thread overview]
Message-ID: <42e9b46219d8840f1f834092e58d54e8160fb414.camel@mediatek.com> (raw)
In-Reply-To: <20240801105032.2533-1-hdanton@sina.com>
On Thu, 2024-08-01 at 18:50 +0800, Hillf Danton wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> On Tue, 30 Jul 2024 16:24:17 +0800 Liju-clr Chen <
> liju-clr.chen@mediatek.com>
> > +
> > +static void gzvm_destroy_vm(struct gzvm *gzvm)
> > +{
> > + pr_debug("VM-%u is going to be destroyed\n", gzvm->vm_id);
> > +
> > + mutex_lock(&gzvm->lock);
> > +
> > + gzvm_arch_destroy_vm(gzvm->vm_id);
> > +
> > + mutex_lock(&gzvm_list_lock);
> > + list_del(&gzvm->vm_list);
> > + mutex_unlock(&gzvm_list_lock);
> > +
> > + mutex_unlock(&gzvm->lock);
> > +
> > + kfree(gzvm);
> > +}
>
> ...
> > +
> > +void gzvm_destroy_all_vms(void)
> > +{
> > + struct gzvm *gzvm, *tmp;
> > +
> > + mutex_lock(&gzvm_list_lock);
> > + if (list_empty(&gzvm_list))
> > + goto out;
> > +
> > + list_for_each_entry_safe(gzvm, tmp, &gzvm_list, vm_list)
> > + gzvm_destroy_vm(gzvm);
> > +
>
> You add a fking deadlock by invoking gzvm_destroy_vm() with
> gzvm_list_lock held.
>
Hi Hillf,
Thank you for reviewing and finding the bug.
It will be fixed in next version.
> > +out:
> > + mutex_unlock(&gzvm_list_lock);
> > +}
BR
Liju
next prev parent reply other threads:[~2024-10-22 3:10 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 8:24 [PATCH v12 00/24] GenieZone hypervisor drivers Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 01/24] virt: geniezone: enable gzvm-ko in defconfig Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 02/24] docs: geniezone: Introduce GenieZone hypervisor Liju-clr Chen
2024-07-30 14:13 ` Randy Dunlap
2024-10-22 2:21 ` Liju-clr Chen (陳麗如)
2024-07-30 8:24 ` [PATCH v12 03/24] dt-bindings: hypervisor: Add MediaTek " Liju-clr Chen
2024-08-01 10:36 ` Hillf Danton
2024-10-22 2:47 ` Liju-clr Chen (陳麗如)
2024-07-30 8:24 ` [PATCH v12 04/24] virt: geniezone: Add GenieZone hypervisor driver Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 05/24] virt: geniezone: Add vm support Liju-clr Chen
2024-08-01 10:50 ` Hillf Danton
2024-10-22 3:10 ` Liju-clr Chen (陳麗如) [this message]
2024-07-30 8:24 ` [PATCH v12 06/24] virt: geniezone: Add set_user_memory_region for vm Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 07/24] virt: geniezone: Add vm capability check Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 08/24] virt: geniezone: Add vcpu support Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 09/24] virt: geniezone: Add irqchip support for virtual interrupt injection Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 10/24] virt: geniezone: Add irqfd support Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 11/24] virt: geniezone: Add ioeventfd support Liju-clr Chen
2024-07-31 8:57 ` Simon Horman
2024-07-30 8:24 ` [PATCH v12 12/24] virt: geniezone: Add memory region purpose for hypervisor Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 13/24] virt: geniezone: Add dtb config support Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 14/24] virt: geniezone: Optimize performance of protected VM memory Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 15/24] virt: geniezone: Add memory pin/unpin support Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 16/24] virt: geniezone: Add demand paging support Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 17/24] virt: geniezone: Add block-based " Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 18/24] virt: geniezone: Add memory relinquish support Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 19/24] virt: geniezone: Provide individual VM memory statistics within debugfs Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 20/24] virt: geniezone: Add tracing support for hyp call and vcpu exit_reason Liju-clr Chen
2024-08-07 20:02 ` Steven Rostedt
2024-07-30 8:24 ` [PATCH v12 21/24] virt: geniezone: Enable PTP for synchronizing time between host and guest VMs Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 22/24] virt: geniezone: Add support for virtual timer migration Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 23/24] virt: geniezone: Add support for guest VM CPU idle Liju-clr Chen
2024-07-30 8:24 ` [PATCH v12 24/24] virt: geniezone: Emulate IPI for guest VM Liju-clr Chen
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=42e9b46219d8840f1f834092e58d54e8160fb414.camel@mediatek.com \
--to=liju-clr.chen@mediatek.com \
--cc=Yingshiuan.Pan@mediatek.com \
--cc=Ze-yu.Wang@mediatek.com \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=will@kernel.org \
/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
all inboxes | Powered by JetHome®