qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Meador Inge <meadori@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-1.2 v2] target-mips: Enable access to required RDHWR hardware registers
Date: Thu, 23 Aug 2012 17:25:15 +0200	[thread overview]
Message-ID: <20120823152515.GH3553@ohm.aurel32.net> (raw)
In-Reply-To: <1345570297-31562-1-git-send-email-meadori@codesourcery.com>

On Tue, Aug 21, 2012 at 12:31:37PM -0500, Meador Inge wrote:
> While running in the usermode emulator all of the required*
> MIPS32r2 RDHWR hardware registers should be accessible (the
> Linux kernel enables access to these same registers).  Note
> that these registers are still enabled when the MIPS ISA is
> not release 2.  This is OK since the Linux kernel emulates
> access to them when they are not available in hardware.
> 
> * There is also the ULR register which is only recommended
>   for full release 2 compliance.  Incidentally, accessing
>   this register in the current implementation works fine
>   without flipping its access bit.
> 
> Signed-off-by: Meador Inge <meadori@codesourcery.com>
> ---
> 
> v1 -> v2:
> 
>  * Removed (env->insn_flags & ISA_MIPS32R2) condition per
>    feedback from Andreas and Aurelien.
> 
>  target-mips/translate.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target-mips/translate.c b/target-mips/translate.c
> index 47daf85..d643676 100644
> --- a/target-mips/translate.c
> +++ b/target-mips/translate.c
> @@ -12768,8 +12768,9 @@ void cpu_state_reset(CPUMIPSState *env)
>  
>  #if defined(CONFIG_USER_ONLY)
>      env->hflags = MIPS_HFLAG_UM;
> -    /* Enable access to the SYNCI_Step register.  */
> -    env->CP0_HWREna |= (1 << 1);
> +    /* Enable access to the CPUNum, SYNCI_Step, CC, and CCRes RDHWR
> +       hardware registers.  */
> +    env->CP0_HWREna |= 0x0000000F;
>      if (env->CP0_Config1 & (1 << CP0C1_FP)) {
>          env->hflags |= MIPS_HFLAG_FPU;
>      }

Thanks, applied.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

      reply	other threads:[~2012-08-23 15:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 17:31 [Qemu-devel] [PATCH for-1.2 v2] target-mips: Enable access to required RDHWR hardware registers Meador Inge
2012-08-23 15:25 ` Aurelien Jarno [this message]

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=20120823152515.GH3553@ohm.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=meadori@codesourcery.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).