[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] [PATCH 8/9] tmem: invocations of tmem codefromexisting xen code



> >>> Dan Magenheimer <dan.magenheimer@xxxxxxxxxx> 06.02.09 15:25 >>>
> >I have to admit I am baffled by all aspects of XEN_GUEST_HANDLE
> >and just hacked on it until the code worked.  I would be grateful
> >for either an explanation of xen/include/xlat.lst or a pointer
> >to an explanation... or, even better, hints on how to fix
> >my code to properly use XEN_GUEST_HANDLE_64.
> 
> The easiest thing is certainly to simply replace XEN_GUEST_HANDLE by
> XEN_GUEST_HANDLE_64.

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?

> As to xlat.lst, just add ? entry there - the ? says the type 
> needs to be
> checked, and it is followed by the type's name and the header it is
> found in. This will generate a CHECK_<typename> macro in
> xen/include/compat/xlat.h, which you then ought to use somewhere in
> the source code. Just pick one of the existing entries to see how this
> works.

I'm afraid that after an hour or two of trying to understand
this xlat code (and why it exists*) and trying to duplicate it for
tmem (which works without it), I'm still not able to get anything
to compile, probably because I don't really understand what's going
on.  Could you be a bit more precise as to what is needed?
Perhaps a README or wiki page would be useful.

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"),
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.

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?

Thanks,
Dan

* I guess I come from an era where it is the system programmer's
  responsibility to ensure that data structures are defined to
  ensure they meet all the packing and alignment restrictions of
  all the architectures they are intended to run on.  While I'm
  all for compile-time checks to catch poor programming or old
  16- and 32-bit code that now needs to run on a 64-bit machine,
  this seems, well, a bit overboard imho.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.