From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=52.12.53.23 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795976975; b=gVALTFk5kryVzx6Q0ppqiYw3SYZE8KCynq3W6AyPBfTpLBe4CY5vUf7jVXVRDk+CiRFn f3PN7gm2zYnY5hbc7HTgJVF3TxX8p+moCvhsAOEHG90ALcQwiDugrEFkXtZFTNU4d86q2 gbwpumZu5PlBW9lvi6hABBUxJ6AmcitadVJ155VWyB5H2EIj4ewadDRdJpyQ9uyKGmb5S XCe3V0DYJuI/6lJsHVY1B/fzD3ZeohAibbi7YHhLvqcLDNBWDvPbq8llKFDymU+YAJkkR iVsKhTyHYk1AV+ALnze8RHni0ByVvzmfE8i09B0Xw45BMCdEP8YR6n3qhbOPwbYIdVg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795976975; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:Received:Received:X-Farcaster-Flow-ID:Received:Received: From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type:X-Originating-IP: X-ClientProxiedBy; bh=BqBXCS+4/Sub+/LLactHaOuj97TQJ/V2INE3dwASimg=; b=exIUZpDk8ZNHf+CRMhSbrx0AUGm1o33GsXssu+t+YNpAbvRmIzLmsFKITikPXxl0x499 UxS80dHcqe95fSgonhk69UcUFkKQmNlXHQpLzu3ddHq1juCQ0sKdqeoG0WNUvDAtOOEMW owPcoC9N6+Aj1YfPlBmdSwAtIszfZ2SDEcxJATrz06e7rXap59/RbaKHGPGolVZRRmhNZ VeY3fQW8AofzCFoDeu5s3jsRvWvG/k9CYv7Qr7quP1SqDmuhIJLlOxxCawSM6KwAROTZ8 YnnhgH41zh/utjV/W60mob+3BR+VUuyV+1ESqZqvRKeG303iNWXwhOn+vIeccMyymFQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=amazon.com; spf=pass smtp.mailfrom=amazon.de; dkim=pass header.d=amazon.com header.i=@amazon.com header.a=rsa-sha256 header.s=amazoncorp2 header.b=sd0cvI1p; arc=none smtp.remote-ip=52.12.53.23 Received: from pdx-out-010.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-010.esa.us-west-2.outbound.mail-perimeter.amazon.com [52.12.53.23]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D87A0606A323; Sun, 29 Nov 2026 18:29:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D87A0606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.a=rsa-sha256 header.s=amazoncorp2 header.b=sd0cvI1p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1795976974; x=1827512974; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BqBXCS+4/Sub+/LLactHaOuj97TQJ/V2INE3dwASimg=; b=sd0cvI1ppMH126qTvQ2JDm8oqf6b0k7qQl8kEMXGcRpGMKqkz/n1sZkg kidOjA9rLdFIebPyLWkFLPz9qhPZpiN61RYE5ONlL2qrqTqKKeBnWvDsW 4eHe2YvhKzts91sxQtmZw1JZUpiCXWY/cqJj8rTy6/3geau97w0DdkLbw Qqg+iP6ARFGF9lpHQkLUHKywCr34tfPN6wxdWxYuUouWadtjKfUxRRlQj iTsgvPQ6js90GO50VXQtaejFUpPmzxNbL7gtyvbPOliBH04IRPQTuBXh+ 5YZaOo1RIAU977FrJ5uI1FrcxMih7K3QcFcVY/KHDliuNYABDZeaZr15t A==; X-CSE-ConnectionGUID: ltDQBTTzQyqpi5WG4+hDyg== X-CSE-MsgGUID: o7aVFZ35QwOcTcMG9sPMMw== X-IronPort-AV: E=Sophos;i="6.27,241,1787011200"; d="scan'208";a="35242802" Received: from ip-10-5-0-115.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.0.115]) by internal-pdx-out-010.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2026 18:29:34 +0000 Received: from EX19MTAUWC002.ant.amazon.com [205.251.233.111:4045] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.30.201:2525] with esmtp (Farcaster) id c0cd401e-9a97-4154-b627-f067708d88ae; Sun, 29 Nov 2026 18:29:34 +0000 (UTC) X-Farcaster-Flow-ID: c0cd401e-9a97-4154-b627-f067708d88ae Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWC002.ant.amazon.com (10.250.64.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.57; Sun, 29 Nov 2026 18:29:33 +0000 Received: from ip-10-253-83-51.amazon.com (172.19.99.218) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.57; Sun, 29 Nov 2026 18:29:30 +0000 From: Alexander Graf To: Greg Kroah-Hartman , Arnd Bergmann CC: The AWS Nitro Enclaves Team , , Paolo Bonzini , "Stefano Garzarella" , Stefan Hajnoczi , Marek Szyprowski , Robin Murphy , Andrew Morton , "David Hildenbrand" , Mike Rapoport , "Jonathan Corbet" , Shuah Khan , "Randy Dunlap" , , , , , , , , , Subject: [PATCH v2 13/23] nitro_enclaves: Do not report a torn down CPU pool as set Date: Sun, 29 Nov 2026 18:21:42 +0000 Message-ID: <73de223a4835808b81d9f05519f38bd87fcc428a.1795965038.git.graf@amazon.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EX19D031UWC001.ant.amazon.com (10.13.139.241) To EX19D001UWA001.ant.amazon.com (10.13.138.214) An admin who writes a CPU list to ne_cpus can be told that the write succeeded while the driver is left with no CPU pool: remove_cpu() returns 1 for a CPU that went offline after the list was checked, and ne_set_kernel_param() only tests for a negative value. Return -EINVAL, as for a list that names an offline CPU. Fixes: ff8a4d3e3a99 ("nitro_enclaves: Add logic for setting an enclave vCPU") Signed-off-by: Alexander Graf --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves/ne_misc_dev.c index 38fbc09cf6076..6db8cf5c80257 100644 --- a/drivers/virt/nitro_enclaves/ne_misc_dev.c +++ b/drivers/virt/nitro_enclaves/ne_misc_dev.c @@ -388,6 +388,9 @@ static int ne_setup_cpu_pool(const char *ne_cpu_list) pr_err("%s: CPU %d is not offlined [rc=%d]\n", ne_misc_dev.name, cpu, rc); + if (rc > 0) + rc = -EINVAL; + goto online_cpus; } } -- 2.47.1