From: Juergen Gross Date: Tue, 11 Apr 2017 16:14:26 +0000 (+0200) Subject: xen,kdump: handle pv domain in paddr_vmcoreinfo_note() X-Git-Tag: v4.1.12-111.0.20170918_2215~224 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ebfa5a13dca5b2c3bc002a092dbc2a6670f2ae59;p=users%2Fjedix%2Flinux-maple.git xen,kdump: handle pv domain in paddr_vmcoreinfo_note() For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address. paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case. Signed-off-by: Juergen Gross Tested-by: Petr Tesarik Reviewed-by: Boris Ostrovsky Reviewed-by: Daniel Kiper Signed-off-by: Juergen Gross OraBug: 26662731 (cherry picked from commit 29985b09613ba106a1ed0496988636d288600515) Signed-off-by: Boris Ostrovsky Reviewed-by: Joao Martins Conflicts: arch/x86/xen/mmu_pv.c ( no mmu_pv.c in our tree) --- diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index fab497f954447..b68043df2e671 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -49,6 +49,9 @@ #include #include #include +#ifdef CONFIG_KEXEC_CORE +#include +#endif #include @@ -2692,6 +2695,16 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order) } EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region); +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note(void) +{ + if (xen_pv_domain()) + return virt_to_machine(&vmcoreinfo_note).maddr; + else + return __pa_symbol(&vmcoreinfo_note); +} +#endif /* CONFIG_KEXEC_CORE */ + #ifdef CONFIG_XEN_PVHVM #ifdef CONFIG_PROC_VMCORE /*