public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: kvm-devel <kvm-devel@lists.sourceforge.net>
Cc: Hollis Blanchard <hollisb@us.ibm.com>
Subject: [RFC][PATCH 2/4] kvm: Arch-specifc KVM_EXIT_DEBUG payload
Date: Fri, 16 May 2008 18:01:58 +0200	[thread overview]
Message-ID: <482DAFF6.3050403@web.de> (raw)
In-Reply-To: <482D9198.7040801@web.de>

This adds an arch field to kvm_run.debug, the payload that is returned
to user space on KVM_EXIT_DEBUG guest exits. For x86, this field is now
supposed to report the precise debug exception (#DB or #BP) and the
current state of the debug registers (the latter is not yet
implemented).

---
 arch/x86/kvm/vmx.c    |    1 +
 include/asm-x86/kvm.h |    5 +++++
 include/linux/kvm.h   |    1 +
 3 files changed, 7 insertions(+)

Index: b/arch/x86/kvm/vmx.c
===================================================================
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2282,6 +2282,7 @@ static int handle_exception(struct kvm_v
 	if ((intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK)) ==
 	    (INTR_TYPE_EXCEPTION | 1)) {
 		kvm_run->exit_reason = KVM_EXIT_DEBUG;
+		kvm_run->debug.arch.exception = 1;
 		return 0;
 	}
 	kvm_run->exit_reason = KVM_EXIT_EXCEPTION;
Index: b/include/asm-x86/kvm.h
===================================================================
--- a/include/asm-x86/kvm.h
+++ b/include/asm-x86/kvm.h
@@ -230,4 +230,9 @@ struct kvm_pit_state {
 #define KVM_TRC_APIC_ACCESS      (KVM_TRC_HANDLER + 0x14)
 #define KVM_TRC_TDP_FAULT        (KVM_TRC_HANDLER + 0x15)
 
+struct kvm_debug_exit_arch {
+	__u32 exception;
+	__u64 dr[8];
+};
+
 #endif
Index: b/include/linux/kvm.h
===================================================================
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -125,6 +125,7 @@ struct kvm_run {
 			__u64 data_offset; /* relative to kvm_run start */
 		} io;
 		struct {
+			struct kvm_debug_exit_arch arch;
 		} debug;
 		/* KVM_EXIT_MMIO */
 		struct {


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  parent reply	other threads:[~2008-05-16 16:01 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 ` Jan Kiszka [this message]
2008-05-21 15:59   ` [kvm-devel] [RFC][PATCH 2/4] kvm: Arch-specifc KVM_EXIT_DEBUG payload 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
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=482DAFF6.3050403@web.de \
    --to=jan.kiszka@web.de \
    --cc=hollisb@us.ibm.com \
    --cc=kvm-devel@lists.sourceforge.net \
    /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