Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp182328pxf; Thu, 11 Mar 2021 00:58:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlbA4DzRwkwxypuPGghFJ2g7KlXtTAM4yJURxlgRKmsCWNy3dURIBCWBryORcrKVfr+4Rj X-Received: by 2002:a17:906:4015:: with SMTP id v21mr2119553ejj.433.1615453131519; Thu, 11 Mar 2021 00:58:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1615453131; cv=pass; d=google.com; s=arc-20160816; b=PuN+ysyb5SMZgf18Pkc9wod1LkIHey6aHZmsS1T5fy62OMQI7M0J91HQinsz1pZB7v kSrFveZFw9dC3Jdp6NY7wfCxvsLD7QrmAEBEX9Cf+zlh/uKFOdZeaESBjZIkPvfAhzgz Z2QRiPVzg/UwYE+5pqzXA+aM058Hb8vxOj7PjoWI2Va7ebN9F873Mzr8CgxQZS/l98Eu P5ASK91Khby3mAaMbBTKi8Gre2bnHTZQFyZ/5OMIsiorIlFpo/t1ACe6Hj922C174sd9 3gQ0msWRVsengut8hxedWYTMmD+SmC5Ex+qN9NOx4x9w0q5J3r0c2Czc2aqBgjzmoTde 37rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=zCO6+YVm5WNQn6v1ig0kpYbEm+5IJD2iZziMcgviviQ=; b=IRHFv3qZmPa7wb8gHlNVFbwlhep0/BxVH2pZlKVgM8QXDhPT0TWPx5Aeu+DDAS+OWu kYGD7gW1Q2BCSYEHWHtAKxs+qewpssYlYSrreiDmYZWfm/VA3e0BVZatQ2u1Bu2S3xqS 4s2vIAkzjVQqZbKQQCtRBrOqMW3Cwze66/yHGkSRokcBzl1pa+5psmDHtkdVXneBVNeC G46KHGjVHHhJzJm/wKVz7f7RAUtzde5PSA0OpJ0fVdmwepGmPXXy0qWeqoq2ND3CvnKo AZcuml1JcVE+/4lhdVigcdsULHOIFHqs0RzspviT9UxDlK7rhwRounF5/l6OUGpsao/A mojw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nec.com header.s=selector1 header.b=ieVRPa1B; arc=pass (i=1 spf=pass spfdomain=nec.com dkim=pass dkdomain=nec.com dmarc=pass fromdomain=nec.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si1339336ejh.597.2021.03.11.00.58.28; Thu, 11 Mar 2021 00:58:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nec.com header.s=selector1 header.b=ieVRPa1B; arc=pass (i=1 spf=pass spfdomain=nec.com dkim=pass dkdomain=nec.com dmarc=pass fromdomain=nec.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231639AbhCKIzj (ORCPT + 99 others); Thu, 11 Mar 2021 03:55:39 -0500 Received: from mail-eopbgr1300055.outbound.protection.outlook.com ([40.107.130.55]:47140 "EHLO APC01-HK2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231362AbhCKIze (ORCPT ); Thu, 11 Mar 2021 03:55:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7r1qUKO7j+qE5Nuz3AOJ2PqIhpsCWUluQWwXE+1TkivnaLEZG1B8JKxxtRt8ttSXbyHCt7mKwnBKP+V6Zf9KVf3q3a28o/6e4Sc9AiuTJoIPDJMkefuC2tFsC6Z8gRQk5VQrV+hpNNoVWdHs5Hl5d9lrGtD942wEsmB7iPqvfaDgHy+NiJ9EAo8IK05yUXMVA+iIQC5KTlp3LNGSs8CgCFasKjER80DDYfk7zs84pqFmghbQNNWkmUDIEGKscz0UEsbalbVkyLhrLCCzotXT89jiUGYdy2/EbJ/yeLf8dt6TYi4yqDNdmrvpzR8Nl2C4bTwjOq19PXm+8ejRrrXwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zCO6+YVm5WNQn6v1ig0kpYbEm+5IJD2iZziMcgviviQ=; b=P2quEEhOI0DRoGHFo7X11i4fKDXt3XXqtR59IUjIpKvBerFkYnjto69+36WP0EVGztCH+1uoGD4TrcQsdIVhw1hF6n86lTmIwMGVSzXu5IbkmvW9lcXAV3777NBXq4OC0GwlCcvFAkR9N/3E8IadQCc2LcASO7Argm6Rs4aCacJgWRupquuoDQYmbsoPnTKE9V/RL+LBdeb0AwSEfpa3zP/lNpAChlc57bg3vrWskNqX/ecMPqQsvBDAUXDUjPlsdcTmbuX4pKspMoy9/QUIhGYZAD/5sVwag9DAEFlnUvtqdjjq9YdKuAKNBwlja/wqg5btqAjKj/7BmJ7BcTBfWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nec.com; dmarc=pass action=none header.from=nec.com; dkim=pass header.d=nec.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nec.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zCO6+YVm5WNQn6v1ig0kpYbEm+5IJD2iZziMcgviviQ=; b=ieVRPa1BNAKgm8K7WuXvEASDOTF/jLEYbZbbn0FH+ThNEHRMF0jsFCDpnfcaqb6xgYnAzm9y7Wv4Dwq/vX3OnvITL8deCp/Nc8OOJg8eknIbx+yEz9h3ANsYBgIMHkojXKDLA2vRwZcIfSJjbK7hi7jSYNGpPMpYTQEDQZws2kg= Received: from TY1PR01MB1852.jpnprd01.prod.outlook.com (2603:1096:403:8::12) by TY2PR01MB2091.jpnprd01.prod.outlook.com (2603:1096:404:10::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.19; Thu, 11 Mar 2021 08:55:30 +0000 Received: from TY1PR01MB1852.jpnprd01.prod.outlook.com ([fe80::1552:1791:e07c:1f72]) by TY1PR01MB1852.jpnprd01.prod.outlook.com ([fe80::1552:1791:e07c:1f72%7]) with mapi id 15.20.3912.026; Thu, 11 Mar 2021 08:55:30 +0000 From: =?iso-2022-jp?B?SE9SSUdVQ0hJIE5BT1lBKBskQktZOH0hIUQ+TGkbKEIp?= To: Aili Yao CC: "Luck, Tony" , Oscar Salvador , "david@redhat.com" , "akpm@linux-foundation.org" , "bp@alien8.de" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "yangfeng1@kingsoft.com" Subject: Re: [PATCH] mm,hwpoison: return -EBUSY when page already poisoned Thread-Topic: [PATCH] mm,hwpoison: return -EBUSY when page already poisoned Thread-Index: AQHXCn0F5fAOAyGRl0mX4JfXYioGdapnG5GAgAEgN4CAAIHeAIAAAyEAgAAQYACAAF5TAIAAhxGAgAALNoCAB+cDgIAABNQAgABOzACAAHYEgIAAsYCAgAAiT4CAACi3AIABIFEAgAAZ9wCAAPG5gIAHOEoAgAHAYAA= Date: Thu, 11 Mar 2021 08:55:30 +0000 Message-ID: <20210311085529.GA22268@hori.linux.bs1.fc.nec.co.jp> References: <20210303115710.2e9f8e23@alex-virtual-machine> <20210303163912.3d508e0f@alex-virtual-machine> <1a78e9abdc134e35a5efcbf6b2fd2263@intel.com> <20210304101653.546a9da1@alex-virtual-machine> <20210304121941.667047c3@alex-virtual-machine> <20210304144524.795872d7@alex-virtual-machine> <20210304235720.GA215567@agluck-desk2.amr.corp.intel.com> <20210305093016.40c87375@alex-virtual-machine> <20210310141042.4db9ea29@alex-virtual-machine> In-Reply-To: <20210310141042.4db9ea29@alex-virtual-machine> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kingsoft.com; dkim=none (message not signed) header.d=none;kingsoft.com; dmarc=none action=none header.from=nec.com; x-originating-ip: [165.225.97.70] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3751600a-2ccd-407a-a6f2-08d8e46b6c92 x-ms-traffictypediagnostic: TY2PR01MB2091: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tZLPuMH3EYGMqx7LVMHRV+VU37nzPpsBtViSqCW/577zMWFiqE8xp7YBAcdIuaxGCKJYdizhY9aZxSj15/pDewTUQ9PN3IanA7zWyfDlzqdXMb6T2e9RNVn/mK6QJGaqM1PKU3BdwxejiH/N7n0MTx+0GPF8GzYJB3l0wew4odX24c6/1pV8w12omqIsV56YV2PP0E3olSEVbreQXk+0ZHJRnl/Lr6W1TJi0iJvs571SBrn/6cIt+p/2hx4VJndZloyox+cxu5rO95Zd0mUGjwwDwwpyVCSRKu4OR5gpdivQAxZOHCHgSA4WLeMv4FLHPOELMhhfST0dORdmIqzLR2ykto13dmatvEbsUA+M74+a5NREbL3A5TytZ7DbJxgaToAiaNd4miFXOUS8TZI+VvzqQYcVaUvh1HbYMDshuxYvf1CPtb1YzV8N6iXbb+6RiBo3MHCioo5Jpa9M9AnrzsCLME/Cbb6uGIN66Uk0tJWC6njUQ+xAbRmKBsORp5rmx7H+ATY2NcUlwa84OOFk9A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY1PR01MB1852.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(366004)(346002)(39860400002)(396003)(136003)(55236004)(66476007)(6916009)(83380400001)(54906003)(4326008)(76116006)(6486002)(33656002)(8936002)(316002)(6512007)(2906002)(8676002)(7416002)(9686003)(71200400001)(66946007)(6506007)(85182001)(186003)(66556008)(66446008)(1076003)(478600001)(86362001)(26005)(53546011)(5660300002)(64756008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-2022-jp?B?NmtzS2FRUlV2bCthNnA3QUt1Qm1PL2lTNDNEcG8rSExkQjk3UDdMUFBU?= =?iso-2022-jp?B?b2dGUTlYZTQwNXNFaWMvSGUrQStSZVZLN1NDUjdkZ0JVWWRVNnM4ZWI0?= =?iso-2022-jp?B?MEE3bkROSC85YWI1MUl1akVGWS83cmZ6NzNLZVZOWkw0S0JOd2xkc0Ja?= =?iso-2022-jp?B?ODh5T2lGRGtZcmJGRFYzd3k4YUxvbmZOalp0QWJyUDFJK3hNaVp4bnNS?= =?iso-2022-jp?B?Wk9tTE41dnE0cXdWQWJ3bWJ6bnhlSnp4cVBKY1FVditBT3hQOUNOT1k5?= =?iso-2022-jp?B?dUJmMEdaUUx1NWV6aDBRWVpUWk4wU2ZrSnppaXpIeWEzNFUyRVhDQXRr?= =?iso-2022-jp?B?SGM0RlNXOVlvL2F3em4wQWhsOC94THRDcTV3QWxyenVrV1V3S29DYnEy?= =?iso-2022-jp?B?S1hVM21mYk0vdDNwc2RTNUtLdmZLb2RyL1JwVDNyM2FKMUdHVmJveVpI?= =?iso-2022-jp?B?SHJ5NWtiYW5yV3RpRGZHMmtOYW1KUFRyMlJjOXYwRS9Lc2dHSVpkY2VK?= =?iso-2022-jp?B?VW0xOEhYdFJzTWhDMzhTU0dRcStoc0xYK3ZBL1JSOXArZzZST1VWMlJI?= =?iso-2022-jp?B?RjJibXZUTEpKbzRQQVJaWkdBV2R2cDhQS2NYZERoUWxscDc0dUIrR3FF?= =?iso-2022-jp?B?ZC9GYjQ4Qk91eVd4SWtWMWQxbXVSWlptRG94YW9aWHozNkUrdmQ4bm1U?= =?iso-2022-jp?B?Ty84Mmx2RjY1ZGlMcHNVUjZBenlwdGVVL21LNyt6cEt6djQ2SzBPUm8w?= =?iso-2022-jp?B?MlNpRGxlczkyOW13aXhKWEh4UnZqZ3YwL0REWnVGR3NLWWJtdlBiZ3Ja?= =?iso-2022-jp?B?MXdGQkpEa2Fna2Z5N2w3Q3BUakxjN0lKRWpxaVVXUHM5a0pUenU2MVVx?= =?iso-2022-jp?B?cGJmU0ttM2FaVGNYRDY5SGpUM21hOWl4cDNaZlNXZkVYcElScEpVTkxZ?= =?iso-2022-jp?B?MjBwT3RQOHBubUE5M1NwMStlV2gyVTdhbEg1Tjk1OVZ5aUNzYWZLb0RH?= =?iso-2022-jp?B?TW9taWZPRWNFTjdWclpUSGJZUk5HN0FHSGhveVcyUzVPTVY4NXlzYm41?= =?iso-2022-jp?B?TUhySXczeTNHbWNtcmNXWmFxV0R2WWNWSElBM1hYOGJkREdJTFcxY2hJ?= =?iso-2022-jp?B?LzlGWTZrZkpPS3ZlMWkxTWUwYTVEYkN6L2huZmdmSGVJSnNQNE9Cb3FO?= =?iso-2022-jp?B?UjVPaisxUk1PaUNVc2Z2cjliaUdIY2krdWlFWHo4bEw2MkFmRVYxa1Q5?= =?iso-2022-jp?B?WlFLS0NvdXE3L0ZaQm5xanRWMzlDOFF5ejhVY0dUUzBZSE0wNFpJVzF4?= =?iso-2022-jp?B?SDh5SmQ2TTRqSGhuVjI1d2F2cS9zSE8rYXRIU2cyaUVlYkxwVmdQRUxT?= =?iso-2022-jp?B?UnRGZ3BWeDJ0d2U2Y3lCa1BJOHl3TmhmRGViNzhSVVJUZmFHYjlBNDMv?= =?iso-2022-jp?B?dkN5anI5TXcvWmZ2Q0tuNU9wdnIyK1ZaejdRYzRXczZFVFdxUjNmaGFv?= =?iso-2022-jp?B?WVd1am8weWUyWjh1TjVud1pScUNRdVM5ZndvdmRiODhMQjhHQVJaYjJX?= =?iso-2022-jp?B?MVpVTjI0TW1GUkMzUE91dVo1djhqVmxESzA0dnYvamJpY1dEcDBkL1hn?= =?iso-2022-jp?B?Wkw4dm9SNGxOdmM0SlBmcFF5L3BMMElvWDdpU1NCbDNLd1hQeW9MeEcr?= =?iso-2022-jp?B?SXpzUURnQzQ2UllhdHNNT2tsZG9pT0kxTHJUYXdILzNXTEFheVc0UVhU?= =?iso-2022-jp?B?S0RsQmcrb04yVzE0ZkhMdzM4TjVCTG5oYTg1eVRpZi9yN1cxdHQ3K0o5?= =?iso-2022-jp?B?N1M1bFRwaUxodEgxZ1NEZkRzUzdYelZvcE5NUUJLekpKWUJXeU5Pd0NT?= =?iso-2022-jp?B?RGMwNGQrWTFUYi9CRWtwZnpTRk9PbTZvYjdWb0pTRHZFL3dFMGZ0UFJI?= Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <7B6967991C13654ABE60CC4F342D881D@jpnprd01.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nec.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TY1PR01MB1852.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3751600a-2ccd-407a-a6f2-08d8e46b6c92 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2021 08:55:30.5969 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: e67df547-9d0d-4f4d-9161-51c6ed1f7d11 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4TuOkpAUYuukSLVmnpc8T5lQXtbJMXcHqViOUQEMAPi5gjdSP1ywTkkyJ82SVgIKugzO2n/rutoEHct56ynasQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB2091 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 10, 2021 at 02:10:42PM +0800, Aili Yao wrote: > On Fri, 5 Mar 2021 15:55:25 +0000 > "Luck, Tony" wrote: >=20 > > > From the walk, it seems we have got the virtual address, can we just = send a SIGBUS with it? =20 > >=20 > > If the walk wins the race and the pte for the poisoned page is still va= lid, then yes. > >=20 > > But we could have: > >=20 > > CPU1 CPU2 > > memory_failure sets poison > > bit for struct page > >=20 > >=20 > > rmap finds page in task > > on CPU2 and sets PTE > > to not-valid-poison > >=20 > > memory_failure returns > > early because struct page > > already marked as poison > >=20 > > walk page tables looking > > for mapping - don't find it > >=20 > > -Tony >=20 > While I don't think there is a race condition, and if you really think th= e pfn with SIGBUS is not > proper, I think following patch maybe one way. > I copy your abandon code, and make a little modification, and just now it= pass > my simple test. >=20 > And also this is a RFC version, only valid if you think the pfn with SIGB= US is not right. >=20 > Thanks! >=20 > From a522ab8856e3a332a2318d57bb19f3c59594d462 Mon Sep 17 00:00:00 2001 > From: Aili Yao > Date: Wed, 10 Mar 2021 13:59:18 +0800 > Subject: [PATCH] x86/mce: fix invalid SIGBUS address >=20 > walk the current process pte and compare with the pfn; > 1. only test for normal page and 2M hugetlb page; > 2. 1G hugetlb and transparentHuge is not support currently; > 3. May other fails is not recognized, This is a RFC version. >=20 > --- > arch/x86/kernel/cpu/mce/core.c | 83 ++++++++++++++++++++++++++++++++++++= ++++-- > 1 file changed, 80 insertions(+), 3 deletions(-) >=20 > diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/cor= e.c > index db4afc5..65d7ef7 100644 > --- a/arch/x86/kernel/cpu/mce/core.c > +++ b/arch/x86/kernel/cpu/mce/core.c > @@ -28,8 +28,12 @@ > #include > #include > #include > +#include > +#include > +#include > #include > #include > +#include > #include > #include > #include Maybe requiring many dependencies like this implies that you might be bette= r to do below in mm/memory-failure.c instead of in this file. > @@ -1235,6 +1239,81 @@ static void __mc_scan_banks(struct mce *m, struct = pt_regs *regs, struct mce *fin > /* mce_clear_state will clear *final, save locally for use later */ > *m =3D *final; > } > +static int mc_pte_entry(pte_t *pte, unsigned long addr, unsigned long ne= xt, struct mm_walk *walk) > +{ > + u64 *buff =3D (u64 *)walk->private; > + u64 pfn =3D buff[0]; > + > + if (!pte_present(*pte) && is_hwpoison_entry(pte_to_swp_entry(*pte))) > + goto find; > + else if (pte_pfn(*pte) =3D=3D pfn) > + goto find; > + > + return 0; > +find: > + buff[0] =3D addr; > + buff[1] =3D PAGE_SHIFT; > + return true; Returning true means you stop walking when you find the first entry pointin= g to a given pfn. But there could be multiple such entries, so if MCE SRAR is triggered by memory access to the larger address in hwpoisoned entries, the returned virtual address might be wrong. > +} > + > +extern bool is_hugetlb_entry_hwpoisoned(pte_t pte); > + > +static int mc_hugetlb_range(pte_t *ptep, unsigned long hmask, > + unsigned long addr, unsigned long end, > + struct mm_walk *walk) > +{ > + u64 *buff =3D (u64 *)walk->private; > + u64 pfn =3D buff[0]; > + int shift =3D PMD_SHIFT; > + pte_t pte =3D huge_ptep_get(ptep); > + > + if (unlikely(is_hugetlb_entry_hwpoisoned(pte))) > + goto find; > + > + if (pte_pfn(*ptep) =3D=3D pfn) > + goto find; > + > + return 0; > +find: > + buff[0] =3D addr; > + buff[1] =3D shift; > + return true; > +} > + > +static struct mm_walk_ops walk =3D { > + .pte_entry =3D mc_pte_entry, > + .hugetlb_entry =3D mc_hugetlb_range > +}; > + > +void mc_memory_failure_error(struct task_struct *p, unsigned long pfn) > +{ > + u64 buff[2] =3D {pfn, 0}; > + struct page *page; > + int ret =3D -1; > + > + page =3D pfn_to_page(pfn); > + if (!page) > + goto force_sigbus; > + > + if (is_zone_device_page(page)) > + goto force_sigbus; > + > + mmap_read_lock(p->mm); > + ret =3D walk_page_range(p->mm, 0, TASK_SIZE_MAX, &walk, (void *)buff); > + mmap_read_unlock(p->mm); > + > + if (ret && buff[0]) { > + pr_err("Memory error may not recovered: %#llx: Sending SIGBUS to %s:%d= due to hardware memory corruption\n", > + buff[0], p->comm, p->pid); > + force_sig_mceerr(BUS_MCEERR_AR, (void __user *)buff[0], buff[1]); > + } else { > +force_sigbus: > + pr_err("Memory error may not recovered, pfn: %#lx: Sending SIGBUS to %= s:%d due to hardware memory corruption\n", > + pfn, p->comm, p->pid); > + force_sig_mceerr(BUS_MCEERR_AR, (void __user *)pfn, PAGE_SHIFT); > + } > + > +} > =20 > static void kill_me_now(struct callback_head *ch) > { > @@ -1259,9 +1338,7 @@ static void kill_me_maybe(struct callback_head *cb) > } > =20 > if (p->mce_vaddr !=3D (void __user *)-1l) { > - pr_err("Memory error may not recovered: %#lx: Sending SIGBUS to %s:%d = due to hardware memory corruption\n", > - p->mce_addr >> PAGE_SHIFT, p->comm, p->pid); > - force_sig_mceerr(BUS_MCEERR_AR, p->mce_vaddr, PAGE_SHIFT); > + mc_memory_failure_error(current, p->mce_addr >> PAGE_SHIFT); I guess that p->mce_vaddr stores the virtual address of the error here. If so, sending SIGBUS with the address looks enough as we do now, so why do you walk page table to find the error virtual address? Thanks, Naoya Horiguchi=