Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1357759lqa; Mon, 29 Apr 2024 06:31:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcqL2Wkd7wUABUibypek8R8zD4fdjSlMPICcSNc0/ruUyM19A4iO/5x5+fpq+ECcm0GEpkVyo0B3Vgo8lAAnKyJbm9AWOWrtyqeAnQqA== X-Google-Smtp-Source: AGHT+IGhxkW94DQdd84wqRtF9CYgSpzSwYmWUnWMoT0Fd61+cEGE+DgKWD1MUucZgokDIwD6t++v X-Received: by 2002:a50:d747:0:b0:570:21b6:660 with SMTP id i7-20020a50d747000000b0057021b60660mr7155606edj.3.1714397518227; Mon, 29 Apr 2024 06:31:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714397518; cv=pass; d=google.com; s=arc-20160816; b=udAwi0DxQsZ1Y+tq9bNyFrt6RRVCMUGX0CQBRV+w4/34vKLSDws3B41iTpIY6WSVMv GXDSSGWuIBK4UMnLGf2nFzauBDXYgnMzQ6P+XVghB0wVCa9kJbxgcJEWOjkXvDzntYSH 0dAoiJSuuiACpzXhkGVth/4bfpU7uStB4SpzoYfQNONAKDg39vGfG/5jHFP8avRKvk0d kyTB/Sy2V/+ugei42zBWqviMb/GYR7BzcimscAMnZJI8wdmEkNKzaO2fzhc3OLY/wx7Z HlcfCs/9tuT/b44FMgqW/Ah6IDZZRGHxhioYjwEZGsZZDX98xc8nUjm5NTTCzOvFS0km 9KRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=Jrk+wtx13fSoXMFUAd70bsbYcdKXycBdeKJThU5avMo=; fh=vK/LsacQu4awtGTknndUOKCWK0ktsy/FiEliIVGZcD0=; b=JUrLN0G9G7+F2f5+Yzn3jowRLPjJ++RLBY1ha/lPSc+pdyrFh9DJ146nNYxNfVUQVk gGPfiaiRZBHfpAYHAl9UkGfIJolLyu78jy8tNB9EawlzVFya6VbJCEfgKVJikD65BdOF YdguSbAf9bSQfVUTe1kbnl1DZ1OhNEw78XPBDDPgCNS3XWiVr4HxLSZB4wed9++YDgLj p3anefyeMkCmAlwSMmHO5Rnj5O1+WfYGyHVYLZKvZB/JF2XCqVlrhVxZNpNsiRl60ogy 7pAHOIMjkmWR5lVnNi2i+axPhPKTGdxmKSEWKCgt+DAuPakyuRDjWHP45/VDDlsn1LfY Cw1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GLq0VWnS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162356-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162356-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id r9-20020aa7d589000000b005723084d953si6684445edq.236.2024.04.29.06.31.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 06:31:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162356-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GLq0VWnS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162356-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162356-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8B91A1F249DC for ; Mon, 29 Apr 2024 13:23:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E3026E5EF; Mon, 29 Apr 2024 13:23:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GLq0VWnS" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBD7B54FAB; Mon, 29 Apr 2024 13:23:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714396982; cv=none; b=mLTkv+LC6ueBvxPaSF3Zeb5S5XURQqqr/R0vyiwwaG1iz9IoYj/bpu+GFnnXfih1nppe88Hg7spiHS/8UwenT+lCUPI6wvc+IAjSgWV9QkKWVQdkcCqwSHiJgGYF4lGu7qeWXhFTTtkBnMlSAXu+7VLC8leUXAB8iKAWxNYMTJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714396982; c=relaxed/simple; bh=Jrk+wtx13fSoXMFUAd70bsbYcdKXycBdeKJThU5avMo=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=gIn59IpRQkNnV59uNNb20b6Z0SP80LqYmGV1Wujfnw1PNziIZfTeAZICdpzYKxU9Lt+aH/+PeghUuSSzzriBj+HPSdSFeXq1HnE9XyUUANPChTVgp8FMWRZ64yn/D4DH3Hm1ga3X5iv2eFpiatM9Ig9E1iSRdRvVLWpELvvt73U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GLq0VWnS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04AFBC113CD; Mon, 29 Apr 2024 13:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714396982; bh=Jrk+wtx13fSoXMFUAd70bsbYcdKXycBdeKJThU5avMo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GLq0VWnSO5LH4s4zHkRjAC9C+k+Saa8Wp2ttSiE5+Jf1EjSvSBAoTOCITFozNpSGJ tEj56FoTZMl5NgyCm/YNSDvZNt7PUXOKM4/FYoeisGnlODrgx8vpKKXyCka1xor3gV F83DH+vdu6UutG9lWDdn3YXtiTH09NNjBEXjDB4qel1jBLMKrhi3hu+CT8ovhH45ce mRQ+LBgggU7IDMRy0AeUK9qKw1XfQ5GXHywNrk0sm5GaMH1Y195Kao/C7ff4yOfCF/ tN6zGBI3pVVgYhffrDhhSoooiCCtJ2YS1HasRAY9xx0yLT+kA8sADHhKmEeR/7U1go UsKSl5MKjVZBg== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 29 Apr 2024 16:22:58 +0300 Message-Id: From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , "Dmitrii Kuvaiskii" , , , , , , Cc: , , , =?utf-8?q?Marcelina_Ko=C5=9Bcielnicka?= Subject: Re: [PATCH 1/2] x86/sgx: Resolve EAUG race where losing thread returns SIGBUS X-Mailer: aerc 0.17.0 References: <20240429104330.3636113-1-dmitrii.kuvaiskii@intel.com> <20240429104330.3636113-2-dmitrii.kuvaiskii@intel.com> In-Reply-To: On Mon Apr 29, 2024 at 4:04 PM EEST, Jarkko Sakkinen wrote: > > Fix these two bugs (1) by returning VM_FAULT_NOPAGE to the generic Linu= x > > fault handler so that no signal is sent to userspace, and (2) by > > replacing sgx_encl_free_epc_page() with sgx_free_epc_page() so that no > > EREMOVE is performed. > > What is the collateral damage caused by ENCLS[EREMOVE]? Have you measured cost of eremove on an empty page? I tried to lookup for a thread from lore because I have a faint memory that it was concluded that its cost irrelevant. Please correct if I'm wrong. BR, Jarkko