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=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no 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 B9EDEC433DB for ; Tue, 26 Jan 2021 15:03:27 +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 7A93920724 for ; Tue, 26 Jan 2021 15:03:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A93920724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=EhHhlyPgXu738Ntv6RnI21CBNGUExhDBkAlG4PqwRxE=; b=LWG4g6NnKQGYYkZGJSz/QOTwp 1aa4923xZV++Z04nnrtygYPN5pjczrY5vhNxXKX/adGgaHv1sNUqq24cB4BjGEBlcOoC29nu+RF1A mPBBCafNYU27BTtNPMSZlC0URWIAE4IZda6NBNNk8zaQas+MEOJdYvGE9Cj7/0E8BS59vnz1DjFNE OzI2mMWsNtLrnZWAO4qZSfW+0Mnran4JTaVafQQeac3y4HlnF4lAcN7pSbuM/Irtao+ddYIjukBRw ZQN3Cf4j33Jpwd/7STXIeZea/Z1/K1Jhn6CwJ8rpVqB4pLpVj8ayc7hWwP2r1VESeCPsgdqgg012G W+c3qnd7A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4Pqy-0007jP-4p; Tue, 26 Jan 2021 15:02:00 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4Pqu-0007i4-Vq for linux-arm-kernel@lists.infradead.org; Tue, 26 Jan 2021 15:01:58 +0000 X-UUID: 8cd08ef192d3491ab1095d1d36e8ffa0-20210126 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=rGVTNTqla9fBGEx7z7mUqUgCLS3k2+Ip6IUjmNlL33Y=; b=tH0Aw/eTEpjVcn/1AZHnYlaOnZNbKVTPrmk4/HFXrNz6/KhQ9Blfj11wzs6mcrjwDTRp0S8w3B88I+cfxTIfr+ISmGpJ8qX77jWf4RUXCxtDg+wCFNQmwaLBx9CjJbxuTHjxFOOjmdYYc0r3uZscxTojW5z+6Tt9E6fpLERdUTA=; X-UUID: 8cd08ef192d3491ab1095d1d36e8ffa0-20210126 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 98647436; Tue, 26 Jan 2021 07:01:54 -0800 Received: from mtkmbs08n2.mediatek.inc (172.21.101.56) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 26 Jan 2021 07:01:52 -0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 26 Jan 2021 23:01:50 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 26 Jan 2021 23:01:50 +0800 From: Lecopzer Chen To: Subject: Re: [PATCH] ARM: mm: harden branch predictor before opening interrupts during fault Date: Tue, 26 Jan 2021 23:01:50 +0800 Message-ID: <20210126150150.13905-1-lecopzer.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210126110716.wv4igts76n3kg3ch@linutronix.de> References: <20210126110716.wv4igts76n3kg3ch@linutronix.de> MIME-Version: 1.0 X-TM-SNTS-SMTP: D66D7140C17D41472CE48D1CD6A2F9666C9EA354FC4251B7BA19B574BE151C652000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210126_100157_259151_B43AB3AE X-CRM114-Status: GOOD ( 21.27 ) 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: lecopzer.chen@mediatek.com, marc.zyngier@arm.com, gregkh@linuxfoundation.org, yj.chiang@mediatek.com, linux@armlinux.org.uk, peterx@redhat.com, linux-kernel@vger.kernel.org, rppt@kernel.org, akpm@linux-foundation.org, walken@google.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org 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 2021-01-26 10:59:32 [+0000], Russell King - ARM Linux admin wrote: > > On Tue, Jan 26, 2021 at 05:17:08PM +0800, Lecopzer Chen wrote: > > > Hi all, > > > > > > I don't see any fix for this issue now(maybe I missed it..?), > > > could we fix this if there is better solution? > > > This issue exists almost two years. > > > > I don't think anyone provided an acceptable patch. > > > > The first patch moved the hardening out of the translation/section > > fault handling. Since the kernel is mapped with sections, these > > are above TASK_SIZE, and the whole point of the branch prediction > > hardening is to prevent the prediction in the kernel being exploited, > > missing the hardening effectively makes the mitigation useless. > > > > The discussion in February 2019 never concluded from what I can see. > > My memory is that I never got a reply which I understood. > Let me try again this week with the information above. NOTE: Before sending this mail, I had searched the relative threads and there are two solutions in general: 1. Add get_pcpu()/put_cpu() https://lkml.org/lkml/2019/6/3/426 Reject by Marc: > The right fix would be to move the call to a point where we haven't > enabled preemption yet. 2. Move out like the patch from Sebastian: This seems follow the concept of 1. (move the call to a point where we haven't enabled preemption yet). But I can't find any reply in the thread. Now the CONFIG_HARDEN_BRANCH_PREDICTOR has already backported to LTS, and after upgrading ARM CONFIG_CPU_V7 products to latest LTS, the CONFIG_HARDEN_BRANCH_PREDICTOR will be default y and this issue makes our devices panic and we have to either disable HARDEN_BRANCH_PREDICTOR or hack in-house to avoid the kernel panic. I'll wait for anyone have acceptable idea and patching(maybe Sebastian could? :)), and I'll also take some time to find other solution too. Thanks, Lecopzer _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel