linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Tabi Timur-B04825 <B04825@freescale.com>
Cc: McClintock Matthew-B29882 <B29882@freescale.com>,
	Wood Scott-B07421 <B07421@freescale.com>,
	Gala Kumar-B11780 <B11780@freescale.com>,
	"paulus@samba.org" <paulus@samba.org>,
	"linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] powerpc/85xx: disable timebase synchronization under the hypervisor
Date: Fri, 24 Jun 2011 05:50:41 +0200	[thread overview]
Message-ID: <53807ffa0f2275ffbf492a6d8905dc32@kernel.crashing.org> (raw)
In-Reply-To: <4E03F8C1.60706@freescale.com>

(context put back:)

>> But does that mean that a guest should never be allowed to modify a 
>> virtualized
>> timebase register, even if the hypervisor can support it?
>
> The book3e mtspr writeup doesn't appear to specify the behavior when
> writing to a read-only SPR, so perhaps you could argue that something 
> other
> than a no-op is implementation-specific behavior.

>> v2.06 III-E 9.2.1:
>> "Writing the Time Base is hypervisor privileged."
>>
>> v2.06 III-E 2.1:
>> "If a hypervisor-privileged register is accessed in the guest 
>> supervisor
>> state (MSR[GS PR] = 0b10), an Embedded Hypervisor Privilege exception
>> occurs."
>>
>> (v2.06 III-E 5.4.1, the big SPR table, also shows the TB regs (for 
>> writing,
>> i.e. 284 and 285) to be hypervisor privileged.  Consistency, hurray 
>> :-) )
>
> To me, all this means that a guest cannot write to the actual timebase
> register.

It also means that the hypervisor gets a trap when a guest tries to do 
this.

>   I'm not interpreting this to mean that a hypervisor can't
> virtualize the timebase and allow a guest to read/write a virtual 
> timebase
> register, so that it thinks it's writing to the real hardware timebase 
> register.

Yes, a hypervisor can do this.  The behaviour of the hardware is not
implementation-specific (modulo bugs ;-) ); when a guest tries to write
to the timebase, the hypervisor gets a trap.  The hypervisor can then
do whatever it wants with it.


Segher

  reply	other threads:[~2011-06-24  3:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-14 23:04 [PATCH] powerpc/85xx: disable timebase synchronization under the hypervisor Timur Tabi
2011-06-14 23:14 ` Scott Wood
2011-06-14 23:15   ` Timur Tabi
2011-06-14 23:25     ` Scott Wood
2011-06-15  1:58       ` Benjamin Herrenschmidt
2011-06-15  2:10         ` Tabi Timur-B04825
2011-06-15  2:33           ` Benjamin Herrenschmidt
2011-06-22 11:44             ` Kumar Gala
2011-06-22 14:55               ` Timur Tabi
2011-06-23 17:22                 ` Scott Wood
2011-06-23 17:33                   ` Timur Tabi
2011-06-23 17:48                     ` Scott Wood
2011-06-24  2:36                       ` Segher Boessenkool
2011-06-24  2:38                         ` Tabi Timur-B04825
2011-06-24  3:50                           ` Segher Boessenkool [this message]
2011-06-24 15:16                           ` Scott Wood
2011-06-24 23:36               ` Benjamin Herrenschmidt
2011-06-27 13:35 ` Kumar Gala

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=53807ffa0f2275ffbf492a6d8905dc32@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=B04825@freescale.com \
    --cc=B07421@freescale.com \
    --cc=B11780@freescale.com \
    --cc=B29882@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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).