Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934075AbdC3Ovn (ORCPT ); Thu, 30 Mar 2017 10:51:43 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:18596 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933347AbdC3Ovm (ORCPT ); Thu, 30 Mar 2017 10:51:42 -0400 Subject: Re: [PATCH] xen,kdump: handle pv domain in paddr_vmcoreinfo_note() To: Juergen Gross , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org References: <20170330141824.4113-1-jgross@suse.com> Cc: ptesarik@suse.com From: Boris Ostrovsky Message-ID: Date: Thu, 30 Mar 2017 10:51:28 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170330141824.4113-1-jgross@suse.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1535 Lines: 50 On 03/30/2017 10:18 AM, Juergen Gross wrote: > 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() only, > but being attributed "weak" it can be replaced easily in Xen case. > > Signed-off-by: Juergen Gross > --- > 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..0e2b8d7 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((unsigned long)(char *)&vmcoreinfo_note); Why not __pa_symbol(), just like in the weak version? -boris > +} > +#endif /* CONFIG_KEXEC_CORE */