qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 10/11] target/ppc: created tcg-stub.c file


From: David Gibson
Subject: Re: [RFC PATCH 10/11] target/ppc: created tcg-stub.c file
Date: Mon, 17 May 2021 13:53:21 +1000

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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]