All of lore.kernel.org
 help / color / mirror / Atom feed
* Grant table version
@ 2013-10-28 18:06 Vladimir 'φ-coder/phcoder' Serbinenko
  2013-10-28 18:39   ` [Xen-devel] " Andrew Cooper
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-10-28 18:06 UTC (permalink / raw)
  To: xen-devel, The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

Hello, all. I'm working on pvgrub2 and my problem is following:
When you first use grant tables you commit yourself to a particular
grant table version. GRUB has to read from disk and hence use grant
tables. By doing so it commits anything that it loads to the same version.
Would it be possible to have a hypercall to reset grant table version?
Of course, before doing such a call one would need to revoke all grants
or this call would discard all current grants.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

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

* Re: Grant table version
  2013-10-28 18:06 Grant table version Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-10-28 18:39   ` Andrew Cooper
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Cooper @ 2013-10-28 18:39 UTC (permalink / raw)
  To: Vladimir 'φ-coder/phcoder' Serbinenko
  Cc: The development of GRUB 2, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1563 bytes --]

On 28/10/13 18:06, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Hello, all. I'm working on pvgrub2 and my problem is following:
> When you first use grant tables you commit yourself to a particular
> grant table version. GRUB has to read from disk and hence use grant
> tables. By doing so it commits anything that it loads to the same version.
> Would it be possible to have a hypercall to reset grant table version?
> Of course, before doing such a call one would need to revoke all grants
> or this call would discard all current grants.

You can change back and forth with grant table versions using the
GNTTABOP_set_version hypercall, so long as you have no active grants.

It is not possible to revoke a grant, as the grant ABI guarantees that a
successful grant stays mapped until explicitly unmapped.  Otherwise, a
reset would cause unexpected pagefaults in the mapper domain.

For compatibility reasons it is not strictly required, but it is
certainly expected that a new kernel explicitly chooses a gnttab version
using the hypercall.  There is certainly an area for problems if pvgrub2
uses grant v2, then leaves v2 active and hands off to an older kernel
who expects v1 and doesn't explicitly set the version.

>From this point of view, the safe course of action is to use whichever
type of grants you want, then tear down all the front/back pairs, and
reset the version to v1 before handing off.

~Andrew

>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 2373 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [Xen-devel] Grant table version
@ 2013-10-28 18:39   ` Andrew Cooper
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Cooper @ 2013-10-28 18:39 UTC (permalink / raw)
  To: Vladimir 'φ-coder/phcoder' Serbinenko
  Cc: The development of GRUB 2, xen-devel

[-- Attachment #1: Type: text/plain, Size: 1562 bytes --]

On 28/10/13 18:06, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Hello, all. I'm working on pvgrub2 and my problem is following:
> When you first use grant tables you commit yourself to a particular
> grant table version. GRUB has to read from disk and hence use grant
> tables. By doing so it commits anything that it loads to the same version.
> Would it be possible to have a hypercall to reset grant table version?
> Of course, before doing such a call one would need to revoke all grants
> or this call would discard all current grants.

You can change back and forth with grant table versions using the
GNTTABOP_set_version hypercall, so long as you have no active grants.

It is not possible to revoke a grant, as the grant ABI guarantees that a
successful grant stays mapped until explicitly unmapped.  Otherwise, a
reset would cause unexpected pagefaults in the mapper domain.

For compatibility reasons it is not strictly required, but it is
certainly expected that a new kernel explicitly chooses a gnttab version
using the hypercall.  There is certainly an area for problems if pvgrub2
uses grant v2, then leaves v2 active and hands off to an older kernel
who expects v1 and doesn't explicitly set the version.

From this point of view, the safe course of action is to use whichever
type of grants you want, then tear down all the front/back pairs, and
reset the version to v1 before handing off.

~Andrew

>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #2: Type: text/html, Size: 2373 bytes --]

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

* Re: Grant table version
  2013-10-28 18:39   ` [Xen-devel] " Andrew Cooper
  (?)
  (?)
