FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 07-05-2012, 03:02 PM
Daniel Kiper
 
Default x86/xen: Read variables from dynamically allocated per_cpu data

per_cpu data is dynamically allocated since 21416 changeset (x86: Dynamically
allocate percpu data area when a CPU comes online). Take into account that
and read variables from correct address.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.0.8.orig/xen_hyper.c crash-6.0.8/xen_hyper.c
--- crash-6.0.8.orig/xen_hyper.c 2012-07-05 15:47:09.000000000 +0200
+++ crash-6.0.8/xen_hyper.c 2012-07-05 15:50:19.000000000 +0200
@@ -64,7 +64,6 @@ xen_hyper_init(void)
machdep->get_smp_cpus();
machdep->memory_size();

-#ifdef IA64
if (symbol_exists("__per_cpu_offset")) {
xht->flags |= XEN_HYPER_SMP;
if((xht->__per_cpu_offset = malloc(sizeof(ulong) * XEN_HYPER_MAX_CPUS())) == NULL) {
@@ -76,7 +75,6 @@ xen_hyper_init(void)
error(FATAL, "cannot read __per_cpu_offset.
");
}
}
-#endif

#if defined(X86) || defined(X86_64)
if (symbol_exists("__per_cpu_shift")) {
diff -Npru crash-6.0.8.orig/xen_hyper_defs.h crash-6.0.8/xen_hyper_defs.h
--- crash-6.0.8.orig/xen_hyper_defs.h 2012-06-29 16:59:18.000000000 +0200
+++ crash-6.0.8/xen_hyper_defs.h 2012-07-05 15:50:19.000000000 +0200
@@ -136,7 +136,13 @@ typedef uint32_t Elf_Word;

#if defined(X86) || defined(X86_64)
#define xen_hyper_per_cpu(var, cpu)
- ((ulong)(var) + (((ulong)(cpu))<<xht->percpu_shift))
+ ({ ulong __var_addr;
+ if (xht->__per_cpu_offset)
+ __var_addr = (xht->flags & XEN_HYPER_SMP) ?
+ ((ulong)(var) + xht->__per_cpu_offset[cpu]) : (ulong)(var);
+ else
+ __var_addr = (ulong)(var) + ((ulong)(cpu) << xht->percpu_shift);
+ __var_addr; })
#elif defined(IA64)
#define xen_hyper_per_cpu(var, cpu)
((xht->flags & XEN_HYPER_SMP) ?

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 08-10-2012, 01:26 PM
Daniel Kiper
 
Default x86/xen: Read variables from dynamically allocated per_cpu data

per_cpu data is dynamically allocated since 21416 changeset (x86: Dynamically
allocate percpu data area when a CPU comes online). Take into account that
and read variables from correct address.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>

diff -Npru crash-6.0.8.orig/xen_hyper.c crash-6.0.8/xen_hyper.c
--- crash-6.0.8.orig/xen_hyper.c 2012-07-05 15:47:09.000000000 +0200
+++ crash-6.0.8/xen_hyper.c 2012-07-05 15:50:19.000000000 +0200
@@ -64,7 +64,6 @@ xen_hyper_init(void)
machdep->get_smp_cpus();
machdep->memory_size();

-#ifdef IA64
if (symbol_exists("__per_cpu_offset")) {
xht->flags |= XEN_HYPER_SMP;
if((xht->__per_cpu_offset = malloc(sizeof(ulong) * XEN_HYPER_MAX_CPUS())) == NULL) {
@@ -76,7 +75,6 @@ xen_hyper_init(void)
error(FATAL, "cannot read __per_cpu_offset.
");
}
}
-#endif

#if defined(X86) || defined(X86_64)
if (symbol_exists("__per_cpu_shift")) {
diff -Npru crash-6.0.8.orig/xen_hyper_defs.h crash-6.0.8/xen_hyper_defs.h
--- crash-6.0.8.orig/xen_hyper_defs.h 2012-06-29 16:59:18.000000000 +0200
+++ crash-6.0.8/xen_hyper_defs.h 2012-07-05 15:50:19.000000000 +0200
@@ -136,7 +136,13 @@ typedef uint32_t Elf_Word;

#if defined(X86) || defined(X86_64)
#define xen_hyper_per_cpu(var, cpu)
- ((ulong)(var) + (((ulong)(cpu))<<xht->percpu_shift))
+ ({ ulong __var_addr;
+ if (xht->__per_cpu_offset)
+ __var_addr = (xht->flags & XEN_HYPER_SMP) ?
+ ((ulong)(var) + xht->__per_cpu_offset[cpu]) : (ulong)(var);
+ else
+ __var_addr = (ulong)(var) + ((ulong)(cpu) << xht->percpu_shift);
+ __var_addr; })
#elif defined(IA64)
#define xen_hyper_per_cpu(var, cpu)
((xht->flags & XEN_HYPER_SMP) ?

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 06:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org