xen: add paravirt_patch_default lookup

The upstream kernel commit edcb5cf84f05e5d2e2af25422a72ccde359fcca9
("x86/paravirt/xen: Remove xen_patch()") broke crash compatibility.
This change adds a check for both symbols: "xen_patch" and
its replacement: "paravirt_patch_default".  Withouth the patch,
crash fails with an error message like this:

  crash: seek error: physical address: 83640e000 type: "pud page"

Resolves: https://github.com/crash-utility/crash/issues/78
Closes: https://github.com/crash-utility/crash/pull/79
Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
This commit is contained in:
John Donnelly 2021-04-08 10:18:10 -07:00 committed by Kazuhito Hagio
parent 6c043760dd
commit 0715962d32
3 changed files with 6 additions and 4 deletions

View File

@ -172,8 +172,8 @@ kernel_init()
if (PVOPS() && symbol_exists("pv_init_ops") &&
readmem(symbol_value("pv_init_ops"), KVADDR, &pv_init_ops,
sizeof(void *), "pv_init_ops", RETURN_ON_ERROR) &&
(p1 = value_symbol(pv_init_ops)) &&
STREQ(p1, "xen_patch")) {
((p1 = value_symbol(pv_init_ops)) &&
(STREQ(p1, "xen_patch") || STREQ(p1, "paravirt_patch_default")))) {
kt->flags |= ARCH_XEN | ARCH_PVOPS_XEN;
kt->xen_flags |= WRITABLE_PAGE_TABLES;
if (machine_type("X86"))

3
x86.c
View File

@ -4998,7 +4998,8 @@ x86_xendump_p2m_create(struct xendump_data *xd)
/*
* Check for pvops Xen kernel before presuming it's HVM.
*/
if (symbol_exists("pv_init_ops") && symbol_exists("xen_patch") &&
if (symbol_exists("pv_init_ops") &&
(symbol_exists("xen_patch") || symbol_exists("paravirt_patch_default")) &&
(xd->xc_core.header.xch_magic == XC_CORE_MAGIC))
return x86_pvops_xendump_p2m_create(xd);

View File

@ -7138,7 +7138,8 @@ x86_64_xendump_p2m_create(struct xendump_data *xd)
/*
* Check for pvops Xen kernel before presuming it's HVM.
*/
if (symbol_exists("pv_init_ops") && symbol_exists("xen_patch") &&
if (symbol_exists("pv_init_ops") &&
(symbol_exists("xen_patch") || symbol_exists("paravirt_patch_default")) &&
(xd->xc_core.header.xch_magic == XC_CORE_MAGIC))
return x86_64_pvops_xendump_p2m_create(xd);