hi, I my unprivileged domain builder, I have run into the problem of how to setup the hypercall-page. I suppose I can decode the kernel binary header to figure out where to put the page, and then memcpy it from loader to linux and things will work. But wouldn''t it be better if the hypercall used to populate the page was available to the domU, so that its startup-code could call on Xen to populate the page? I find the current approach of hardcoding the page location in the kernel header pretty ugly. Jacob _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 7 Feb 2006, at 16:20, Jacob Gorm Hansen wrote:> I my unprivileged domain builder, I have run into the problem of how > to setup the hypercall-page. I suppose I can decode the kernel binary > header to figure out where to put the page, and then memcpy it from > loader to linux and things will work. > > But wouldn''t it be better if the hypercall used to populate the page > was available to the domU, so that its startup-code could call on Xen > to populate the page? I find the current approach of hardcoding the > page location in the kernel header pretty ugly.We can make the hypercall for filling the page one that can be executed by unpriv domains (i.e., make it not a dom0_op). Or if you want to fill it in from within the domU, how about if we did something like reserve some space of MSRs for Xen use (e.g., hex Bxxxxxxx). Then we could say that, if the guest writes an MFN to a particular one of those MSRs, it gets filled with hypercall-page goodness. :-) -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 2/7/06, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> We can make the hypercall for filling the page one that can be executed > by unpriv domains (i.e., make it not a dom0_op).That would be fine with me, though I guess purists would argue that it would remove some flexibility, e.g. int 0x82 (or another hardcoded trap vector) would have always have to be supported.> Or if you want to fill it in from within the domU, how about if we did > something like reserve some space of MSRs for Xen use (e.g., hex > Bxxxxxxx). Then we could say that, if the guest writes an MFN to a > particular one of those MSRs, it gets filled with hypercall-page > goodness. :-)Hmm would that work in paravirt mode also? I guess Xen would trap the exception and do the right thing? I suppose this has the advantage of avoiding any hardcoded trap vectors.> -- KeirJacob _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 7 Feb 2006, at 18:04, Jacob Gorm Hansen wrote:>> Or if you want to fill it in from within the domU, how about if we did >> something like reserve some space of MSRs for Xen use (e.g., hex >> Bxxxxxxx). Then we could say that, if the guest writes an MFN to a >> particular one of those MSRs, it gets filled with hypercall-page >> goodness. :-) > > Hmm would that work in paravirt mode also? I guess Xen would trap the > exception and do the right thing? I suppose this has the advantage of > avoiding any hardcoded trap vectors.Yes, although it does sound kinda gross, it will work and ultimately I think it sounds quite attractive compared with the alternatives. Not sure how to decide what MSR range to pick to reserve... Apart from that it''s trivial to implement. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 2/7/06, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> > On 7 Feb 2006, at 18:04, Jacob Gorm Hansen wrote: > > >> Or if you want to fill it in from within the domU, how about if we did > >> something like reserve some space of MSRs for Xen use (e.g., hex > >> Bxxxxxxx). Then we could say that, if the guest writes an MFN to a > >> particular one of those MSRs, it gets filled with hypercall-page > >> goodness. :-) > > > > Hmm would that work in paravirt mode also? I guess Xen would trap the > > exception and do the right thing? I suppose this has the advantage of > > avoiding any hardcoded trap vectors. > > Yes, although it does sound kinda gross, it will work and ultimately I > think it sounds quite attractive compared with the alternatives. Not > sure how to decide what MSR range to pick to reserve... Apart from that > it''s trivial to implement.hi, I''ve bumped my head against this again, and a quick fix would be to make the dom0 op unprivileged. If you can tell me where in the xen source you would like op to be moved, I send in a patch for it. Jacob _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel