Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp642496rdb; Fri, 8 Sep 2023 11:26:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJqjp3MGOjUKr/QzeQqsL+We5byRYgwRkOly9qyg275mRnbfOy8ROjwpBd/8xNI5usLvRo X-Received: by 2002:a05:6870:a781:b0:19f:6711:8e0a with SMTP id x1-20020a056870a78100b0019f67118e0amr3792492oao.32.1694197581911; Fri, 08 Sep 2023 11:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694197581; cv=none; d=google.com; s=arc-20160816; b=kmfBHwfM+AwPODYzK5TceaNgEyNgaB9nclaqQLhUQtgLD6MrNqmKvdv+RwknJRWXus TbP3SqDxDA/oMYUeS9xshlimLKL1jG6CGnTi0X41YAO5nJa3ZOrPy0iLad9iBDW/how5 TkV1WdBdG8oJr65mB5qakBb+VS0ay6NVWQfjxKkLzd1AHlw/cP2NiQqBqBGKfSx/3RGp 16V4qvGBDQO7kN7rpDl5+L3tTTxSqAx48PyRhOAZRyQcez7zWuMLoBOfuCfoTIYjpoJS MemJvChS+CSq+PIyKU7YwLVOXPJGG6YvVuCmpPa+eQ4HKkRTumxnE6+YTKoyExyFHkq3 oPUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LbgxR6XC8LYMVBzfsv+O9qJkpfwcf2slpkIZbcLgfOw=; fh=ke+OX7Rn90Zm5SXQMRLO8hSsNzM5QGVX/9sO3bThcZ4=; b=Dq4uhIYYSOC0hM9y2QpDQYVgyxDwUuoJIegUkyzyZT4sdcKL6NvHiOYIPUJw7R5mxg C3m+T5syHmAqaY8EjglpND8Ecv1nxvo4J5uigtEEz/nxnpbwF6iMCI7RS39ICUneyY2B M4PvAJwejquo0bUbAwtR6LVj9oJ9nuJs11vLI1kOI49PRn+CFec54jYqXQBX671Fma9t gqizz/IBTzZ12ZgIdZtzVXOSBpN+WhuW0hJxDrmp0OuPfbyJSXD3O7PIvt1MQ26XDrGx N2gb/rXxBOXpUHG9+HsgNDZdBn2jSMB1aB6gPNH8DYMHNAu1lkzxVvIYz1d6pGsyp9gP H+Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=amB6TIzY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y191-20020a638ac8000000b00573fc71f6d9si1777537pgd.64.2023.09.08.11.26.07; Fri, 08 Sep 2023 11:26:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=amB6TIzY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241557AbjIHNug (ORCPT + 99 others); Fri, 8 Sep 2023 09:50:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230266AbjIHNuf (ORCPT ); Fri, 8 Sep 2023 09:50:35 -0400 Received: from pandora.armlinux.org.uk (unknown [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74B361BC6 for ; Fri, 8 Sep 2023 06:50:29 -0700 (PDT) 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-Transfer-Encoding:Content-Type: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-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LbgxR6XC8LYMVBzfsv+O9qJkpfwcf2slpkIZbcLgfOw=; b=amB6TIzYbCI8yf9vGXczOH6gAb Necd/KYkOmHfQ8ShgSY+zaCPtTpDolSDpVYcgB0Cxgc967lR9v0sUO0K1oyH3at2+B8T23Ty2llYU qZalkl5ChML9LfUaG7ZDMjiUJFL7OTq/LrGs0Di+oblw2xGfDKfhCaymtM0ErZyPUcz27rf7oBn1A GM1LrIzFPqsJQWTrrzwvc6IqnrF0pr2ZUJgtLG1fn3wkRvJVaN6Z6p5eBIsICRxIPSrLEdZCUSS0H AMOV0UMv3c7zQY7CFUGDALXmUgOldxAa2fdUsX4UfJOcpU16jTr2s538brGD+AVocsrlL5c6h00bN xrdiy3KA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36590) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qebs9-00050u-2n; Fri, 08 Sep 2023 14:50:09 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qebs1-0006wF-Av; Fri, 08 Sep 2023 14:50:01 +0100 Date: Fri, 8 Sep 2023 14:50:01 +0100 From: "Russell King (Oracle)" To: Linus Walleij Cc: Zhizhou Zhang , rppt@kernel.org, akpm@linux-foundation.org, vishal.moola@gmail.com, arnd@arndb.de, wangkefeng.wang@huawei.com, willy@infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Zhizhou Zhang Subject: Re: [PATCH] ARM: mm: fix stack corruption when CONFIG_ARM_PV_FIXUP=y Message-ID: References: <20230907143302.4940-1-zhizhou.zh@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Russell King (Oracle) X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RDNS_NONE, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 08, 2023 at 02:58:49PM +0200, Linus Walleij wrote: > Hi Zhizhou, > > wow a great patch! I'm surprised no-one has been hit by this before. > I guess we were lucky. > > On Thu, Sep 7, 2023 at 4:33 PM Zhizhou Zhang wrote: > > > From: Zhizhou Zhang > > > > flush_cache_all() save registers to stack at function entry. > > If it's called after cache disabled, the data is written to > > memory directly. So the following clean cache operation corrupted > > registers saved by flush_cache_all(), including lr register. > > calling flush_cache_all() before turn off cache fixed the problem. > > > > Signed-off-by: Zhizhou Zhang > > Reviewed-by: Linus Walleij > > I would also add > Cc: stable@vger.kernel.org > > Then please put this into Russell's patch tracker once review > is complete. However, it makes a total nonsense of the comment, which explains precisely why the flush_cache_all() is where it is. Moving it before that comment means that the comment is now rediculous. So, please don't put it in the patch system. The patch certainly needs to be tested on TI Keystone which is the primary user of this code. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!