All of lore.kernel.org
 help / color / mirror / Atom feed
* arch_set_info_guest() and cr1
@ 2011-08-12  2:03 Mukesh Rathor
  2011-08-12  6:16 ` Keir Fraser
  0 siblings, 1 reply; 8+ messages in thread
From: Mukesh Rathor @ 2011-08-12  2:03 UTC (permalink / raw)
  To: Xen-devel

Hi,

Just wondering under what circumstances will cr1 be set in this
function?

int arch_set_info_guest(
    struct vcpu *v, vcpu_guest_context_u c)
{
.....

#ifdef __x86_64__
        if ( c.nat->ctrlreg[1] )           <------
        {
.....



thanks,
Mukesh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: arch_set_info_guest() and cr1
  2011-08-12  2:03 arch_set_info_guest() and cr1 Mukesh Rathor
@ 2011-08-12  6:16 ` Keir Fraser
  2011-08-12 22:01   ` Mukesh Rathor
  0 siblings, 1 reply; 8+ messages in thread
From: Keir Fraser @ 2011-08-12  6:16 UTC (permalink / raw)
  To: Mukesh Rathor, Xen-devel

We stash the user-space CR3 value there (PV x86_64 guests have two CR3s). Of
course you should need only the guest kernel CR3.

 K.

On 12/08/2011 03:03, "Mukesh Rathor" <mukesh.rathor@oracle.com> wrote:

> Hi,
> 
> Just wondering under what circumstances will cr1 be set in this
> function?
> 
> int arch_set_info_guest(
>     struct vcpu *v, vcpu_guest_context_u c)
> {
> .....
> 
> #ifdef __x86_64__
>         if ( c.nat->ctrlreg[1] )           <------
>         {
> .....
> 
> 
> 
> thanks,
> Mukesh
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: arch_set_info_guest() and cr1
  2011-08-12  6:16 ` Keir Fraser
@ 2011-08-12 22:01   ` Mukesh Rathor
  2011-08-13  2:17     ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 8+ messages in thread
From: Mukesh Rathor @ 2011-08-12 22:01 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Xen-devel

Ah I see it, during save/restore, it is used. 
Well, I'm trying to keep the option of using PV paging with hybrid, so 
I may need to honor that. But that's phase 2.

thanks,
Mukesh

On Fri, 12 Aug 2011 07:16:39 +0100
Keir Fraser <keir.xen@gmail.com> wrote:

> We stash the user-space CR3 value there (PV x86_64 guests have two
> CR3s). Of course you should need only the guest kernel CR3.
> 
>  K.
> 
> On 12/08/2011 03:03, "Mukesh Rathor" <mukesh.rathor@oracle.com> wrote:
> 
> > Hi,
> > 
> > Just wondering under what circumstances will cr1 be set in this
> > function?
> > 
> > int arch_set_info_guest(
> >     struct vcpu *v, vcpu_guest_context_u c)
> > {
> > .....
> > 
> > #ifdef __x86_64__
> >         if ( c.nat->ctrlreg[1] )           <------
> >         {
> > .....
> > 
> > 
> > 
> > thanks,
> > Mukesh
> > 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: arch_set_info_guest() and cr1
  2011-08-12 22:01   ` Mukesh Rathor
@ 2011-08-13  2:17     ` Jeremy Fitzhardinge
  2011-08-15  7:35       ` Jan Beulich
  2011-09-22  7:32       ` Ian Campbell
  0 siblings, 2 replies; 8+ messages in thread
From: Jeremy Fitzhardinge @ 2011-08-13  2:17 UTC (permalink / raw)
  To: Mukesh Rathor; +Cc: Xen-devel, Keir Fraser

On 08/12/2011 03:01 PM, Mukesh Rathor wrote:
> Ah I see it, during save/restore, it is used. 
> Well, I'm trying to keep the option of using PV paging with hybrid, so 
> I may need to honor that. But that's phase 2.

Though it would be nice to re-enable the use of PV writable pagetables
to get access to HAP, and we could do without that.

Does Xen require that the user pagetable be a proper subset of the
kernel pagetable?  If we can assume that and get proper ring protections
in the HVM container, then we can simply ignore the user pagetable (and
would have to if we want to get good syscall performance).

    J

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: arch_set_info_guest() and cr1
  2011-08-13  2:17     ` Jeremy Fitzhardinge
@ 2011-08-15  7:35       ` Jan Beulich
  2011-09-22  7:32       ` Ian Campbell
  1 sibling, 0 replies; 8+ messages in thread
From: Jan Beulich @ 2011-08-15  7:35 UTC (permalink / raw)
  To: Jeremy Fitzhardinge, Mukesh Rathor; +Cc: Xen-devel, Keir Fraser

>>> On 13.08.11 at 04:17, Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> On 08/12/2011 03:01 PM, Mukesh Rathor wrote:
>> Ah I see it, during save/restore, it is used. 
>> Well, I'm trying to keep the option of using PV paging with hybrid, so 
>> I may need to honor that. But that's phase 2.
> 
> Though it would be nice to re-enable the use of PV writable pagetables
> to get access to HAP, and we could do without that.
> 
> Does Xen require that the user pagetable be a proper subset of the
> kernel pagetable?  If we can assume that and get proper ring protections
> in the HVM container, then we can simply ignore the user pagetable (and
> would have to if we want to get good syscall performance).

No, Xen doesn't enforce anything on the user page table that it
wouldn't on a kernel one. In fact, it can't even correlate the
respective (kernel,user) pairs.

