xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Using kdb debugger on Xen-4.1
@ 2011-05-16 14:01 Sergey Tovpeko
  2011-05-18  2:11 ` Mukesh Rathor
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Tovpeko @ 2011-05-16 14:01 UTC (permalink / raw)
  To: mukesh.rathor; +Cc: xen-devel


[-- 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Using kdb debugger on Xen-4.1
  2011-05-16 14:01 Using kdb debugger on Xen-4.1 Sergey Tovpeko
@ 2011-05-18  2:11 ` Mukesh Rathor
  0 siblings, 0 replies; 2+ messages in thread
From: Mukesh Rathor @ 2011-05-18  2:11 UTC (permalink / raw)
  To: Sergey Tovpeko; +Cc: xen-devel

Hi Sergey,

Yeah, I noticed that on my prev refresh a while ago, and its sitting
in my list of things to do. I hope to return to it soon and refresh my
kdb branch on xen.org.

thanks,
Mukesh

On Mon, 16 May 2011 18:01:12 +0400
Sergey Tovpeko <tsv.devel@gmail.com> wrote:

> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-18  2:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-16 14:01 Using kdb debugger on Xen-4.1 Sergey Tovpeko
2011-05-18  2:11 ` Mukesh Rathor

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).