From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: ebiederm@xmission.com (Eric W. Biederman) References: <1480445729-27130-1-git-send-email-labbott@redhat.com> <1480445729-27130-8-git-send-email-labbott@redhat.com> <20161201024103.GA32438@dhcp-128-65.nay.redhat.com> Date: Wed, 30 Nov 2016 21:13:24 -0600 In-Reply-To: <20161201024103.GA32438@dhcp-128-65.nay.redhat.com> (Dave Young's message of "Thu, 1 Dec 2016 10:41:03 +0800") Message-ID: <87polc7357.fsf@xmission.com> MIME-Version: 1.0 Subject: Re: [PATCHv4 07/10] kexec: Switch to __pa_symbol List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Dave Young Cc: Mark Rutland , Andrew Morton , Ard Biesheuvel , Catalin Marinas , x86@kernel.org, Will Deacon , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Joonsoo Kim , Laura Abbott , kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski Dave Young writes: > Hi, Laura > On 11/29/16 at 10:55am, Laura Abbott wrote: >> >> __pa_symbol is the correct api to get the physical address of kernel >> symbols. Switch to it to allow for better debug checking. >> > > I assume __pa_symbol is faster than __pa, but it still need some testing > on all arches which support kexec. > > But seems long long ago there is a commit e3ebadd95cb in the commit log > I see below from: > "we should deprecate __pa_symbol(), and preferably __pa() too - and > just use "virt_to_phys()" instead, which is is more readable and has > nicer semantics." > > But maybe in modern code __pa_symbol is prefered I may miss background. > virt_to_phys still sounds more readable now for me though. There has been a lot of history with the various definitions. __pa_symbol used to be x86 specific. Now what we have is that __pa_symbol is just __pa(RELOC_HIDE(x)); Now arguably that whole reloc hide thing should happen by architectures having a non-inline version of __pa as was done in the commit you mention. But at this point there appears to be nothing wrong with changing a __pa to a __pa_symbol it might make things a tad more reliable depending on the implementation of __pa. Acked-by: "Eric W. Biederman" Eric >> Signed-off-by: Laura Abbott >> --- >> Found during review of the kernel. Untested. >> --- >> kernel/kexec_core.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c >> index 5616755..e1b625e 100644 >> --- a/kernel/kexec_core.c >> +++ b/kernel/kexec_core.c >> @@ -1397,7 +1397,7 @@ void __weak arch_crash_save_vmcoreinfo(void) >> >> phys_addr_t __weak paddr_vmcoreinfo_note(void) >> { >> - return __pa((unsigned long)(char *)&vmcoreinfo_note); >> + return __pa_symbol((unsigned long)(char *)&vmcoreinfo_note); >> } >> >> static int __init crash_save_vmcoreinfo_init(void) >> -- >> 2.7.4 >> >> >> _______________________________________________ >> kexec mailing list >> kexec@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/kexec > > Thanks > Dave _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Date: Wed, 30 Nov 2016 21:13:24 -0600 Subject: [PATCHv4 07/10] kexec: Switch to __pa_symbol In-Reply-To: <20161201024103.GA32438@dhcp-128-65.nay.redhat.com> (Dave Young's message of "Thu, 1 Dec 2016 10:41:03 +0800") References: <1480445729-27130-1-git-send-email-labbott@redhat.com> <1480445729-27130-8-git-send-email-labbott@redhat.com> <20161201024103.GA32438@dhcp-128-65.nay.redhat.com> Message-ID: <87polc7357.fsf@xmission.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Dave Young writes: > Hi, Laura > On 11/29/16 at 10:55am, Laura Abbott wrote: >> >> __pa_symbol is the correct api to get the physical address of kernel >> symbols. Switch to it to allow for better debug checking. >> > > I assume __pa_symbol is faster than __pa, but it still need some testing > on all arches which support kexec. > > But seems long long ago there is a commit e3ebadd95cb in the commit log > I see below from: > "we should deprecate __pa_symbol(), and preferably __pa() too - and > just use "virt_to_phys()" instead, which is is more readable and has > nicer semantics." > > But maybe in modern code __pa_symbol is prefered I may miss background. > virt_to_phys still sounds more readable now for me though. There has been a lot of history with the various definitions. __pa_symbol used to be x86 specific. Now what we have is that __pa_symbol is just __pa(RELOC_HIDE(x)); Now arguably that whole reloc hide thing should happen by architectures having a non-inline version of __pa as was done in the commit you mention. But at this point there appears to be nothing wrong with changing a __pa to a __pa_symbol it might make things a tad more reliable depending on the implementation of __pa. Acked-by: "Eric W. Biederman" Eric >> Signed-off-by: Laura Abbott >> --- >> Found during review of the kernel. Untested. >> --- >> kernel/kexec_core.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c >> index 5616755..e1b625e 100644 >> --- a/kernel/kexec_core.c >> +++ b/kernel/kexec_core.c >> @@ -1397,7 +1397,7 @@ void __weak arch_crash_save_vmcoreinfo(void) >> >> phys_addr_t __weak paddr_vmcoreinfo_note(void) >> { >> - return __pa((unsigned long)(char *)&vmcoreinfo_note); >> + return __pa_symbol((unsigned long)(char *)&vmcoreinfo_note); >> } >> >> static int __init crash_save_vmcoreinfo_init(void) >> -- >> 2.7.4 >> >> >> _______________________________________________ >> kexec mailing list >> kexec at lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/kexec > > Thanks > Dave From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id C7D186B0253 for ; Wed, 30 Nov 2016 22:16:22 -0500 (EST) Received: by mail-pf0-f200.google.com with SMTP id 17so334634452pfy.2 for ; Wed, 30 Nov 2016 19:16:22 -0800 (PST) Received: from out01.mta.xmission.com (out01.mta.xmission.com. [166.70.13.231]) by mx.google.com with ESMTPS id 31si38515968pli.203.2016.11.30.19.16.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 19:16:21 -0800 (PST) From: ebiederm@xmission.com (Eric W. Biederman) References: <1480445729-27130-1-git-send-email-labbott@redhat.com> <1480445729-27130-8-git-send-email-labbott@redhat.com> <20161201024103.GA32438@dhcp-128-65.nay.redhat.com> Date: Wed, 30 Nov 2016 21:13:24 -0600 In-Reply-To: <20161201024103.GA32438@dhcp-128-65.nay.redhat.com> (Dave Young's message of "Thu, 1 Dec 2016 10:41:03 +0800") Message-ID: <87polc7357.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [PATCHv4 07/10] kexec: Switch to __pa_symbol Sender: owner-linux-mm@kvack.org List-ID: To: Dave Young Cc: Laura Abbott , Mark Rutland , Ard Biesheuvel , Will Deacon , Catalin Marinas , x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ingo Molnar , "H. Peter Anvin" , Joonsoo Kim , Thomas Gleixner , Andrew Morton , linux-arm-kernel@lists.infradead.org, Marek Szyprowski Dave Young writes: > Hi, Laura > On 11/29/16 at 10:55am, Laura Abbott wrote: >> >> __pa_symbol is the correct api to get the physical address of kernel >> symbols. Switch to it to allow for better debug checking. >> > > I assume __pa_symbol is faster than __pa, but it still need some testing > on all arches which support kexec. > > But seems long long ago there is a commit e3ebadd95cb in the commit log > I see below from: > "we should deprecate __pa_symbol(), and preferably __pa() too - and > just use "virt_to_phys()" instead, which is is more readable and has > nicer semantics." > > But maybe in modern code __pa_symbol is prefered I may miss background. > virt_to_phys still sounds more readable now for me though. There has been a lot of history with the various definitions. __pa_symbol used to be x86 specific. Now what we have is that __pa_symbol is just __pa(RELOC_HIDE(x)); Now arguably that whole reloc hide thing should happen by architectures having a non-inline version of __pa as was done in the commit you mention. But at this point there appears to be nothing wrong with changing a __pa to a __pa_symbol it might make things a tad more reliable depending on the implementation of __pa. Acked-by: "Eric W. Biederman" Eric >> Signed-off-by: Laura Abbott >> --- >> Found during review of the kernel. Untested. >> --- >> kernel/kexec_core.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c >> index 5616755..e1b625e 100644 >> --- a/kernel/kexec_core.c >> +++ b/kernel/kexec_core.c >> @@ -1397,7 +1397,7 @@ void __weak arch_crash_save_vmcoreinfo(void) >> >> phys_addr_t __weak paddr_vmcoreinfo_note(void) >> { >> - return __pa((unsigned long)(char *)&vmcoreinfo_note); >> + return __pa_symbol((unsigned long)(char *)&vmcoreinfo_note); >> } >> >> static int __init crash_save_vmcoreinfo_init(void) >> -- >> 2.7.4 >> >> >> _______________________________________________ >> kexec mailing list >> kexec@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/kexec > > Thanks > Dave -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758180AbcLADQY (ORCPT ); Wed, 30 Nov 2016 22:16:24 -0500 Received: from out01.mta.xmission.com ([166.70.13.231]:50316 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755255AbcLADQW (ORCPT ); Wed, 30 Nov 2016 22:16:22 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Dave Young Cc: Laura Abbott , Mark Rutland , Ard Biesheuvel , Will Deacon , Catalin Marinas , x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ingo Molnar , "H. Peter Anvin" , Joonsoo Kim , Thomas Gleixner , Andrew Morton , linux-arm-kernel@lists.infradead.org, Marek Szyprowski References: <1480445729-27130-1-git-send-email-labbott@redhat.com> <1480445729-27130-8-git-send-email-labbott@redhat.com> <20161201024103.GA32438@dhcp-128-65.nay.redhat.com> Date: Wed, 30 Nov 2016 21:13:24 -0600 In-Reply-To: <20161201024103.GA32438@dhcp-128-65.nay.redhat.com> (Dave Young's message of "Thu, 1 Dec 2016 10:41:03 +0800") Message-ID: <87polc7357.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1cCHr3-0002dr-7P;;;mid=<87polc7357.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=68.113.178.29;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18s8eznpCUvc+vm4fVx8achO8grSf20RyY= X-SA-Exim-Connect-IP: 68.113.178.29 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] * 1.0 XM_Sft_Co_L33T No description available. * 1.0 XM_H_SpoofStaff3 XMission Staff Spoof * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Dave Young X-Spam-Relay-Country: X-Spam-Timing: total 6032 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.8 (0.1%), b_tie_ro: 2.7 (0.0%), parse: 1.27 (0.0%), extract_message_metadata: 30 (0.5%), get_uri_detail_list: 3.7 (0.1%), tests_pri_-1000: 12 (0.2%), tests_pri_-950: 2.1 (0.0%), tests_pri_-900: 1.77 (0.0%), tests_pri_-400: 37 (0.6%), check_bayes: 35 (0.6%), b_tokenize: 14 (0.2%), b_tok_get_all: 9 (0.2%), b_comp_prob: 4.4 (0.1%), b_tok_touch_all: 3.0 (0.0%), b_finish: 0.91 (0.0%), tests_pri_0: 653 (10.8%), check_dkim_signature: 0.95 (0.0%), check_dkim_adsp: 4.6 (0.1%), tests_pri_500: 5285 (87.6%), poll_dns_idle: 5273 (87.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCHv4 07/10] kexec: Switch to __pa_symbol X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dave Young writes: > Hi, Laura > On 11/29/16 at 10:55am, Laura Abbott wrote: >> >> __pa_symbol is the correct api to get the physical address of kernel >> symbols. Switch to it to allow for better debug checking. >> > > I assume __pa_symbol is faster than __pa, but it still need some testing > on all arches which support kexec. > > But seems long long ago there is a commit e3ebadd95cb in the commit log > I see below from: > "we should deprecate __pa_symbol(), and preferably __pa() too - and > just use "virt_to_phys()" instead, which is is more readable and has > nicer semantics." > > But maybe in modern code __pa_symbol is prefered I may miss background. > virt_to_phys still sounds more readable now for me though. There has been a lot of history with the various definitions. __pa_symbol used to be x86 specific. Now what we have is that __pa_symbol is just __pa(RELOC_HIDE(x)); Now arguably that whole reloc hide thing should happen by architectures having a non-inline version of __pa as was done in the commit you mention. But at this point there appears to be nothing wrong with changing a __pa to a __pa_symbol it might make things a tad more reliable depending on the implementation of __pa. Acked-by: "Eric W. Biederman" Eric >> Signed-off-by: Laura Abbott >> --- >> Found during review of the kernel. Untested. >> --- >> kernel/kexec_core.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c >> index 5616755..e1b625e 100644 >> --- a/kernel/kexec_core.c >> +++ b/kernel/kexec_core.c >> @@ -1397,7 +1397,7 @@ void __weak arch_crash_save_vmcoreinfo(void) >> >> phys_addr_t __weak paddr_vmcoreinfo_note(void) >> { >> - return __pa((unsigned long)(char *)&vmcoreinfo_note); >> + return __pa_symbol((unsigned long)(char *)&vmcoreinfo_note); >> } >> >> static int __init crash_save_vmcoreinfo_init(void) >> -- >> 2.7.4 >> >> >> _______________________________________________ >> kexec mailing list >> kexec@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/kexec > > Thanks > Dave