Jan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: arch_set_info_guest() and cr1
  2011-08-13  2:17     ` Jeremy Fitzhardinge
  2011-08-15  7:35       ` Jan Beulich
@ 2011-09-22  7:32       ` Ian Campbell
  2011-09-22 23:31         ` Jeremy Fitzhardinge
  1 sibling, 1 reply; 8+ messages in thread
From: Ian Campbell @ 2011-09-22  7:32 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: Xen-devel, Keir Fraser

(old mail, I know)

On Sat, 2011-08-13 at 03:17 +0100, Jeremy Fitzhardinge wrote:
> On 08/12/2011 03:01 PM, Mukesh Rathor wrote:
> > Ah I see it, during save/restore, it is used. 
> > Well, I'm trying to keep the option of using PV paging with hybrid, so 
> > I may need to honor that. But that's phase 2.
> 
> Though it would be nice to re-enable the use of PV writable pagetables
> to get access to HAP, and we could do without that.
> 
> Does Xen require that the user pagetable be a proper subset of the
> kernel pagetable?  If we can assume that and get proper ring protections
> in the HVM container, then we can simply ignore the user pagetable (and
> would have to if we want to get good syscall performance).

IIRC back when I did the (now completely defunct) supervisor mode kernel
stuff that was exactly the assumption which was made and it certainly
worked in practice (although "require" might be a strong term).

Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: arch_set_info_guest() and cr1
  2011-09-22  7:32       ` Ian Campbell
@ 2011-09-22 23:31         ` Jeremy Fitzhardinge
  2011-09-23  5:30           ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Jeremy Fitzhardinge @ 2011-09-22 23:31 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Xen-devel, Tim Deegan, Keir Fraser

On 09/22/2011 12:32 AM, Ian Campbell wrote:
> (old mail, I know)
>
> On Sat, 2011-08-13 at 03:17 +0100, Jeremy Fitzhardinge wrote:
>> On 08/12/2011 03:01 PM, Mukesh Rathor wrote:
>>> Ah I see it, during save/restore, it is used. 
>>> Well, I'm trying to keep the option of using PV paging with hybrid, so 
>>> I may need to honor that. But that's phase 2.
>> Though it would be nice to re-enable the use of PV writable pagetables
>> to get access to HAP, and we could do without that.
>>
>> Does Xen require that the user pagetable be a proper subset of the
>> kernel pagetable?  If we can assume that and get proper ring protections
>> in the HVM container, then we can simply ignore the user pagetable (and
>> would have to if we want to get good syscall performance).
> IIRC back when I did the (now completely defunct) supervisor mode kernel
> stuff that was exactly the assumption which was made and it certainly
> worked in practice (although "require" might be a strong term).

Well, I guess we could add ELF notes to allow a guest to say "I really
need separate non-intersecting user/kernel pagetables" if they really
need it.  Or repurpose auto_translated_physmap to also mean "no separate
user/kernel pagetables required".  Has that ever been supported for
64-bit PV guests?  My memory of the chronology is that it died as a
feature at about the time that 64-bit support went in.

    J

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: arch_set_info_guest() and cr1
  2011-09-22 23:31         ` Jeremy Fitzhardinge
@ 2011-09-23  5:30           ` Ian Campbell
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2011-09-23  5:30 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: Keir, Xen-devel, Tim Deegan, Fraser

On Fri, 2011-09-23 at 00:31 +0100, Jeremy Fitzhardinge wrote:
> On 09/22/2011 12:32 AM, Ian Campbell wrote:
> > (old mail, I know)
> >
> > On Sat, 2011-08-13 at 03:17 +0100, Jeremy Fitzhardinge wrote:
> >> On 08/12/2011 03:01 PM, Mukesh Rathor wrote:
> >>> Ah I see it, during save/restore, it is used. 
> >>> Well, I'm trying to keep the option of using PV paging with hybrid, so 
> >>> I may need to honor that. But that's phase 2.
> >> Though it would be nice to re-enable the use of PV writable pagetables
> >> to get access to HAP, and we could do without that.
> >>
> >> Does Xen require that the user pagetable be a proper subset of the
> >> kernel pagetable?  If we can assume that and get proper ring protections
> >> in the HVM container, then we can simply ignore the user pagetable (and
> >> would have to if we want to get good syscall performance).
> > IIRC back when I did the (now completely defunct) supervisor mode kernel
> > stuff that was exactly the assumption which was made and it certainly
> > worked in practice (although "require" might be a strong term).
> 
> Well, I guess we could add ELF notes to allow a guest to say "I really
> need separate non-intersecting user/kernel pagetables" if they really
> need it.  Or repurpose auto_translated_physmap to also mean "no separate
> user/kernel pagetables required".

IIRC that's effectively one of the things which auto_translated_physmap
implies.

> Has that ever been supported for 64-bit PV guests?

In the classic patches, yes, but not in the pvops ones AFAIK.

>   My memory of the chronology is that it died as a
> feature at about the time that 64-bit support went in.
> 
>     J

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-23  5:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-12  2:03 arch_set_info_guest() and cr1 Mukesh Rathor
2011-08-12  6:16 ` Keir Fraser
2011-08-12 22:01   ` Mukesh Rathor
2011-08-13  2:17     ` Jeremy Fitzhardinge
2011-08-15  7:35       ` Jan Beulich
2011-09-22  7:32       ` Ian Campbell
2011-09-22 23:31         ` Jeremy Fitzhardinge
2011-09-23  5:30           ` Ian Campbell

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.