Skip to content

Commit

Permalink
Two fixes for the Xen hypervisor; the first fixes a bug seen
Browse files Browse the repository at this point in the history
with Xen 4.11.0 during initialization, which fails with the error
message "crash: invalid kernel virtual address: <address> type:
fill_pcpu_struct", followed by "WARNING: cannot fill pcpu_struct"
and "crash: cannot read cpu_info".  The second fix prevents a
segmentation violation associated with a crash-7.1.1 commit that
addressed the Xen 4.5.0 hypervisor symbol name change from
"dom0" to "hardware_domain".
([email protected])
  • Loading branch information
Dave Anderson committed Jan 18, 2019
1 parent 141df20 commit c6f0db6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion x86_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -7903,7 +7903,11 @@ 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");
XEN_HYPER_ASSIGN_OFFSET(tss_struct_rsp0) = MEMBER_OFFSET("tss_struct", "__blh") + sizeof(short unsigned int);
if (MEMBER_EXISTS("tss_struct", "__blh")) {
XEN_HYPER_ASSIGN_OFFSET(tss_struct_rsp0) = MEMBER_OFFSET("tss_struct", "__blh") + sizeof(short unsigned int);
} else {
XEN_HYPER_ASSIGN_OFFSET(tss_struct_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");
Expand Down
8 changes: 4 additions & 4 deletions xen_hyper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ xen_hyper_get_domains(void)
long domain_next_in_list;
int i, j;

if (!try_get_symbol_data("dom0", sizeof(void *), &domain))
get_symbol_data("hardware_domain", sizeof(void *), &domain);
if (!try_get_symbol_data("hardware_domain", sizeof(void *), &domain))
get_symbol_data("dom0", sizeof(void *), &domain);

domain_next_in_list = MEMBER_OFFSET("domain", "next_in_list");
i = 0;
Expand Down Expand Up @@ -1103,8 +1103,8 @@ xen_hyper_get_domain_next(int mod, ulong *next)
if (xhdt->dom0) {
*next = xhdt->dom0->domain;
} else {
if (!try_get_symbol_data("dom0", sizeof(void *), next))
get_symbol_data("hardware_domain", sizeof(void *), next);
if (!try_get_symbol_data("hardware_domain", sizeof(void *), next))
get_symbol_data("dom0", sizeof(void *), next);
}
return xhdt->domain_struct;
break;
Expand Down

0 comments on commit c6f0db6

Please sign in to comment.