From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.56.8 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796130237; b=h1/slR9miWtwmi/+2bzaHhg+D54xaRSzDFlOhILog/SUR9cAaL4B1EtEQwgTvIBb8uWf /yxYKDZc239lXy75qMvXgL1QUOSwcjlYf5VnvGIizRe12qzWKpRiTil98IRgaMv1onWXO IX0aN//M2vmETRG3KTv44Fyzs4mdPeHbUAP0EwZ/VB7PsiI3AdU9y6hHRs3/RVfWXTl+E VfJQO25gYwU5U4HYqUf/QiPeICezQ9IQU2WtFys0eXfqd/xwH227BHuh91U3BJP0rlgbc C4mDnNPgLAduSR/iGeykF0Kjl/t+eFoQiMdOJYp9f2i50zY4Qtu6evg5bFTWt18GedQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796130237; h=DMARC-Filter:DKIM-Signature:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:Content-Type:Content-Disposition: In-Reply-To:X-ClientProxiedBy:MIME-Version:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=rNGjgJMObVR806a041nsYM+Th+zyURuy7HE3SHiJ8Og=; b=mGI5uTBEyBx9Ftf969yIeHp2ypErwhhl0NeogwBdIfWyK8drBodLcoykH08IMisvOo8s h87Zm9pyuS6mBWMFmuU+7uSVt9KDdxEnlXvEzjWMxo+iR+C4D1D6yhq7yZ9H/RoJONRHU RPE3TWeMR1rFmkPuck4C9Zm5q5FTdLDKNhAE0FlpGDWjA5O48tp0XNQJXsPYwbEtmkhpF I5QM1Qf/Ldzc0XubTbjnNVli4M9hqMX6L1iwiU41XFGG1nISGJHUMAlCSy/6fg9NCLF+7 Y5PpoTV3iWcA6o8M9JNOEehCfya8/BnOt7wov/Ch/6QHAudR+1SnnYxD5EeRYHBUOTg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b="aVZ2h/Py"; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.56.8 Received: from BN1PR04CU002.outbound.protection.outlook.com (mail-eastus2azon11010008.outbound.protection.outlook.com [52.101.56.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E81B606A325; Tue, 1 Dec 2026 13:03:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0E81B606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=aVZ2h/Py ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Sd6/DWP141/DnL2j9UIijBImj/QPfm+JtTE7c24b9hG+C/e00bA87FoJmN7BGBnc2AFAIk7HRhYJVzszTd+5uQZlo/lQwjgn7/7k3Mh3rQkpktZdNQ2p41ZcEax27e56EQK9c8vnkTK11Z7EzGdk61p/I34+mBet1PNvUrTZ1phi3s+a4K6Pvhhzaa4ESLBpjpTzDUZY/WHogCFqDwSFOQ4eorRe4/RPnnMiG7UosSGwOHa7ccoGY1poISHfonAptIyNubb9V6tOvkAKduiyopQejzL8Xrx7KQjH7MWsneTPpQ92TAhr7sG9ijVrCE/rZPP5K5e03Sw1h6yD5ZapwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rNGjgJMObVR806a041nsYM+Th+zyURuy7HE3SHiJ8Og=; b=vdRws5n7hoiW6ykPH2R5CDQAAYmkeq1py2IJP5pbv2J+LdjqeeGePZV38HegPj2dARrL+klvqBBSDy9280jFKhvEmZs4cLtS0n95MeF2WIvW93HWBxIfqthP+S0F75Jf51QquHwuTLtEIi3rv/ALWJ/2beKRATBG693bogEglcJx1g4bSHglK5U1eLos6ZUeCpm5vzvrHvdYz2iCos+3Vd0iyMcO3KYJhSt/LodOd0Gcqjr6OAc2sRZE/e7zKajl0ppDqfs4ddJfutxAgfG2C+PGiF/01xvifpq0KfEBZq2PknBN+9kFSrS+TJJTEbJ5EEr6xOBrjybN+jXAUYEoiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rNGjgJMObVR806a041nsYM+Th+zyURuy7HE3SHiJ8Og=; b=aVZ2h/PyHO6VE63NS1D2vC5q/++9mscFiY/Dq6ZJ7gckzu6ZejgkIs6/X7RaUtJLLH4ctbWbyomNR+7VKEsAEp8Sk0YaxvpD5UcI9vDlIj4QWWsiIBSDdgbolTn/A0EAEGmRGfd5FDF126/9GbmsLghuxPFl1n3yU4gGg3ObEdBEbN+k710IcTQIuN3C/eqiyiCBtlgp84h26V7btaqqvMNwR2KtyfcBC3xAcVP5RblMh+7igz0PDyzBBNbQW1EnIg9YHkEzOkagDmpWRBbDYRGZNBdcwkWYgwSBmjRRX0RT8UfHYIax4ICSmHZRVKCBcyeB/RgXxcmJ7RP+fWNXfQ== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CHBPR12MB731189.namprd12.prod.outlook.com (2603:10b6:610:33d::12) by PH7PR12MB6980.namprd12.prod.outlook.com (2603:10b6:510:1ba::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Tue, 1 Dec 2026 13:03:50 +0000 Received: from CHBPR12MB731189.namprd12.prod.outlook.com ([fe80::b0e5:123d:fe06:e10d]) by CHBPR12MB731189.namprd12.prod.outlook.com ([fe80::b0e5:123d:fe06:e10d%6]) with mapi id 15.21.0662.012; Tue, 1 Dec 2026 13:03:50 +0000 Date: Tue, 1 Dec 2026 09:03:48 -0400 From: Jason Gunthorpe To: "Aneesh Kumar K.V" Cc: Alexey Kardashevskiy , Borislav Petkov , Jonathan Corbet , Dave Hansen , "H. Peter Anvin" , Kiryl Shutsemau , kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Lukas Wunner , Ingo Molnar , Randy Dunlap , Rick Edgecombe , Shuah Khan , Shuah Khan , Thomas Gleixner , x86@kernel.org, Jiri Pirko , patches@lists.linux.dev, Yeoreum Yun Subject: Re: [PATCH tsm 2/4] attestation: Move the ARM Realm Token tsm_report driver Message-ID: <20261201130348.GD114472@nvidia.com> References: <2-v1-56c8df81fd64+16c-att_start_jgg@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: YT4PR01CA0321.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10a::15) To CHBPR12MB731189.namprd12.prod.outlook.com (2603:10b6:610:33d::12) X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CHBPR12MB731189:EE_|PH7PR12MB6980:EE_ X-MS-Office365-Filtering-Correlation-Id: ed2d41f5-7f65-412b-5bfd-08df4fab8ac2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016|23010399003|11063799006|4143699003|6133799003|261009223027099003|18002099003|22082099003|261022075727099003|10067099003|56012099006|261022105027099003|261028144727099003|261026121527099003|261026140227099003|261022113327099003|261102123227099003|261021135927099003|261021121427099003|261021123027099003; X-Microsoft-Antispam-Message-Info: XH4DkU6wVYOZuJd+oDyAwBCBieIHOQa6hdRrwbq+Rs6xmY3d5bFBcTmjxcGDxB97ZlQGLWHnycXbNzrYFJxrX5ap2r6aDi1tMBDwNok/sfxfPLnb0sywATXLA7OpW+Yh2WV4wozwk8z0YoPV8nc8TVD9Kuxk/CZTdIPm0NJjX5BD7oIWOs/0VknL+AeDIak1aTr07Q2jjWdh8dM7caeB9erz+5NddJhZXdEWK31mLuGxMLrgWnipO4KK5yT6qaxxgMmt3F5aARyIu2wBK2gtncMReFRaUADvKrTzzwEo3Oi4AktyO8i4zmCCYXdLWpCBb/LvyQ3L4QZDHuH8jrMtTmRHxHm/etwQAbsR6txGoe4kFr3zVMU5+xPqPCKc/PzvkUSqFcyCbRqcJANOrsw89FmIoZc9j63Cu3o/JgnELv9J5/TdtmCzBpMXEcmcLoJFYrKmBkU0PyMmAy1L3H7pLweTCCH/6/XAI2Nx9TDEXzBsYSO311/aTo6/KlkMH2nHwmUI8pVX9AC+RqjpLvbZsF7epB5BrAYg346kMIJAun0MK30EY+HPxONZmcXt1c6e2AUPQcnhXmqCvOStfl7nL0D3bSl9VVAXHvUyeXHqektQutZb12f9RozUYwvnKtYlQ+WEYiexOjw7FKmo64rljSmQpGpBU4LWpuyCENpMJTI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CHBPR12MB731189.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(366016)(23010399003)(11063799006)(4143699003)(6133799003)(261009223027099003)(18002099003)(22082099003)(261022075727099003)(10067099003)(56012099006)(261022105027099003)(261028144727099003)(261026121527099003)(261026140227099003)(261022113327099003)(261102123227099003)(261021135927099003)(261021121427099003)(261021123027099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?rF+SYd1G03GMF/5coIhdnzOEsR0FZ7SBx12r9HFp/o7aI89uM3SWpj92R+Jk?= =?us-ascii?Q?TZaHE8GyyGFMsro7Ula6VyGsKXUmE1DxAU9OCa+f/8wu1WQqUhCPY3Iir521?= =?us-ascii?Q?/pbFcmNCAZoE2GHE9pyy/XiDLanYv2HCweX3gyFBK2GcNTk2oG5Kk/+ZuI/Q?= =?us-ascii?Q?K14gaKx/J33isuba+1aPTCmmxsJooHYtdIzeyxAiWQ+WEKHH8XGA9eoDJBdp?= =?us-ascii?Q?jHIa2KDzTkDJKotuId+ofs7xzr56Z4PLzkv0V4X/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f227M8VUUgo6XtTQqRz5WzJtC+OgwQug+yF7bR0iVYEHXeUtF1GOCMQ?= =?us-ascii?Q?3Qi2JxEUCw11rbL3wVR0vIlKa4XAgEJy2FBvpbOYSCar6giBJ23+IX5o75He?= =?us-ascii?Q?9TDe+9HKjfQUZ+IzGMNp2fZfApz17ANSQZTbMXeoOYiGqSsz3GVtNkNX8s3o?= =?us-ascii?Q?zXcJrpeO4oAUqnq6Kj6pDI7UBviXWnUSLeb4S4grr+tbRqesqABSrNXNdNL6?= =?us-ascii?Q?th4QhoUS2V+aNUHo+3lyELEI1Zxe5/JbBT9xmpRPn2rue/uLSQp5Prwfd4lU?= =?us-ascii?Q?o2aZV8/HLooI4Qc74jp7eEnnhWXrost0FwqmAx6mQzF3i98+XBCAZTTaxqpa?= =?us-ascii?Q?JTTkEuRbBBp82KDMzzDvqYri+Y0XpDN0JxtIEaEQNj/DSjwzgiM7GZL7fWZs?= =?us-ascii?Q?yYHEz+EEv6GEv6fnoICdXX75YFHnBWqUGqXV2QluyMgK9zhNrJU1X1a+ZcD8?= =?us-ascii?Q?aN3230mERs2qOX7YQznr9+bjDfZ3Muhf1zDvdHOU44MGbfU25z+85ctZ/j6f?= =?us-ascii?Q?ED/f78WHzX20i13OeOtU7SIGXIaqYDnMUn6pxePL8VyfeypTUOyX31+i/9OO?= =?us-ascii?Q?rfa7hQrBpw=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed2d41f5-7f65-412b-5bfd-08df4fab8ac2 X-MS-Exchange-CrossTenant-AuthSource: CHBPR12MB731189.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 13:03:49.8329 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xA/8Fsf4oixDLX3OBwp/mQI3cq6mG1ROf7okPoegtW4Dwddifsa0SjmFZUvzzQ9Y X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6980 On Tue, Dec 01, 2026 at 10:55:02AM +0530, Aneesh Kumar K.V wrote: > Jason Gunthorpe writes: > > > drivers/virt/coco/arm-cca-guest/main.c is a bit broadly named, but it is > > the driver for the Root of Trust inside the RMM, which the guest accesses > > only through RSI calls. > > > > This is commonly called the "Realm Token". It also has 4 measurement > > registers, but there is no driver for them in Linux yet. > > > > Move it into drivers/attestation/arm/cca-guest.c. > > > > The simple rename takes the arm_smccc_driver for SMC_RSI_ABI_VERSION along > > with it. This isn't going to work long term, but Yeoreum has some good > > ideas on how to split multi-function SMCCC interfaces into > > subsystem-specific drivers that will solve this. > > > > [ ... 150 lines skipped ... ] > > That creates quite a bit of confusion around the guest driver. The CoCo > driver, arm-cca-guest.ko, will gain many additional features. Not really, it prevent confusions by splitting things up by functionality. This file today is 100% the realm token driver. It would make things worse to cram a bunch of other unrelated stuff into it later on and then try to split out again. Lets start with things in the right place before we add more stuff. > The model I have been working towards is for arm-cca-guest.ko to be > the driver for the arm-rsi device and, depending on the relevant > conditions, register with different subsystems. For example, it > registers an attestation device by calling: > > attestation_cca_guest_register(dsc->realm_dev, dsc->binding, tsm); That call is the job of the tsm driver, and we still need to figure out where that all lives. A tsm driver for bare metal living in drivers/virt/coco is pretty nonsensical too. As is AMD putting their tsm driver in drivers/crypto :\ TSM has the same issue, I don't want to see drivers strewn all over the place. I'm strongly thinking that drivers/firwmare/tsm/ is probably the right thing to do there too. > attestation_cca_guest_register() will be provided by > attestation-cca-guest.ko, with the implementation in > drivers/attestation/arm/cca/da-guest.c. Sure, that makes sense, and this patch is just the realm token version of the same idea. > IMHO, drivers/virt/coco should remain the location of the CoCo driver, > which should manage the arm-rsi device. We don't need a "rsi device" for the realm token, we just need to autoprobe the module somehow. > Once tsm_report is moved to the attestation framework, the cca-guest > attestation driver would similarly provide the corresponding > registration functions. That doesn't seem as nice - I prefer Yeoreum's enhancement to the smcc bus.. But which ever direction things go the report/attestation code wants to live here where I moved it and all this code belongs there. We will figure out the driver binding to deal with the 'multi function smccc' in one way or another so we can have proper drivers housed in their proper subsystems. The FIRME stuff has the same issue it wants an attestation driver and a TSM driver, which is why I liked the smcc bus enhancement. It is nice and reusable for each. You can just fork off the two drivers naturally and then have some shared 'arm_rsi' or 'arm_firme' helper library under drivers/firmware/arm as necessary. Jason