From: "Jan Beulich" Subject: RE: [PATCH 8/9] tmem: invocations of tmemcodefromexisting xen code Date: Mon, 09 Feb 2009 09:23:16 +0000 Message-ID: <49900414.76E4.0078.0@novell.com> References: <498C58BF.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: 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: Dan Magenheimer Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >>> Dan Magenheimer 06.02.09 20:00 >>> >OK, I did that and it compiles fine. What's the difference >between the two? Is the _64 version used when the structure >contains a 64-bit value that might not be aligned on a 64-bit >boundary? Not only, it's also widening the field to 64-bits to make sure the = (native) 64-bit accessors can be used on it. >Just adding tmem_op...tmem.h to xlat.lst and adding a new >common/compat/tmem_xen.c with: > >#define xen_tmem_op tmem_op >CHECK_tmem_op; >#undef xen_tmem_op > >doesn't seem to work (generates "sed: can't read compat/tmem.h"), Yeah, I forgot that with a new header you'd have to also add that new header's name to header-y in xen/include/Makefile, so that a compat header would be generated. >so please define "use somewhere" more precisely. The >existing entries don't provide much guidance as they all seem >to be doing complex things, that I don't think I need. If it seems to cumbersome, just leave it off for the moment, and I'll = submit a fixup patch after it got merged. >Also, ignoring the structure alignment/packing rules, is this >supposed to get rid of the masking I do in cli_mfn_to_va() >when the hypercall is made by a 32-bit guest? I thought it was (I didn't invent it), but it appears it isn't. Though = there also shouldn't be a need to - all the guest can clobber by specifying a handle that doesn't have the upper 32 bits clear is its argument translation = area, which means it can only shoot itself in the foot. But you ought to be = using guest_handle_cast there (and perhaps elsewhere) anyway (rather than referencing handle.p directly), which would allow hiding any masking in case it would turn out necessary. Jan