Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933178AbdCaKOz (ORCPT ); Fri, 31 Mar 2017 06:14:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:50589 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932896AbdCaKOy (ORCPT ); Fri, 31 Mar 2017 06:14:54 -0400 From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Cc: boris.ostrovsky@oracle.com, ptesarik@suse.com, Juergen Gross Subject: [PATCH v2] xen,kdump: handle pv domain in paddr_vmcoreinfo_note() Date: Fri, 31 Mar 2017 12:14:38 +0200 Message-Id: <20170331101438.28582-1-jgross@suse.com> X-Mailer: git-send-email 2.10.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1435 Lines: 51 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 --- Changes in V2: - use __pa_symbol() (Boris Ostrovsky) - remove unneeded casts (Jan Beulich) This patch needs to be rebased on top of Vitaly's series to split pv- and hvm-code. I'll do this as soon as his series is in the Xen tree in its final form. --- arch/x86/xen/mmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 37cb5aa..33ab96c 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 @@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, return -EINVAL; } EXPORT_SYMBOL_GPL(xen_unmap_domain_gfn_range); + +#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 */ -- 2.10.2