From: Greg Kurz <groug@kaod.org>
To: Sam Bobroff <sam.bobroff@au1.ibm.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/4] spapr: Fix bug in h_signal_sys_reset()
Date: Thu, 3 Aug 2017 14:37:15 +0200 [thread overview]
Message-ID: <20170803143715.33d0a62c@bahia.lan> (raw)
In-Reply-To: <4646e612ef5efb4f17f07eaec18e940f7ae93382.1501740002.git.sam.bobroff@au1.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1588 bytes --]
On Thu, 3 Aug 2017 16:28:27 +1000
Sam Bobroff <sam.bobroff@au1.ibm.com> wrote:
> The unicast case in h_signal_sys_reset() seems to be broken:
> rather than selecting the target CPU, it looks like it will pick
> either the first CPU or fail to find one at all.
>
> Fix it by using the search function rather than open coding the
> search.
>
Heh the open coded search is using cpu where it should have been using
POWERPC_CPU(cs) => it can only succeed if a the vCPU is signalling itself.
> This was found by inspection; the code appears to be unused because
> the Linux kernel only uses the broadcast target.
>
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
> ---
> hw/ppc/spapr_hcall.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index 72ea5a8247..07b3da8dc4 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -1431,11 +1431,10 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *cpu,
>
> } else {
> /* Unicast */
> - CPU_FOREACH(cs) {
> - if (cpu->cpu_dt_id == target) {
> - run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL);
> - return H_SUCCESS;
> - }
> + cs = CPU(ppc_get_vcpu_by_dt_id(target));
> + if (cs) {
> + run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL);
> + return H_SUCCESS;
> }
> return H_PARAMETER;
> }
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2017-08-03 12:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 6:28 [Qemu-devel] [PATCH 0/4] Cleanup cpu_dt_id Sam Bobroff
2017-08-03 6:28 ` [Qemu-devel] [PATCH 1/4] spapr: Fix bug in h_signal_sys_reset() Sam Bobroff
2017-08-03 12:37 ` Greg Kurz [this message]
2017-08-04 2:18 ` [Qemu-devel] [Qemu-ppc] " David Gibson
2017-08-03 6:28 ` [Qemu-devel] [PATCH 2/4] e500: Use cpu_index instead of vcpu_dt_id Sam Bobroff
2017-08-03 13:15 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-08-04 2:21 ` David Gibson
2017-08-03 6:28 ` [Qemu-devel] [PATCH 3/4] ppc: spapr: Rename cpu_dt_id to vcpu_id Sam Bobroff
2017-08-03 13:19 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-08-04 2:25 ` David Gibson
2017-08-03 6:28 ` [Qemu-devel] [PATCH 4/4] ppc: spapr: Make VCPU ID handling private to SPAPR Sam Bobroff
2017-08-03 13:23 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-08-04 3:10 ` [Qemu-devel] " David Gibson
2017-08-07 6:07 ` Sam Bobroff
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=20170803143715.33d0a62c@bahia.lan \
--to=groug@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sam.bobroff@au1.ibm.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).