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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBE94C433F5 for ; Fri, 4 Feb 2022 18:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qBMwCeAReR6AvKyZIbIzoX1UGQjIGfK0E0RwkeycusQ=; b=WzKeHXfBI9cwok m/z3PK1IEvPFThU738SQ1nwsRttLGxer8QNTB3NZ1udqp3LefuVjGN/bw1heIIew3BjUMf9VqmqQF CtSLSM6Av/m+STqgseXh+wVffQA9I1Vbzeuw7HPt3nIZ7JqaQqaC0WO7dpg4YHcIkXUkgg+O6KArC RbrCv5e5l6btmmviE3SaJnG9xWRb46wBhL2rPsOVhScw7L7nv5FCQb2/koONLs2y5lmxf4hlz9k4t 5vIQrJqJCG6Xhstm8F8y528FGMNaEU+rUAIlprp6NWe8GDz7qzMSow2DZqFiWh2Url8oI9GAmHQGH pJtO0+gKv5cogymoGnqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nG3k4-005F6D-5A; Fri, 04 Feb 2022 18:55:32 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nG3jz-005Ezh-GG for linux-arm-kernel@lists.infradead.org; Fri, 04 Feb 2022 18:55:29 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1A618B83884; Fri, 4 Feb 2022 18:55:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F9E6C340E9; Fri, 4 Feb 2022 18:55:20 +0000 (UTC) Date: Fri, 4 Feb 2022 18:55:17 +0000 From: Catalin Marinas To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rt-users@vger.kernel.org, Sebastian Andrzej Siewior , Will Deacon , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Steven Rostedt , Daniel Bristot de Oliveira , "Paul E. McKenney" , Frederic Weisbecker , Josh Triplett , Mathieu Desnoyers , Davidlohr Bueso , Lai Jiangshan , Joel Fernandes , Anshuman Khandual , Vincenzo Frascino , Steven Price , Ard Biesheuvel , Boqun Feng , Mike Galbraith Subject: Re: [PATCH v4] arm64: mm: Make arch_faults_on_old_pte() check for migratability Message-ID: References: <20220127192437.1192957-1-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220127192437.1192957-1-valentin.schneider@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220204_105527_691646_09C96C43 X-CRM114-Status: GOOD ( 23.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 27, 2022 at 07:24:37PM +0000, Valentin Schneider wrote: > arch_faults_on_old_pte() relies on the calling context being > non-preemptible. CONFIG_PREEMPT_RT turns the PTE lock into a sleepable > spinlock, which doesn't disable preemption once acquired, triggering the > warning in arch_faults_on_old_pte(). > > It does however disable migration, ensuring the task remains on the same > CPU during the entirety of the critical section, making the read of > cpu_has_hw_af() safe and stable. > > Make arch_faults_on_old_pte() check cant_migrate() instead of preemptible(). > > Suggested-by: Sebastian Andrzej Siewior > Signed-off-by: Valentin Schneider > Link: https://lore.kernel.org/r/20210811201354.1976839-5-valentin.schneider@arm.com > --- > v3 -> v4: Dropped migratable(), reuse cant_migrate() (Sebastian) > --- > arch/arm64/include/asm/pgtable.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h > index c4ba047a82d2..3caf6346ea95 100644 > --- a/arch/arm64/include/asm/pgtable.h > +++ b/arch/arm64/include/asm/pgtable.h > @@ -1001,7 +1001,8 @@ static inline void update_mmu_cache(struct vm_area_struct *vma, > */ > static inline bool arch_faults_on_old_pte(void) > { > - WARN_ON(preemptible()); > + /* The register read below requires a stable CPU to make any sense */ > + cant_migrate(); > > return !cpu_has_hw_af(); > } The patch looks alright but what's the plan with it? Does it go into the preempt-rt tree, mainline? It's not a fix to be queued now, so: Acked-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel