From patchwork Thu Oct 26 22:55:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haitao Huang X-Patchwork-Id: 158699 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp220915vqb; Thu, 26 Oct 2023 15:56:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsqaHqCbgCPyN8a50DAHLAgzVPPmUoGZRa+JWP/f3Rom7EOfJPQF7H0nhAWHQA+hFeHIjZ X-Received: by 2002:a05:6830:7191:b0:6cd:9bc:b994 with SMTP id el17-20020a056830719100b006cd09bcb994mr1066552otb.1.1698361011531; Thu, 26 Oct 2023 15:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698361011; cv=none; d=google.com; s=arc-20160816; b=jVrt+KdIVVcPnyDbkRPpSsNJjKDQ617+9uKPjitXhtZq6bVU9nHuZYgKnL69Ls/DtC wgByWjvp6J/Wcdlns/+g8GCP3up9fwmJ8jv733kIrFou+83u53PRymXSn3W7w5Bm/LiO 3db+YOIPBlR8/jPhX5fljkM9lsG/IsxfKCL9fisSb17Lx3iesl3yevXmiO8SzIy3aCnq SoQoarIC6aNKIrPrKO0RCZXds5TZikB7Tku4t5jD60kHngtU5x9VEnyy5aY/VGzdZuRv sh48xwBuL76LsMIdSYygr8dXuDMamru1y+j0i+1mQWFbr8IpcXyRQiJfsTZws5lAegTe UoRA== 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 Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id w3-20020a0ded03000000b005a2248bbdd9si452998ywe.487.2023.10.26.15.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 15:56:51 -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 F0CD182972FA; Thu, 26 Oct 2023 15:56:48 -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 S234854AbjJZW4d (ORCPT + 26 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 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:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780860595702189880 X-GMAIL-MSGID: 1780860595702189880 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);