All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: James Harper <james.harper@bendigoit.com.au>
Cc: xen-devel@lists.xensource.com
Subject: Re: faster windows debugging design
Date: Tue, 19 Oct 2010 15:18:33 -0400	[thread overview]
Message-ID: <20101019191833.GA9229@dumpdata.com> (raw)
In-Reply-To: <AEC6C66638C05B468B556EA548C1A77D01B1FF30@trantor>

On Tue, Oct 19, 2010 at 11:02:26PM +1100, James Harper wrote:
> Here's my plan so far...
> 
> Windows debugging is done via the serial port (or 1394 or USB). The
> current way of debugging a windows DomU is to connect 'xm console' to a
> tcp port in domU, and then on a separate machine (virtual or physical)
> connect that tcp port to a virtual serial port or a named pipe. This
> tends to suffer from fairly poor performance though as anyone who's used
> it will confirm.
> 
> My approach is to write a new kd module - kdxen.dll - under windows
> which is loaded by specifying /debugport=xen in boot.ini. This sets up
> an alternate communication channel with Xen that doesn't involve a
> vmexit every time a byte is read or written via the serial port.
> xen_platform.c is modified to control the other end of that
> communication channel (I'm using the same 0x10-1F ioport range to set up
> the channel at the moment, otherwise it could possibly go in a separate
> module altogether. Needs to be a fixed port though.). I/O is done via
> the backend of the serial port interface (qemu_chr_write(serial_hds[0],
> ...) which means that no change is required past dom0. Additionally, the
> debugger does a lot of busywaiting for I/O (no interrupts are used)
> which can be deferred to usleeps in qemu which should reduce system load
> a bit.

Would it make sense to provide a "failsafe" mechanism for debugging? Say
you need to debug this driver, and want to use the old mechanism. Or 
is that not a problem since the old mechanism is rock solid and won't
be impared?

> 
> So the changes to qemu that I can see so far are:
> . additional code to control the setup and teardown of communication
> rings (tx and rx ring)
> . a way to divert received I/O from the serial port to my faster
> interface so that the serial port doesn't eat data
> 
> Any comments?
> 
> The other possible approach is to emulate a 1394 interface just enough
> to make windows sufficiently happy to use it as a debug interface. This
> is quite a bit more complex though, qemu would need to implement a new
> PCI device, and also deal with the fact that RDMA is not actually
> available end-to-end (eg over tcp) so qemu would need knowledge of the
> windbg protocol to convert to a serial stream of data compatible with
> the serial windbg protocol. I'm not completely sure about any of that
> though.

USB debugging? There is a USB device already there (in QEMU), and both
Linux and Windows have the USB debug port stack implemented quite robustly.
(Thought I am not sure how well they work past a S3 sleep/resume).

  reply	other threads:[~2010-10-19 19:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19 12:02 faster windows debugging design James Harper
2010-10-19 19:18 ` Konrad Rzeszutek Wilk [this message]
2010-10-19 22:40   ` James Harper
2010-10-20  9:06   ` Tim Deegan
2010-10-20 10:08     ` Paolo Bonzini
2010-10-25 14:36       ` Tim Deegan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101019191833.GA9229@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=james.harper@bendigoit.com.au \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.