From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout03.his.huawei.com (canpmsgout03.his.huawei.com [113.46.200.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 982471E1C11 for ; Wed, 8 Apr 2026 01:49:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775612952; cv=none; b=TlisGkLYq6IIgScRI2uCzrjtceMUGAa1ObRLBZ5RIiizmC6p36FZUW2fpjh0Jwo5mBEJZiFPpBoX9BejlViM+wHXcV5zOFZcpB1hmyN1SADEgwN+riPiB/vRODCGco/Y47F25dFGoyr9Qe87hu58K0Xaa1ttl721qCDH0v00Qn0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775612952; c=relaxed/simple; bh=t3Ar0qEoKwwTeRoGPtw+KsIxncJ8/til6pOrVVXema8=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=D4HyFutntpLDKDiTayxYI0rEeUeRYygezhtwYC3hWVmyDI7BILBMzIHQP8lcJN1FKomgKN8YazJOyzaufmwsEmCK3mZQyKwCuC/6Ec5KWgtcpxrvcQkCHNybcI/Ujscj2i7C46rR19jUyddg3E0l7IDd+WVqU7aYXFnrbnXvs0I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=Sg46r535; arc=none smtp.client-ip=113.46.200.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="Sg46r535" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=S3K8W6XadrkzzITKWyFi2YXLD4Lw3Sy7gIPpFStdzas=; b=Sg46r535GiLVioFW1VZ6hVRbW3bOYspGoSM8qlS4aVWdXlyr3jDecCP5rchSULCeyuSqGgylI Rj4QP9h1f2mm1Ub3VgjbMUmxa/lIz2yYL1GIIamRlO2fmTG9td87AhUXY3ZtOpDuFXW0qZrqoNf xr2013impAhBIJyTgI70HS8= Received: from mail.maildlp.com (unknown [172.19.163.0]) by canpmsgout03.his.huawei.com (SkyGuard) with ESMTPS id 4fr5Rx0GCszpSwg; Wed, 8 Apr 2026 09:43:09 +0800 (CST) Received: from dggpemf500011.china.huawei.com (unknown [7.185.36.131]) by mail.maildlp.com (Postfix) with ESMTPS id AA6F34056D; Wed, 8 Apr 2026 09:49:08 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by dggpemf500011.china.huawei.com (7.185.36.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 8 Apr 2026 09:49:07 +0800 Message-ID: Date: Wed, 8 Apr 2026 09:49:05 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 07/10] arm64: entry: Consistently prefix arm64-specific wrappers Content-Language: en-US To: Mark Rutland , , Catalin Marinas , Will Deacon CC: , , , , , References: <20260407131650.3813777-1-mark.rutland@arm.com> <20260407131650.3813777-8-mark.rutland@arm.com> From: Jinjie Ruan In-Reply-To: <20260407131650.3813777-8-mark.rutland@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems500002.china.huawei.com (7.221.188.17) To dggpemf500011.china.huawei.com (7.185.36.131) On 2026/4/7 21:16, Mark Rutland wrote: > For historical reasons, arm64's entry code has arm64-specific functions > named enter_from_kernel_mode() and exit_to_kernel_mode(), which are > wrappers for similarly-named functions from the generic irqentry code. > Other arm64-specific wrappers have an 'arm64_' prefix to clearly > distinguish them from their generic counterparts, e.g. > arm64_enter_from_user_mode() and arm64_exit_to_user_mode(). > > For consistency and clarity, add an 'arm64_' prefix to these functions. > > There should be no functional change as a result of this patch. > > Signed-off-by: Mark Rutland > Cc: Andy Lutomirski > Cc: Catalin Marinas > Cc: Jinjie Ruan > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: Vladimir Murzin > Cc: Will Deacon > --- > arch/arm64/kernel/entry-common.c | 38 ++++++++++++++++---------------- > 1 file changed, 19 insertions(+), 19 deletions(-) Reviewed-by: Jinjie Ruan > > diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c > index 3625797e9ee8f..3d01cdacdc7a2 100644 > --- a/arch/arm64/kernel/entry-common.c > +++ b/arch/arm64/kernel/entry-common.c > @@ -35,7 +35,7 @@ > * Before this function is called it is not safe to call regular kernel code, > * instrumentable code, or any code which may trigger an exception. > */ > -static noinstr irqentry_state_t enter_from_kernel_mode(struct pt_regs *regs) > +static noinstr irqentry_state_t arm64_enter_from_kernel_mode(struct pt_regs *regs) > { > irqentry_state_t state; > > @@ -51,8 +51,8 @@ static noinstr irqentry_state_t enter_from_kernel_mode(struct pt_regs *regs) > * After this function returns it is not safe to call regular kernel code, > * instrumentable code, or any code which may trigger an exception. > */ > -static void noinstr exit_to_kernel_mode(struct pt_regs *regs, > - irqentry_state_t state) > +static void noinstr arm64_exit_to_kernel_mode(struct pt_regs *regs, > + irqentry_state_t state) > { > mte_check_tfsr_exit(); > irqentry_exit(regs, state); > @@ -298,11 +298,11 @@ static void noinstr el1_abort(struct pt_regs *regs, unsigned long esr) > unsigned long far = read_sysreg(far_el1); > irqentry_state_t state; > > - state = enter_from_kernel_mode(regs); > + state = arm64_enter_from_kernel_mode(regs); > local_daif_inherit(regs); > do_mem_abort(far, esr, regs); > local_daif_mask(); > - exit_to_kernel_mode(regs, state); > + arm64_exit_to_kernel_mode(regs, state); > } > > static void noinstr el1_pc(struct pt_regs *regs, unsigned long esr) > @@ -310,55 +310,55 @@ static void noinstr el1_pc(struct pt_regs *regs, unsigned long esr) > unsigned long far = read_sysreg(far_el1); > irqentry_state_t state; > > - state = enter_from_kernel_mode(regs); > + state = arm64_enter_from_kernel_mode(regs); > local_daif_inherit(regs); > do_sp_pc_abort(far, esr, regs); > local_daif_mask(); > - exit_to_kernel_mode(regs, state); > + arm64_exit_to_kernel_mode(regs, state); > } > > static void noinstr el1_undef(struct pt_regs *regs, unsigned long esr) > { > irqentry_state_t state; > > - state = enter_from_kernel_mode(regs); > + state = arm64_enter_from_kernel_mode(regs); > local_daif_inherit(regs); > do_el1_undef(regs, esr); > local_daif_mask(); > - exit_to_kernel_mode(regs, state); > + arm64_exit_to_kernel_mode(regs, state); > } > > static void noinstr el1_bti(struct pt_regs *regs, unsigned long esr) > { > irqentry_state_t state; > > - state = enter_from_kernel_mode(regs); > + state = arm64_enter_from_kernel_mode(regs); > local_daif_inherit(regs); > do_el1_bti(regs, esr); > local_daif_mask(); > - exit_to_kernel_mode(regs, state); > + arm64_exit_to_kernel_mode(regs, state); > } > > static void noinstr el1_gcs(struct pt_regs *regs, unsigned long esr) > { > irqentry_state_t state; > > - state = enter_from_kernel_mode(regs); > + state = arm64_enter_from_kernel_mode(regs); > local_daif_inherit(regs); > do_el1_gcs(regs, esr); > local_daif_mask(); > - exit_to_kernel_mode(regs, state); > + arm64_exit_to_kernel_mode(regs, state); > } > > static void noinstr el1_mops(struct pt_regs *regs, unsigned long esr) > { > irqentry_state_t state; > > - state = enter_from_kernel_mode(regs); > + state = arm64_enter_from_kernel_mode(regs); > local_daif_inherit(regs); > do_el1_mops(regs, esr); > local_daif_mask(); > - exit_to_kernel_mode(regs, state); > + arm64_exit_to_kernel_mode(regs, state); > } > > static void noinstr el1_breakpt(struct pt_regs *regs, unsigned long esr) > @@ -420,11 +420,11 @@ static void noinstr el1_fpac(struct pt_regs *regs, unsigned long esr) > { > irqentry_state_t state; > > - state = enter_from_kernel_mode(regs); > + state = arm64_enter_from_kernel_mode(regs); > local_daif_inherit(regs); > do_el1_fpac(regs, esr); > local_daif_mask(); > - exit_to_kernel_mode(regs, state); > + arm64_exit_to_kernel_mode(regs, state); > } > > asmlinkage void noinstr el1h_64_sync_handler(struct pt_regs *regs) > @@ -491,13 +491,13 @@ static __always_inline void __el1_irq(struct pt_regs *regs, > { > irqentry_state_t state; > > - state = enter_from_kernel_mode(regs); > + state = arm64_enter_from_kernel_mode(regs); > > irq_enter_rcu(); > do_interrupt_handler(regs, handler); > irq_exit_rcu(); > > - exit_to_kernel_mode(regs, state); > + arm64_exit_to_kernel_mode(regs, state); > } > static void noinstr el1_interrupt(struct pt_regs *regs, > void (*handler)(struct pt_regs *))