Thank you for the update, Qi. For v3: Acked-by: Lianbo Jiang <[email protected]>
On Tue, Dec 21, 2021 at 3:41 PM <[email protected]> wrote: > Date: Tue, 21 Dec 2021 15:40:31 +0800 > From: Qi Zheng <[email protected]> > To: [email protected], [email protected] > Cc: Qi Zheng <[email protected]>, [email protected] > Subject: [Crash-utility] [PATCH v3] Fix pvops Xen detection for arm > machine > Message-ID: <[email protected]> > Content-Type: text/plain; charset="US-ASCII" > > Since the xen_start_info on the arm/arm64 platform is static defined: > > ./arm/xen/enlighten.c:40:static struct start_info _xen_start_info; > ./arm/xen/enlighten.c:41:struct start_info *xen_start_info = &_xen_start_info; > ./arm/xen/enlighten.c:42:EXPORT_SYMBOL(xen_start_info); > > The is_pvops_xen() in commit 4badc6229c69f5cd9da7eb7bdf400a53ec6db01a > ("Fix pvops Xen detection for kernels >= v4.20") always return TRUE. > Then the following error will be reported because p2m_mid_missing > and xen_p2m_addr are not defined: > > crash: cannot resolve "p2m_top" > > For the arm/arm64 platform, fix it by using xen_vcpu_info instead of > xen_start_info to detect Xen dumps. > > And considering that xen_start_info is only defined on x86 and arm > platform, use machine_type() to explicitly narrow the scope of the > xen_start_info check to x86. > > Signed-off-by: Qi Zheng <[email protected]> > Acked-by: Kazuhito Hagio <[email protected]> > --- > kernel.c | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > > diff --git a/kernel.c b/kernel.c > index f4598ea..37b7af7 100644 > --- a/kernel.c > +++ b/kernel.c > @@ -10757,11 +10757,21 @@ is_pvops_xen(void) > STREQ(sym, "paravirt_patch_default"))) > return TRUE; > > - if (symbol_exists("xen_start_info") && > - readmem(symbol_value("xen_start_info"), KVADDR, &addr, > - sizeof(void *), "xen_start_info", RETURN_ON_ERROR) && > - addr != 0) > - return TRUE; > + if (machine_type("X86") || machine_type("X86_64")) { > + if (symbol_exists("xen_start_info") && > + readmem(symbol_value("xen_start_info"), KVADDR, &addr, > + sizeof(void *), "xen_start_info", RETURN_ON_ERROR) && > + addr != 0) > + return TRUE; > + } > + > + if (machine_type("ARM") || machine_type("ARM64")) { > + if (symbol_exists("xen_vcpu_info") && > + readmem(symbol_value("xen_vcpu_info"), KVADDR, &addr, > + sizeof(void *), "xen_vcpu_info", RETURN_ON_ERROR) && > + addr != 0) > + return TRUE; > + } > > return FALSE; > } > -- > changes since [v2]: > - use machine_type() to explicitly narrow the scope of the xen_start_info > check to x86. > - Collect Acked-by from Kazu. > > [v1]: > https://listman.redhat.com/archives/crash-utility/2021-December/msg00007.html > [v2]: > https://listman.redhat.com/archives/crash-utility/2021-December/msg00028.html > 2.11.0 -- Crash-utility mailing list [email protected] https://listman.redhat.com/mailman/listinfo/crash-utility
