qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: malc <av1474@comtv.ru>
To: Alexander Graf <agraf@suse.de>
Cc: Dima Ilyevsky <ilyevsky@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] TBL register permissions for PPC
Date: Wed, 2 Dec 2009 02:35:30 +0300 (MSK)	[thread overview]
Message-ID: <Pine.LNX.4.64.0912020235050.2234@linmac.oyster.ru> (raw)
In-Reply-To: <8F6B1156-5574-41A3-B2EE-978E77391EF7@suse.de>

On Wed, 2 Dec 2009, Alexander Graf wrote:

> 
> On 01.12.2009, at 19:33, Dima Ilyevsky wrote:
> 
> > Hello All,
> > 
> > I have a question about read permissions of TBL SPR for all ppc processors:
> > I have discovered that my application, compiled by WindRiver diab compiler and running in vxworks OS on ppc405 architecture bumps into exception generated when trying to read TBL or TBU registers:
> 
> Unless Linux does something funky, mftlb, mftbu (and mftb on 64 bit) are readable from PR=1.
> 
> int main()
> {
>     long tbu=0, tbl=0;
> 
>     asm("mftbu %0" : "=r" (tbu));
>     asm("mftbl %0" : "=r" (tbl));
> 
>     printf("TB: %#x %#x\n", tbl, tbu);
> }
> 
> agraf@lychee:/tmp> ./mftb 
> TB: 0xc0397180 0x603
> 
> However it can't be written to:
> 
> asm("mttbl %0" : : "r" (tbl));
> 
> agraf@lychee:/tmp> ./mftb 
> Illegal instruction


7.2.1 Writing the Time Base
Writing the Time Base is privileged, and can be done
only in hypervisor state. Reading the Time Base is not
privileged; it is discussed in Chapter 4 of Book II.

> 
> 
> So yes, I'd suspect a bug in qemu here. Feel free to send a patch.
> 
> Alex
> 

-- 
mailto:av1474@comtv.ru

  reply	other threads:[~2009-12-01 23:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01 18:33 [Qemu-devel] TBL register permissions for PPC Dima Ilyevsky
2009-12-01 19:28 ` Krumme, Chris
2009-12-01 23:23 ` Alexander Graf
2009-12-01 23:35   ` malc [this message]
2010-03-24 21:56   ` Dmitry Ilyevsky
2010-03-25  7:53     ` Alexander Graf
2010-03-26  0:31       ` Dmitry Ilyevsky
2010-03-26  1:15         ` Alexander Graf
2010-03-26 22:42         ` Aurelien Jarno

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=Pine.LNX.4.64.0912020235050.2234@linmac.oyster.ru \
    --to=av1474@comtv.ru \
    --cc=agraf@suse.de \
    --cc=ilyevsky@gmail.com \
    --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).