* Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector [not found] <mailman.138.1584442890.3017.qemu-ppc@nongnu.org> @ 2020-03-17 15:06 ` Programmingkid 2020-03-17 22:46 ` David Gibson 0 siblings, 1 reply; 10+ messages in thread From: Programmingkid @ 2020-03-17 15:06 UTC (permalink / raw) To: qemu-ppc, Cédric Le Goater, David Gibson, npiggin Cc: Aravinda Prasad, Ganesh Goudar, Greg Kurz, QEMU Developers > On Mar 17, 2020, at 7:01 AM, qemu-ppc-request@nongnu.org wrote: > > Message: 3 > Date: Tue, 17 Mar 2020 11:47:32 +0100 > From: Cédric Le Goater <clg@kaod.org> > To: David Gibson <david@gibson.dropbear.id.au>, Nicholas Piggin > <npiggin@gmail.com> > Cc: qemu-ppc@nongnu.org, Aravinda Prasad <arawinda.p@gmail.com>, > Ganesh Goudar <ganeshgr@linux.ibm.com>, Greg Kurz <groug@kaod.org>, > qemu-devel@nongnu.org > Subject: Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset > to take an alternate vector > Message-ID: <097148e5-78be-a294-236d-160fb5c29d4a@kaod.org> > Content-Type: text/plain; charset=windows-1252 > > On 3/17/20 12:34 AM, David Gibson wrote: >> On Tue, Mar 17, 2020 at 09:28:24AM +1000, Nicholas Piggin wrote: >>> Cédric Le Goater's on March 17, 2020 4:15 am: >>>> On 3/16/20 3:26 PM, Nicholas Piggin wrote: >>>>> Provide for an alternate delivery location, -1 defaults to the >>>>> architected address. >>>> >>>> I don't know what is the best approach, to override the vector addr >>>> computed by powerpc_excp() or use a machine class handler with >>>> cpu->vhyp. >>> >>> Yeah it's getting a bit ad hoc and inconsistent with machine check >>> etc, I just figured get something minimal in there now. The whole >>> exception delivery needs a spring clean though. >> Currently Mac OS 9 will not restart. When someone goes to restart it the screen will turn black and stay that way. Could this patch solve this problem? ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-17 15:06 ` [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector Programmingkid @ 2020-03-17 22:46 ` David Gibson 2020-03-19 20:49 ` Programmingkid 0 siblings, 1 reply; 10+ messages in thread From: David Gibson @ 2020-03-17 22:46 UTC (permalink / raw) To: Programmingkid Cc: Aravinda Prasad, Greg Kurz, npiggin, QEMU Developers, Ganesh Goudar, Cédric Le Goater, qemu-ppc [-- Attachment #1: Type: text/plain, Size: 1952 bytes --] On Tue, Mar 17, 2020 at 11:06:15AM -0400, Programmingkid wrote: > > > On Mar 17, 2020, at 7:01 AM, qemu-ppc-request@nongnu.org wrote: > > > > Message: 3 > > Date: Tue, 17 Mar 2020 11:47:32 +0100 > > From: Cédric Le Goater <clg@kaod.org> > > To: David Gibson <david@gibson.dropbear.id.au>, Nicholas Piggin > > <npiggin@gmail.com> > > Cc: qemu-ppc@nongnu.org, Aravinda Prasad <arawinda.p@gmail.com>, > > Ganesh Goudar <ganeshgr@linux.ibm.com>, Greg Kurz <groug@kaod.org>, > > qemu-devel@nongnu.org > > Subject: Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset > > to take an alternate vector > > Message-ID: <097148e5-78be-a294-236d-160fb5c29d4a@kaod.org> > > Content-Type: text/plain; charset=windows-1252 > > > > On 3/17/20 12:34 AM, David Gibson wrote: > >> On Tue, Mar 17, 2020 at 09:28:24AM +1000, Nicholas Piggin wrote: > >>> Cédric Le Goater's on March 17, 2020 4:15 am: > >>>> On 3/16/20 3:26 PM, Nicholas Piggin wrote: > >>>>> Provide for an alternate delivery location, -1 defaults to the > >>>>> architected address. > >>>> > >>>> I don't know what is the best approach, to override the vector addr > >>>> computed by powerpc_excp() or use a machine class handler with > >>>> cpu->vhyp. > >>> > >>> Yeah it's getting a bit ad hoc and inconsistent with machine check > >>> etc, I just figured get something minimal in there now. The whole > >>> exception delivery needs a spring clean though. > >> > > Currently Mac OS 9 will not restart. When someone goes to restart it > the screen will turn black and stay that way. Could this patch solve > this problem? No. It's unlikely to be related, and at this stage is used exclusively to implement the FWNMI stuff for the pseries machine. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-17 22:46 ` David Gibson @ 2020-03-19 20:49 ` Programmingkid 0 siblings, 0 replies; 10+ messages in thread From: Programmingkid @ 2020-03-19 20:49 UTC (permalink / raw) To: David Gibson Cc: Aravinda Prasad, Greg Kurz, npiggin, QEMU Developers, Ganesh Goudar, Cédric Le Goater, qemu-ppc > On Mar 17, 2020, at 6:46 PM, David Gibson <david@gibson.dropbear.id.au> wrote: > > On Tue, Mar 17, 2020 at 11:06:15AM -0400, Programmingkid wrote: >> >>> On Mar 17, 2020, at 7:01 AM, qemu-ppc-request@nongnu.org wrote: >>> >>> Message: 3 >>> Date: Tue, 17 Mar 2020 11:47:32 +0100 >>> From: Cédric Le Goater <clg@kaod.org> >>> To: David Gibson <david@gibson.dropbear.id.au>, Nicholas Piggin >>> <npiggin@gmail.com> >>> Cc: qemu-ppc@nongnu.org, Aravinda Prasad <arawinda.p@gmail.com>, >>> Ganesh Goudar <ganeshgr@linux.ibm.com>, Greg Kurz <groug@kaod.org>, >>> qemu-devel@nongnu.org >>> Subject: Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset >>> to take an alternate vector >>> Message-ID: <097148e5-78be-a294-236d-160fb5c29d4a@kaod.org> >>> Content-Type: text/plain; charset=windows-1252 >>> >>> On 3/17/20 12:34 AM, David Gibson wrote: >>>> On Tue, Mar 17, 2020 at 09:28:24AM +1000, Nicholas Piggin wrote: >>>>> Cédric Le Goater's on March 17, 2020 4:15 am: >>>>>> On 3/16/20 3:26 PM, Nicholas Piggin wrote: >>>>>>> Provide for an alternate delivery location, -1 defaults to the >>>>>>> architected address. >>>>>> >>>>>> I don't know what is the best approach, to override the vector addr >>>>>> computed by powerpc_excp() or use a machine class handler with >>>>>> cpu->vhyp. >>>>> >>>>> Yeah it's getting a bit ad hoc and inconsistent with machine check >>>>> etc, I just figured get something minimal in there now. The whole >>>>> exception delivery needs a spring clean though. >>>> >> >> Currently Mac OS 9 will not restart. When someone goes to restart it >> the screen will turn black and stay that way. Could this patch solve >> this problem? > > No. It's unlikely to be related, and at this stage is used > exclusively to implement the FWNMI stuff for the pseries machine. > > -- > David Gibson | I'll have my music baroque, and my code > david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ > | _way_ _around_! > http://www.ozlabs.org/~dgibson Ok. Thank you. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 0/8] FWNMI fixes / changes @ 2020-03-16 14:26 Nicholas Piggin 2020-03-16 14:26 ` [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector Nicholas Piggin 0 siblings, 1 reply; 10+ messages in thread From: Nicholas Piggin @ 2020-03-16 14:26 UTC (permalink / raw) To: qemu-ppc Cc: Aravinda Prasad, Alexey Kardashevskiy, qemu-devel, Nicholas Piggin, Greg Kurz, Ganesh Goudar, David Gibson Hi, Since v1, I fixed the intermediate compile error spotted by Greg, and rediffed the series on top of ppc-for-5.0, plus Alexey's patch ("spapr/rtas: Reserve space for RTAS blob and log"). The first 6 patches are otherwise unchanged since last posting. Patch 7 implements fwnim sreset interrupts now in a way that's compatible with existing Linux guests (which doesn't necessarily quite match PAPR, but does match PowerVM behaviour). Patch 8 isn't required but it papers over Linux warning messages caused by another quirk. Thanks, Nick Nicholas Piggin (8): ppc/spapr: Fix FWNMI machine check failure handling ppc/spapr: Change FWNMI names ppc/spapr: Add FWNMI System Reset state ppc/spapr: Fix FWNMI machine check interrupt delivery ppc/spapr: Allow FWNMI on TCG target/ppc: Allow ppc_cpu_do_system_reset to take an alternate vector ppc/spapr: Implement FWNMI System Reset delivery ppc/spapr: Ignore common "ibm,nmi-interlock" Linux bug hw/ppc/spapr.c | 76 ++++++++++++++++++++++------- hw/ppc/spapr_caps.c | 19 ++++---- hw/ppc/spapr_events.c | 38 ++++----------- hw/ppc/spapr_rtas.c | 43 +++++++++++++---- include/hw/ppc/spapr.h | 28 +++++++---- target/ppc/cpu.h | 3 +- target/ppc/excp_helper.c | 79 ++++++++++++++++++++++--------- tests/qtest/libqos/libqos-spapr.h | 2 +- 8 files changed, 188 insertions(+), 100 deletions(-) -- 2.23.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-16 14:26 [PATCH v2 0/8] FWNMI fixes / changes Nicholas Piggin @ 2020-03-16 14:26 ` Nicholas Piggin 2020-03-16 18:04 ` Greg Kurz 2020-03-16 18:15 ` Cédric Le Goater 0 siblings, 2 replies; 10+ messages in thread From: Nicholas Piggin @ 2020-03-16 14:26 UTC (permalink / raw) To: qemu-ppc Cc: Aravinda Prasad, Alexey Kardashevskiy, qemu-devel, Nicholas Piggin, Greg Kurz, Ganesh Goudar, David Gibson Provide for an alternate delivery location, -1 defaults to the architected address. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- hw/ppc/spapr.c | 2 +- target/ppc/cpu.h | 2 +- target/ppc/excp_helper.c | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5f93c49706..25221d843c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3400,7 +3400,7 @@ static void spapr_machine_finalizefn(Object *obj) void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg) { cpu_synchronize_state(cs); - ppc_cpu_do_system_reset(cs); + ppc_cpu_do_system_reset(cs, -1); } static void spapr_nmi(NMIState *n, int cpu_index, Error **errp) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 3953680534..f8c7d6f19c 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1220,7 +1220,7 @@ int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque); #ifndef CONFIG_USER_ONLY -void ppc_cpu_do_system_reset(CPUState *cs); +void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector); void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector); extern const VMStateDescription vmstate_ppc_cpu; #endif diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 7f2b5899d3..08bc885ca6 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -961,12 +961,15 @@ static void ppc_hw_interrupt(CPUPPCState *env) } } -void ppc_cpu_do_system_reset(CPUState *cs) +void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector) { PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_RESET); + if (vector != -1) { + env->nip = vector; + } } void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector) -- 2.23.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-16 14:26 ` [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector Nicholas Piggin @ 2020-03-16 18:04 ` Greg Kurz 2020-03-16 18:15 ` Cédric Le Goater 1 sibling, 0 replies; 10+ messages in thread From: Greg Kurz @ 2020-03-16 18:04 UTC (permalink / raw) To: Nicholas Piggin Cc: Aravinda Prasad, Alexey Kardashevskiy, qemu-devel, Ganesh Goudar, qemu-ppc, David Gibson On Tue, 17 Mar 2020 00:26:11 +1000 Nicholas Piggin <npiggin@gmail.com> wrote: > Provide for an alternate delivery location, -1 defaults to the > architected address. > > Signed-off-by: Nicholas Piggin <npiggin@gmail.com> > --- Reviewed-by: Greg Kurz <groug@kaod.org> > hw/ppc/spapr.c | 2 +- > target/ppc/cpu.h | 2 +- > target/ppc/excp_helper.c | 5 ++++- > 3 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 5f93c49706..25221d843c 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -3400,7 +3400,7 @@ static void spapr_machine_finalizefn(Object *obj) > void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg) > { > cpu_synchronize_state(cs); > - ppc_cpu_do_system_reset(cs); > + ppc_cpu_do_system_reset(cs, -1); > } > > static void spapr_nmi(NMIState *n, int cpu_index, Error **errp) > diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h > index 3953680534..f8c7d6f19c 100644 > --- a/target/ppc/cpu.h > +++ b/target/ppc/cpu.h > @@ -1220,7 +1220,7 @@ int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, > int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, > int cpuid, void *opaque); > #ifndef CONFIG_USER_ONLY > -void ppc_cpu_do_system_reset(CPUState *cs); > +void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector); > void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector); > extern const VMStateDescription vmstate_ppc_cpu; > #endif > diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c > index 7f2b5899d3..08bc885ca6 100644 > --- a/target/ppc/excp_helper.c > +++ b/target/ppc/excp_helper.c > @@ -961,12 +961,15 @@ static void ppc_hw_interrupt(CPUPPCState *env) > } > } > > -void ppc_cpu_do_system_reset(CPUState *cs) > +void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector) > { > PowerPCCPU *cpu = POWERPC_CPU(cs); > CPUPPCState *env = &cpu->env; > > powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_RESET); > + if (vector != -1) { > + env->nip = vector; > + } > } > > void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-16 14:26 ` [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector Nicholas Piggin 2020-03-16 18:04 ` Greg Kurz @ 2020-03-16 18:15 ` Cédric Le Goater 2020-03-16 23:28 ` Nicholas Piggin 2020-03-16 23:28 ` David Gibson 1 sibling, 2 replies; 10+ messages in thread From: Cédric Le Goater @ 2020-03-16 18:15 UTC (permalink / raw) To: Nicholas Piggin, qemu-ppc Cc: Aravinda Prasad, David Gibson, Ganesh Goudar, qemu-devel, Greg Kurz On 3/16/20 3:26 PM, Nicholas Piggin wrote: > Provide for an alternate delivery location, -1 defaults to the > architected address. I don't know what is the best approach, to override the vector addr computed by powerpc_excp() or use a machine class handler with cpu->vhyp. > Signed-off-by: Nicholas Piggin <npiggin@gmail.com> > --- > hw/ppc/spapr.c | 2 +- > target/ppc/cpu.h | 2 +- > target/ppc/excp_helper.c | 5 ++++- > 3 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 5f93c49706..25221d843c 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -3400,7 +3400,7 @@ static void spapr_machine_finalizefn(Object *obj) > void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg) > { > cpu_synchronize_state(cs); > - ppc_cpu_do_system_reset(cs); > + ppc_cpu_do_system_reset(cs, -1); > } > > static void spapr_nmi(NMIState *n, int cpu_index, Error **errp) > diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h > index 3953680534..f8c7d6f19c 100644 > --- a/target/ppc/cpu.h > +++ b/target/ppc/cpu.h > @@ -1220,7 +1220,7 @@ int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, > int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, > int cpuid, void *opaque); > #ifndef CONFIG_USER_ONLY > -void ppc_cpu_do_system_reset(CPUState *cs); > +void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector); > void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector); > extern const VMStateDescription vmstate_ppc_cpu; > #endif > diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c > index 7f2b5899d3..08bc885ca6 100644 > --- a/target/ppc/excp_helper.c > +++ b/target/ppc/excp_helper.c > @@ -961,12 +961,15 @@ static void ppc_hw_interrupt(CPUPPCState *env) > } > } > > -void ppc_cpu_do_system_reset(CPUState *cs) > +void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector) > { > PowerPCCPU *cpu = POWERPC_CPU(cs); > CPUPPCState *env = &cpu->env; > > powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_RESET); > + if (vector != -1) { > + env->nip = vector; > + } > } > > void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector) > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-16 18:15 ` Cédric Le Goater @ 2020-03-16 23:28 ` Nicholas Piggin 2020-03-16 23:34 ` David Gibson 2020-03-16 23:28 ` David Gibson 1 sibling, 1 reply; 10+ messages in thread From: Nicholas Piggin @ 2020-03-16 23:28 UTC (permalink / raw) To: Cédric Le Goater, qemu-ppc Cc: Aravinda Prasad, qemu-devel, Ganesh Goudar, Greg Kurz, David Gibson Cédric Le Goater's on March 17, 2020 4:15 am: > On 3/16/20 3:26 PM, Nicholas Piggin wrote: >> Provide for an alternate delivery location, -1 defaults to the >> architected address. > > I don't know what is the best approach, to override the vector addr > computed by powerpc_excp() or use a machine class handler with > cpu->vhyp. Yeah it's getting a bit ad hoc and inconsistent with machine check etc, I just figured get something minimal in there now. The whole exception delivery needs a spring clean though. Thanks, Nick ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-16 23:28 ` Nicholas Piggin @ 2020-03-16 23:34 ` David Gibson 2020-03-17 10:47 ` Cédric Le Goater 0 siblings, 1 reply; 10+ messages in thread From: David Gibson @ 2020-03-16 23:34 UTC (permalink / raw) To: Nicholas Piggin Cc: Aravinda Prasad, qemu-devel, Greg Kurz, Ganesh Goudar, Cédric Le Goater, qemu-ppc [-- Attachment #1: Type: text/plain, Size: 1065 bytes --] On Tue, Mar 17, 2020 at 09:28:24AM +1000, Nicholas Piggin wrote: > Cédric Le Goater's on March 17, 2020 4:15 am: > > On 3/16/20 3:26 PM, Nicholas Piggin wrote: > >> Provide for an alternate delivery location, -1 defaults to the > >> architected address. > > > > I don't know what is the best approach, to override the vector addr > > computed by powerpc_excp() or use a machine class handler with > > cpu->vhyp. > > Yeah it's getting a bit ad hoc and inconsistent with machine check > etc, I just figured get something minimal in there now. The whole > exception delivery needs a spring clean though. Yeah, there's a huge amount of cruft in nearly all the softmmu code. It's such a big task that I don't really have any plans to tackle it specifically. Instead I've been cleaning up little pieces as they impinge on things I actually care about. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-16 23:34 ` David Gibson @ 2020-03-17 10:47 ` Cédric Le Goater 0 siblings, 0 replies; 10+ messages in thread From: Cédric Le Goater @ 2020-03-17 10:47 UTC (permalink / raw) To: David Gibson, Nicholas Piggin Cc: Aravinda Prasad, Ganesh Goudar, qemu-ppc, Greg Kurz, qemu-devel On 3/17/20 12:34 AM, David Gibson wrote: > On Tue, Mar 17, 2020 at 09:28:24AM +1000, Nicholas Piggin wrote: >> Cédric Le Goater's on March 17, 2020 4:15 am: >>> On 3/16/20 3:26 PM, Nicholas Piggin wrote: >>>> Provide for an alternate delivery location, -1 defaults to the >>>> architected address. >>> >>> I don't know what is the best approach, to override the vector addr >>> computed by powerpc_excp() or use a machine class handler with >>> cpu->vhyp. >> >> Yeah it's getting a bit ad hoc and inconsistent with machine check >> etc, I just figured get something minimal in there now. The whole >> exception delivery needs a spring clean though. > > Yeah, there's a huge amount of cruft in nearly all the softmmu code. The MMU emulation is not that bad to read. However, the exception model is hideous as one would say. powerpc_excp() is my favorite. > It's such a big task that I don't really have any plans to tackle it > specifically. Instead I've been cleaning up little pieces as they > impinge on things I actually care about. Maybe we should extract book3s to start with. C. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-16 18:15 ` Cédric Le Goater 2020-03-16 23:28 ` Nicholas Piggin @ 2020-03-16 23:28 ` David Gibson 1 sibling, 0 replies; 10+ messages in thread From: David Gibson @ 2020-03-16 23:28 UTC (permalink / raw) To: Cédric Le Goater Cc: Aravinda Prasad, qemu-devel, Nicholas Piggin, Greg Kurz, Ganesh Goudar, qemu-ppc [-- Attachment #1: Type: text/plain, Size: 2864 bytes --] On Mon, Mar 16, 2020 at 07:15:14PM +0100, Cédric Le Goater wrote: > On 3/16/20 3:26 PM, Nicholas Piggin wrote: > > Provide for an alternate delivery location, -1 defaults to the > > architected address. > > I don't know what is the best approach, to override the vector addr > computed by powerpc_excp() or use a machine class handler with > cpu->vhyp. Again, in the interests of getting this in for the soft freeze, I've applied this now. We can clean it up later. > > > Signed-off-by: Nicholas Piggin <npiggin@gmail.com> > > --- > > hw/ppc/spapr.c | 2 +- > > target/ppc/cpu.h | 2 +- > > target/ppc/excp_helper.c | 5 ++++- > > 3 files changed, 6 insertions(+), 3 deletions(-) > > > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > index 5f93c49706..25221d843c 100644 > > --- a/hw/ppc/spapr.c > > +++ b/hw/ppc/spapr.c > > @@ -3400,7 +3400,7 @@ static void spapr_machine_finalizefn(Object *obj) > > void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg) > > { > > cpu_synchronize_state(cs); > > - ppc_cpu_do_system_reset(cs); > > + ppc_cpu_do_system_reset(cs, -1); > > } > > > > static void spapr_nmi(NMIState *n, int cpu_index, Error **errp) > > diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h > > index 3953680534..f8c7d6f19c 100644 > > --- a/target/ppc/cpu.h > > +++ b/target/ppc/cpu.h > > @@ -1220,7 +1220,7 @@ int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, > > int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, > > int cpuid, void *opaque); > > #ifndef CONFIG_USER_ONLY > > -void ppc_cpu_do_system_reset(CPUState *cs); > > +void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector); > > void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector); > > extern const VMStateDescription vmstate_ppc_cpu; > > #endif > > diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c > > index 7f2b5899d3..08bc885ca6 100644 > > --- a/target/ppc/excp_helper.c > > +++ b/target/ppc/excp_helper.c > > @@ -961,12 +961,15 @@ static void ppc_hw_interrupt(CPUPPCState *env) > > } > > } > > > > -void ppc_cpu_do_system_reset(CPUState *cs) > > +void ppc_cpu_do_system_reset(CPUState *cs, target_ulong vector) > > { > > PowerPCCPU *cpu = POWERPC_CPU(cs); > > CPUPPCState *env = &cpu->env; > > > > powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_RESET); > > + if (vector != -1) { > > + env->nip = vector; > > + } > > } > > > > void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector) > > > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-03-19 20:51 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <mailman.138.1584442890.3017.qemu-ppc@nongnu.org> 2020-03-17 15:06 ` [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector Programmingkid 2020-03-17 22:46 ` David Gibson 2020-03-19 20:49 ` Programmingkid 2020-03-16 14:26 [PATCH v2 0/8] FWNMI fixes / changes Nicholas Piggin 2020-03-16 14:26 ` [PATCH v2 6/8] target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector Nicholas Piggin 2020-03-16 18:04 ` Greg Kurz 2020-03-16 18:15 ` Cédric Le Goater 2020-03-16 23:28 ` Nicholas Piggin 2020-03-16 23:34 ` David Gibson 2020-03-17 10:47 ` Cédric Le Goater 2020-03-16 23:28 ` David Gibson
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).