From patchwork Wed Aug 26 14:52:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11738815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C7D2722 for ; Wed, 26 Aug 2020 15:00:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24FEA214F1 for ; Wed, 26 Aug 2020 15:00:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Tl0IcyNc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jmGYaI3y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24FEA214F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yq3+oIs8nH3rY6N37BjAbes2SCN5yqKUeWhN4HHK/Bo=; b=Tl0IcyNcca4q5T7o3z19eiUNQ 5043CUYy5GfG0njPybbNEs0P2ZhKayVHvYRR6skcdaIv/Dezwzq/EFAct8pP/ohqNgPy5QLZ2fiGM lJvOjgHXkEi3/p00CRy8Jwycm8Mw/fTNe/E+eMnbmjaZxz84AV8iAFGcPKDQ1o+OzICEKOPh2RMxb idlcyLNnwLg5jaVT4yU3CfbHfREbpCQiyV7VUbVbBQVvSEJPxK4zhzMc9aHeLbu/Ns8PsCByh2lTO SVu/cKYy9KqWrc4CW1voWhlj1I8vo2DRsCJMM6N4/fx2+uGBqA0ODvy7Jo+9UXZvhLCF8SKw/snPu rSQTJxYnw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAwr9-00049t-Da; Wed, 26 Aug 2020 14:56:56 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAwnc-0002Je-Qs for linux-arm-kernel@lists.infradead.org; Wed, 26 Aug 2020 14:53:24 +0000 Received: by mail-pj1-x1044.google.com with SMTP id 2so994290pjx.5 for ; Wed, 26 Aug 2020 07:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Nrd8d6fyv75dXwELwu7SjNDDoELmbfaISz3tG67A/Og=; b=jmGYaI3y7+bK+s5Vq9pxlP9AKQX1/f2kkCSAPyU9Hi/mpiMeJEdVOU/SlTvNdwQGsE W2SIrItUXPPqUOIXKf/izMh44nFlQ2RurR55qfloUW+TfZiQl2VuBZNvaB49yw6EoD4a WxeSZrkQmX/QFaDD02lYY1c3hZD/Mb97GrTdTrkW4nhVIts6RXNT93bIwp8VxBnDweHM g845Oid0hY/B7UgntbvniBX8J6laGUpy2/U4xJWfWAToa3tq1C9lqyWqPQUihHF3u6pk Et/YbsLLCXqIJwlosSd6raD7od40ipLLbl2bAjKmM86DA4Fd+m/rvkN3KdTJEvDaHCh5 2VgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Nrd8d6fyv75dXwELwu7SjNDDoELmbfaISz3tG67A/Og=; b=T1kSAA/y7i7eZJd+HFsw6dDp4qzh+386VPf9l+HOuQVEe5dxg5drKaCsyFhARygJ4n +Gu05sPq0NtBJA4S4dHd8m9WV3WftyV3qfhpWUE6uE6P++jlEz/Ye4ZIac8fNR+5tmCR wWxt3p63mrk1Gcj5Lsau3WrNpoOMt5K2/IgKMnzfsOI+HTJ/aEkOdnybKr7ReetBqQzl HURLAEZiOciT2PSlWJ9zg8CnijTugEHqI7ia+jE4GCncRCCUziqfmu+kPnd9H3Cz875R R1m9pPe5mzu45ThOZt2PU6JnnLV36lco7jAP8Wctd7M/NFsoJnOHlLcBG5m8ic7UG/+S oamA== X-Gm-Message-State: AOAM532D6GKxLqcaFsxhi5q8XWWoj/ZwquroM7ebqngF2etHF6RazjcF 6Po++vj2SyqzfVtOdK5gMw4= X-Google-Smtp-Source: ABdhPJyDERUfmwLIZqqYQ35h4vwNp6nxCDqre3x7r/Ny6pXllt93M9hcqByBq70CqedHa2ThMMOxZA== X-Received: by 2002:a17:90b:4d0f:: with SMTP id mw15mr6341778pjb.174.1598453593254; Wed, 26 Aug 2020 07:53:13 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (61-68-212-105.tpgi.com.au. [61.68.212.105]) by smtp.gmail.com with ESMTPSA id r7sm3327140pfl.186.2020.08.26.07.53.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 07:53:12 -0700 (PDT) From: Nicholas Piggin To: linux-arch@vger.kernel.org Subject: [PATCH v2 04/23] arm: use asm-generic/mmu_context.h for no-op implementations Date: Thu, 27 Aug 2020 00:52:30 +1000 Message-Id: <20200826145249.745432-5-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200826145249.745432-1-npiggin@gmail.com> References: <20200826145249.745432-1-npiggin@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200826_105317_170195_6B9E1208 X-CRM114-Status: GOOD ( 14.72 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1044 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [npiggin[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, Nicholas Piggin , Russell King , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/arm/include/asm/mmu_context.h | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h index f99ed524fe41..84e58956fcab 100644 --- a/arch/arm/include/asm/mmu_context.h +++ b/arch/arm/include/asm/mmu_context.h @@ -26,6 +26,8 @@ void __check_vmalloc_seq(struct mm_struct *mm); #ifdef CONFIG_CPU_HAS_ASID void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); + +#define init_new_context init_new_context static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) { @@ -92,32 +94,10 @@ static inline void finish_arch_post_lock_switch(void) #endif /* CONFIG_MMU */ -static inline int -init_new_context(struct task_struct *tsk, struct mm_struct *mm) -{ - return 0; -} - - #endif /* CONFIG_CPU_HAS_ASID */ -#define destroy_context(mm) do { } while(0) #define activate_mm(prev,next) switch_mm(prev, next, NULL) -/* - * This is called when "tsk" is about to enter lazy TLB mode. - * - * mm: describes the currently active mm context - * tsk: task which is entering lazy tlb - * cpu: cpu number which is entering lazy tlb - * - * tsk->mm will be NULL - */ -static inline void -enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) -{ -} - /* * This is the actual mm switch as far as the scheduler * is concerned. No registers are touched. We avoid @@ -149,6 +129,6 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, #endif } -#define deactivate_mm(tsk,mm) do { } while (0) +#include #endif From patchwork Wed Aug 26 14:52:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11738817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C49D0722 for ; Wed, 26 Aug 2020 15:00:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AEB721741 for ; Wed, 26 Aug 2020 15:00:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rMw3ZkQx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fSSBLXXX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9AEB721741 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=915MBpZdkWIxBhDeCG7p1atx4o9QkyDeuaR539RYE5c=; b=rMw3ZkQxYJZAajW83IU9iFK74 Rd9h3SOarVvTviTqqZqQlna3dlloF4f82o8HiovDNAufykRvHqlBosFiJ6dyDSmMSIav7R6XYSGwR 3BbDqx78UZBcG4KbuHL6vGr8LM2OoHIuq2vh9MP4JstBSDYL8rrrdjsXdxIrVk1P8fDt/dln3EV1a 6hee1oQ+rxwoKUAVbp5sdvqxcEZ0nvAuIZ03k4YVnflG3fGZ4FBV+mVi0lvfC2/PNm1k984lznk0m EF02JQFkHrjHqRHV3cV+psAheoT+7DWZPKDRsJKCOSa+MgQgi6ZI6kGqOKogP69cwNFK1Sw56WFEd ujFC03rtQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAwsH-0004lH-F1; Wed, 26 Aug 2020 14:58:05 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAwng-0002LX-MI for linux-arm-kernel@lists.infradead.org; Wed, 26 Aug 2020 14:53:26 +0000 Received: by mail-pf1-x444.google.com with SMTP id k15so1097308pfc.12 for ; Wed, 26 Aug 2020 07:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GRVo5HKDem8WxmcB1xWWA3LpL1WS5jJLaPxEr9bIN0g=; b=fSSBLXXXk2qS/LnVPa23lP13CmKBs1rky8hMENw53CWEEBphdlvfZ9/MTpLCvRZMD/ ycGkdaD75uWOC76qpFqWC3i9Ck7qpJ1p/XO6hB+56qb22OcfnRShNTxizaIF7L6eyBpv EPtVWcKJsLuSDYbDXBkHS2U4vr9s3hz0CGyh/m/Fc6S1YOceeG5gNQGlgHP+1AMWGpRf 4W0AzdqgZnJ7zAoD95zfCANL1wt2adlM/wOzy9AFxQfPK7mZSNL1zy3SQcTWBhNl8YFG PYeR0RXcuAUoSrj/mEEok3rT9xm4gbcbyoXfIztDu8O8dKjSa4uraQFeo6jI/gNkFIUN eIlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GRVo5HKDem8WxmcB1xWWA3LpL1WS5jJLaPxEr9bIN0g=; b=o6Qp1jPo4EmY36z2xYkHlsLj7e80qhUL0qhc0YW8GvMkS63NHvR+7R3w71nuf/MeK9 CKCbE+1AoL+CxBz/NXdBl2du4M2+0gvZUSC0eOqkarFWzNGYIXgVMlGu8GG5W2yp08go RY3W7SHC6xp0agj5T+03RZ9EBCrD7nNsFgKKd7l9T7yjmHZxuibckgz2Yt2IEAxEcj+g wW2BsrIQbc0OjaRCfoNLHCg6L9g9GUGIaLScILYDrCVKtGU6sxHAOcDAejTnoTGYV6E8 YQh0Wh/N3KA8nthjWMzQc1LV0+vhpzLyzziqhEFCrR65otvz3svWfZ6m2Ser9jXYp4GN VSzw== X-Gm-Message-State: AOAM530EOj5kroihWcTlj/qn2xfr+wGh1znw0zl97u7yMRe+XFaPFyIJ Ke/F/IKkU/pNDms84ywnsuA= X-Google-Smtp-Source: ABdhPJx2I5iBb/AgkxmwaVWL1JQh+QbMlvvoQtZudmmMNCZaNPUm28VeclvSIUMYYia3AJbYczBWMw== X-Received: by 2002:a62:86ca:: with SMTP id x193mr7890073pfd.114.1598453597165; Wed, 26 Aug 2020 07:53:17 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (61-68-212-105.tpgi.com.au. [61.68.212.105]) by smtp.gmail.com with ESMTPSA id r7sm3327140pfl.186.2020.08.26.07.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 07:53:16 -0700 (PDT) From: Nicholas Piggin To: linux-arch@vger.kernel.org Subject: [PATCH v2 05/23] arm64: use asm-generic/mmu_context.h for no-op implementations Date: Thu, 27 Aug 2020 00:52:31 +1000 Message-Id: <20200826145249.745432-6-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200826145249.745432-1-npiggin@gmail.com> References: <20200826145249.745432-1-npiggin@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200826_105321_033385_2A17202F X-CRM114-Status: GOOD ( 13.28 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [npiggin[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Catalin Marinas , linux-kernel@vger.kernel.org, Nicholas Piggin , linux-mm@kvack.org, Will Deacon , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Nicholas Piggin Acked-by: Catalin Marinas Reported-by: kernel test robot Reported-by: kernel test robot Reported-by: kernel test robot Reported-by: Naresh Kamboju --- arch/arm64/include/asm/mmu_context.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index f2d7537d6f83..765e8a0f88c9 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -174,8 +174,7 @@ static inline void cpu_replace_ttbr1(pgd_t *pgdp) * Setting a reserved TTBR0 or EPD0 would work, but it all gets ugly when you * take CPU migration into account. */ -#define destroy_context(mm) do { } while(0) -void check_and_switch_context(struct mm_struct *mm); +void check_and_switch_context(struct mm_struct *mm, unsigned int cpu); #define init_new_context(tsk,mm) ({ atomic64_set(&(mm)->context.id, 0); 0; }) @@ -202,6 +201,7 @@ static inline void update_saved_ttbr0(struct task_struct *tsk, } #endif +#define enter_lazy_tlb enter_lazy_tlb static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) { @@ -242,12 +242,11 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, update_saved_ttbr0(tsk, next); } -#define deactivate_mm(tsk,mm) do { } while (0) -#define activate_mm(prev,next) switch_mm(prev, next, current) - void verify_cpu_asid_bits(void); void post_ttbr_update_workaround(void); +#include + #endif /* !__ASSEMBLY__ */ #endif /* !__ASM_MMU_CONTEXT_H */