From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2245ACDB474 for ; Tue, 17 Oct 2023 00:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233890AbjJQAKQ (ORCPT ); Mon, 16 Oct 2023 20:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232096AbjJQAKO (ORCPT ); Mon, 16 Oct 2023 20:10:14 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FD0593; Mon, 16 Oct 2023 17:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697501413; x=1729037413; h=to:cc:subject:references:date:mime-version: content-transfer-encoding:from:message-id:in-reply-to; bh=VYDZT96kexfqaH+AR3VV1CdJlxfibH9c6rb9UionuyU=; b=DzLIBWiXq9+kxC61Ay+fyhuFLvpihfwCW6/F2xm9KNzqe/vYMRS/D+yY 601uv0dYJzHYMT/yr4i9SyqcDZvFE218zjxYXhVTHoblUAO5dNKCaYPV3 CMcLIW31qX7q2j0bfnNea1BMsYqH5bX/h/doaNVnySqtcI3rFR/t88wv8 aanMKADkIkUD+/7k3sZ4nFx10NECWZw5VaLkOqlqBtgmHGx5352HYFJQ3 i9Q/meg12a0bfjYueUv0jzfGbKKvWr+m68LM+75t7hp5NyAq/Ogyr9vLx 2il8dwmlyZs68pWmyzPimxUTwvz62yVnYOyABO5R8eqUx24G+2zwzs0r6 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="376036956" X-IronPort-AV: E=Sophos;i="6.03,230,1694761200"; d="scan'208";a="376036956" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 17:10:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="755882750" X-IronPort-AV: E=Sophos;i="6.03,230,1694761200"; d="scan'208";a="755882750" Received: from hhuan26-mobl.amr.corp.intel.com ([10.92.17.92]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 16 Oct 2023 17:10:10 -0700 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Christopherson,, Sean" , "Huang, Kai" Cc: "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: <20230923030657.16148-1-haitao.huang@linux.intel.com> <20230923030657.16148-13-haitao.huang@linux.intel.com> <1b265d0c9dfe17de2782962ed26a99cc9d330138.camel@intel.com> <06142144151da06772a9f0cc195a3c8ffcbc07b7.camel@intel.com> <1f7a740f3acff8a04ec95be39864fb3e32d2d96c.camel@intel.com> <631f34613bcc8b5aa41cf519fa9d76bcd57a7650.camel@intel.com> <35a7fde056037a40b3b4b170e2ecd45bf8c4ba9f.camel@intel.com> Date: Mon, 16 Oct 2023 19:10:09 -0500 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Haitao Huang" Organization: Intel Message-ID: In-Reply-To: <35a7fde056037a40b3b4b170e2ecd45bf8c4ba9f.camel@intel.com> User-Agent: Opera Mail/1.0 (Win32) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Oct 2023 16:09:52 -0500, Huang, Kai wrote: [...] > still need to fix the bug mentioned above here. > > I really think you should just go this simple way: > > When you want to take EPC back from VM, kill the VM. > My only concern is that this is a compromise due to current limitation (no other sane way to take EPC from VMs). If we define this behavior and it becomes a contract to user space, then we can't change in future. On the other hand, my understanding the reason you want this behavior is to enforce EPC limit at runtime. I just not sure how important it is and if it is a real usage given all limitations of SGX VMs we have (static EPC size, no migration). Thanks Haitao