@ 2013-10-30 12:26   ` Vladimir 'φ-coder/phcoder' Serbinenko
  -1 siblings, 0 replies; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-10-30 12:26 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: The development of GRUB 2, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1738 bytes --]

On 28.10.2013 19:39, Andrew Cooper wrote:
> On 28/10/13 18:06, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>> Hello, all. I'm working on pvgrub2 and my problem is following:
>> When you first use grant tables you commit yourself to a particular
>> grant table version. GRUB has to read from disk and hence use grant
>> tables. By doing so it commits anything that it loads to the same version.
>> Would it be possible to have a hypercall to reset grant table version?
>> Of course, before doing such a call one would need to revoke all grants
>> or this call would discard all current grants.
> 
> You can change back and forth with grant table versions using the
> GNTTABOP_set_version hypercall, so long as you have no active grants.
> 
> It is not possible to revoke a grant, as the grant ABI guarantees that a
> successful grant stays mapped until explicitly unmapped.  Otherwise, a
> reset would cause unexpected pagefaults in the mapper domain.
> 
> For compatibility reasons it is not strictly required, but it is
> certainly expected that a new kernel explicitly chooses a gnttab version
> using the hypercall.  There is certainly an area for problems if pvgrub2
> uses grant v2, then leaves v2 active and hands off to an older kernel
> who expects v1 and doesn't explicitly set the version.
> 
> From this point of view, the safe course of action is to use whichever
> type of grants you want, then tear down all the front/back pairs, and
> reset the version to v1 before handing off.
> 
Thank you, that's what I did now.
> ~Andrew
> 
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
> 



[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [Xen-devel] Grant table version
  2013-10-28 18:39   ` [Xen-devel] " Andrew Cooper
  (?)
@ 2013-10-30 12:26   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-10-31 15:48     ` Ian Campbell
  2013-10-31 15:48     ` [Xen-devel] " Ian Campbell
  -1 siblings, 2 replies; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-10-30 12:26 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: The development of GRUB 2, xen-devel

[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]

On 28.10.2013 19:39, Andrew Cooper wrote:
> On 28/10/13 18:06, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>> Hello, all. I'm working on pvgrub2 and my problem is following:
>> When you first use grant tables you commit yourself to a particular
>> grant table version. GRUB has to read from disk and hence use grant
>> tables. By doing so it commits anything that it loads to the same version.
>> Would it be possible to have a hypercall to reset grant table version?
>> Of course, before doing such a call one would need to revoke all grants
>> or this call would discard all current grants.
> 
> You can change back and forth with grant table versions using the
> GNTTABOP_set_version hypercall, so long as you have no active grants.
> 
> It is not possible to revoke a grant, as the grant ABI guarantees that a
> successful grant stays mapped until explicitly unmapped.  Otherwise, a
> reset would cause unexpected pagefaults in the mapper domain.
> 
> For compatibility reasons it is not strictly required, but it is
> certainly expected that a new kernel explicitly chooses a gnttab version
> using the hypercall.  There is certainly an area for problems if pvgrub2
> uses grant v2, then leaves v2 active and hands off to an older kernel
> who expects v1 and doesn't explicitly set the version.
> 
> From this point of view, the safe course of action is to use whichever
> type of grants you want, then tear down all the front/back pairs, and
> reset the version to v1 before handing off.
> 
Thank you, that's what I did now.
> ~Andrew
> 
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

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

* Re: Grant table version
  2013-10-30 12:26   ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-10-31 15:48     ` Ian Campbell
  2013-10-31 15:48     ` [Xen-devel] " Ian Campbell
  1 sibling, 0 replies; 10+ messages in thread
From: Ian Campbell @ 2013-10-31 15:48 UTC (permalink / raw)
  To: Vladimir 'φ-coder/phcoder' Serbinenko
  Cc: Andrew Cooper, xen-devel, The development of GRUB 2

On Wed, 2013-10-30 at 13:26 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:

> > From this point of view, the safe course of action is to use whichever
> > type of grants you want, then tear down all the front/back pairs, and
> > reset the version to v1 before handing off.
> > 
> Thank you, that's what I did now.

