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@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 10/11] target/ppc: created tcg-stub.c file
Date: Mon, 17 May 2021 13:53:21 +1000	[thread overview]
Message-ID: <YKHosTp7I7vpq4uw@yekko> (raw)
In-Reply-To: <4954165f-c4fe-aad8-3d0f-070297e6722c@eldorado.org.br>

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

On Thu, May 13, 2021 at 09:56:27AM -0300, Bruno Piazera Larsen wrote:
> 
> On 13/05/2021 00:59, David Gibson wrote:
> > On Wed, May 12, 2021 at 11:08:12AM -0300, Bruno Larsen (billionai) wrote:
> > > Created a file with stubs needed to compile disabling TCG.
> > > 
> > > We're not sure about keeping the softmmu stubs in this file. if there is
> > > a better place to put them, please let us know.
> > > 
> > > The other 3 functions have been stubbed because we didn't know what to
> > > do with them. Making the file compile in the !TCG case would create an
> > > ifdef hell, but extracting the functions meant moving many others as
> > > well, and there weren't any good places to put them.
> > > 
> > > Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
> > > ---
> > >   target/ppc/tcg-stub.c | 33 +++++++++++++++++++++++++++++++++
> > >   1 file changed, 33 insertions(+)
> > >   create mode 100644 target/ppc/tcg-stub.c
> > > 
> > > diff --git a/target/ppc/tcg-stub.c b/target/ppc/tcg-stub.c
> > > new file mode 100644
> > > index 0000000000..67099e2676
> > > --- /dev/null
> > > +++ b/target/ppc/tcg-stub.c
> > > @@ -0,0 +1,33 @@
> > > +
> > > +#include "qemu/osdep.h"
> > > +#include "exec/hwaddr.h"
> > > +#include "cpu.h"
> > > +#include "hw/ppc/spapr.h"
> > > +
> > > +hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
> > > +{
> > > +    return 0;
> > > +}
> > > +
> > > +void dump_mmu(CPUPPCState *env)
> > > +{
> > > +}
> > > +
> > > +void ppc_tlb_invalidate_all(CPUPPCState *env)
> > > +{
> > > +}
> > > +
> > > +target_ulong softmmu_resize_hpt_prepare(PowerPCCPU *cpu,
> > > +                                        SpaprMachineState *spapr,
> > > +                                        target_ulong shift)
> > > +{
> > > +    g_assert_not_reached();
> > > +}
> > > +
> > > +target_ulong softmmu_resize_hpt_commit(PowerPCCPU* cpu,
> > > +                                       SpaprMachineState *spapr,
> > > +                                       target_ulong flags,
> > > +                                       target_ulong shift)
> > > +{
> > > +    g_assert_not_reached();
> > > +}
> > I think these last two stubs should be obsoleted by the patch from
> > Lucas I already merged "hw/ppc: moved hcalls that depend on softmmu".
> 
> They aren't,

Ah, sorry.  I forgot (again) that the resize_hpt stuff is a bit
different from the other kvm-implemented mmu hypercalls.

> when talking to him he said he wanted to use as few ifdefs as
> possible. Which do you think is better, to go back and ifdef away those
> calls, or keep the stubs? And if we keep the stubs, do we keep them here or
> in hw/ppc/spapr_hcall.c, along with other stubs?

Hmm.. I don't think you should need to do either.  IIUC, when in a
!TCG build, kvm_enabled() should evaluate to true at compile time.  In
which case as long as the calls to these functions are protected by an
if (!kvm_enabled()) the compiler should be able to just figure it out
without stubs.

-- 
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:12 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
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 [this message]
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=YKHosTp7I7vpq4uw@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).