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
--------------090008030409060006040104
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 8bit
<html>
<head>
<meta content="text/html; charset=UTF-8"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 28/10/13 18:06, Vladimir
''φ-coder/phcoder'' Serbinenko wrote:<br>
</div>
<blockquote cite="mid:526EA78A.6020104@gmail.com"
type="cite">
<pre wrap="">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.</pre>
</blockquote>
<br>
You can change back and forth with grant table versions using the
GNTTABOP_set_version hypercall, so long as you have no active
grants.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
~Andrew<br>
<br>
<blockquote cite="mid:526EA78A.6020104@gmail.com"
type="cite">
<pre wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre
wrap="">_______________________________________________
Xen-devel mailing list
<a class="moz-txt-link-abbreviated"
href="mailto:Xen-devel@lists.xen.org">Xen-devel@lists.xen.org</a>
<a class="moz-txt-link-freetext"
href="http://lists.xen.org/xen-devel">http://lists.xen.org/xen-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>
--------------090008030409060006040104--
--===============1525064449349187710=Content-Type: text/plain;
charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
--===============1525064449349187710==--