From patchwork Mon Oct 17 22:33:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Tai X-Patchwork-Id: 13009638 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7749AC4332F for ; Mon, 17 Oct 2022 22:32:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 062976B0075; Mon, 17 Oct 2022 18:32:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 012C06B0078; Mon, 17 Oct 2022 18:32:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1D876B007B; Mon, 17 Oct 2022 18:32:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D4C246B0075 for ; Mon, 17 Oct 2022 18:32:55 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 835F31C68B8 for ; Mon, 17 Oct 2022 22:32:55 +0000 (UTC) X-FDA: 80031892710.19.CE13AB1 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf10.hostedemail.com (Postfix) with ESMTP id 1AA40C0021 for ; Mon, 17 Oct 2022 22:32:54 +0000 (UTC) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29HLmwO0027014; Mon, 17 Oct 2022 22:32:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2022-7-12; bh=axepoFwpQrDrQYXcdV/6jV6ZYyzoOO5W6Iku2bzAuP0=; b=Cd/knNbuY+0XHtBl2JHSSNzZ1ogK6VQ+DJBzk+2xqUsync1Rbjju9HqJYaDg9fHuwEro vvC6nZP5UBGPo3wKsjsEhMyn6016qadoS9HfNQ6Mh6FLzht7J/Yc9bMDE2DJBP3xMdoL 68XCwGIeww1w1wuf5HQdgY08fM2b5nScJg5dVbRhIEgSAPXu1mInEA9TO43VQBjnGr5R WZrGnSMuqIKDTFzRR8+wwjv5Pp9NKlXZEzQunlv5QvnKTmAOwgLss1x1JgxG/Q2CGXKV enx9Zps3u33v/qBGAOe4aIUIKn78GkJANjkM8Qv11ScrsYSzP23dJAa/7z2Ieg/NSaQn 4w== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k99nt96dk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Oct 2022 22:32:39 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29HKxNhY015891; Mon, 17 Oct 2022 22:32:38 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hr9hvqq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Oct 2022 22:32:38 +0000 Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29HMWcTt026010; Mon, 17 Oct 2022 22:32:38 GMT Received: from brm-x62-20.us.oracle.com (brm-x62-20.us.oracle.com [10.80.150.35]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3k8hr9hvqj-1; Mon, 17 Oct 2022 22:32:37 +0000 From: Thomas Tai To: tony.luck@intel.com, dave.hansen@linux.intel.com, jarkko@kernel.org, reinette.chatre@intel.com, linmiaohe@huawei.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, naoya.horiguchi@nec.com, thomas.tai@oracle.com Subject: [PATCH V3 0/1] x86/sgx: Add code to inject hwpoison into SGX memory Date: Mon, 17 Oct 2022 18:33:04 -0400 Message-Id: <20221017223305.578073-1-thomas.tai@oracle.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-17_13,2022-10-17_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210170128 X-Proofpoint-ORIG-GUID: yfcvgpH1kbUgstCQrvzJ-PRU0AHOcINR X-Proofpoint-GUID: yfcvgpH1kbUgstCQrvzJ-PRU0AHOcINR ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="Cd/knNbu"; spf=pass (imf10.hostedemail.com: domain of thomas.tai@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=thomas.tai@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666045975; a=rsa-sha256; cv=none; b=XxzZg8SbObEwy4pgHQcn/QBqHtQzYEP2tTP1ggUshy2hAfqDsH+oy3I+eOVB6QTUf6vqzn tFXYj9DHVR6Ey/wAqeg7gEO4TYT/SMpOMlL0md8qNJZIczQuwotXV0bplS8dnzLvwSKO+L x13X9hvOBWzV95xIiiQMvaGjFG62O5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666045975; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=axepoFwpQrDrQYXcdV/6jV6ZYyzoOO5W6Iku2bzAuP0=; b=wCam5HxGmE+nIcLgUPBhkPQ7icmOMHtl4gEApFY+3382IyH0BOzO41Pgb/fMC6KFuk2AEo ANeCo5OJmOdHvme1c4yOsmfekHqXjWq4xay8qHdVAnEkDgJ9Df+5qhFtTC+Msa0CEEvFgd yFBtke7oPvgEeekvoL65gYVbqTorVwY= X-Stat-Signature: 59ouuoeu44i8rsofyjpja796rj8o3sg4 X-Rspamd-Queue-Id: 1AA40C0021 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="Cd/knNbu"; spf=pass (imf10.hostedemail.com: domain of thomas.tai@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=thomas.tai@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1666045974-780508 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This patch adds code to inject hwpoison into SGX memory. The SGX memory is processor reserved memory that cannot be directly accessed by system software. Changes since v2: - As suggested by Naoya Horiguchi , add a new mf_action_page_type MF_MSG_SGX and use action_result() to show the page type and the action taken. - Rewrite hwpoison.rst to show the output from dmesg after injection. - Add reinette.chatre@intel.com to the email list. Sorry that I mistyped the email address in the previous emails. - v2 Reviewed-by: Jarkko Sakkinen Changes since v1: - Add a comment in hwpoison_inject as suggested by Miaohe - v1: Reviewed-by: Tony Luck - v1: Reviewed-by: Miaohe Lin Thomas Tai (1): x86/sgx: Add code to inject hwpoison into SGX memory Documentation/mm/hwpoison.rst | 24 ++++++++++++++++++++++++ include/linux/mm.h | 1 + include/ras/ras_event.h | 1 + mm/hwpoison-inject.c | 4 ++++ mm/memory-failure.c | 5 ++++- 5 files changed, 34 insertions(+), 1 deletion(-)