From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DCC5C83004 for ; Wed, 29 Apr 2020 17:01:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4EFBE208FE for ; Wed, 29 Apr 2020 17:01:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EFBE208FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 038F48E000D; Wed, 29 Apr 2020 13:01:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F2B9C8E0001; Wed, 29 Apr 2020 13:01:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E420A8E000D; Wed, 29 Apr 2020 13:01:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id C75388E0001 for ; Wed, 29 Apr 2020 13:01:44 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8BF1A8248068 for ; Wed, 29 Apr 2020 17:01:44 +0000 (UTC) X-FDA: 76761509328.07.prose03_666f55e546519 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 6BF911803F9AD for ; Wed, 29 Apr 2020 17:01:44 +0000 (UTC) X-HE-Tag: prose03_666f55e546519 X-Filterd-Recvd-Size: 3633 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 17:01:43 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2D8D1106F; Wed, 29 Apr 2020 10:01:43 -0700 (PDT) Received: from [192.168.0.14] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7AE7A3F73D; Wed, 29 Apr 2020 10:01:40 -0700 (PDT) Subject: Re: [PATCH v9 10/18] arm64: kexec: cpu_soft_restart change argument types To: Pavel Tatashin References: <20200326032420.27220-1-pasha.tatashin@soleen.com> <20200326032420.27220-11-pasha.tatashin@soleen.com> From: James Morse Cc: jmorris@namei.org, sashal@kernel.org, ebiederm@xmission.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, maz@kernel.org, vladimir.murzin@arm.com, matthias.bgg@gmail.com, bhsharma@redhat.com, linux-mm@kvack.org, mark.rutland@arm.com, steve.capper@arm.com, rfontana@redhat.com, tglx@linutronix.de, selindag@gmail.com Message-ID: Date: Wed, 29 Apr 2020 18:01:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200326032420.27220-11-pasha.tatashin@soleen.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Pavel, On 26/03/2020 03:24, Pavel Tatashin wrote: > Change argument types from unsigned long to a more descriptive > phys_addr_t. For 'entry', which is a physical addresses, sure... > diff --git a/arch/arm64/kernel/cpu-reset.h b/arch/arm64/kernel/cpu-reset.h > index ed50e9587ad8..38cbd4068019 100644 > --- a/arch/arm64/kernel/cpu-reset.h > +++ b/arch/arm64/kernel/cpu-reset.h > @@ -10,17 +10,17 @@ > > #include > > -void __cpu_soft_restart(unsigned long el2_switch, unsigned long entry, > - unsigned long arg0, unsigned long arg1, unsigned long arg2); > +void __cpu_soft_restart(phys_addr_t el2_switch, phys_addr_t entry, > + phys_addr_t arg0, phys_addr_t arg1, phys_addr_t arg2); This looks weird because its re-using the hyp-stub API, because it might call the hyp-stub from the idmap. entry is passed in, so this isn't tied to kexec. Without tying it to kexec, how do you know arg2 is a physical address? I think it tried to be re-usable because 32bit has more users for this. arg0-2 are unsigned long because the hyp-stub is just moving general purpose registers around. This is to avoid casting? Sure, its only got one caller. This thing evolved because the platform-has-EL2 and kdump-while-KVM-was-running code was bolted on as they were discovered. > -static inline void __noreturn cpu_soft_restart(unsigned long entry, > - unsigned long arg0, > - unsigned long arg1, > - unsigned long arg2) > +static inline void __noreturn cpu_soft_restart(phys_addr_t entry, > + phys_addr_t arg0, > + phys_addr_t arg1, > + phys_addr_t arg2) > { > typeof(__cpu_soft_restart) *restart; > > - unsigned long el2_switch = !is_kernel_in_hyp_mode() && > + phys_addr_t el2_switch = !is_kernel_in_hyp_mode() && > is_hyp_mode_available(); What on earth happened here!? > restart = (void *)__pa_symbol(__cpu_soft_restart); Thanks, James