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

[Xen-devel] Re: follow-up to guest debug support patches



Thanks for the prompt response.
 
> It should at some point be extended to allow multiple exec_domains
> like gdb supports multiple threads in a single process.

As I pointed out in my original e-mail the absence of SMP support is temporary.
I'll add x86_64 support as soon as I have something to play with.

> patch1:
> It seems to be missing a way to undo the foreign mappings on exit?

Foreign mappings aren't automatically undone when the process exits
and the reference count goes down? If not, that seems like a major
problem - what if the program crashes?
 
> The memcpy copying the user_ctxt is now after if gets used (addtl.
> VMX checks)  Looks like he wasn't too careful when forward
> porting -- scary :-(  Maybe the VMX check should just look at the
> context passed in.
Fixed in patch 2.

> Not sure why he's skipping setting DONEFPUINIT, kernel mode and clearing
> IOPL bits though.

This is unchanged. If it looks weird it is an artifact of how the diff
is generated.
Why would I want to set DONEFPUINIT and clear IOPL more than once?
I've probably mis-parsed the sentence.

    if (!(c->flags & ECF_VMX_GUEST)) 
        if ( ((ed->arch.user_ctxt.cs & 3) == 0) ||
             ((ed->arch.user_ctxt.ss & 3) == 0) )
                return -EINVAL;

    if (test_bit(EDF_DONEINIT, &ed->ed_flags))
        return 0;

    clear_bit(EDF_DONEFPUINIT, &ed->ed_flags);
    if ( c->flags & ECF_I387_VALID )
        set_bit(EDF_DONEFPUINIT, &ed->ed_flags)
 
> Doesn't the change in traps.c break in-guest debugger support?  It seems
> to always pause the domain if it is in kernel, an in-guest debugger
> which has set a breakpoint in the kernel will never get the int3.  I
> think
> this needs some kind of flag to enable/disable this behaviour.

I thought about that, but is there an In-guest kernel debugger that
can set breakpoints? All I know of are stubs that require a serial
port. Does NetBSD's in-kernel debugger allow one to set breakpoints
and continue? If so I can just put the debugger option back in
Rules.mk.

> 
> patch2:
> adresses point2 above
> 
> Now same concern applies to do_debug as for int3
> 
> I think the order in arch_final_setup_guest should be:
> 
> - check cs/ss in passed in cpu_ctxt (before doing anything)
> - update DONEFPUINIT and TF_kernel_mode flags
> - copy user_ctxt
> - copy fpu ctxt
> - clear iopl
> - exit if updating (EDF_DONEINIT)

OK, I'll do that. I'll pull a new tree so I can unify the patches as
requested by Keir.

       -Kip


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

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