From: Shannon Zhao <zhaoshenglong@huawei.com>
To: Auger Eric <eric.auger@redhat.com>, <qemu-arm@nongnu.org>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org,
shannon.zhaosl@gmail.com
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH] KVM: GIC: Fix memory leak due to calling kvm_init_irq_routing twice
Date: Thu, 31 May 2018 16:04:46 +0800 [thread overview]
Message-ID: <5B0FAC9E.6090306@huawei.com> (raw)
In-Reply-To: <84171c12-e281-8de5-ec3d-ac0aaf3c3dbb@redhat.com>
On 2018/5/31 15:54, Auger Eric wrote:
> Hi Shannon,
>
> On 05/31/2018 09:16 AM, Shannon Zhao wrote:
>> kvm_irqchip_create called by kvm_init will call kvm_init_irq_routing to
>> initialize global capability variables. If we call kvm_init_irq_routing in
>> GIC realize function, previous allocated memory will leak.
>>
>> Fix this by deleting the unnecessary call.
>>
>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> openpic_kvm seems to suffer the same leak. Don't you want to fix it as
> well?
>
I have a look at below patch of openpic_kvm which says on ppc it doesn't
call kvm_irqchip_create. So no such issue for it.
commit d85937e683f6ff4d68293cb24c780fb1f6820d2c
Author: Scott Wood <scottwood@freescale.com>
Date: Wed Jun 12 15:32:51 2013 -0500
kvm/openpic: in-kernel mpic support
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
>
Thanks.
> Thanks
>
> Eric
>> ---
>> hw/intc/arm_gic_kvm.c | 1 -
>> hw/intc/arm_gicv3_kvm.c | 1 -
>> 2 files changed, 2 deletions(-)
>>
>> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
>> index 6f467e6..204369d 100644
>> --- a/hw/intc/arm_gic_kvm.c
>> +++ b/hw/intc/arm_gic_kvm.c
>> @@ -572,7 +572,6 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
>>
>> if (kvm_has_gsi_routing()) {
>> /* set up irq routing */
>> - kvm_init_irq_routing(kvm_state);
>> for (i = 0; i < s->num_irq - GIC_INTERNAL; ++i) {
>> kvm_irqchip_add_irq_route(kvm_state, i, 0, i);
>> }
>> diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
>> index 001d82b..aa4c7c5 100644
>> --- a/hw/intc/arm_gicv3_kvm.c
>> +++ b/hw/intc/arm_gicv3_kvm.c
>> @@ -813,7 +813,6 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
>>
>> if (kvm_has_gsi_routing()) {
>> /* set up irq routing */
>> - kvm_init_irq_routing(kvm_state);
>> for (i = 0; i < s->num_irq - GIC_INTERNAL; ++i) {
>> kvm_irqchip_add_irq_route(kvm_state, i, 0, i);
>> }
>>
>
> .
>
--
Shannon
WARNING: multiple messages have this Message-ID (diff)
From: Shannon Zhao <zhaoshenglong@huawei.com>
To: Auger Eric <eric.auger@redhat.com>, qemu-arm@nongnu.org
Cc: peter.maydell@linaro.org, shannon.zhaosl@gmail.com,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] KVM: GIC: Fix memory leak due to calling kvm_init_irq_routing twice
Date: Thu, 31 May 2018 16:04:46 +0800 [thread overview]
Message-ID: <5B0FAC9E.6090306@huawei.com> (raw)
In-Reply-To: <84171c12-e281-8de5-ec3d-ac0aaf3c3dbb@redhat.com>
On 2018/5/31 15:54, Auger Eric wrote:
> Hi Shannon,
>
> On 05/31/2018 09:16 AM, Shannon Zhao wrote:
>> kvm_irqchip_create called by kvm_init will call kvm_init_irq_routing to
>> initialize global capability variables. If we call kvm_init_irq_routing in
>> GIC realize function, previous allocated memory will leak.
>>
>> Fix this by deleting the unnecessary call.
>>
>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> openpic_kvm seems to suffer the same leak. Don't you want to fix it as
> well?
>
I have a look at below patch of openpic_kvm which says on ppc it doesn't
call kvm_irqchip_create. So no such issue for it.
commit d85937e683f6ff4d68293cb24c780fb1f6820d2c
Author: Scott Wood <scottwood@freescale.com>
Date: Wed Jun 12 15:32:51 2013 -0500
kvm/openpic: in-kernel mpic support
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
>
Thanks.
> Thanks
>
> Eric
>> ---
>> hw/intc/arm_gic_kvm.c | 1 -
>> hw/intc/arm_gicv3_kvm.c | 1 -
>> 2 files changed, 2 deletions(-)
>>
>> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
>> index 6f467e6..204369d 100644
>> --- a/hw/intc/arm_gic_kvm.c
>> +++ b/hw/intc/arm_gic_kvm.c
>> @@ -572,7 +572,6 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
>>
>> if (kvm_has_gsi_routing()) {
>> /* set up irq routing */
>> - kvm_init_irq_routing(kvm_state);
>> for (i = 0; i < s->num_irq - GIC_INTERNAL; ++i) {
>> kvm_irqchip_add_irq_route(kvm_state, i, 0, i);
>> }
>> diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
>> index 001d82b..aa4c7c5 100644
>> --- a/hw/intc/arm_gicv3_kvm.c
>> +++ b/hw/intc/arm_gicv3_kvm.c
>> @@ -813,7 +813,6 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
>>
>> if (kvm_has_gsi_routing()) {
>> /* set up irq routing */
>> - kvm_init_irq_routing(kvm_state);
>> for (i = 0; i < s->num_irq - GIC_INTERNAL; ++i) {
>> kvm_irqchip_add_irq_route(kvm_state, i, 0, i);
>> }
>>
>
> .
>
--
Shannon
next prev parent reply other threads:[~2018-05-31 8:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-31 7:16 [Qemu-arm] [PATCH] KVM: GIC: Fix memory leak due to calling kvm_init_irq_routing twice Shannon Zhao
2018-05-31 7:16 ` [Qemu-devel] " Shannon Zhao
2018-05-31 7:54 ` [Qemu-arm] " Auger Eric
2018-05-31 7:54 ` Auger Eric
2018-05-31 8:04 ` Shannon Zhao [this message]
2018-05-31 8:04 ` Shannon Zhao
2018-05-31 8:27 ` [Qemu-arm] " Auger Eric
2018-05-31 8:27 ` Auger Eric
2018-05-31 13:56 ` [Qemu-arm] " Peter Maydell
2018-05-31 13:56 ` [Qemu-devel] " Peter Maydell
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=5B0FAC9E.6090306@huawei.com \
--to=zhaoshenglong@huawei.com \
--cc=eric.auger@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shannon.zhaosl@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.