Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   Fix missing 'init_tss' symbol in Xen4 (http://www.linux-archive.org/crash-utility/473549-fix-missing-init_tss-symbol-xen4.html)

Petr Tesarik 01-07-2011 02:08 PM

Fix missing 'init_tss' symbol in Xen4
 
In Xen4, init_tss is a per-cpu symbol. Without this patch, crash fails on Xen4
hypervisor dumps during initialization with 'crash: cannot
resolve "init_tss"'.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
---
xen_hyper.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

--- a/xen_hyper.c
+++ b/xen_hyper.c
@@ -319,6 +319,7 @@
struct xen_hyper_pcpu_context *pcc;
char *buf, *bp;
int i, cpuid;
+ int flag;


XEN_HYPER_MEMBER_OFFSET_INIT(cpu_info_guest_cpu_us er_regs, "cpu_info", "guest_cpu_user_regs");

XEN_HYPER_MEMBER_OFFSET_INIT(cpu_info_processor_id , "cpu_info", "processor_id");
@@ -330,11 +331,21 @@

/* get physical cpu context */
xen_hyper_alloc_pcpu_context_space(XEN_HYPER_MAX_C PUS());
- init_tss_base = symbol_value("init_tss");
+ if (symbol_exists("per_cpu__init_tss")) {
+ init_tss_base = symbol_value("per_cpu__init_tss");
+ flag = TRUE;
+ } else {
+ init_tss_base = symbol_value("init_tss");
+ flag = FALSE;
+ }
buf = GETBUF(XEN_HYPER_SIZE(tss_struct));
for_cpu_indexes(i, cpuid)
{
- init_tss = init_tss_base + XEN_HYPER_SIZE(tss_struct) * cpuid;
+ if (flag)
+ init_tss = xen_hyper_per_cpu(init_tss_base, cpuid);
+ else
+ init_tss = init_tss_base +
+ XEN_HYPER_SIZE(tss_struct) * cpuid;
if (!readmem(init_tss, KVADDR, buf,
XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
error(FATAL, "cannot read init_tss.
");

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

Dave Anderson 01-07-2011 02:48 PM

Fix missing 'init_tss' symbol in Xen4
 
----- Original Message -----
> In Xen4, init_tss is a per-cpu symbol. Without this patch, crash fails on Xen4
> hypervisor dumps during initialization with 'crash: cannot
> resolve "init_tss"'.

Queued for the next release.

Thanks,
Dave

> Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
> ---
> xen_hyper.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> --- a/xen_hyper.c
> +++ b/xen_hyper.c
> @@ -319,6 +319,7 @@
> struct xen_hyper_pcpu_context *pcc;
> char *buf, *bp;
> int i, cpuid;
> + int flag;
>
>
> XEN_HYPER_MEMBER_OFFSET_INIT(cpu_info_guest_cpu_us er_regs, "cpu_info",
> "guest_cpu_user_regs");
>
> XEN_HYPER_MEMBER_OFFSET_INIT(cpu_info_processor_id , "cpu_info",
> "processor_id");
> @@ -330,11 +331,21 @@
>
> /* get physical cpu context */
> xen_hyper_alloc_pcpu_context_space(XEN_HYPER_MAX_C PUS());
> - init_tss_base = symbol_value("init_tss");
> + if (symbol_exists("per_cpu__init_tss")) {
> + init_tss_base = symbol_value("per_cpu__init_tss");
> + flag = TRUE;
> + } else {
> + init_tss_base = symbol_value("init_tss");
> + flag = FALSE;
> + }
> buf = GETBUF(XEN_HYPER_SIZE(tss_struct));
> for_cpu_indexes(i, cpuid)
> {
> - init_tss = init_tss_base + XEN_HYPER_SIZE(tss_struct) * cpuid;
> + if (flag)
> + init_tss = xen_hyper_per_cpu(init_tss_base, cpuid);
> + else
> + init_tss = init_tss_base +
> + XEN_HYPER_SIZE(tss_struct) * cpuid;
> if (!readmem(init_tss, KVADDR, buf,
> XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
> error(FATAL, "cannot read init_tss.
");
>
> --
> Crash-utility mailing list
> Crash-utility@redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility

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

Petr Tesarik 01-17-2011 10:40 AM

Fix missing 'init_tss' symbol in Xen4
 
In Xen4, init_tss is a per-cpu symbol. Without this patch, crash fails
on Xen4 hypervisor dumps during initialization with
'crash: cannot resolve "init_tss"'.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>

---
xen_hyper.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

--- a/xen_hyper.c
+++ b/xen_hyper.c
@@ -319,6 +319,7 @@ xen_hyper_x86_pcpu_init(void)
struct xen_hyper_pcpu_context *pcc;
char *buf, *bp;
int i, cpuid;
+ int flag;

XEN_HYPER_MEMBER_OFFSET_INIT(cpu_info_guest_cpu_us er_regs, "cpu_info",
"guest_cpu_user_regs");
XEN_HYPER_MEMBER_OFFSET_INIT(cpu_info_processor_id , "cpu_info",
"processor_id");
@@ -330,11 +331,21 @@ xen_hyper_x86_pcpu_init(void)

/* get physical cpu context */
xen_hyper_alloc_pcpu_context_space(XEN_HYPER_MAX_C PUS());
- init_tss_base = symbol_value("init_tss");
+ if (symbol_exists("per_cpu__init_tss")) {
+ init_tss_base = symbol_value("per_cpu__init_tss");
+ flag = TRUE;
+ } else {
+ init_tss_base = symbol_value("init_tss");
+ flag = FALSE;
+ }
buf = GETBUF(XEN_HYPER_SIZE(tss_struct));
for_cpu_indexes(i, cpuid)
{
- init_tss = init_tss_base + XEN_HYPER_SIZE(tss_struct) * cpuid;
+ if (flag)
+ init_tss = xen_hyper_per_cpu(init_tss_base, cpuid);
+ else
+ init_tss = init_tss_base +
+ XEN_HYPER_SIZE(tss_struct) * cpuid;
if (!readmem(init_tss, KVADDR, buf,
XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
error(FATAL, "cannot read init_tss.
");

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


All times are GMT. The time now is 05:34 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.