Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp776425rdh; Thu, 26 Oct 2023 15:56:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpZZAo8EhPVtQJBFGygXIlWu03Kh4s3/Dslr8wqiCk9O0FWZz4yghNzOqKVOdXCMMm596b X-Received: by 2002:a25:d748:0:b0:da0:86e8:aea4 with SMTP id o69-20020a25d748000000b00da086e8aea4mr836622ybg.57.1698361016790; Thu, 26 Oct 2023 15:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698361016; cv=none; d=google.com; s=arc-20160816; b=w2FRyLXGjGSVr9k1w8rFdqyYXkOXy+NjREb39FRJPzSz4fvkR6uofD07hcuti+fzhL zu/eiZhdtZeueBU9o/WNXBmYlQmCRvq4KRO9u0fDUdAVd15OJJGA6GNeyyei19HlVN+t aP6VTtgwvm1AJPb3okDTDIrlav89UXLjtQ/CwSVpG5YeYnjCfNCtRk7au9XJH9Y/dzq1 Rz1GADrIiZPqPOHX2R47oDGSQ0lbroiP1imYZN24wF9SSP1NmhGs1WoTifJCDVt4615O fqpyp63MKC0P0/jqJmyuQrbc58pA3krF+0w7IWOF3NtvcmgN0JTISyXhlOXsmXS8k8WB 8axA== 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 :dkim-signature; bh=8ccIGnUxyOpyYiiXa7oG9zU12Y257wqBk2RlKLUwk8A=; fh=LWX0JSgoRxVcZLQj87dHR0rhhKvGoc5IUjI9a23RaPA=; b=iSSiprYG2BaTn9Y64x2yGO40p6HY4AEwtb+6e/scEh306b+H9mUEQAeyhGvcF/MQw2 ciNiibsfwdzvHU0635/HDbwrZXhIbYfhr+3Ie5wVzGyTQjhT4bssk/mXqidsgSQX2fge 8T5qZSf2sgeq7TZfloGP7XyxvNncUVtFpncG56A36VVXTJrTpCwFNUzqppTkzjWKXVQN Ucq/1oBR/H94Hdilvht40kPmbZNLy8Nde/4IQd/VJodtbAfL8HFeppMIr/rELzffrcmw +UwrzDi510xx+A32oA52B3uWyBiqmJ+j5Qdcm6+WcOHS63tqoF9Y2udqjJ1XDJ9eZpAR 7VEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Kn4jIAJq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z63-20020a254c42000000b00d9a4cbda9bfsi643568yba.173.2023.10.26.15.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 15:56:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Kn4jIAJq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 22AE082972FA; Thu, 26 Oct 2023 15:56:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231129AbjJZW4d (ORCPT + 99 others); Thu, 26 Oct 2023 18:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232276AbjJZW4c (ORCPT ); Thu, 26 Oct 2023 18:56:32 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59C4C19A7; Thu, 26 Oct 2023 15:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698360970; x=1729896970; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Mc7kQfl3lsKa9cHbrKVWe9ASJRPZQ1HJXSWoLjPrDt8=; b=Kn4jIAJqvvYG4SeRZ0rBiZKCdLMntuHabAXm3Xltp5gHhHTrSFqL/pr4 rtP9zqEXb43ntwFqPWnYnv3JWf+gKkFsANW1iWgK8nxqzpH30jftdDHdB P+QkTINaYnQWe1GRcQ76GOJIetdHqVwFsMApCqdpKZsS/aebWrD5h5Qvp 9N8TelZvwJw0XYifG8E1B7LRBDwZyTv3DEtrsPtXvkaWwsFo/Q81hkOs+ Txry+60R36VkoOcDmHv8sEtHqCzxkTign90vfFJyzzKddZjhI/lT+mQ7a 3Yy+4rentjSqPet6NnQgCe/0X1EijNJRykU5ICE2KafkQon+HjjgVVz0M g==; X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="367012866" X-IronPort-AV: E=Sophos;i="6.03,254,1694761200"; d="scan'208";a="367012866" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 15:56:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="752917106" X-IronPort-AV: E=Sophos;i="6.03,254,1694761200"; d="scan'208";a="752917106" Received: from b4969161e530.jf.intel.com ([10.165.56.46]) by orsmga007.jf.intel.com with ESMTP; 26 Oct 2023 15:56:09 -0700 From: Haitao Huang To: tip-bot2@linutronix.de Cc: #@tip-bot2.tec.linutronix.de, haitao.huang@linux.intel.com, linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, mingo@kernel.org, stable@vger.kernel.org, v6.0+@tip-bot2.tec.linutronix.de, x86@kernel.org Subject: [PATCH] Revert "x86/sgx: Return VM_FAULT_SIGBUS instead of VM_FAULT_OOM for EPC exhaustion" Date: Thu, 26 Oct 2023 15:55:28 -0700 Message-Id: <20231026225528.5738-1-haitao.huang@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <169778941056.3135.14169781154210769341.tip-bot2@tip-bot2> References: <169778941056.3135.14169781154210769341.tip-bot2@tip-bot2> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 26 Oct 2023 15:56:54 -0700 (PDT) This reverts commit 6b7b71a70af6d75e0a9eddf4b01e4383a78b8a5e. That patch was a mistake. link: https://lore.kernel.org/all/op.2dfkbh2iwjvjmi@hhuan26-mobl.amr.corp.intel.com/ Signed-off-by: Haitao Huang --- Sorry for the trouble. Please use this to revert or drop it from the the tip/x86/urgent branch. --- arch/x86/kernel/cpu/sgx/encl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c index d13b7e4ad0f5..279148e72459 100644 --- a/arch/x86/kernel/cpu/sgx/encl.c +++ b/arch/x86/kernel/cpu/sgx/encl.c @@ -322,7 +322,7 @@ struct sgx_encl_page *sgx_encl_load_page(struct sgx_encl *encl, * ENCLS[EAUG] instruction. * * Returns: Appropriate vm_fault_t: VM_FAULT_NOPAGE when PTE was installed - * successfully, VM_FAULT_SIGBUS as error otherwise. + * successfully, VM_FAULT_SIGBUS or VM_FAULT_OOM as error otherwise. */ static vm_fault_t sgx_encl_eaug_page(struct vm_area_struct *vma, struct sgx_encl *encl, unsigned long addr) @@ -348,7 +348,7 @@ static vm_fault_t sgx_encl_eaug_page(struct vm_area_struct *vma, secinfo_flags = SGX_SECINFO_R | SGX_SECINFO_W | SGX_SECINFO_X; encl_page = sgx_encl_page_alloc(encl, addr - encl->base, secinfo_flags); if (IS_ERR(encl_page)) - return VM_FAULT_SIGBUS; + return VM_FAULT_OOM; mutex_lock(&encl->lock); -- 2.25.1