Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp148372pxb; Fri, 17 Sep 2021 21:57:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFh4CktqDacChZx20yFn2OTRGOi/s2Hcj3v2BcDl+jcR9rFKdlfB0JQUbLHKAUaqEpIhik X-Received: by 2002:a17:906:3746:: with SMTP id e6mr16681064ejc.57.1631941048627; Fri, 17 Sep 2021 21:57:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631941048; cv=none; d=google.com; s=arc-20160816; b=p736xB9q6CuXfu+OzLq1hLEFsCu8n3QuCfy0U5FxSLg0bMwrhPqfuENUyJWSaPURYs 7cwit1EKtZ5S8nFPmzmKk5t1AazdYRhNtN9TvLj9vn7MpoGJ2oFUmr1MmEn4gc+Y608G 6gYm1C/Dhrud/vzik+v5XSu920BTgfH4yzSkEG48adRhQgzTi0i+zbXVCmWreNbWVyCt XqzKGn9XbCTnp8OA89ZpYPK8w8tqA4Y4YvtLiSfy7pvVjTTk0ms0oUlVizSORmJQta1M 8QNNQb9N/JO9qyICB3a9g2lfsIDeuZo/uWW6CJ0iByZVz4mKdIQNwtHqFZZykgY4pngO 0yLw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bsEhMYWW4Cu/ov+DYlEpcb2As759yaO10JocrUsSx3E=; b=SQkgeZ++MBR7T2qayQxRugecY5f3rqOntU0o7ipTXKbbgLdjS1YCr0ZLwXW/hE7EuN kaNdz6Pe3yigZXQtK0BbtmSbMWWcQ3agn8Oxs9TRIAp+pVQONx4l8J67YSz9WQrgQti7 BrYa2AxxS6ejnTPShss2O/62+TQEIWFSGJsyoe+MIlrJr+Pl3uWBdstddoU4xXVphT4s 1N7POk7GdUD6pkLrnk4qVfPfBeKGgnPw/MMmMwrKk2hA4w9p64EFNwtDu+aVI+xlk75J fSxAxAIK0jC7GczVLOuqjQt7KKNRLeSkQBUMzgv8TXuXtBioZ+qQ8JgPdyN7CWuEpBwn gCmw== 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 w16si8632588ejk.681.2021.09.17.21.57.04; Fri, 17 Sep 2021 21:57:28 -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 S241567AbhIQVkN (ORCPT + 99 others); Fri, 17 Sep 2021 17:40:13 -0400 Received: from mga07.intel.com ([134.134.136.100]:54587 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbhIQVkM (ORCPT ); Fri, 17 Sep 2021 17:40:12 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10110"; a="286563045" X-IronPort-AV: E=Sophos;i="5.85,302,1624345200"; d="scan'208";a="286563045" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2021 14:38:49 -0700 X-IronPort-AV: E=Sophos;i="5.85,302,1624345200"; d="scan'208";a="546646796" Received: from agluck-desk2.sc.intel.com ([10.3.52.146]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2021 14:38:49 -0700 From: Tony Luck To: Sean Christopherson , Jarkko Sakkinen , Dave Hansen Cc: Cathy Zhang , linux-sgx@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Tony Luck Subject: [PATCH v5 0/7] Basic recovery for machine checks inside SGX Date: Fri, 17 Sep 2021 14:38:29 -0700 Message-Id: <20210917213836.175138-1-tony.luck@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210827195543.1667168-1-tony.luck@intel.com> References: <20210827195543.1667168-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now version 5. Changes since v4: Jarkko Sakkinen: + Add linux-sgx@vger.kernel.org to Cc: list + Remove explicit struct sgx_va_page *va_page type from argument and use in sgx_alloc_va_page(). Just use "void *" as this code doesn't do anything with the internals of struct sgx_va_page. + Drop the union of all possible types for the "owner" field in struct sgx_epc_page (sorry Dave Hansen, this went in last time from your comment, but it doesn't seem to add much value). Back to "void *owner;" + rename the xarray that tracks which addresses are EPC pages from "epc_page_ranges" to "sgx_epc_address_space". Dave Hansen: + Use more generic names for the globally visible functions that are needed in generic code: sgx_memory_failure -> arch_memory_failure sgx_is_epc_page -> arch_is_platform_page Tony Luck: + Found that ghes code spits warnings for memory addresses that it thinks are bad. Add a check for SGX pages. Tony Luck (7): x86/sgx: Provide indication of life-cycle of EPC pages x86/sgx: Add infrastructure to identify SGX EPC pages x86/sgx: Initial poison handling for dirty and free pages x86/sgx: Add SGX infrastructure to recover from poison x86/sgx: Hook arch_memory_failure() into mainline code x86/sgx: Add hook to error injection address validation x86/sgx: Add check for SGX pages to ghes_do_memory_failure() .../firmware-guide/acpi/apei/einj.rst | 19 +++ arch/x86/include/asm/processor.h | 8 + arch/x86/include/asm/set_memory.h | 4 + arch/x86/kernel/cpu/sgx/encl.c | 5 +- arch/x86/kernel/cpu/sgx/encl.h | 2 +- arch/x86/kernel/cpu/sgx/ioctl.c | 2 +- arch/x86/kernel/cpu/sgx/main.c | 140 ++++++++++++++++-- arch/x86/kernel/cpu/sgx/sgx.h | 14 +- drivers/acpi/apei/einj.c | 3 +- drivers/acpi/apei/ghes.c | 2 +- include/linux/mm.h | 13 ++ mm/memory-failure.c | 19 ++- 12 files changed, 203 insertions(+), 28 deletions(-) base-commit: 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f -- 2.31.1