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 C3E2CC433FE for ; Wed, 4 May 2022 10:27:51 +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=D6DS1Ku/bw04xpUxcHWmoEWZ8BsEDF0MwirR/iajJjs=; b=kcTc9Qj3dnB9bu U2RO2g7PVAKAnCLYg026/eeh9IZZ/S8m0UeL3Kss28ky/XglLQkWuflAQGmtdqnAGRemX+1aI6U/j iGOqNKJhzuiSLktbsWVnCU3A2TJFTyo2tH7XeymP69egpG/17VQ43A/hGKQGjRBkBh62zX4NVPmQt GeyDiZZ9jUDvRvQMoM0qBc2jHGfiy0qvbO72jZYTVPlWB8htxqcy+YQhdYLsatuvoTZ2YXa/SqjM2 vu7rWBbI7+5zehoaQrUoGv9HEBXuwmUQkwT0OmJ/MOAFn9Vi0aDPK1IlxbxUC3MK7ftYQ3/0iVSLS RHlM4XUtmjuhwsEGkEgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmCDf-00AEYo-04; Wed, 04 May 2022 10:26:55 +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 1nmCDa-00AEX7-I2 for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 10:26:53 +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 1DA4AB8253E; Wed, 4 May 2022 10:26:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10C3EC385A4; Wed, 4 May 2022 10:26:43 +0000 (UTC) Date: Wed, 4 May 2022 11:26:40 +0100 From: Catalin Marinas To: Tong Tiangen Cc: Mark Rutland , James Morse , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Robin Murphy , Dave Hansen , Will Deacon , Alexander Viro , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , x86@kernel.org, "H . Peter Anvin" , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Kefeng Wang , Xie XiuQi , Guohanjun Subject: Re: [PATCH -next v4 4/7] arm64: add copy_{to, from}_user to machine check safe Message-ID: References: <20220420030418.3189040-1-tongtiangen@huawei.com> <20220420030418.3189040-5-tongtiangen@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220420030418.3189040-5-tongtiangen@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_032650_800508_E7DD7392 X-CRM114-Status: GOOD ( 17.80 ) 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 Wed, Apr 20, 2022 at 03:04:15AM +0000, Tong Tiangen wrote: > Add copy_{to, from}_user() to machine check safe. > > If copy fail due to hardware memory error, only the relevant processes are > affected, so killing the user process and isolate the user page with > hardware memory errors is a more reasonable choice than kernel panic. Just to make sure I understand - we can only recover if the fault is in a user page. That is, for a copy_from_user(), we can only handle the faults in the source address, not the destination. > diff --git a/arch/arm64/lib/copy_from_user.S b/arch/arm64/lib/copy_from_user.S > index 34e317907524..480cc5ac0a8d 100644 > --- a/arch/arm64/lib/copy_from_user.S > +++ b/arch/arm64/lib/copy_from_user.S > @@ -25,7 +25,7 @@ > .endm > > .macro strb1 reg, ptr, val > - strb \reg, [\ptr], \val > + USER_MC(9998f, strb \reg, [\ptr], \val) > .endm So if I got the above correctly, why do we need an exception table entry for the store to the kernel address? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel