From patchwork Tue Jul 28 03:33:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11688065 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 E6B826C1 for ; Tue, 28 Jul 2020 03:36:33 +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 BCE2B2065E for ; Tue, 28 Jul 2020 03:36:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aGUm/nUI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QHMAvZm/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCE2B2065E 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=aGUm/nUI1DM/xwHv/RQ6SEqFm JTHfdzw5MEZY7uUCIwupQmRJ2/4edg+m7yuY01F7/YXC5QQz3VKwpfXl0ONqkfuQp6gza6FjyWttz IeRfs2KXetG/hVfJJjOAuQKhnhyZS7NxKGGtXpzDp5UzOR2E2CqrkX2aRMl/S3HYDJu36ydE13jE6 H+bMM459mKpKX3lLJudQ31yBHFFi6mtFDJvXSqTTLwIwxtRhlVe37+If4Rkh8sN5l6TLueTkFJxSQ x/AwNJMqFTUiuzLeacU0eUMstZMXVV87H2blcl1wNAyelEPVu07dfTFa3CKYlFXFEeosbHAgjqQNa DX8s4qv0w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0GO0-0003bX-Aa; Tue, 28 Jul 2020 03:34:40 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0GNw-0003a2-Au for linux-arm-kernel@lists.infradead.org; Tue, 28 Jul 2020 03:34:37 +0000 Received: by mail-pl1-x641.google.com with SMTP id w17so9177219ply.11 for ; Mon, 27 Jul 2020 20:34:36 -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=QHMAvZm/I0mF7utvjLbQSyiSosPMZuOxRY46k50CA7iZnu7xOPahXjDTi/nli2iOhv Oujn0wifZJR0DIe2O8z1n0MmwDSg9mE3kxEZ/3Bms22rTyKzBjZpGjj4ZRt1TsSZAXKH cxEtM8iWj21TtUr1td7PZ1i6Xfb3xSLRfzOaallNzYOVSTkzj2Y7yKuPBodwXP0ooyRc plFBjkGe3b2VhcXajSxhIDjHOKQS9D34CfcZEhtK2JnsDK6E28/nBVwOwsb90HNxJSHp jCvNTGFACF+ZyyVeYdv5DKC96pLKi++TWTA+CqIsqWVfyWEpL1nESj9KwJxZuZyWGUdV d2ow== 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=LA3vpCv9irEzp+ExDpXaRg/k0QRYEKwxfwPZ+QqJ87dIrPyyorbJmGqgbdPT8BSIyt d7NpxcYG2+FV4eI5DXBjZvLHdbaoo8NUpV0Ty/LW2rDr9w7nbWLXFaZ3fuc7nPT77cD7 6L8tsDZxHTCxQ/uX7LUzwm4mLFXEMe6BUa8uK8Lae1Ofxi4Vvfji9KmMy10QXPKS8nAS VN4Mh0jpFAfZn/pLIvnnLV5+Y7dq9XA7jkrpOfHkpmU9kQGRVxFkh+EMMBf4jR4VDTyz MmNHLN22ADs6dyb8xSa5LQ1yYIL+2VZW+gk7dYOznVHBSt8/GROPqGS20+IWJR53x5t6 puNg== X-Gm-Message-State: AOAM531aMzVDzf+EllDB5vDJ8+xREZSdQYce3OTuU4rs8ziQ/5nwCT/R 8VKJfFcGaPhK0DvsuQ1cSkU= X-Google-Smtp-Source: ABdhPJz+ArXXeCto+CwCq9TBJZxoqe/CgzjVj2vgHlZDtuVaDXZVPE2JctuE3f1k9kh4PunK2ucVxw== X-Received: by 2002:a17:90b:4005:: with SMTP id ie5mr2327280pjb.147.1595907274466; Mon, 27 Jul 2020 20:34:34 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (110-174-173-27.tpgi.com.au. [110.174.173.27]) by smtp.gmail.com with ESMTPSA id r4sm998707pji.37.2020.07.27.20.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 20:34:34 -0700 (PDT) From: Nicholas Piggin To: linux-arch@vger.kernel.org Subject: [PATCH 04/24] arm: use asm-generic/mmu_context.h for no-op implementations Date: Tue, 28 Jul 2020 13:33:45 +1000 Message-Id: <20200728033405.78469-5-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200728033405.78469-1-npiggin@gmail.com> References: <20200728033405.78469-1-npiggin@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200727_233436_430357_8DE30EC8 X-CRM114-Status: GOOD ( 15.66 ) 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:641 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [npiggin[at]gmail.com] 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_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 Signed-off-by: Vineet Gupta --- 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 Tue Jul 28 03:33:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11688063 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 429676C1 for ; Tue, 28 Jul 2020 03:36:31 +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 1AB4820672 for ; Tue, 28 Jul 2020 03:36:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NmS5W1K0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HnC3UjGv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AB4820672 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=dtHVbQmLv+W19eLoJdPg9AIDBEEjHrA1N93S17Lzg2s=; b=NmS5W1K01SkkzKHjupNJ55TW6 P1I7G9v1ZfYNvCJOvXVqc4ac0iJ2tNrwwBR9ZTXOnElZF57saZL6oYEVuAwjnKAUKcNot2RUiznLR D1mH25cY+Al6lMtO+UMW1IhQ+Ye/9gDzEw/gP/tcuo931w7qlMhk2xRUdbFV2kqOHFrc8GZ7fqUdB FCf1Mx/aIOfgo7hfPqO9g79UHWs5FmxbfmqLKQbhefeRQ7/7ta0XmRX7S9FJKZtmb5PzYXyPotKWq GhRjlRGUoNjRRh6owlbsL/oj1/Gow0mONiDnUfQqozRzwuJW6NJ0XhHOcdRGICvMbZnUTdiENINDq uVpsRLxWw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0GO6-0003dd-U8; Tue, 28 Jul 2020 03:34:46 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0GO0-0003bQ-6L for linux-arm-kernel@lists.infradead.org; Tue, 28 Jul 2020 03:34:41 +0000 Received: by mail-pg1-x541.google.com with SMTP id p3so11111713pgh.3 for ; Mon, 27 Jul 2020 20:34:39 -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=KLCo3Tk+lxREvcakRGac/Ng0j4T/GOteVNveKT3Mrb0=; b=HnC3UjGv+m0tU9xTbpRWvbcPR7+Lt5ZN3EL28a/0mi8A/q+hbAczLsS3nUVqiGLiuW EiniTd5jtilMJZFmO0PMPi7a+blkrENBtM9oMLNODC3zJ47JaPCeNqklG71kRDoh3yFg HbK9DYUTb1/8B4ykFsAsLsGEaFwWbbZaMVEeU4Sbgx5UK14DK3qtAZCGtxeaOhNf08r0 zXZDVWgYlqQZlIVKaXvX+ouKXW+XvptAqLX+kha+1E4F2czSCLJ7mOTKjpTzZs4YhJar g0BmGmRvqG/YhqfVf5PSUeEfeLMeOi5zfXVLkGmM+O9wSf+9XGCZHQYm6CxvjAxMo36Z NjmQ== 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=KLCo3Tk+lxREvcakRGac/Ng0j4T/GOteVNveKT3Mrb0=; b=nKAr41j9p/lpBKcUbrh8Zi4lqz5HC4UjmDEfLdWyF7Z2Uu5+fV3GBr7OdH49gGKgh4 vP8KdBbCzUkseUp8PMQdBrgc3cPcX0m+qkhOTvN72vwStaKP6PVbgj74xy0lGLX2hR9B SrGGolEk0tfSayMZTBoSDIL2xdGIZbLhQd+Fb0ubqaoBB/mEvoioI3xKhm5s4XzptdRH F9o5chJDrmoU2wR315modfmIhUaYmKxht+LVW/qz0XBNjVZ/SiyhFNkt9P83C4ADKJw9 elmwSAjQKmqyB0X81FBa6beU2BMD6SL/Am434SHNdvrY+d8lfhKosZ/4I9zEG7xwcEMC KC1Q== X-Gm-Message-State: AOAM533+nb6vA54jn/fv9SktOz/kEezFAl/Ea4S5tW+dNFEkmPZ2p2vO nockGebrjyzSYLmLzgDm8HM= X-Google-Smtp-Source: ABdhPJxqkjcQJjy20YQ8lm0iiv+MQTiwXbUI2uiLeEqgTNovbPmCo9H8X++qot7CTFtYr/wPKm7S+g== X-Received: by 2002:a63:395:: with SMTP id 143mr16621520pgd.57.1595907278354; Mon, 27 Jul 2020 20:34:38 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (110-174-173-27.tpgi.com.au. [110.174.173.27]) by smtp.gmail.com with ESMTPSA id r4sm998707pji.37.2020.07.27.20.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 20:34:37 -0700 (PDT) From: Nicholas Piggin To: linux-arch@vger.kernel.org Subject: [PATCH 05/24] arm64: use asm-generic/mmu_context.h for no-op implementations Date: Tue, 28 Jul 2020 13:33:46 +1000 Message-Id: <20200728033405.78469-6-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200728033405.78469-1-npiggin@gmail.com> References: <20200728033405.78469-1-npiggin@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200727_233440_308977_1BAA6CB6 X-CRM114-Status: GOOD ( 13.64 ) 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:541 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [npiggin[at]gmail.com] 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_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 --- arch/arm64/include/asm/mmu_context.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index b0bd9b55594c..0f5e351f586a 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -174,7 +174,6 @@ 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, 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) { @@ -244,12 +244,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 */