Tian, Kevin
2006-Apr-26 07:54 UTC
RE: Hypercall number assignment convension (was Re: [Xen-devel] Re:[PATCH]: kexec: framework and i386)
>From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk] >Sent: 2006年4月26日 15:38 > >On 26 Apr 2006, at 03:34, Tian, Kevin wrote: > >> I prefer to the first one. However not the current >> __HYPERVISOR_arch_specific_0, *_1, *_2, ..., how about just call >> it as __HYPERVISOR_arch_specific_ops which contains another >> namespace defined by different architecture seperately? > >Sometimes you might want a fast hypercall that doesn''t have two levels >of demultiplexing, or where the register/stack parameters are carefully >crafted and would not fit with an ioctl()-style hypercall (see x86''s >IRET hypercall).See.> >How about reserving 8 or 16 arch-specific hypercalls up front? >#define __HYPERVISOR_arch_0 32 > ... >#define __HYPERVISOR_arch_7 39 > >We could give a bit of breathing space to the non-arch range by >starting __HYPERVISOR_arch_* at. e.g., 40 or 48? > > -- KeirThen we may need to fill that breathing space with do_ni_hypercall to ensure no leakage from NR_hypercall check. If that''s the case, how about define the __HYPERVISOR_arch_* at end of 256 spaces, and fill all unused entries with do_ni_hypercall. By that way, the check to illegal hypercall (<256) is a bit slower, however it shouldn''t matter for that rare cases. Thanks, Kevin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Apr-26 07:55 UTC
Re: Hypercall number assignment convension (was Re: [Xen-devel] Re:[PATCH]: kexec: framework and i386)
On 26 Apr 2006, at 08:54, Tian, Kevin wrote:> Then we may need to fill that breathing space with do_ni_hypercall > to ensure no leakage from NR_hypercall check. If that''s the case, > how about define the __HYPERVISOR_arch_* at end of 256 spaces, > and fill all unused entries with do_ni_hypercall. By that way, the > check > to illegal hypercall (<256) is a bit slower, however it shouldn''t > matter > for that rare cases.Yes, it would need filling with ni_hypercall: we already do that on x86 anyway (since hypercall table is rounded up to a power of two). I don''t want to put the hypercalls that far up: with one hypercall page x86 will currently have a problem implementing more than 128 hypercalls. I also don''t want to put them right at the end of the hypercall space because that would make it harder/uglier to add extra arch hypercalls later on. I think 48-55 would be reasonable. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel