Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp861106pxv; Wed, 14 Jul 2021 17:47:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9h3WhZp+0aru/0GO0D7jHz58VMWBiwZpAgr/OKthmlSyH++jS5klmB/eKPICuv2umvPYG X-Received: by 2002:a5d:974f:: with SMTP id c15mr632282ioo.190.1626310028853; Wed, 14 Jul 2021 17:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626310028; cv=none; d=google.com; s=arc-20160816; b=TMLNRIqopXqRtQ5/p5J5R+oPQAXPNoPR4CDGqFkyK7+pEPhajCOWkB4ALwyAEhF+5i 2pXaxiWNlFjbhgTyRRn0t7zMoGB+dFGyozC+tLJH08ahp7xeam1yB+WIOZU9CIuQDxhZ fAxuU1U9WS8xhMsxoqTCIIcYplj8cVbdDiG6INBY+o+XUVeOvsEyGg6N1qCastxzes3e U9jTmGo6kjyjd/lSydy6S34jMOl89/RhuvGXGH82Po9TSyCqR5G+rTeXC+Hw+dQZW2na h24d3LavAA7R3J8NrI/I4XiPEL+UVWy7Rygea0oAB9EL2x4WtmhlhOIiOSamxL2Zg9TL ivnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :dlp-version:dlp-reaction:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=2gXaoYyKtWvbHRsNDJIova54PQEBINhlYGOwNNqTgUw=; b=EAVtPgJTNpRCWMPPX4jT31M25CMUM9NYS+6xSJ//CHI3ugEUrb8jlACjHFxyM2sPYd bu0ynUxSm9wIH09fxwKwXPDyxsZ7kTqYflok6ZTJm8e8LA/do1zUy3lqSf/85d9LISP7 Ewo/xToAZaB7r0yMzUDHPrgL8Y2wERkrfqRHnNfD/6KDgrpJFgG3oCUT09A3vZCKohKV xJa2fSb4aR0UY22VrpPQZxMZc/S3MzWsX3WFl0ixtmpqAfSb92xuuvL7BCep5aRP/Lov 4iBD6WPwdDNgeK9WKeHU90WTo7lf3ZrYDZwjPdGST9IPGiWzDrwn/n3BdMV2lX4XPzf/ M71A== 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 b3si3989353iln.124.2021.07.14.17.46.56; Wed, 14 Jul 2021 17:47:08 -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 S237778AbhGNXlz convert rfc822-to-8bit (ORCPT + 99 others); Wed, 14 Jul 2021 19:41:55 -0400 Received: from mga02.intel.com ([134.134.136.20]:12240 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbhGNXlz (ORCPT ); Wed, 14 Jul 2021 19:41:55 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10045"; a="197629552" X-IronPort-AV: E=Sophos;i="5.84,240,1620716400"; d="scan'208";a="197629552" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2021 16:39:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,240,1620716400"; d="scan'208";a="562601991" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga004.jf.intel.com with ESMTP; 14 Jul 2021 16:39:02 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 14 Jul 2021 16:39:02 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 14 Jul 2021 16:39:01 -0700 Received: from fmsmsx610.amr.corp.intel.com ([10.18.126.90]) by fmsmsx610.amr.corp.intel.com ([10.18.126.90]) with mapi id 15.01.2242.010; Wed, 14 Jul 2021 16:39:01 -0700 From: "Luck, Tony" To: Sean Christopherson , "Chatre, Reinette" CC: Jarkko Sakkinen , Dave Hansen , "x86@kernel.org" , "linux-sgx@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 1/4] x86/sgx: Track phase and type of SGX EPC pages Thread-Topic: [PATCH 1/4] x86/sgx: Track phase and type of SGX EPC pages Thread-Index: AQHXdCUcDncuRnkx9Ue+ht5iNpTdPatDbnyA//+NavCAAH2fgIAAHc8A//+QpcA= Date: Wed, 14 Jul 2021 23:39:01 +0000 Message-ID: References: <20210708181423.1312359-1-tony.luck@intel.com> <20210708181423.1312359-2-tony.luck@intel.com> <93845f78-120d-7522-bd3e-fe042380d29e@intel.com> <31668f36583844cbbae0b10a594193d6@intel.com> <00114991-9075-84f4-797d-f0f953d34660@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.1.200.100] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I've no objection to tracking the type for SGX2, my argument in the context of > #MC support is that there should be no need to track the type. Either the #MC > is recoverable or it isn't, and the enclave is toast regardless of what type of > page hit the #MC. I'll separate the "phase" from the "type". Here phase is used for the life-cycle of EPC pages: DIRTY -> FREE -> IN-USE -> DIRTY Errors can be reported by memory controller page scrubbers for pages that are not "IN-USE" ... and the recovery action is just to make sure that they are never allocated. When a page is IN-USE ... it has a "type". I currently only have a way to inject errors into SGX_PAGE_TYPE_REG pages. That means initial recovery code is going to focus on those since that is all I can test. But I'll try not to special case them as far as possible. -Tony