----- Original Message -----
Hi Dave,
Am Mittwoch, 11. Dezember 2019, 20:28:49 CET schrieb Dave Anderson:
>
...
>
> If you don't have a 32-bit x86 machine, or don't have the proper
> libraries to build a 32-bit crash binary on an x86_64 host with
> "make target=X86", just re-post the patch with your best effort
> and I'll build-test it.
>
> Thanks,
> Dave
Sorry, my bad, I didn't think of 32 bit.
I installed the 32 bit libraries and hopefully fixed the issuses.
But I'm not able to test the 32 bit variant because I have no proper dumps.
Many thanks.
Dietmar.
Thanks Dietmar -- your patch is queued for crash-7.2.8:
https://github.com/crash-utility/crash/commit/4e4e5859731da650d3520150d7e...
Dave
Signed-off-by: Dietmar Hahn <dietmar.hahn(a)ts.fujitsu.com>
---
x86.c | 12 ++++++------
x86_64.c | 20 +++++++++++++++-----
xen_hyper.c | 22 ++++++++++++----------
xen_hyper_defs.h | 8 ++++----
xen_hyper_dump_tables.c | 8 ++++----
5 files changed, 41 insertions(+), 29 deletions(-)
diff --git a/x86.c b/x86.c
index 88562b6..de0d3d3 100644
--- a/x86.c
+++ b/x86.c
@@ -5600,18 +5600,18 @@ x86_get_stackbase_hyper(ulong task)
if (symbol_exists("init_tss")) {
init_tss = symbol_value("init_tss");
- init_tss += XEN_HYPER_SIZE(tss_struct) * pcpu;
+ init_tss += XEN_HYPER_SIZE(tss) * pcpu;
} else {
init_tss = symbol_value("per_cpu__init_tss");
init_tss = xen_hyper_per_cpu(init_tss, pcpu);
}
- buf = GETBUF(XEN_HYPER_SIZE(tss_struct));
+ buf = GETBUF(XEN_HYPER_SIZE(tss));
if (!readmem(init_tss, KVADDR, buf,
- XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
+ XEN_HYPER_SIZE(tss), "init_tss", RETURN_ON_ERROR)) {
error(FATAL, "cannot read init_tss.\n");
}
- esp = ULONG(buf + XEN_HYPER_OFFSET(tss_struct_esp0));
+ esp = ULONG(buf + XEN_HYPER_OFFSET(tss_esp0));
FREEBUF(buf);
base = esp & (~(STACKSIZE() - 1));
@@ -5745,8 +5745,8 @@ x86_init_hyper(int when)
#endif
XEN_HYPER_STRUCT_SIZE_INIT(cpu_time, "cpu_time");
XEN_HYPER_STRUCT_SIZE_INIT(cpuinfo_x86, "cpuinfo_x86");
- XEN_HYPER_STRUCT_SIZE_INIT(tss_struct, "tss_struct");
- XEN_HYPER_MEMBER_OFFSET_INIT(tss_struct_esp0, "tss_struct",
"esp0");
+ XEN_HYPER_STRUCT_SIZE_INIT(tss, "tss_struct");
+ XEN_HYPER_MEMBER_OFFSET_INIT(tss_esp0, "tss_struct", "esp0");
XEN_HYPER_MEMBER_OFFSET_INIT(cpu_time_local_tsc_stamp, "cpu_time",
"local_tsc_stamp");
XEN_HYPER_MEMBER_OFFSET_INIT(cpu_time_stime_local_stamp, "cpu_time",
"stime_local_stamp");
XEN_HYPER_MEMBER_OFFSET_INIT(cpu_time_stime_master_stamp, "cpu_time",
"stime_master_stamp");
diff --git a/x86_64.c b/x86_64.c
index a4138ed..4f1a6d7 100644
--- a/x86_64.c
+++ b/x86_64.c
@@ -7973,13 +7973,23 @@ x86_64_init_hyper(int when)
case POST_GDB:
XEN_HYPER_STRUCT_SIZE_INIT(cpuinfo_x86, "cpuinfo_x86");
- XEN_HYPER_STRUCT_SIZE_INIT(tss_struct, "tss_struct");
- if (MEMBER_EXISTS("tss_struct", "__blh")) {
- XEN_HYPER_ASSIGN_OFFSET(tss_struct_rsp0) = MEMBER_OFFSET("tss_struct",
"__blh") + sizeof(short unsigned int);
+ if (symbol_exists("per_cpu__tss_page")) {
+ XEN_HYPER_STRUCT_SIZE_INIT(tss, "tss64");
+ XEN_HYPER_ASSIGN_OFFSET(tss_rsp0) =
+ MEMBER_OFFSET("tss64", "rsp0");
+ XEN_HYPER_MEMBER_OFFSET_INIT(tss_ist, "tss64", "ist");
} else {
- XEN_HYPER_ASSIGN_OFFSET(tss_struct_rsp0) = MEMBER_OFFSET("tss_struct",
"rsp0");
+ XEN_HYPER_STRUCT_SIZE_INIT(tss, "tss_struct");
+ XEN_HYPER_MEMBER_OFFSET_INIT(tss_ist, "tss_struct", "ist");
+ if (MEMBER_EXISTS("tss_struct", "__blh")) {
+ XEN_HYPER_ASSIGN_OFFSET(tss_rsp0) =
+ MEMBER_OFFSET("tss_struct", "__blh") +
+ sizeof(short unsigned int);
+ } else {
+ XEN_HYPER_ASSIGN_OFFSET(tss_rsp0) =
+ MEMBER_OFFSET("tss_struct", "rsp0");
+ }
}
- XEN_HYPER_MEMBER_OFFSET_INIT(tss_struct_ist, "tss_struct",
"ist");
if (symbol_exists("cpu_data")) {
xht->cpu_data_address = symbol_value("cpu_data");
}
diff --git a/xen_hyper.c b/xen_hyper.c
index f2f00e6..1030c0a 100644
--- a/xen_hyper.c
+++ b/xen_hyper.c
@@ -338,33 +338,35 @@ xen_hyper_x86_pcpu_init(void)
if((xhpct->pcpu_struct = malloc(XEN_HYPER_SIZE(cpu_info))) == NULL) {
error(FATAL, "cannot malloc pcpu struct space.\n");
}
-
/* get physical cpu context */
xen_hyper_alloc_pcpu_context_space(XEN_HYPER_MAX_CPUS());
if (symbol_exists("per_cpu__init_tss")) {
init_tss_base = symbol_value("per_cpu__init_tss");
flag = TRUE;
+ } else if (symbol_exists("per_cpu__tss_page")) {
+ init_tss_base = symbol_value("per_cpu__tss_page");
+ flag = TRUE;
} else {
init_tss_base = symbol_value("init_tss");
flag = FALSE;
}
- buf = GETBUF(XEN_HYPER_SIZE(tss_struct));
+ buf = GETBUF(XEN_HYPER_SIZE(tss));
for_cpu_indexes(i, 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;
+ XEN_HYPER_SIZE(tss) * cpuid;
if (!readmem(init_tss, KVADDR, buf,
- XEN_HYPER_SIZE(tss_struct), "init_tss", RETURN_ON_ERROR)) {
+ XEN_HYPER_SIZE(tss), "init_tss", RETURN_ON_ERROR)) {
error(FATAL, "cannot read init_tss.\n");
}
if (machine_type("X86")) {
- sp = ULONG(buf + XEN_HYPER_OFFSET(tss_struct_esp0));
+ sp = ULONG(buf + XEN_HYPER_OFFSET(tss_esp0));
} else if (machine_type("X86_64")) {
- sp = ULONG(buf + XEN_HYPER_OFFSET(tss_struct_rsp0));
- } else
+ sp = ULONG(buf + XEN_HYPER_OFFSET(tss_rsp0));
+ } else
sp = 0;
cpu_info = XEN_HYPER_GET_CPU_INFO(sp);
if (CRASHDEBUG(1)) {
@@ -1777,10 +1779,10 @@ xen_hyper_store_pcpu_context_tss(struct
xen_hyper_pcpu_context *pcc,
pcc->init_tss = init_tss;
if (machine_type("X86")) {
- pcc->sp.esp0 = ULONG(tss + XEN_HYPER_OFFSET(tss_struct_esp0));
+ pcc->sp.esp0 = ULONG(tss + XEN_HYPER_OFFSET(tss_esp0));
} else if (machine_type("X86_64")) {
- pcc->sp.rsp0 = ULONG(tss + XEN_HYPER_OFFSET(tss_struct_rsp0));
- ist_p = (uint64_t *)(tss + XEN_HYPER_OFFSET(tss_struct_ist));
+ pcc->sp.rsp0 = ULONG(tss + XEN_HYPER_OFFSET(tss_rsp0));
+ ist_p = (uint64_t *)(tss + XEN_HYPER_OFFSET(tss_ist));
for (i = 0; i < XEN_HYPER_TSS_IST_MAX; i++, ist_p++) {
pcc->ist[i] = ULONG(ist_p);
}
diff --git a/xen_hyper_defs.h b/xen_hyper_defs.h
index b871bdd..acf910a 100644
--- a/xen_hyper_defs.h
+++ b/xen_hyper_defs.h
@@ -598,7 +598,7 @@ struct xen_hyper_size_table {
long scheduler;
long shared_info;
long timer;
- long tss_struct;
+ long tss;
long vcpu;
long vcpu_runstate_info;
long xen_crash_xen_regs_t; /* elf note v2 */
@@ -727,9 +727,9 @@ struct xen_hyper_offset_table {
long timer_heap_offset;
long timer_killed;
/* tss */
- long tss_struct_rsp0;
- long tss_struct_esp0;
- long tss_struct_ist;
+ long tss_rsp0;
+ long tss_esp0;
+ long tss_ist;
/* vcpu */
long vcpu_vcpu_id;
long vcpu_processor;
diff --git a/xen_hyper_dump_tables.c b/xen_hyper_dump_tables.c
index eb646b6..0360d25 100644
--- a/xen_hyper_dump_tables.c
+++ b/xen_hyper_dump_tables.c
@@ -636,8 +636,8 @@ xen_hyper_dump_xen_hyper_size_table(char *spec, ulong
makestruct)
(buf, "%ld\n", xen_hyper_size_table.shared_info));
XEN_HYPER_PRI(fp, len, "timer: ", buf, flag,
(buf, "%ld\n", xen_hyper_size_table.timer));
- XEN_HYPER_PRI(fp, len, "tss_struct: ", buf, flag,
- (buf, "%ld\n", xen_hyper_size_table.tss_struct));
+ XEN_HYPER_PRI(fp, len, "tss: ", buf, flag,
+ (buf, "%ld\n", xen_hyper_size_table.tss));
XEN_HYPER_PRI(fp, len, "vcpu: ", buf, flag,
(buf, "%ld\n", xen_hyper_size_table.vcpu));
XEN_HYPER_PRI(fp, len, "vcpu_runstate_info: ", buf, flag,
@@ -868,9 +868,9 @@ xen_hyper_dump_xen_hyper_offset_table(char *spec, ulong
makestruct)
(buf, "%ld\n", xen_hyper_offset_table.timer_killed));
XEN_HYPER_PRI(fp, len, "tss_struct_rsp0: ", buf, flag,
- (buf, "%ld\n", xen_hyper_offset_table.tss_struct_rsp0));
+ (buf, "%ld\n", xen_hyper_offset_table.tss_rsp0));
XEN_HYPER_PRI(fp, len, "tss_struct_esp0: ", buf, flag,
- (buf, "%ld\n", xen_hyper_offset_table.tss_struct_esp0));
+ (buf, "%ld\n", xen_hyper_offset_table.tss_esp0));
XEN_HYPER_PRI(fp, len, "vcpu_vcpu_id: ", buf, flag,
(buf, "%ld\n", xen_hyper_offset_table.vcpu_vcpu_id));
--
2.16.4