From: Fabiano Rosas <farosas@linux.ibm.com>
To: Nicholas Piggin <npiggin@gmail.com>, kvm-ppc@vger.kernel.org
Cc: aik@ozlabs.ru, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 4/4] KVM: PPC: Decrement module refcount if init_vm fails
Date: Tue, 25 Jan 2022 15:08:33 +0000 [thread overview]
Message-ID: <87mtjjx37y.fsf@linux.ibm.com> (raw)
In-Reply-To: <1643082153.tb99kluqtm.astroid@bobo.none>
Nicholas Piggin <npiggin@gmail.com> writes:
> Excerpts from Fabiano Rosas's message of January 25, 2022 8:08 am:
>> We increment the reference count for KVM-HV/PR before the call to
>> kvmppc_core_init_vm. If that function fails we need to decrement the
>> refcount.
>>
>> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
>> ---
>> Caught this while testing Nick's LPID patches by looking at
>> /sys/module/kvm_hv/refcnt
>
> Nice catch. Is this the only change in the series?
Yes.
> You can just use kvm_ops->owner like try_module_get() does I think? Also
> try_module_get works on a NULL module same as module_put by the looks,
> so you could adjust that in this patch to remove the NULL check so it
> is consistent with the put.
Sure, I'll send a v3.
WARNING: multiple messages have this Message-ID (diff)
From: Fabiano Rosas <farosas@linux.ibm.com>
To: Nicholas Piggin <npiggin@gmail.com>, kvm-ppc@vger.kernel.org
Cc: aik@ozlabs.ru, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 4/4] KVM: PPC: Decrement module refcount if init_vm fails
Date: Tue, 25 Jan 2022 12:08:33 -0300 [thread overview]
Message-ID: <87mtjjx37y.fsf@linux.ibm.com> (raw)
In-Reply-To: <1643082153.tb99kluqtm.astroid@bobo.none>
Nicholas Piggin <npiggin@gmail.com> writes:
> Excerpts from Fabiano Rosas's message of January 25, 2022 8:08 am:
>> We increment the reference count for KVM-HV/PR before the call to
>> kvmppc_core_init_vm. If that function fails we need to decrement the
>> refcount.
>>
>> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
>> ---
>> Caught this while testing Nick's LPID patches by looking at
>> /sys/module/kvm_hv/refcnt
>
> Nice catch. Is this the only change in the series?
Yes.
> You can just use kvm_ops->owner like try_module_get() does I think? Also
> try_module_get works on a NULL module same as module_put by the looks,
> so you could adjust that in this patch to remove the NULL check so it
> is consistent with the put.
Sure, I'll send a v3.
next prev parent reply other threads:[~2022-01-25 15:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 22:07 [PATCH v2 0/4] KVM: PPC: KVM module exit fixes Fabiano Rosas
2022-01-24 22:07 ` Fabiano Rosas
2022-01-24 22:08 ` [PATCH v2 1/4] KVM: PPC: Book3S HV: Check return value of kvmppc_radix_init Fabiano Rosas
2022-01-24 22:08 ` Fabiano Rosas
2022-01-24 22:08 ` [PATCH v2 2/4] KVM: PPC: Book3S HV: Delay setting of kvm ops Fabiano Rosas
2022-01-24 22:08 ` Fabiano Rosas
2022-01-24 22:08 ` [PATCH v2 3/4] KVM: PPC: Book3S HV: Free allocated memory if module init fails Fabiano Rosas
2022-01-24 22:08 ` Fabiano Rosas
2022-01-24 22:08 ` [PATCH v2 4/4] KVM: PPC: Decrement module refcount if init_vm fails Fabiano Rosas
2022-01-24 22:08 ` Fabiano Rosas
2022-01-25 3:46 ` Nicholas Piggin
2022-01-25 3:46 ` Nicholas Piggin
2022-01-25 15:08 ` Fabiano Rosas [this message]
2022-01-25 15:08 ` Fabiano Rosas
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=87mtjjx37y.fsf@linux.ibm.com \
--to=farosas@linux.ibm.com \
--cc=aik@ozlabs.ru \
--cc=kvm-ppc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@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.