xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Tovpeko <tsv.devel@gmail.com>
To: mukesh.rathor@oracle.com
Cc: xen-devel@lists.xensource.com
Subject: Using kdb debugger on Xen-4.1
Date: Mon, 16 May 2011 18:01:12 +0400	[thread overview]
Message-ID: <BANLkTikzBoOCHQtA2hMpPvMU9rWsXVAR1g@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 572 bytes --]

Hello!

I've tried kdb on Xen 4.1 to debug hypervisor&Dom0 online and I should
say it works well.
Took kdb from http://xenbits.xen.org/ext/debuggers.hg/

It seems there are still one issue I run into.

 GET_PROCESSOR_ID macros defined in arch/x86/x86_64/entry.S is
out-of-date and should be updated for Xen-4.1. I mean that one uses
fixed offset to get processor_id field.

        orq  $(STACK_SIZE-16),reg;    \


That offset has been changed in cpu_info structure in new Xen.

I attached  the patch how it should be fixed on my vision. Please,
review the one.

Sergey.

[-- Attachment #1.2: Type: text/html, Size: 741 bytes --]

[-- Attachment #2: get_processor_id.patch --]
[-- Type: text/x-patch, Size: 1597 bytes --]

commit f45d74f37a7d5cfc9a5fb8356802b41615a8ec56
Author: Sergey Tovpeko <tovpeko@altell.ru>
Date:   Thu May 12 15:00:09 2011 +0400

    [kdb] Fixed GET_PROCESSOR_ID macros

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 31efe63..b54e039 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -12,17 +12,6 @@
 #include <asm/page.h>
 #include <public/xen.h>
 
-#ifdef XEN_KDB_CONFIG
-/* return (int) smp_processor_id in reg. the upper 32bits should already be
- *  * zeroed(?), but we clear anyways by shifting left and right */
-#define GET_PROCESSOR_ID(reg)         \
-        movq $~(STACK_SIZE-1),reg;    \
-        andq %rsp,reg;                \
-        orq  $(STACK_SIZE-16),reg;    \
-        movq (reg),reg;               \
-        shl $32,reg;                  \
-        shr $32,reg;
-#endif
         ALIGN
 /* %rbx: struct vcpu */
 switch_to_kernel:
diff --git a/xen/include/asm-x86/x86_64/asm_defns.h b/xen/include/asm-x86/x86_64/asm_defns.h
index 5c7159a..1fb154f 100644
--- a/xen/include/asm-x86/x86_64/asm_defns.h
+++ b/xen/include/asm-x86/x86_64/asm_defns.h
@@ -130,6 +130,12 @@ STR(IRQ) #nr "_interrupt:\n\t"                  \
         GET_CPUINFO_FIELD(CPUINFO_current_vcpu,reg)     \
         movq (reg),reg;
 
+#define GET_PROCESSOR_ID(reg)                           \
+        GET_CPUINFO_FIELD(CPUINFO_processor_id,reg)     \
+        movq (reg), reg;                                \
+        shl $32,reg;                                    \
+        shr $32,reg;
+
 #ifdef __ASSEMBLY__
 # define _ASM_EX(p) p-.
 #else

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2011-05-16 14:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 14:01 Sergey Tovpeko [this message]
2011-05-18  2:11 ` Using kdb debugger on Xen-4.1 Mukesh Rathor

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=BANLkTikzBoOCHQtA2hMpPvMU9rWsXVAR1g@mail.gmail.com \
    --to=tsv.devel@gmail.com \
    --cc=mukesh.rathor@oracle.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).