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 X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A808EC433F5 for ; Mon, 13 Sep 2021 13:54:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7448B619E1 for ; Mon, 13 Sep 2021 13:54:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7448B619E1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=Vx8YAY4yL6BYsh5dwqles3o1V/ZuFbtj3o3ZjQHMD0Q=; b=gaT508gJewv8sT 9Lm7bVW43Zfd0PDP4wH1OJAAbpz81uM/8whkme6MjUhBEYHKKkLF1viDG+Ewiec5aiVDpBj+qNYnJ 5HMo6ZDz/quyIst5rOsuHKlHFpTg5ySPjlOi9xDh8TmJ25B+4mw+rBaW0yC1tN8Jk+pKfXGdnTxh3 1zGj6at5PdIZE0EiSM6AqvXOb4kqyuHKtdewuCvAM+yNeptFiME9PY+Lle1RqgRB7nxMQLBlc4gLQ MQ6a5wEnEnF9mipLsy33BCXs4K7+YHroHOQuICEFPicKz/a4wAR3quOesdCODkkje+v5JPreR+ZYK PLWn4xeQeGGhdhTQrEiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPmOI-001vF5-R8; Mon, 13 Sep 2021 13:52:58 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPmOC-001vDS-0t for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 13:52:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yP1bI9VBeSM+QnRsLyPnifgQoO9bBcjOvf79ZVnw9y4=; b=R3K5o0Hg1eq4fqOVnzGtt6luvo cMYQBkxxfPL28xr7pAn/RdLuq5DOX09Vi7xafOiABmB+UzRRMWZ3bM4IfugMshs5T+JtvSGOSiRd6 llM2kLqSXIelUnIEl/Ig7i9EDn2Kf3+PwU5JLI5HX8BU/n+3kDd1l3H5GcTtD5kiZd7mO8Jg03tqg /28iGO6E7a4tgZKvTclPtjKfs6YDtJ0RABhgAB2WmrA+jHv21ukLd1cPy3zOsclvaaQDhYnp7kE1n hqpCxEebDHqIiUi9YuUIpNqRBW7rzym7QAix5F0js96MQAIg4o3bsCLaJ2nEvxbL474YMX93x8uD0 fhkuDstg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45080) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mPmO8-0003Xj-Nb; Mon, 13 Sep 2021 14:52:47 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mPmO6-000253-0j; Mon, 13 Sep 2021 14:52:46 +0100 Date: Mon, 13 Sep 2021 14:52:45 +0100 From: "Russell King (Oracle)" To: Ard Biesheuvel Cc: Linux ARM , Keith Packard , Kees Cook , Arnd Bergmann , Linus Walleij Subject: Re: [PATCH v4 4/5] ARM: smp: Store current pointer in TPIDRURO register if available Message-ID: References: <20210913104001.3043132-1-ardb@kernel.org> <20210913104001.3043132-5-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_065252_109171_369F7D60 X-CRM114-Status: GOOD ( 19.72 ) 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 Mon, Sep 13, 2021 at 02:52:46PM +0200, Ard Biesheuvel wrote: > Hi Russell, > > Thanks for taking a look. > > However, the next patch drops the 'ldr ip, [r4, #TI_TASK]' I am adding > here, so I won't be able to use this as-is. > > I could just split the ldr/set_current sequence into two, and change > the first one into a mov in the following patch, and move the > set_current to right before where sp is updated. > > I.e., in this patch > > @@ -762,6 +764,8 @@ ENTRY(__switch_to) > add r7, r7, #TSK_STACK_CANARY & ~IMM12_MASK > .endif > ldr r7, [r7, #TSK_STACK_CANARY & IMM12_MASK] > +#elif defined(CONFIG_CURRENT_POINTER_IN_TPIDRURO) > + ldr r7, [r2, #TI_TASK] > #endif > #ifdef CONFIG_CPU_USE_DOMAINS > mcr p15, 0, r6, c3, c0, 0 @ Set domain register > @@ -776,6 +780,7 @@ ENTRY(__switch_to) > #endif > THUMB( mov ip, r4 ) > mov r0, r5 > + set_current r7 > ARM( ldmia r4, {r4 - sl, fp, sp, pc} ) > THUMB( ldmia ip!, {r4 - sl, fp} ) > THUMB( ldr sp, [ip], #4 ) > > and in the next one > > @@ -765,7 +765,7 @@ ENTRY(__switch_to) > .endif > ldr r7, [r7, #TSK_STACK_CANARY & IMM12_MASK] > #elif defined(CONFIG_CURRENT_POINTER_IN_TPIDRURO) > - ldr r7, [r2, #TI_TASK] > + mov r7, r2 @ Preserve 'next' > #endif > #ifdef CONFIG_CPU_USE_DOMAINS > mcr p15, 0, r6, c3, c0, 0 @ Set domain register > > Would that work for you? Definitely does! Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel