Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp673745pxv; Thu, 8 Jul 2021 11:15:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAv3iyAmFYki7/DmpMwRsfGLjdHr8/I6GppPXqdR/GYg8fywVOzpaIxBU32qQAUm/yGOVI X-Received: by 2002:a17:906:57d8:: with SMTP id u24mr17180215ejr.252.1625768155116; Thu, 08 Jul 2021 11:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625768155; cv=none; d=google.com; s=arc-20160816; b=vBnzRK4YnbIdfAyGmAmPKlqHK3OUo1ragJYCVe9H4n9X0KfNZc4gbKuvPBZ3EPEDmQ is1rdAH0oBjaw6Jgglz8lEWBYbJbD4cZr0aBSkmWex/S8PXt/AJD9CYCxsi9wr3//lYv WXB8Q1fQ/ZHDvLzkl8HDhT4/9AZ8z/YHd8rmLVJCAiduaF2waS+mqfltqApNdGU2VVeO EG0FTut2gUFwNYPigoEpEWRVcOKsmJyGRLb9oK8pS/wAu7iSgOWrgtFkOv17MD1/GY49 cPc/jjV9bRly1TS6W8SLkir5fDTJ7K399u44khHinLQJKCgHtt+9RXHRlWXHyaUm+7Od JeGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=C7Ir2wErhbNFoqBqwOph5S46ZclAsFJ+XzMIkzVWves=; b=bFYiQ0lwNXrH4frB8JLuakuVhzAPBAxnSloi9T9Dc5yVGEXcSFAkry6itothwZVfAi f8C0Sgq+P1J5985dxDqO9nEOK/RdotzhJmvZbRtziReVy2k8O+cv604vCD++N70eyJxp Pj40l7G+N5U/MZ2JAuQJcmwsK4Hd9bLMffjHD2UVMwGI0TALwrNHKLJfNpVCn5CUGgAv zJ1R2iXGYgSp6NdXRIn9et0cM0FDfYrK22EcHJGYT1/poCemHyaDC1lqv9yXL33iHarC 83yziBGiI+bxg86Y3suzjJdtFv4cB0BU/6hiC7brQiHFfI38c6UNXeDCxfZ/jvPjxYIC IYxw== ARC-Authentication-Results: i=1; mx.google.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si4334585ejh.472.2021.07.08.11.15.31; Thu, 08 Jul 2021 11:15:55 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230191AbhGHSRX (ORCPT + 99 others); Thu, 8 Jul 2021 14:17:23 -0400 Received: from mga01.intel.com ([192.55.52.88]:2094 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbhGHSRS (ORCPT ); Thu, 8 Jul 2021 14:17:18 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10039"; a="231327150" X-IronPort-AV: E=Sophos;i="5.84,224,1620716400"; d="scan'208";a="231327150" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2021 11:14:35 -0700 X-IronPort-AV: E=Sophos;i="5.84,224,1620716400"; d="scan'208";a="482637386" Received: from agluck-desk2.sc.intel.com ([10.3.52.146]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2021 11:14:34 -0700 From: Tony Luck To: tony.luck@intel.com Cc: Jarkko Sakkinen , Dave Hansen , x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] Basic recovery for machine checks inside SGX Date: Thu, 8 Jul 2021 11:14:19 -0700 Message-Id: <20210708181423.1312359-1-tony.luck@intel.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cover the easy cases: 1) memory errors reported by patrol scrubber in unused SGX pages 2) machine checks due to poison consumption from SGX_PAGE_TYPE_REG pages 3) When poison is consumed in an enclave inside a guest, just kill the guest. Tony Luck (4): x86/sgx: Track phase and type of SGX EPC pages x86/sgx: Add basic infrastructure to recover from errors in SGX memory x86/sgx: Hook sgx_memory_failure() into mainline code x86/sgx: Add hook to error injection address validation .../firmware-guide/acpi/apei/einj.rst | 19 +++ arch/x86/include/asm/sgx.h | 6 + arch/x86/kernel/cpu/sgx/encl.c | 4 +- arch/x86/kernel/cpu/sgx/ioctl.c | 4 +- arch/x86/kernel/cpu/sgx/main.c | 147 +++++++++++++++++- arch/x86/kernel/cpu/sgx/sgx.h | 17 +- arch/x86/kernel/cpu/sgx/virt.c | 11 +- drivers/acpi/apei/einj.c | 3 +- include/linux/mm.h | 15 ++ mm/memory-failure.c | 4 + 10 files changed, 219 insertions(+), 11 deletions(-) base-commit: 62fb9874f5da54fdb243003b386128037319b219 -- 2.29.2