qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/3] PPC64: Implement slbmte
Date: Mon, 2 Mar 2009 21:28:52 +0200	[thread overview]
Message-ID: <f43fc5580903021128n517f9e25i7b456219e9b84c8c@mail.gmail.com> (raw)
In-Reply-To: <E5D5B27F-D0E1-4B14-94F9-854445DC55BB@suse.de>

On 3/2/09, Alexander Graf <agraf@suse.de> wrote:
>
>  On 02.03.2009, at 19:58, Blue Swirl wrote:
>
>
> > On 3/2/09, Alexander Graf <agraf@suse.de> wrote:
> >
> > > In order to modify SLB entries on recent PPC64 machines, the slbmte
> > > instruction is used.
> > >
> > > This patch implements the slbmte instruction and makes the "bridge"
> > > mode code use the slb set functions, so we can move the SLB into
> > > the CPU struct later.
> > >
> > > This is required for Linux to run on PPC64.
> > >
> > > Signed-off-by: Alexander Graf <alex@csgraf.de>
> > >
> >
> >
> > >  void ppc_store_sr (CPUPPCState *env, int srnum, target_ulong value)
> > >  {
> > >    LOG_MMU("%s: reg=%d " ADDRX " " ADDRX "\n",
> > >                __func__, srnum, value, env->sr[srnum]);
> > > -    if (env->sr[srnum] != value) {
> > > +    if (env->mmu_model & POWERPC_MMU_64) {
> > >
> >
> >
> > >  target_ulong helper_load_sr (target_ulong sr_num)
> > >  {
> > > +    if (env->mmu_model & POWERPC_MMU_64)
> > > +        return ppc_load_sr(env, sr_num);
> > >    return env->sr[sr_num];
> > >  }
> > >
> >
> > It would be faster to move the MMU model checks to translation time.
> >
>
>  The problem is that we don't know which -cpu the user will give us when we
> run qemu-system-ppc64.
>  Of course we could just make qemu-system-ppc64 not take any non-64 bit
> CPUs, if nobody totally disagrees.

env could contain a pointer to (static const) structure describing the
CPU features. This pointer would be copied to corresponding
DisasContext feature pointer, to be used by the translation functions.

See for example target-sparc: translate.c (CHECK_IU_FEATURE macro) and
helper.c for CPU definitions. IIRC MIPS or ARM have even nicer macros.

  parent reply	other threads:[~2009-03-02 19:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02 17:07 [Qemu-devel] [PATCH 0/3] PPC64 Linux bringup patches Alexander Graf
2009-03-02 17:07 ` [Qemu-devel] [PATCH 1/3] PPC: Circumvent overflow in mtcrf Alexander Graf
2009-03-02 17:07   ` [Qemu-devel] [PATCH 2/3] PPC64: Implement slbmte Alexander Graf
2009-03-02 17:07     ` [Qemu-devel] [PATCH 3/3] PPC64: Implement large pages Alexander Graf
2009-03-02 18:58     ` [Qemu-devel] Re: [PATCH 2/3] PPC64: Implement slbmte Blue Swirl
2009-03-02 19:00       ` Alexander Graf
2009-03-02 19:07         ` Paul Brook
2009-03-02 19:28         ` Blue Swirl [this message]
2009-03-02 19:47           ` Alexander Graf
2009-03-02 18:53   ` [Qemu-devel] Re: [PATCH 1/3] PPC: Circumvent overflow in mtcrf Blue Swirl
2009-03-02 22:45   ` [Qemu-devel] " Laurent Desnogues
2009-03-03 10:26     ` Alexander Graf
2009-03-03 10:30       ` Laurent Desnogues

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=f43fc5580903021128n517f9e25i7b456219e9b84c8c@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.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).