From: "Jan Beulich" Subject: Re: [PATCH] Paging and memory sharing for HVM guests Date: Fri, 18 Dec 2009 08:08:31 +0000 Message-ID: <4B2B468F0200007800026955@vpn.id2.novell.com> References: <20091217163845.GA26398@phenom.dumpdata.com> <4B2A719E020000780002679C@vpn.id2.novell.com> <4B2A64EB.3010004@cs.ubc.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4B2A64EB.3010004@cs.ubc.ca> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Patrick Colp Cc: xen-devel@lists.xensource.com, Keir Fraser , Grzegorz Milos , Konrad Rzeszutek Wilk , Andrew Peace List-Id: xen-devel@lists.xenproject.org >>> Patrick Colp 17.12.09 18:05 >>> >Jan Beulich wrote: >>>>> Konrad Rzeszutek Wilk 17.12.09 17:38 >>> >>> 1). The "*mfnp |=3D 0x80000000U;" and "*mfnp |=3D 0xf0000000U;" = should >>> use a #define. Maybe copy over the #defines from the xen tree ? >>=20 >> Did you find any defines in the tools sources for that? The only place = I >> found this condition being checked at all was in xc_map_foreign_pages(),= >> where it used hard-coded values. Or are you referring to the >> XEN_DOMCTL_PFINFO_* values? I'd say they're being mis-used when >> applied to the mfn array used by mmap-batch (including apparent >> pre-existing uses). > >I think many people agree that this idea of using 0xf0000000 is a very=20 >inelegant solution (myself included). Maybe now would be a good time = to=20 >hash out what the proper way to deal with this is. I think this discussion= =20 >should extend to the privcmd/libxc mmap interfaces generally as well. Yes, I fully agree. While I had cooked together a patch to make the tools auto-detect whether the underlying (64-bit) kernel uses a sufficiently wide mask as error indicator (and a Linux side patch to actually make the kernel behaviorally match the pseudo-documentation in privcmd.h ("array of mfns - top nibble set on err"), I meanwhile realized that this would break older tools running on a fixed kernel (a combination I suppose to be valid). The only way I can see to solve this is a new ioctl, and if we need a new ioctl anyway, we can as well design it properly. The question however is what the best way for an error indication is: Fully over- writing the passed in MFNs, an extra bit vector passed in (does user mode have a sufficiently common interface for dealing with bit fields, like the kernel's bitops.h?), or yet something else? Jan