hi, I am trying to create a custom domain from code based on xc_linux_build.c. While I do not expect my newly instantiated domain to happily execute whatever code I have for it at this stage, I am a bit surprised that instead of just silently dying, it takes all of Xen with it, and the machine reboots once I start my newly constructed domain. The start operation completes and returns without error, but as soon as the domain is scheduled (it appears) the machine crashes. I have tried to instrument the Xen code with various printks (I have a serial line connected) and apparently the switch_to function completes without errors. I suppose that with enough printks I will eventually find the troubled spot, but I was hoping that a little advice as to where to look would ease my burdens. What parameters to the build- and start-domain syscalls should I be extra careful with, and where in Xen will bad domain parameters most likely cause a crash? Thanks in advance, Jacob ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM''s Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
> hi, > > I am trying to create a custom domain from code based on > xc_linux_build.c. > > While I do not expect my newly instantiated domain to happily execute > whatever code I have for it at this stage, I am a bit surprised that > instead of just silently dying, it takes all of Xen with it, and the > machine reboots once I start my newly constructed domain.Hmmm... well, I was reasonably careful to ensure that there is sanity checking within Xen when building a domain to ensure that the domain cannot crash the whole machine. This may not be perfect, however, and xc_linux_build runs with enough privilege to hose the machine :-( We want to look at making domain building require fewer privileges sometime soon.> The start operation completes and returns without error, but as soon as > the domain is scheduled (it appears) the machine crashes. > > I have tried to instrument the Xen code with various printks (I have a > serial line connected) and apparently the switch_to function completes > without errors. I suppose that with enough printks I will eventually > find the troubled spot, but I was hoping that a little advice as to > where to look would ease my burdens. > > What parameters to the build- and start-domain syscalls should I be > extra careful with, and where in Xen will bad domain parameters most > likely cause a crash?Which Xen tree are you developing on? 1.2 or 1.3? You should turn on debugging in xen/arch/i386/Rules.mk. If you are running on a newer Xen then that will also turn on all DPRINTKs automatically. Thus you may get some error messages before you crash. How different is your domain builder from the default one? Perhaps a better place to look is just at what you do that is different? Basically, I think you''ll need to find this one via tracing! If you find anywhere in Xen that could be better sanity-checked then let me know and I''ll patch it. Cheers, Keir ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM''s Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Tue, 2004-01-06 at 19:03, Keir Fraser wrote:> > hi, > > > Hmmm... well, I was reasonably careful to ensure that there is sanity > checking within Xen when building a domain to ensure that the domain > cannot crash the whole machine. This may not be perfect, however, and > xc_linux_build runs with enough privilege to hose the machine :-( We > want to look at making domain building require fewer privileges > sometime soon.Does Xen use the start_info (passed in ctxt->esi) for anything (such as setting up CR3), or is this value just passed on to the domain? Is passing bogus start_info a problem for Xen? If not, what is the state of CR3 and paging when the domain boots? best, Jacob ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM''s Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
> Does Xen use the start_info (passed in ctxt->esi) for anything (such as > setting up CR3), or is this value just passed on to the domain? Is > passing bogus start_info a problem for Xen?No, the start_info structure is opaque to Xen. The definition of start_info, and the convention of passing a pointer to it in %esi, is known only to DOM0 control utils and guest OSes.> If not, what is the state of CR3 and paging when the domain boots?It''s a field in full_execution_context_t, passed to DOM0_BUILDDOMAIN. -- Keir ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Wed, 2004-01-07 at 16:52, Keir Fraser wrote:> > Does Xen use the start_info (passed in ctxt->esi) for anything (such as > > setting up CR3), or is this value just passed on to the domain? Is > > passing bogus start_info a problem for Xen? > > No, the start_info structure is opaque to Xen. The definition of > start_info, and the convention of passing a pointer to it in %esi, is > known only to DOM0 control utils and guest OSes. > > > If not, what is the state of CR3 and paging when the domain boots? > > It''s a field in full_execution_context_t, passed to > DOM0_BUILDDOMAIN.This is what went wrong, specifying a sane pt_base value improved things. I suppose that in a perfect world Xen could check the ownership and pinning of this page and report and error on domain creation. thanks, Jacob ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Wed, 2004-01-07 at 17:29, Jacob Gorm Hansen wrote:> This is what went wrong, specifying a sane pt_base value improved > things. I suppose that in a perfect world Xen could check the ownership > and pinning of this page and report and error on domain creation.-- oops a bit too quick there, still crashing ... :-( Jacob ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
> > It''s a field in full_execution_context_t, passed to > > DOM0_BUILDDOMAIN. > > This is what went wrong, specifying a sane pt_base value improved > things. I suppose that in a perfect world Xen could check the ownership > and pinning of this page and report and error on domain creation.Actually, the newly checked-in page-management code will be returning an error if the pinning operation fails. I think BUILDDOMAIN is the only case where I don''t check the error code. I''ll fix that - thanks! -- Keir ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Wed, 2004-01-07 at 17:33, Jacob Gorm Hansen wrote:> On Wed, 2004-01-07 at 17:29, Jacob Gorm Hansen wrote: > > This is what went wrong, specifying a sane pt_base value improved > > things. I suppose that in a perfect world Xen could check the ownership > > and pinning of this page and report and error on domain creation. > > -- oops a bit too quick there, still crashing ... :-(Ok, this _was_ the problem, my new domain now hello worlds as expected :-) thanks for the help! Jacob ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel