qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] TBL register permissions for PPC


From: Dmitry Ilyevsky
Subject: Re: [Qemu-devel] TBL register permissions for PPC
Date: Thu, 25 Mar 2010 00:56:54 +0300


Hello All,

Please review patch for TBL SPR read access for generic PPC.

Description:

POWER specification docs define TBL/TBU SPRs as readable in user and privileged modes. Therefore SPRs permissions were changed in gen_tbl function in target-ppc/translate_init.c file.

Testing:

Tested with vxworks-6.2 bsp and OS on custom qemu board that includes ppc405 emulated core


BR,
Dmitry Ilyevsky

On Wed, Dec 2, 2009 at 2:23 AM, Alexander Graf <address@hidden> 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);
}

address@hidden:/tmp> ./mftb
TB: 0xc0397180 0x603

However it can't be written to:

asm("mttbl %0" : : "r" (tbl));

address@hidden:/tmp> ./mftb
Illegal instruction


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

Alex

Attachment: 0001-Generic-PowerPC-time-base-SPR-should-be-accessible-i.patch
Description: Text Data


reply via email to

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