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=-4.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 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 80A38C433E0 for ; Wed, 3 Mar 2021 12:51:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7D53764EBB for ; Wed, 3 Mar 2021 12:51:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D53764EBB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kingsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E39388D0162; Wed, 3 Mar 2021 07:51:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DE9458D0157; Wed, 3 Mar 2021 07:51:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8A238D0162; Wed, 3 Mar 2021 07:51:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id AE9E98D0157 for ; Wed, 3 Mar 2021 07:51:38 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 344E64DDF for ; Wed, 3 Mar 2021 12:51:38 +0000 (UTC) X-FDA: 77878549476.05.98F382D Received: from mail.kingsoft.com (mail.kingsoft.com [114.255.44.145]) by imf09.hostedemail.com (Postfix) with ESMTP id 3DE3B6000110 for ; Wed, 3 Mar 2021 12:51:34 +0000 (UTC) X-AuditID: 0a580155-713ff700000550c6-8a-603f7f0a80d2 Received: from mail.kingsoft.com (localhost [10.88.1.32]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.kingsoft.com (SMG-2-NODE-85) with SMTP id A7.FF.20678.A0F7F306; Wed, 3 Mar 2021 20:20:26 +0800 (HKT) Received: from alex-virtual-machine (172.16.253.254) by KSBJMAIL2.kingsoft.cn (10.88.1.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 3 Mar 2021 20:51:29 +0800 Date: Wed, 3 Mar 2021 20:51:29 +0800 From: Aili Yao To: Andy Lutomirski CC: "Luck, Tony" , Andy Lutomirski , HORIGUCHI NAOYA , Dave Hansen , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , , Linux-MM , LKML , Subject: Re: [PATCH v3] x86/fault: Send a SIGBUS to user process always for hwpoison page access. Message-ID: <20210303205129.0a66f7a7@alex-virtual-machine> In-Reply-To: <20210303202402.384265a3@alex-virtual-machine> References: <8d0c76f97f35499f91a2b82d3e7c024d@intel.com> <59469ECC-5316-4074-98EF-52FFF7940818@amacapital.net> <20210303202402.384265a3@alex-virtual-machine> Organization: kingsoft X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [172.16.253.254] X-ClientProxiedBy: KSBJMAIL1.kingsoft.cn (10.88.1.31) To KSBJMAIL2.kingsoft.cn (10.88.1.32) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsXCFcGooMtVb59gcGCtscXnDf/YLF5saGe0 mLZR3OLyrjlsFvfW/Ge1WL22gdXi/K61rBaXDixgsrjYeIDR4njvASaLzZumMlu8uXCPxeLH hsesDrwe31v7WDzuv/nL4rF5hZbH4j0vmTw2repk89j0aRK7x7tz59g95p0M9HhxdSOLx/t9 V9k8Pm+S8zjR8oU1gCeKyyYlNSezLLVI3y6BK2Pt0fOsBVf4KuY+ec3awLiLu4uRk0NCwERi YfNH1i5GLg4hgelMEksPN7NAOC8ZJd607GEHqWIRUJHY3PYPzGYTUJXYdW8WK4gtIqAp8XLK fLAGZoGXzBLb3sxiBkkICyRLnJn0gBHE5hWwkrg+aztYnFPAWuL/zsmMEBsWMkqsWv4ZrIhf QEyi98p/Joib7CXatiyCahaUODnzCQuIzQy0rXX7b3YIW1ti2cLXYEOFBBQlDi/5xQ7RqyRx pHsGG4QdK7Fs3ivWCYzCs5CMmoVk1CwkoxYwMq9iZCnOTTfaxAiJxtAdjDOaPuodYmTiYDzE KMHBrCTCK/7SNkGINyWxsiq1KD++qDQntfgQozQHi5I479StJglCAumJJanZqakFqUUwWSYO TqkGpsfd12fLxHJpMbzk/3x7dUjrXD5Bjmlc/nrmfPu6BFJ3KS86KZd53kCuJiXJbbuQ4DHF HTvTd5u0NMVXhHrnTEk8crG6OGjLRm/ZZ8t3KR77l5rH4P1i3dEN58P4/EXKmo/r6me3iHun tnDVzWJd6CO+Qq771uKZFkGre3blyxX9dWky9flZUXX48cTMOY9dom5Mtk5wMg+rXiS50sd1 z+KC66y7NBZd+mv0sEBAWEziVqGG7YV75oyL//6XKrkwed6GmXF7s6x+iqfd23el5bKM43Hu xwea2C6F+n09ebfM0eVwMYvVkVybOYITKye5/t79quJjmPaZ56yZhVxLLrSz3uESu6848+tB lc81SizFGYmGWsxFxYkAdcD1LDUDAAA= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3DE3B6000110 X-Stat-Signature: 9skqesa451wp45dtgngkmacfaa4rky7x Received-SPF: none (kingsoft.com>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=mail.kingsoft.com; client-ip=114.255.44.145 X-HE-DKIM-Result: none/none X-HE-Tag: 1614775894-750834 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 3 Mar 2021 20:24:02 +0800 Aili Yao wrote: > On Mon, 1 Mar 2021 11:09:36 -0800 > Andy Lutomirski wrote: >=20 > > > On Mar 1, 2021, at 11:02 AM, Luck, Tony wrote: > > >=20 > > > =EF=BB=BF =20 > > >>=20 > > >> Some programs may use read(2), write(2), etc as ways to check if > > >> memory is valid without getting a signal. They might not want > > >> signals, which means that this feature might need to be configurable= . =20 > > >=20 > > > That sounds like an appalling hack. If users need such a mechanism > > > we should create some better way to do that. > > > =20 > >=20 > > Appalling hack or not, it works. So, if we=E2=80=99re going to send a s= ignal to user code that looks like it originated from a bina fide architect= ural recoverable fault, it needs to be recoverable. A load from a failed N= VDIMM page is such a fault. A *kernel* load is not. So we need to distingui= sh it somehow. =20 >=20 > Sorry for my previous mis-understanding, and i have some questions:=20 > if programs use read,write to check if if memory is valid, does it really= want to cover the poison case?=20 > When for such a case, an error is returned, can the program realize it's= hwposion issue not other software error and process correctly? >=20 > if this is the proper action, the original posion flow in current code fr= om read and write need to change too. >=20 Sorry, another question: When programs use read(2), write(2) as ways to check if memory is valid, = does it really want to check if the user page the program provided is valid= , not the destination or disk space valid? the patch will not affect this purpose as it's only valid for user page w= hich program provide to write or some syscall similiar parameter. --=20 Thanks! Aili Yao