Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp116105pxj; Thu, 3 Jun 2021 02:15:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNrLJpfzURamycg2eBuB7NgMm/8cCsDLBgdIEezhRJH8aRbxglT0DFlVh9LCZiYy+09ON9 X-Received: by 2002:a05:6402:1052:: with SMTP id e18mr43763995edu.366.1622711730022; Thu, 03 Jun 2021 02:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622711730; cv=none; d=google.com; s=arc-20160816; b=E897xls8w/Dzrd2xpSbf5hB7sw2k6vizMK7fILGhVV8W8TASP6IBHus6qhZ/fVpoIH a/XxdJFzPpJqF5GkruhTi8nw9s8U3uQLZAlhh2sNqE3U13483VXvYPq1hvndQdZN32cu zHFeUALalr79Qw7Jy6AdkAWP6S/o7X544ywCKqsGv2JEqW1Zi+i80Hqfp3rIJWgQfPjt vhN/g1NGqPrdYseTksy2SQMgxkJwL/AKL/E/sFqt3msVR5MdODi5wpPW66pk40NVbE4e zjHqsyIhHBx8xlfvO+pvzeZwcV5VuaaVwqnKtBHBiOIfepPz1tX/jlPvwbv6NXWm9/x2 1dqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:message-id; bh=uJ1RmLGK65GGMWJi9jDadQUzDgGSU/T2n25b/JZhvL4=; b=bUzIEYA+WuGf46ho9o1o5i+0Hfu21RT1LnWlDsDXceRbevzSKj2SCyP6+TvF4EzN2S s1CtGFZFwHvm6czhJqjsjjdtrfmvp7u3sGdugX/wyyjNxy3OU+9XPvrnklKKesrNcc1C 5oGHesk4AKKeaM51LQ6XLpfGrwSVgBCDtFMDpwZd7fzq3NtJQYaDp/TXsq/ExLlPbzhh 84yCfeGzEX1W8iR5o5Ol7QlbBIa4OqvAsKtg6z70X54udQymAjE7T/lghys8BbutEVYO 4IaHjORxRZoxwWu2RaRvxPIx4B6MtBae6biTSUIlShdcRpbKWVw+CwqmokG924cfUhC5 0TuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si2233267edj.541.2021.06.03.02.15.06; Thu, 03 Jun 2021 02:15:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229620AbhFCJPk (ORCPT + 99 others); Thu, 3 Jun 2021 05:15:40 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:41211 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhFCJPj (ORCPT ); Thu, 3 Jun 2021 05:15:39 -0400 Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4FwgDy3dCCzBCBn; Thu, 3 Jun 2021 11:13:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wukhei5NwqNx; Thu, 3 Jun 2021 11:13:54 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4FwgDy2kMSzBCBP; Thu, 3 Jun 2021 11:13:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4B2FB8B84B; Thu, 3 Jun 2021 11:13:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 2VCQW90XFg8F; Thu, 3 Jun 2021 11:13:54 +0200 (CEST) Received: from po15610vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id F41CE8B767; Thu, 3 Jun 2021 11:13:53 +0200 (CEST) Received: by po15610vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 2206B64931; Thu, 3 Jun 2021 09:13:54 +0000 (UTC) Message-Id: <8479a862e165a57a855292d47e24c259a578f5a0.1622711627.git.christophe.leroy@csgroup.eu> From: Christophe Leroy Subject: [PATCH] powerpc/kuap: Force inlining of all first level KUAP helpers. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 3 Jun 2021 09:13:54 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All KUAP helpers defined in asm/kup.h are single line functions that should be inlined. But on book3s/32 build, we get many instances of . Force inlining of those helpers. Signed-off-by: Christophe Leroy --- Was previously part of a series, resending standalone as it really is independant. --- arch/powerpc/include/asm/kup.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/include/asm/kup.h b/arch/powerpc/include/asm/kup.h index ec96232529ac..a35ded8bedcd 100644 --- a/arch/powerpc/include/asm/kup.h +++ b/arch/powerpc/include/asm/kup.h @@ -96,51 +96,51 @@ static __always_inline void setup_kup(void) setup_kuap(disable_kuap); } -static inline void allow_read_from_user(const void __user *from, unsigned long size) +static __always_inline void allow_read_from_user(const void __user *from, unsigned long size) { barrier_nospec(); allow_user_access(NULL, from, size, KUAP_READ); } -static inline void allow_write_to_user(void __user *to, unsigned long size) +static __always_inline void allow_write_to_user(void __user *to, unsigned long size) { allow_user_access(to, NULL, size, KUAP_WRITE); } -static inline void allow_read_write_user(void __user *to, const void __user *from, - unsigned long size) +static __always_inline void allow_read_write_user(void __user *to, const void __user *from, + unsigned long size) { barrier_nospec(); allow_user_access(to, from, size, KUAP_READ_WRITE); } -static inline void prevent_read_from_user(const void __user *from, unsigned long size) +static __always_inline void prevent_read_from_user(const void __user *from, unsigned long size) { prevent_user_access(NULL, from, size, KUAP_READ); } -static inline void prevent_write_to_user(void __user *to, unsigned long size) +static __always_inline void prevent_write_to_user(void __user *to, unsigned long size) { prevent_user_access(to, NULL, size, KUAP_WRITE); } -static inline void prevent_read_write_user(void __user *to, const void __user *from, - unsigned long size) +static __always_inline void prevent_read_write_user(void __user *to, const void __user *from, + unsigned long size) { prevent_user_access(to, from, size, KUAP_READ_WRITE); } -static inline void prevent_current_access_user(void) +static __always_inline void prevent_current_access_user(void) { prevent_user_access(NULL, NULL, ~0UL, KUAP_CURRENT); } -static inline void prevent_current_read_from_user(void) +static __always_inline void prevent_current_read_from_user(void) { prevent_user_access(NULL, NULL, ~0UL, KUAP_CURRENT_READ); } -static inline void prevent_current_write_to_user(void) +static __always_inline void prevent_current_write_to_user(void) { prevent_user_access(NULL, NULL, ~0UL, KUAP_CURRENT_WRITE); } -- 2.25.0