public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Avi Kivity <avi@qumranet.com>, kvm-devel <kvm@vger.kernel.org>
Subject: Re: [kvm-devel] [RFC][PATCH 3/4] kvm-vmx: KVM_EXIT_DEBUG on #BP	exceptions
Date: Thu, 22 May 2008 09:26:51 -0500	[thread overview]
Message-ID: <200805220926.52133.hollisb@us.ibm.com> (raw)
In-Reply-To: <483575C2.1040303@web.de>

On Thursday 22 May 2008 08:31:46 Jan Kiszka wrote:
> Avi Kivity wrote:
> > Jan Kiszka wrote:
> >> In order to allow the gdbstub of QEMU to push (soft) breakpoint handling
> >> completely into the gdb frontend, this patch enables guest exits also
> >> for #BP exceptions - in case guest debugging was turned on.
> >>
> >> Along this enhancement, this patch also fixes the flag manipulation for
> >> the singlestep mode.
> >>   
> > 
> > Suppose userspace determines the exception is due to a guest
> > breakpoint.  How does it inject the debug exception?
> 
> Good question. Is there no "inject exception #XX" mechanism in kvm yet?
> 
> Will need this, as my current impression is that we better keep track of
> breakpoints at qemu level to tell guest soft-BPs apart from host
> injected ones. Would you suggest to add a separate IOCTL for exception
> injection then? Or should the new guest debug IOCTL contain a flag that
> signals "inject breakpoint trap" (both for guest soft-BP hits as well as
> guests already in single step mode)?

In addition to injecting debug interrupts, qemu should also be able to inject 
machine checks, for the case of undecoded MMIO accesses.

As long as qemu can access the complete register state (e.g. including "reason 
for machine check" registers), I don't think the injection interface *needs* 
to be more complicated than "exception number".

OTOH, I can see the argument for atomic injection operations, so to support 
that you'd end up with a sub-structure like kvm_exit, something like:

struct kvm_inject_arch {
	u32 exception_type;
	union {
		struct machine_check {
			u32 mcsr;
		} mc;
		struct debug {
		} debug;
	};
}

This stuff is completely arch-specific, so making a common "inject" ioctl 
number that simply calls arch function (like GET_SREGS) would be appropriate.

-- 
Hollis Blanchard
IBM Linux Technology Center

  parent reply	other threads:[~2008-05-22 14:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <482D9198.7040801@web.de>
2008-05-16 16:01 ` [RFC][PATCH 1/4] qemu: refactor cpu_watch/breakpoint API Jan Kiszka
2008-05-16 16:01 ` [RFC][PATCH 2/4] kvm: Arch-specifc KVM_EXIT_DEBUG payload Jan Kiszka
2008-05-21 15:59   ` [kvm-devel] " Avi Kivity
2008-05-22 13:27     ` Jan Kiszka
2008-05-21 16:04   ` Avi Kivity
2008-05-22 13:42     ` Jan Kiszka
2008-05-22 13:59       ` Avi Kivity
2008-05-22 14:32         ` Jan Kiszka
2008-05-22 14:35           ` Avi Kivity
2008-05-16 16:02 ` [RFC][PATCH 3/4] kvm-vmx: KVM_EXIT_DEBUG on #BP exceptions Jan Kiszka
2008-05-21 16:01   ` [kvm-devel] " Avi Kivity
2008-05-22 13:31     ` Jan Kiszka
2008-05-22 13:58       ` Avi Kivity
2008-05-22 14:24         ` Jan Kiszka
2008-05-22 14:31           ` Avi Kivity
2008-05-22 14:26       ` Hollis Blanchard [this message]
2008-05-22 14:34         ` Avi Kivity
2008-05-22 18:27           ` Hollis Blanchard
2008-05-25 10:24             ` Avi Kivity
2008-05-16 16:02 ` [RFC][PATCH 4/4] kvm-userspace: use soft-BPs for guest debugging Jan Kiszka

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=200805220926.52133.hollisb@us.ibm.com \
    --to=hollisb@us.ibm.com \
    --cc=avi@qumranet.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox