From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D445606A336 for ; Sun, 29 Nov 2026 18:22:06 +0000 (UTC) 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=dAsaxBrl Received: by kanga.kvack.org (Postfix) id 6EA6E6B05B0; Sun, 29 Nov 2026 13:22:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 69B546B05B1; Sun, 29 Nov 2026 13:22:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B24B6B05B2; Sun, 29 Nov 2026 13:22:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2D3006B05B0 for ; Sun, 29 Nov 2026 13:22:05 -0500 (EST) Received: from smtpin04.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A4D52808CC for ; Sun, 29 Nov 2026 18:22:04 +0000 (UTC) X-FDA: 85488975768.04.29037C3 Received: from pdx-out-001.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-001.esa.us-west-2.outbound.mail-perimeter.amazon.com [44.245.243.92]) by imf11.hostedemail.com (Postfix) with ESMTP id 783C240002 for ; Sun, 29 Nov 2026 18:22:02 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=amazon.com header.s=amazoncorp2 header.b=dAsaxBrl; dmarc=pass (policy=quarantine) header.from=amazon.com; spf=pass (imf11.hostedemail.com: domain of "prvs=786c6b92e=graf@amazon.de" designates 44.245.243.92 as permitted sender) smtp.mailfrom="prvs=786c6b92e=graf@amazon.de" ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1795976522; b=d9XFLmnZDhzSHrZ99IdPwhOGzoYD40yBrFleUlJBn8BcaU6qp/zX0FofDTZUTH6xzgGaVS 6MV3tJShuYpY2/esiugL1eQIvSmNxOwCOROH22xLV1PxxqbqqwZuNp334XSbp4xbfkfP+y DPphcsz4I0TFqaDgu+OQUjCjOxeirJ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1795976522; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=kbEjYixzTXEub2Id/OKzRek/8TgM6wMfGduGuOyX7fc=; b=JAUIEipKYEJIykGU8q6l6Nyj0oQgxJg9cxLdMclXIxXccAqMzP6hvoB2BID0K0C4rEyfI2 5yAqCwB9XymsT808itWePJy97/bMnaV+zpSOx08aOfKJ47rAhJ4YrP6lUrxGp0Y98SbQ9r OA87M3j4pkyWdzd11qGaJj5gDZeXpjw= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=amazon.com header.s=amazoncorp2 header.b=dAsaxBrl; dmarc=pass (policy=quarantine) header.from=amazon.com; spf=pass (imf11.hostedemail.com: domain of "prvs=786c6b92e=graf@amazon.de" designates 44.245.243.92 as permitted sender) smtp.mailfrom="prvs=786c6b92e=graf@amazon.de" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1795976522; x=1827512522; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=kbEjYixzTXEub2Id/OKzRek/8TgM6wMfGduGuOyX7fc=; b=dAsaxBrlrP+yxBWWMd7hzuDlesI1DNxSSRs0lrT4u2qQVDNqOZJYwxbe CTYk0bcVJnd3ckGMo7gGLr/51owbi/w056szzOkjZjtxwFSEavoK5dxog HA3QVVarLvWaq9ojAUtsbkUo0wdR8VBjuCZfhRbMFtCZANKIQCuyRluHr VvRYyHe7ImFpxkN55S3ksccwWQ7dd3Hucqy0ckX/Tjj7Io7379Q4pkqVt fUIJ6MrXbxP7DjvN0IvGj0z5m+TYKAaSnCYx8o+T4esFauhDKT5/MM0jm 69x7vdRA16nV+CURo7Ym+VRH864cZCK9xbd1dbNV0jqAgDK+6FTP4Hbgx g==; X-CSE-ConnectionGUID: v7qtM1bxQUu1TzCCpnj8Ug== X-CSE-MsgGUID: eUS3GPehRMWZshH/2I9CQA== X-IronPort-AV: E=Sophos;i="6.27,241,1787011200"; d="scan'208";a="34939675" Received: from ip-10-5-9-48.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.9.48]) by internal-pdx-out-001.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2026 18:21:58 +0000 Received: from EX19MTAUWA002.ant.amazon.com [205.251.233.178:26171] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.6.41:2525] with esmtp (Farcaster) id cb552a80-6dde-4001-9113-7868ab2b96f4; Sun, 29 Nov 2026 18:21:58 +0000 (UTC) X-Farcaster-Flow-ID: cb552a80-6dde-4001-9113-7868ab2b96f4 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) 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:21:58 +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:21:54 +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 00/23] nitro_enclaves: Fix enclave release, command retries and the CPU pool Date: Sun, 29 Nov 2026 18:21:29 +0000 Message-ID: X-Mailer: git-send-email 2.47.1 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EX19D031UWA003.ant.amazon.com (10.13.139.47) To EX19D001UWA001.ant.amazon.com (10.13.138.214) X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 783C240002 X-Rspam-User: X-Stat-Signature: bzg8mec7itmkru87c7tzy4tjw34jjjim X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-HE-Tag: 1795976522-845180 X-HE-Meta: U2FsdGVkX1/DinZrCaKxoPUNzcFNlbE/G5u3IEQBIqDbBhOWZfYlJFaMM9vfVFugJxRxrsYWu4a8EcSWj2D4jItjim6rHhs4w3/zqk4TiNuHR3cPE7LPwT7Clcbo33waRVSbz4t8CRY3Yfszn1u9GYbdEtqmTvkMX9gy5b8Exk2KaVErmQS3VSEWNtvqMKmA6V7hAVsIBTjIqkLSNHD8q7mdBBY7qeiMiMowDzWWFnW2YhbdcQ4ML6/VIXYeWHdaAPXjMSwtcxEUViPZ0IxUe6zcKTqJLCMlWrvBE8uMFAZWJytfUNv+3JfeEdHk/fkVjD9eE6PY5ISxN16KtM11w20kScLdNaPM19AxkV5lNSJlMJcg6Ee9bnP6AMYq32aLxU64stYBHkax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LhEs9LCF/xbamyDPalsFy7orU4HuqLjLj3ItuHPu01jssYcoZLp/aV15w3a05CSGtP0XzeU4lsu/yW9MMBvu2RgYkFWqRkFkGfAokBaxQIfOww6V5/VYUcaJX7+kHnT6ikLwmpuKR11imkFMv4vcpwWh9QAb990whh2Oj+kbzIPU6sHAvFiTtR+hscsj0XS6iVFbPHPle4JmmPVODseubr84y5pvaSgwTxjQzX0OIgRpFTeu2zVlOWknXjeqrJ1XP//waXkXAxYhG+fd8fdp70NnyCg/lZRRvtn71wY52rSI3FNA01ofbKiIcz+yKZaokTF+HSy65HHTavHJga8kx1pHKPxqpbr6zLI+vTs+5BYDRFDsuKCO8Vm3gie1igmQUcO22/gAIrkT26kjE7StoEf4pj9UjifU4Np08azUV/weiWy28ATo5B1EHVmVGUVGP5GbLkTrJoPb1VTNWRtCednGybZDhiuZk7l5kNOcOo= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 While working with AI on the nitro_enclaves driver, it stumbled over a few issues in the code. None of them are out of the ordinary, but they all fix legit corner cases that are better to have fixed upstream. While at it, I also realized that the MAINTAINERS file is outdated. Alexandru Ciobotaru no longer works on Nitro Enclaves. I'm taking over the maintainer role instead. Alex Changes in v2: - Rebase onto v7.4-rc4+ - Move the MAINTAINERS update to the front - New patch "nitro_enclaves: Request write access to enclave memory regions" to require write permission when pinning an enclave's memory - New patch "nitro_enclaves: Online and offline pool CPUs with no pool lock held" so that no driver lock is held across CPU hotplug (Sashiko) - New patch "nitro_enclaves: Free the CPU pool when driver registration fails" so that a failed module init does not leave the pool CPUs offline (Sashiko) - New patch "nitro_enclaves: Free the CPU pool that ne_exit() does not see" for a module load that fails or an rmmod that races a ne_cpus write - Add the Fixes: tag on the interrupt setup reorder (Sashiko) - Clear a rejected boot-time ne_cpus value (Sashiko) - Refuse a CPU list that does not fit the parameter buffer v1: https://lore.kernel.org/r/cover.1794300000.git.graf@amazon.com Alexander Graf (23): MAINTAINERS: Take over the Nitro Enclaves driver nitro_enclaves: Release the reference on a rejected region page nitro_enclaves: Request write access to enclave memory regions nitro_enclaves: Split freeing the slot from freeing the enclave nitro_enclaves: Ignore the reply of a failed slot info command nitro_enclaves: Retry a command the device asks us to retry nitro_enclaves: Stop sending commands to a broken device nitro_enclaves: Set up the device state before requesting its interrupts nitro_enclaves: Online and offline pool CPUs with no pool lock held nitro_enclaves: Wait for file operations before unbinding the PCI device nitro_enclaves: Let the region tracking arrays fall back to vmalloc nitro_enclaves: Do not return enclave threads to a replaced CPU pool nitro_enclaves: Do not report a torn down CPU pool as set nitro_enclaves: Keep the CPU pool when the new CPU list does not parse nitro_enclaves: Put the CPU pool back when the new CPU list is refused nitro_enclaves: Initialise the CPU pool mutex statically nitro_enclaves: Free the CPU pool when driver registration fails nitro_enclaves: Free the CPU pool that ne_exit() does not see nitro_enclaves: Build the boot-time CPU pool once the CPUs are online nitro_enclaves: Set up the CPU pool under the CPU hotplug read lock nitro_enclaves: Let 32-bit processes use the ioctl interface nitro_enclaves: Index CPU pool cores by sibling mask nitro_enclaves: Time the wait for the device to turn off by the clock MAINTAINERS | 2 +- drivers/virt/nitro_enclaves/ne_misc_dev.c | 804 ++++++++++++++++------ drivers/virt/nitro_enclaves/ne_misc_dev.h | 24 +- drivers/virt/nitro_enclaves/ne_pci_dev.c | 236 ++++++- drivers/virt/nitro_enclaves/ne_pci_dev.h | 4 + 5 files changed, 814 insertions(+), 256 deletions(-) base-commit: 4f069ab1ec243e6b60dc438772905855c60774e8 -- 2.47.1