From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Vas5S-0006Qp-2i for mharc-grub-devel@gnu.org; Mon, 28 Oct 2013 15:02:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VarjM-0006NC-8M for grub-devel@gnu.org; Mon, 28 Oct 2013 14:40:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VarjH-0003tz-AK for grub-devel@gnu.org; Mon, 28 Oct 2013 14:40:00 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:23338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VarjH-0003tg-5G for grub-devel@gnu.org; Mon, 28 Oct 2013 14:39:55 -0400 X-IronPort-AV: E=Sophos;i="4.93,587,1378857600"; d="scan'208,217";a="65496338" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 28 Oct 2013 18:39:53 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.2.342.4; Mon, 28 Oct 2013 14:39:53 -0400 Received: from andrewcoop.uk.xensource.com ([10.80.2.18]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1VarjE-0001qg-TS; Mon, 28 Oct 2013 18:39:52 +0000 Message-ID: <526EAF78.2070408@citrix.com> Date: Mon, 28 Oct 2013 18:39:52 +0000 From: Andrew Cooper User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130922 Icedove/17.0.9 MIME-Version: 1.0 To: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= Subject: Re: [Xen-devel] Grant table version References: <526EA78A.6020104@gmail.com> In-Reply-To: <526EA78A.6020104@gmail.com> X-Enigmail-Version: 1.5.2 Content-Type: multipart/alternative; boundary="------------090008030409060006040104" X-DLP: MIA2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 X-Mailman-Approved-At: Mon, 28 Oct 2013 15:02:48 -0400 Cc: The development of GRUB 2 , "xen-devel@lists.xen.org" X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2013 18:40:05 -0000 --------------090008030409060006040104 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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
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--