[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 6/6] spapr: Fix bug in h_signal_sys_reset()
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 6/6] spapr: Fix bug in h_signal_sys_reset() |
Date: |
Wed, 9 Aug 2017 17:03:57 +1000 |
From: Sam Bobroff <address@hidden>
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.
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 <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
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;
}
--
2.13.4
- [Qemu-ppc] [PULL 0/6] ppc patch queue 2017-08-09, David Gibson, 2017/08/09
- [Qemu-ppc] [PULL 3/6] target/ppc: Implement TIDR, David Gibson, 2017/08/09
- [Qemu-ppc] [PULL 1/6] booke206: fix MAS update on tlb miss, David Gibson, 2017/08/09
- [Qemu-ppc] [PULL 5/6] spapr_drc: abort if object_property_add_child() fails, David Gibson, 2017/08/09
- [Qemu-ppc] [PULL 6/6] spapr: Fix bug in h_signal_sys_reset(),
David Gibson <=
- [Qemu-ppc] [PULL 4/6] target/ppc: Add stub implementation of the PSSCR, David Gibson, 2017/08/09
- [Qemu-ppc] [PULL 2/6] ppc: fix double-free in cpu_post_load(), David Gibson, 2017/08/09
- Re: [Qemu-ppc] [PULL 0/6] ppc patch queue 2017-08-09, Peter Maydell, 2017/08/10
- Re: [Qemu-ppc] [Qemu-devel] [PULL 0/6] ppc patch queue 2017-08-09, David Gibson, 2017/08/11
- Re: [Qemu-ppc] [Qemu-devel] [PULL 0/6] ppc patch queue 2017-08-09, Peter Maydell, 2017/08/11
- Re: [Qemu-ppc] [Qemu-devel] [PULL 0/6] ppc patch queue 2017-08-09, Philippe Mathieu-Daudé, 2017/08/11
- Re: [Qemu-ppc] [Qemu-devel] [PULL 0/6] ppc patch queue 2017-08-09, David Gibson, 2017/08/14
- Re: [Qemu-ppc] [Qemu-devel] [PULL 0/6] ppc patch queue 2017-08-09, Michael S. Tsirkin, 2017/08/14
- Re: [Qemu-ppc] [Qemu-devel] [PULL 0/6] ppc patch queue 2017-08-09, David Gibson, 2017/08/15