qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@linux.vnet.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] target-ppc: Problem with mtmsr emulation
Date: Fri, 28 Mar 2014 13:02:33 +0100	[thread overview]
Message-ID: <20140328130233.2b6e8a3e@oc7435384737.ibm.com> (raw)
In-Reply-To: <6CFA60A9-841A-401E-8A64-B3290F19A54D@suse.de>

On Fri, 28 Mar 2014 18:25:02 +0800
Alexander Graf <agraf@suse.de> wrote:

> 
> 
> > Am 28.03.2014 um 16:16 schrieb Thomas Huth <thuth@linux.vnet.ibm.com>:
> > 
> > 
> > Hi all!
> > 
> > There seems to be a problem with the emulation of the mtmsr instruction:
> > According to the PowerISA spec, chapter Book III-S, the mtmsr opcode
> > has a so-called "L" field at bit position 15. Looking at the function
> > gen_mtmsr() in target-ppc/translate.c, the bit is taken into account
> > since the function checks for ctx->opcode & 0x00010000.
> > However, when looking at the GEN_HANDLER definition later in that file:
> > 
> > GEN_HANDLER(mtmsr, 0x1F, 0x12, 0x04, 0x001FF801, PPC_MISC)
> > 
> > you can see that the bit is marked as invalid bit in the 0x001FF801
> > mask, thus if the bit is set, a program exception is generated instead
> > of executing the gen_mtmsr() function.
> > 
> > An easy way to fix this for Book III-S is to change the mask to
> > 0x001EF801 (just like the mask for mtmsrd), but I am afraid that this
> > would break the Book III-E variant of mtmsr, since the embedded version
> > does not have this bit defined. Any suggestions how to fix this problem
> > in a proper way?
> 
> Please check in the older isa versions whether that bit is declared reserved.
> 
> If it is, we need to make sure we only match it on newer ISA conformance.

The oldest ISA version that I've found (version 2.01, from 2003) already
contains the L bit, so I assume it's always been there. So it's likely
just a Book III-S vs. Book III-E issue.

 Thomas

  reply	other threads:[~2014-03-28 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28  8:16 [Qemu-devel] target-ppc: Problem with mtmsr emulation Thomas Huth
2014-03-28 10:25 ` Alexander Graf
2014-03-28 12:02   ` Thomas Huth [this message]
2014-03-28 14:36     ` [Qemu-devel] [Qemu-ppc] " Tom Musta
2014-03-28 17:56       ` Tom Musta

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=20140328130233.2b6e8a3e@oc7435384737.ibm.com \
    --to=thuth@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).