All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Subject: Re: Not emulated registers on BOOKE_HV (GS-mode)
Date: Wed, 16 May 2012 09:13:36 +0000	[thread overview]
Message-ID: <4FB36FC0.7070801@suse.de> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D03D13A1F@039-SN2MPN1-021.039d.mgd.msft.net>

On 05/16/2012 11:02 AM, Sethi Varun-B16395 wrote:
>
>> -----Original Message-----
>> From: kvm-ppc-owner@vger.kernel.org [mailto:kvm-ppc-
>> owner@vger.kernel.org] On Behalf Of Bhushan Bharat-R65777
>> Sent: Wednesday, May 16, 2012 12:58 PM
>> To: Alexander Graf
>> Cc: Wood Scott-B07421; Yoder Stuart-B08248; kvm-ppc@vger.kernel.org
>> Subject: Not emulated registers on BOOKE_HV (GS-mode)
>>
>> Hi Alex,
>>
>> There is below comment in arch/powerpc/kvm/booke_emulate.c
>>
>> /*
>>   * NOTE: some of these registers are not emulated on BOOKE_HV (GS-mode).
>>   * Their backing store is in real registers, and these functions
>>   * will return the wrong result if called for them in another context
>>   * (such as debugging).
>>   */
>>
>> "some of these registers are not emulated on BOOKE_HV (GS-mode)"
>>   1) Is not that mtspr()/mfspr() for "not emulated" registers should
>> follow EMULATE_FAIL path? So should be ifdef out for BOOKE_HV? Otherwise
>> the emulation code execute.
>>   2) Or These are not emulated because the GS mode have direct access to
>> these registers, Right? So no trap?
>>
> For BOOKE_HV mtspr/mfspr would get mapped to hardware maintained guest shadow copies.
> For example guest access to dear would get mapped to gdear and wouldn't trap
>
>> "and these functions will return the wrong result if called for them in
>> another context (such as debugging)."
>>   1) So do you mean that guest is not supposed to access these registers
>> in normal scenario but the debugger (some command on gdb in guest) can
>> access these register? then does it make sense to treat mtspr() as nop
>> and mfspr returns 0/undefined?
>>
> Actually, in a normal scenario (For BOOKE_HV) guest (MSR[GS] = 1) would be able to directly access these registers
> without hypervisor intervention. However I am not sure under what condition would the guest access generate a trap, all
> guest accesses would be with MSR[GS]=1.

Yup. E500mc would just never reach that code - and even if it did, it 
simply wouldn't do anything useful.

What did you guys need this change for? I'm sure there's some incentive 
behind it, right? The only one I can see right now would be reduced code 
size.


Alex


  parent reply	other threads:[~2012-05-16  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16  7:28 Not emulated registers on BOOKE_HV (GS-mode) Bhushan Bharat-R65777
2012-05-16  9:02 ` Sethi Varun-B16395
2012-05-16  9:13 ` Alexander Graf [this message]
2012-05-16 22:29 ` Scott Wood
2012-05-16 22:44 ` Alexander Graf

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=4FB36FC0.7070801@suse.de \
    --to=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.