From: Steven Smith Subject: Re: [PATCH 07 of 10] Transitive grant support Date: Mon, 5 Oct 2009 14:19:37 +0100 Message-ID: <20091005131937.GA1485@weybridge.uk.xensource.com> References: <4AC9C42E0200007800017EF4@vpn.id2.novell.com> <4AC9CE530200007800017F24@vpn.id2.novell.com> <20091005111551.GA17388@weybridge.uk.xensource.com> <4AC9FACD0200007800017FAC@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1286584381==" Return-path: In-Reply-To: <4AC9FACD0200007800017FAC@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: Steven Smith , "xen-devel@lists.xensource.com" , Keir Fraser , "joserenato.santos@hp.com" List-Id: xen-devel@lists.xenproject.org --===============1286584381== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > >>> Steven Smith 05.10.09 13:15 >>> > >Would something like this be acceptable? > >... > >The __attribute__((packed))s are very much not a thing of beauty, but > >it's at least fairly self-contained. >=20 > Hmm, this being a public header, I'm afraid using gcc extensions isn't > appropriate. Okay. How about this one? union grant_entry_v2 { grant_entry_header_t hdr; /* * The frame to which we are granting access. This field has the * same meaning as the grant_entry_v1 field of the same name. */ struct { grant_entry_header_t hdr; uint32_t pad0; uint64_t frame; } full_page; /* * If the grant type is GTF_grant_access and GTF_sub_page is set, * @domid is allowed to access bytes [@page_off,@page_off+@length) * in frame @frame. */ struct { grant_entry_header_t hdr; uint16_t page_off; uint16_t length; uint64_t frame; } sub_page; /* * If the grant is GTF_transitive, @domid is allowed to use the * grant @gref in domain @trans_domid, as if it was the local * domain. Obviously, the transitive access must be compatible * with the original grant. * * The current version of Xen does not allow transitive grants to * be mapped. */ struct { grant_entry_header_t hdr; domid_t trans_domid; uint16_t pad0; grant_ref_t gref; } transitive; uint32_t __spacer[4]; /* Pad to a power of two */ }; Duplicating the header into every field is kind of icky, but I can't see any other way of avoiding unfortunate padding without using gcc extensions. Steven. --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFKyfJovAgSWYI3DVMRAlDQAKCa4GpbpVPnTHDLYbT0FNz7DXFDlgCfZ6gC umfudnERNTFUMWVVLKj0ueU= =2MHJ -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0-- --===============1286584381== 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.xensource.com http://lists.xensource.com/xen-devel --===============1286584381==--