qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Bruno Piazera Larsen <bruno.larsen@eldorado.org.br>
Cc: farosas@linux.ibm.com,
	Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, lucas.araujo@eldorado.org.br,
	fernando.valle@eldorado.org.br, qemu-ppc@nongnu.org,
	matheus.ferst@eldorado.org.br, luis.pires@eldorado.org.br
Subject: Re: [RFC PATCH 08/11] target/ppc: wrapped some TCG only logic with ifdefs
Date: Mon, 17 May 2021 14:10:02 +1000	[thread overview]
Message-ID: <YKHsmsdJx2MKKLe/@yekko> (raw)
In-Reply-To: <b32575a0-07b6-1819-1dec-525277c98cb1@eldorado.org.br>

[-- Attachment #1: Type: text/plain, Size: 3604 bytes --]

On Fri, May 14, 2021 at 01:22:48PM -0300, Bruno Piazera Larsen wrote:
> 
> On 14/05/2021 11:44, Richard Henderson wrote:
> > On 5/14/21 8:29 AM, Bruno Piazera Larsen wrote:
> > > 
> > > On 12/05/2021 15:57, Bruno Piazera Larsen wrote:
> > > > On 12/05/2021 15:33, Richard Henderson wrote:
> > > > > On 5/12/21 9:08 AM, Bruno Larsen (billionai) wrote:
> > > > > > diff --git a/include/exec/helper-proto.h
> > > > > > b/include/exec/helper-proto.h
> > > > > > index ba100793a7..ce287222ee 100644
> > > > > > --- a/include/exec/helper-proto.h
> > > > > > +++ b/include/exec/helper-proto.h
> > > > > > @@ -38,7 +38,9 @@ dh_ctype(ret) HELPER(name)
> > > > > > (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \
> > > > > >   #define IN_HELPER_PROTO
> > > > > >     #include "helper.h"
> > > > > > +#ifdef CONFIG_TCG
> > > > > >   #include "trace/generated-helpers.h"
> > > > > > +#endif
> > > > > >   #include "accel/tcg/tcg-runtime.h"
> > > > > >   #include "accel/tcg/plugin-helpers.h"
> > > > > 
> > > > > Um.. this file is exclusively TCG already.
> > > > > Are you missing some use of helper_foo()?
> > > > A lot of files that we are compiling (mainly mmu-*, excp_helper
> > > > and gdbstub IIRC). We could comb through all of them and remove
> > > > all declarations of helpers and wrap the inclusion of
> > > > helper-proto itself in ifdefs, but it felt unnecessarily long.
> > > > If it is preferable, we can do it.
> > > > 
> > > So, I just looked and we'd need to change excp_helper.c and
> > > mmu-hash64.c, encasing 14 and 8 helper_foo() declarations. Is it
> > > better to work on those 2 files, or to change helper-proto?
> > 
> > Let's work on excp_helper.c and mmu-hash64.c.
> > 
> > For excp_helper.c, ideally everything in there would be tcg related. 
> > Either explicitly as helper_foo() or by being one of the TCGCPUOps
> > functions like ppc_cpu_exec_interrupt.
> 
> Removing excp_helper.c gives linker errors for the functions:
> 
> * ppc_cpu_do_system_reset, on hw/ppc/pnv.c and hw/ppc/spapr.c

Oof, that's a bit tricky.  We definitely do need this system reset
injection for KVM as well as TCG.  Unfortunately it calls into
powerpc_excp() which I think has a bunch of TCG specific stuff as
well.

Long term, I think the thing would be to remove the giant ugly
multiplexer in powerpc_excp() in favour of different entry points.
But that's a big job.

Short term, littering it with ifdefs might be the least worst we can
do.  Richard, any better ideas?


> * ppc_do_cpu_interrupt, on hw/ppc/spapr_events.c and target/ppc/kvm.c, and
> from what was discussed on the IRC this should still be compiled

Similar situation to above, but much easier because it doesn't go
through the giant multiplexer.
> 
> 
> I think ppc_do_cpu_interrupt could go to cpu.c, but no clue where the others
> should go.

Yes, moving ppc_cpu_do_interrupt() to common code is the right call.

> 
> > 
> > For mmu-hash64.c... I guess the easiest thing in the short term is to
> > put big ifdefs around helper_slbi{a,e,eg}.  Or they could be moved to
> > mmu_helper.c, with slb_lookup declared in mmu-hash64.h.
> > 
> The ifdefs are easy enough, and not compiling it gives way too many linker
> errors. Moving the helpers and static functions sounds the cleanest though,
> so I'll look into it while I wait for the excp_helper help
> > 
> > r~

-- 
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 --]

  reply	other threads:[~2021-05-17  4:15 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 14:08 [RFC PATCH 00/11] target/ppc: add support to disable-tcg Bruno Larsen (billionai)
2021-05-12 14:08 ` [PATCH 01/11] target/ppc: created ppc_{store, get}_vscr for generic vscr usage Bruno Larsen (billionai)
2021-05-12 16:48   ` [PATCH 01/11] target/ppc: created ppc_{store,get}_vscr " Richard Henderson
2021-05-13  3:48   ` David Gibson
2021-05-12 14:08 ` [PATCH 02/11] target/ppc: moved ppc_store_sdr1 to cpu.c Bruno Larsen (billionai)
2021-05-12 16:54   ` Richard Henderson
2021-05-13  3:50   ` David Gibson
2021-05-31 18:17     ` Bruno Piazera Larsen
2021-06-07  3:50       ` David Gibson
2021-05-12 14:08 ` [PATCH 03/11] target/ppc: moved ppc_cpu_dump_state to cpu_init.c Bruno Larsen (billionai)
2021-05-12 16:58   ` Richard Henderson
2021-05-12 17:00     ` Richard Henderson
2021-05-13  3:51   ` David Gibson
2021-05-12 14:08 ` [PATCH 04/11] target/ppc: moved ppc_store_msr into gdbstub.c Bruno Larsen (billionai)
2021-05-12 17:05   ` Richard Henderson
2021-05-13  3:52     ` David Gibson
2021-05-12 14:08 ` [PATCH 05/11] target/ppc: moved ppc_store_lpcr to cpu.c Bruno Larsen (billionai)
2021-05-12 17:07   ` Richard Henderson
2021-05-13  3:53   ` David Gibson
2021-05-12 14:08 ` [PATCH 06/11] target/ppc: updated vscr manipulation in machine.c Bruno Larsen (billionai)
2021-05-12 17:08   ` Richard Henderson
2021-05-13  3:54     ` David Gibson
2021-05-12 14:08 ` [PATCH 07/11] target/ppc: added KVM fallback to fpscr manipulation Bruno Larsen (billionai)
2021-05-12 18:20   ` Richard Henderson
2021-05-12 19:15     ` Bruno Piazera Larsen
2021-05-13 16:36     ` Bruno Piazera Larsen
2021-05-13 22:45       ` Richard Henderson
2021-05-14 11:12         ` Bruno Piazera Larsen
2021-05-12 14:08 ` [RFC PATCH 08/11] target/ppc: wrapped some TCG only logic with ifdefs Bruno Larsen (billionai)
2021-05-12 18:33   ` Richard Henderson
2021-05-12 18:57     ` Bruno Piazera Larsen
2021-05-14 13:29       ` Bruno Piazera Larsen
2021-05-14 14:44         ` Richard Henderson
2021-05-14 16:22           ` Bruno Piazera Larsen
2021-05-17  4:10             ` David Gibson [this message]
2021-05-17 16:07               ` Richard Henderson
2021-05-17  4:00           ` David Gibson
2021-05-24 18:01     ` Bruno Piazera Larsen
2021-05-24 20:03       ` Richard Henderson
2021-05-12 14:08 ` [PATCH 09/11] include/exec: added functions to the stubs in exec-all.h Bruno Larsen (billionai)
2021-05-12 18:34   ` Richard Henderson
2021-05-13 14:03     ` Lucas Mateus Martins Araujo e Castro
2021-05-13 23:44       ` Richard Henderson
2021-05-17  3:58         ` David Gibson
2021-05-17 16:59           ` Lucas Mateus Martins Araujo e Castro
2021-05-17 18:02             ` Richard Henderson
2021-05-18 18:45               ` Bruno Piazera Larsen
2021-05-24  3:18             ` David Gibson
2021-05-17  3:55       ` David Gibson
2021-05-17 11:07         ` Bruno Piazera Larsen
2021-05-24  3:15           ` David Gibson
2021-05-12 14:08 ` [RFC PATCH 10/11] target/ppc: created tcg-stub.c file Bruno Larsen (billionai)
2021-05-12 18:39   ` Richard Henderson
2021-05-12 19:09     ` Bruno Piazera Larsen
2021-05-14 18:07     ` Bruno Piazera Larsen
2021-05-13  3:59   ` David Gibson
2021-05-13 12:56     ` Bruno Piazera Larsen
2021-05-17  3:53       ` David Gibson
2021-05-12 14:08 ` [PATCH 11/11] target/ppc: updated meson.build to support disable-tcg Bruno Larsen (billionai)

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=YKHsmsdJx2MKKLe/@yekko \
    --to=david@gibson.dropbear.id.au \
    --cc=bruno.larsen@eldorado.org.br \
    --cc=farosas@linux.ibm.com \
    --cc=fernando.valle@eldorado.org.br \
    --cc=lucas.araujo@eldorado.org.br \
    --cc=luis.pires@eldorado.org.br \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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).