Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3570831rdg; Tue, 17 Oct 2023 21:50:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1xMaZqh7eb7HHdPw42qpaSVNHgA5TngHj51Q7KpQHwCjohAfcr/vEEYRn2wV3DzwbEgHy X-Received: by 2002:a05:6808:94:b0:3b0:da4a:4823 with SMTP id s20-20020a056808009400b003b0da4a4823mr4283574oic.56.1697604629236; Tue, 17 Oct 2023 21:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697604629; cv=none; d=google.com; s=arc-20160816; b=NuQf4PB5M/Hnuh69Cf9BAsMEjIz/Qb6A+Pj7NHj0fqMLTomBymggLmMJiVjIsXG8U+ FyYpZLPbUPU11xj5i7WBXRv8AxuzGc4Nl2aum7oZXxwPr6OoeCDjG9iW/rtHdvUIUiOm hJvkBNDOj6XewVreGQIRhdjlkyvdaqPgb24Lwi2lAgGFcVtCdVFCGcYGM09aDVFRofls L9C9UTAh9lnR723iK5Ga8qlmQDRKWBGrXR8qb6qliEfdxH7PP6rYTHkkEvr23xdkshfZ 1N4Ya/v2JH9Or6R7kH0P0ldXZYmTf2jCxuD+zclXxhIxqrPNz9crTb221A5vSDZqOjM1 25Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:message-id:organization :from:content-transfer-encoding:mime-version:date:references:subject :cc:to:dkim-signature; bh=OAyYKj20BT/ar5SnAiEiDjouQbeqJ0zNJVisvpwG5dk=; fh=Lbl1KXQF49nLQpjFVU14yCo0uiLxlFUbfHVDWvvq44M=; b=dxwWjkpVXm8lCDqpsU374WreW9/t0bKir0LAxz3NApB9yj0LVa7iq+iiKiv2jbOo0r 6vFKR839hctRQOqCSxaTJBfgDN6q513eazOY50jl3z9oJxwHLXxT6k9Y01rmHBal7hMy blN1L5e6eTQFqXIBWtkJBIq+oOAkU209+L2lJBV0ujKxspbAFd8qI6E7tXbqbQy0NRPc XPNrVXRZzX1Go1R8DIpq2VbzrKgJ/Cjuq/S7zyg81mwutTUnxb+MJ3f8IaChlwLBXUqS peFbkUAmruaLa01Ok0X/A2nmc1+FxWDnLpDv5qinkItoP0LHHVaUhYT64OxU2qVOTCBn bNKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l+Nei83e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id c7-20020a656747000000b00563dfffe7b9si1378512pgu.810.2023.10.17.21.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 21:50:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l+Nei83e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5805C81121EF; Tue, 17 Oct 2023 21:50:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229605AbjJREuZ (ORCPT + 99 others); Wed, 18 Oct 2023 00:50:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbjJREt7 (ORCPT ); Wed, 18 Oct 2023 00:49:59 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EDBD55B2; Tue, 17 Oct 2023 21:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697604098; x=1729140098; h=to:cc:subject:references:date:mime-version: content-transfer-encoding:from:message-id:in-reply-to; bh=F/dSfCnfGZ0vy8R6NzqQ9H0Paj53OwpGh0/vX+zt4EU=; b=l+Nei83eiXQqaeLM/51Ss2RoqbJMGj0GhxQd60bDHe1wHLgDuYUbQ14k ddVktWDlsIHgLNYBedZ8g8XoKNaY3LUMiDL3gQVuJ6ak6m9iPdydcuVTY yNZSVUkLZcmIXYaEk8sMAtBcwoLehj/JcGbGmaa2iFTEif8qUl52KyzBp t3wExoaLZGWk3HzxodciPgyeSvBH1IA1kkXuQE43YvWjhI9EZS46la0Ks hDL9AYjZOn2hagpTqEED5LBHKGJDEhIJQWmRhVo37xxETy/Yq8irdfrXL jRlaCLM0xsZB9dWuxiEDoq5XNYhKMYLiehWcGp79PEDb5drspVt4WfxBr A==; X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="383158307" X-IronPort-AV: E=Sophos;i="6.03,234,1694761200"; d="scan'208";a="383158307" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 21:39:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="791453312" X-IronPort-AV: E=Sophos;i="6.03,234,1694761200"; d="scan'208";a="791453312" Received: from hhuan26-mobl.amr.corp.intel.com ([10.92.17.92]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 17 Oct 2023 21:39:27 -0700 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: =?iso-8859-15?Q?Michal_Koutn=FD?= Cc: "Christopherson,, Sean" , "Huang, Kai" , "Zhang, Bo" , "linux-sgx@vger.kernel.org" , "cgroups@vger.kernel.org" , "yangjie@microsoft.com" , "dave.hansen@linux.intel.com" , "Li, Zhiquan1" , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "tglx@linutronix.de" , "tj@kernel.org" , "anakrish@microsoft.com" , "jarkko@kernel.org" , "hpa@zytor.com" , "mikko.ylinen@linux.intel.com" , "Mehta, Sohil" , "bp@alien8.de" , "x86@kernel.org" , "kristen@linux.intel.com" Subject: Re: [PATCH v5 12/18] x86/sgx: Add EPC OOM path to forcefully reclaim EPC References: <631f34613bcc8b5aa41cf519fa9d76bcd57a7650.camel@intel.com> <35a7fde056037a40b3b4b170e2ecd45bf8c4ba9f.camel@intel.com> <915907d56861ef4aa7f9f68e0eb8d136a60bee39.camel@intel.com> <6lrq4xmk42zteq6thpyah7jy25rmvkp7mqxtll6sl7z62m7n4m@vrbbedtgxeq4> Date: Tue, 17 Oct 2023 23:39:27 -0500 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Haitao Huang" Organization: Intel Message-ID: In-Reply-To: User-Agent: Opera Mail/1.0 (Win32) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 17 Oct 2023 21:50:28 -0700 (PDT) On Tue, 17 Oct 2023 14:13:22 -0500, Michal Koutn=FD w= rote: > On Tue, Oct 17, 2023 at 08:54:48PM +0200, Michal Koutn=FD = > wrote: >> Is this distinction between preemptability of EPC pages mandated by t= he >> HW implementation? (host/"process" enclaves vs VM enclaves) Or do hav= e >> users an option to lock certain pages in memory that yields this >> difference? > > (After skimming Documentation/arch/x86/sgx.rst, Section "Virtual EPC")= > > Or would these two types warrant also two types of miscresource? (To > deal with each in own way.) They are from the same bucket of HW resource so I think it's more suitab= le = to be one resource type. Otherwise need to policy to dividing the = capacity, etc. And it is still possible in future vEPC become reclaimabl= e. My current thinking is we probably can get away with non-preemptive = max_write for enclaves too. See my other reply. Thanks Haitao