All of lore.kernel.org
 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, qemu-devel@nongnu.org,
	richard.henderson@linaro.org, luis.pires@eldorado.org.br,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	lucas.araujo@eldorado.org.br, fernando.valle@eldorado.org.br,
	qemu-ppc@nongnu.org, matheus.ferst@eldorado.org.br
Subject: Re: [PATCH v5 2/4] target/ppc: added ifdefs around TCG-only code
Date: Thu, 27 May 2021 14:18:08 +1000	[thread overview]
Message-ID: <YK8dgHfO7E4AApVd@yekko> (raw)
In-Reply-To: <abf18c12-129f-b1a5-5d67-90fc6fa71afe@eldorado.org.br>

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

On Wed, May 26, 2021 at 02:24:32PM -0300, Bruno Piazera Larsen wrote:
> 
> On 25/05/2021 10:02, Philippe Mathieu-Daudé wrote:
> > On 5/25/21 1:53 PM, Bruno Larsen (billionai) wrote:
> > > excp_helper.c, mmu-hash64.c and mmu_helper.c have some function
> > > declarations that are TCG-only, and couldn't be easily moved to a
> > > TCG only file, so ifdefs were added around them.
> > > 
> > > We also needed ifdefs around some header files because helper-proto.h
> > > includes trace/generated-helpers.h, which is never created when building
> > > without TCG, and cpu_ldst.h includes tcg/tcg.h, whose containing folder
> > > is not included as a -iquote. As future cleanup, we could change the
> > > part of the configuration script to add those.
> > > 
> > > cpu_init.c also had a callback definition that is TCG only and could be
> > > removed as part of a future cleanup (all the dump_statistics part is
> > > almost never used and will become obsolete as we transition to using
> > > decodetree).
> > > 
> > > Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
> > > ---
> > >   target/ppc/cpu_init.c    |  2 ++
> > >   target/ppc/excp_helper.c | 21 ++++++++++++++++++---
> > >   target/ppc/mmu-hash64.c  | 11 ++++++++++-
> > >   target/ppc/mmu_helper.c  | 16 ++++++++++++++--
> > >   4 files changed, 44 insertions(+), 6 deletions(-)
> > Please have a look at commit range 0a31c16c9ce..a2b0a27d33e
> > for the MIPS convertion.
> > 
> > >   #if !defined(CONFIG_USER_ONLY)
> > > +#ifdef CONFIG_TCG
> > >   void helper_store_msr(CPUPPCState *env, target_ulong val)
> > >   {
> > For example this one is similar to commit d60146a9389, you
> > could simply move this function to tcg/sysemu/msr_helpers.c
> > and modify the meson file, then when TCG is not available,
> > the file isn't built, without having to use #ifdef'ry.
> 
> I can see what you mean, but I think the point was to not create separate
> files solely based on the accelerator type.
> 
> It's up to dgibson if we use that approach, but I agree that it could make
> the code quite a bit cleaner.
> 
> The next question would then be: should we go the whole 9 yards and add
> tcg/sysemu/* and tcg/linux-user/*, or can we just use tcg/* and rely on devs
> reading and understanding the meson.build file? I believe tcg/sysemu/* is
> going to be very empty (for now, only what is in mmu-hash64.c and is
> TCG-only, IIRC), so it sounds like a bit of an overkill, but I also see the
> argument for future-proofing.

The ifdefs are pretty messy, but drafts based on splitting into
separate files have hit their own complications.  So, I'm inclined to
just go with the ifdefs for now, and hope to clean things up further
in future.

So, applied to ppc-for-6.1.

-- 
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-27  7:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 11:53 [PATCH v5 0/4] target/ppc: add support to disable-tcg Bruno Larsen (billionai)
2021-05-25 11:53 ` [PATCH v5 1/4] target/ppc: used ternary operator when registering MAS Bruno Larsen (billionai)
2021-05-27  4:13   ` David Gibson
2021-05-25 11:53 ` [PATCH v5 2/4] target/ppc: added ifdefs around TCG-only code Bruno Larsen (billionai)
2021-05-25 13:02   ` Philippe Mathieu-Daudé
2021-05-26 17:24     ` Bruno Piazera Larsen
2021-05-27  4:18       ` David Gibson [this message]
2021-05-25 11:53 ` [PATCH v5 3/4] target/ppc: created tcg-stub.c file Bruno Larsen (billionai)
2021-05-27  4:18   ` David Gibson
2021-05-25 11:53 ` [PATCH v5 4/4] target/ppc: updated meson.build to support disable-tcg Bruno Larsen (billionai)
2021-05-27  5:10   ` David Gibson

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=YK8dgHfO7E4AApVd@yekko \
    --to=david@gibson.dropbear.id.au \
    --cc=bruno.larsen@eldorado.org.br \
    --cc=f4bug@amsat.org \
    --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 \
    --subject='Re: [PATCH v5 2/4] target/ppc: added ifdefs around TCG-only code' \
    /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

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.