Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2833896rdg; Mon, 16 Oct 2023 17:10:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3F5wo0dQ4woXueS+44H90b9FlxTS0rf9IRCd43mtKZGvdqQAMEZex5X2qXjU09aWjmnEV X-Received: by 2002:a17:90a:fc84:b0:27d:8457:e541 with SMTP id ci4-20020a17090afc8400b0027d8457e541mr555930pjb.49.1697501434898; Mon, 16 Oct 2023 17:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697501434; cv=none; d=google.com; s=arc-20160816; b=j9lEWTRN0D+WuLd87q58ZT4x8e9UlM2+i+6oOtyU0tjKmINuluw4FJGXNnVJDUb0Yp STbs89Qj8s5yo7YASuxyDA63R0PPLqUorbERdS1bUmp44aubF6qfmaVDclZ+O5JeSErq zX7DRo8I1aG1v+hBm/hjJzlQZxTolYiAG8gii3JCcP4ruOJLSU93jr2SyaaMzU4mn82U 6GKnDaFZ1SQffqomIG6UcfhehUVc5+fsEcjkX2dCNicTUx5Ehjgny0V1vb5jNkape6lK MhS83PjSxxl2gYZzJAV19D60xGNo51rZKZjFkw0cot2iJ4t959bzHh0MHwmG8PxAtDU/ 2BVg== 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=TuRv0wHnj4rSLVOBzgq/F2k8b8m0DDiU2aqiUHtkMsg=; fh=BrG4V6GIh432FGJbIp5V6sKlECnZ0t8xonlPv3nXmcU=; b=vwzMXIARN6pXT+T2HcrQwfl22bKELFJPclF40KWt7MbfITJujU6+7LNuJ61ZgFaJtx fZk8PkTLPKZpvOFrJQfb8QxffU5fu0n/gUwNml036GY4VRc+3MQpMafqwvyhtsy0XUx8 KPDCOgrNwa0weTavkD3vaHG0gIaZXZhqOg3NdPdUVxosYL0oTP5BZTB6gAJa+JSUu36k KPk73NZ6AlLbjhO8vm/KcBHZwE9gTfDsGLdZEa2Pw60RNrpczmp8kYjFnbrxpsv2hZyY iUrNGy2U7jKkA6B4HRa9OCA8BrzWup8rrz8SYkRUml0y975ewTyQZszzs+Fx9qZsjolS COOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DzLIBWiX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id lw9-20020a17090b180900b0027d4684804dsi479898pjb.122.2023.10.16.17.10.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 17:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DzLIBWiX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 9F52C8042D00; Mon, 16 Oct 2023 17:10:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233802AbjJQAKP (ORCPT + 99 others); Mon, 16 Oct 2023 20:10:15 -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) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Mon, 16 Oct 2023 17:10:32 -0700 (PDT) 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