From: Christoffer Dall <christoffer.dall@linaro.org>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: KVM: unregister notifiers in hyp mode teardown path
Date: Wed, 6 Apr 2016 15:15:25 +0200 [thread overview]
Message-ID: <20160406131525.GD16355@cbox> (raw)
In-Reply-To: <57050A82.7030905@arm.com>
On Wed, Apr 06, 2016 at 02:09:22PM +0100, Sudeep Holla wrote:
> Hi Christoffer,
>
> On 06/04/16 12:52, Christoffer Dall wrote:
> >Hi Sudeep,
> >
> >
> >On Mon, Apr 04, 2016 at 02:46:51PM +0100, Sudeep Holla wrote:
> >>Commit 1e947bad0b63 ("arm64: KVM: Skip HYP setup when already running
> >>in HYP") re-organized the hyp init code and ended up leaving the CPU
> >>hotplug and PM notifier even if hyp mode initialization fails.
> >>
> >>Since KVM is not yet supported with ACPI, the above mentioned commit
> >>breaks CPU hotplug in ACPI boot.
> >>
> >>This patch fixes teardown_hyp_mode to properly unregister both CPU
> >>hotplug and PM notifiers in the teardown path.
> >>
> >>Fixes: 1e947bad0b63 ("arm64: KVM: Skip HYP setup when already running in HYP")
> >>Cc: Christoffer Dall <christoffer.dall@linaro.org>
> >>Cc: Marc Zyngier <marc.zyngier@arm.com>
> >>Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> >
> >I fixed up your patch to apply after James' patch:
> >5f5560b (arm64: KVM: Register CPU notifiers when the kernel runs at HYP, 2016-03-30)
> >
>
> Thanks for that, sorry I didn't realize it would conflict with that change.
>
> >My only concern with this approach is that we're not checking the return
> >values from the cpu_pm_register_notifier calls, and we're potentially
> >calling unregister_cpu_notifier even if the original registration
> >failed.
> >
>
> I agree with your concern and I had the same when I first wrote the
> patch. But considering the return values makes it unnecessarily ugly, so
> I dropped it and kept it simple.
>
> >I know this can't happen given current implementations, but if any of
> >these functions ever start returning error values, then we're silently
> >ignoring them. What is our policy on these things?
> >
>
> I am fine to handle that, but as you mentioned it's not really needed.
> May be we can add some error message if that's really required.
>
Hopefully we're not the only ones taking a slight shortcut here, so
anyone modifying those functions will notice it when doing so...
> >Let me know if the following revised version of your patch looks ok to
> >you (against kvmarm/master):
> >
>
> Looks fine and tested kvmarm/master with this patch on top.
>
Thanks, will queue it then.
-Christoffer
WARNING: multiple messages have this Message-ID (diff)
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: KVM: unregister notifiers in hyp mode teardown path
Date: Wed, 6 Apr 2016 15:15:25 +0200 [thread overview]
Message-ID: <20160406131525.GD16355@cbox> (raw)
In-Reply-To: <57050A82.7030905@arm.com>
On Wed, Apr 06, 2016 at 02:09:22PM +0100, Sudeep Holla wrote:
> Hi Christoffer,
>
> On 06/04/16 12:52, Christoffer Dall wrote:
> >Hi Sudeep,
> >
> >
> >On Mon, Apr 04, 2016 at 02:46:51PM +0100, Sudeep Holla wrote:
> >>Commit 1e947bad0b63 ("arm64: KVM: Skip HYP setup when already running
> >>in HYP") re-organized the hyp init code and ended up leaving the CPU
> >>hotplug and PM notifier even if hyp mode initialization fails.
> >>
> >>Since KVM is not yet supported with ACPI, the above mentioned commit
> >>breaks CPU hotplug in ACPI boot.
> >>
> >>This patch fixes teardown_hyp_mode to properly unregister both CPU
> >>hotplug and PM notifiers in the teardown path.
> >>
> >>Fixes: 1e947bad0b63 ("arm64: KVM: Skip HYP setup when already running in HYP")
> >>Cc: Christoffer Dall <christoffer.dall@linaro.org>
> >>Cc: Marc Zyngier <marc.zyngier@arm.com>
> >>Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> >
> >I fixed up your patch to apply after James' patch:
> >5f5560b (arm64: KVM: Register CPU notifiers when the kernel runs at HYP, 2016-03-30)
> >
>
> Thanks for that, sorry I didn't realize it would conflict with that change.
>
> >My only concern with this approach is that we're not checking the return
> >values from the cpu_pm_register_notifier calls, and we're potentially
> >calling unregister_cpu_notifier even if the original registration
> >failed.
> >
>
> I agree with your concern and I had the same when I first wrote the
> patch. But considering the return values makes it unnecessarily ugly, so
> I dropped it and kept it simple.
>
> >I know this can't happen given current implementations, but if any of
> >these functions ever start returning error values, then we're silently
> >ignoring them. What is our policy on these things?
> >
>
> I am fine to handle that, but as you mentioned it's not really needed.
> May be we can add some error message if that's really required.
>
Hopefully we're not the only ones taking a slight shortcut here, so
anyone modifying those functions will notice it when doing so...
> >Let me know if the following revised version of your patch looks ok to
> >you (against kvmarm/master):
> >
>
> Looks fine and tested kvmarm/master with this patch on top.
>
Thanks, will queue it then.
-Christoffer
next prev parent reply other threads:[~2016-04-06 13:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 13:46 [PATCH] arm64: KVM: unregister notifiers in hyp mode teardown path Sudeep Holla
2016-04-04 13:46 ` Sudeep Holla
2016-04-04 13:55 ` Marc Zyngier
2016-04-04 13:55 ` Marc Zyngier
2016-04-04 14:22 ` Sudeep Holla
2016-04-04 14:22 ` Sudeep Holla
2016-04-04 14:33 ` Marc Zyngier
2016-04-04 14:33 ` Marc Zyngier
2016-04-06 11:52 ` Christoffer Dall
2016-04-06 11:52 ` Christoffer Dall
2016-04-06 13:09 ` Sudeep Holla
2016-04-06 13:09 ` Sudeep Holla
2016-04-06 13:15 ` Christoffer Dall [this message]
2016-04-06 13:15 ` Christoffer Dall
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=20160406131525.GD16355@cbox \
--to=christoffer.dall@linaro.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.com \
--cc=sudeep.holla@arm.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.