FWIW I don't think there is any need for pvgrub to be using the sorts of
advanced features enabled by gnttab v2. Even Linux doesn't use most
(any?) of them ;-)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [Xen-devel] Grant table version
  2013-10-30 12:26   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-10-31 15:48     ` Ian Campbell
@ 2013-10-31 15:48     ` Ian Campbell
  2013-12-15 22:02         ` [Xen-devel] " Matt Wilson
  1 sibling, 1 reply; 10+ messages in thread
From: Ian Campbell @ 2013-10-31 15:48 UTC (permalink / raw)
  To: Vladimir 'φ-coder/phcoder' Serbinenko
  Cc: Andrew Cooper, xen-devel, The development of GRUB 2

On Wed, 2013-10-30 at 13:26 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:

> > From this point of view, the safe course of action is to use whichever
> > type of grants you want, then tear down all the front/back pairs, and
> > reset the version to v1 before handing off.
> > 
> Thank you, that's what I did now.

FWIW I don't think there is any need for pvgrub to be using the sorts of
advanced features enabled by gnttab v2. Even Linux doesn't use most
(any?) of them ;-)

Ian.



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

* Re: Grant table version
  2013-10-31 15:48     ` [Xen-devel] " Ian Campbell
@ 2013-12-15 22:02         ` Matt Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Matt Wilson @ 2013-12-15 22:02 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Vladimir 'φ-coder/phcoder' Serbinenko, xen-devel,
	The development of GRUB 2, Andrew Cooper

On Thu, Oct 31, 2013 at 03:48:23PM +0000, Ian Campbell wrote:
> On Wed, 2013-10-30 at 13:26 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
> wrote:
> 
> > > From this point of view, the safe course of action is to use whichever
> > > type of grants you want, then tear down all the front/back pairs, and
> > > reset the version to v1 before handing off.
> > > 
> > Thank you, that's what I did now.
> 
> FWIW I don't think there is any need for pvgrub to be using the sorts of
> advanced features enabled by gnttab v2. Even Linux doesn't use most
> (any?) of them ;-)

Indeed. Vladimir, for maximum compatibility with various versions of
Xen, it would probably be best to use gnttab v1 only.

--msw

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [Xen-devel] Grant table version
@ 2013-12-15 22:02         ` Matt Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Matt Wilson @ 2013-12-15 22:02 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Vladimir 'φ-coder/phcoder' Serbinenko, xen-devel,
	The development of GRUB 2, Andrew Cooper

On Thu, Oct 31, 2013 at 03:48:23PM +0000, Ian Campbell wrote:
> On Wed, 2013-10-30 at 13:26 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
> wrote:
> 
> > > From this point of view, the safe course of action is to use whichever
> > > type of grants you want, then tear down all the front/back pairs, and
> > > reset the version to v1 before handing off.
> > > 
> > Thank you, that's what I did now.
> 
> FWIW I don't think there is any need for pvgrub to be using the sorts of
> advanced features enabled by gnttab v2. Even Linux doesn't use most
> (any?) of them ;-)

Indeed. Vladimir, for maximum compatibility with various versions of
Xen, it would probably be best to use gnttab v1 only.

--msw


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

* Grant table version
@ 2013-10-28 18:06 Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-10-28 18:06 UTC (permalink / raw)
  To: xen-devel, The development of GRUB 2


[-- Attachment #1.1: Type: text/plain, Size: 474 bytes --]

Hello, all. I'm working on pvgrub2 and my problem is following:
When you first use grant tables you commit yourself to a particular
grant table version. GRUB has to read from disk and hence use grant
tables. By doing so it commits anything that it loads to the same version.
Would it be possible to have a hypercall to reset grant table version?
Of course, before doing such a call one would need to revoke all grants
or this call would discard all current grants.


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2013-12-16 10:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-28 18:06 Grant table version Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-28 18:39 ` Andrew Cooper
2013-10-28 18:39   ` [Xen-devel] " Andrew Cooper
2013-10-30 12:26   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-31 15:48     ` Ian Campbell
2013-10-31 15:48     ` [Xen-devel] " Ian Campbell
2013-12-15 22:02       ` Matt Wilson
2013-12-15 22:02         ` [Xen-devel] " Matt Wilson
2013-10-30 12:26   ` Vladimir 'φ-coder/phcoder' Serbinenko
  -- strict thread matches above, loose matches on Subject: below --
2013-10-28 18:06 Vladimir 'φ-coder/phcoder' Serbinenko

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.