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.85.24 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796138080; b=fi9aXig+9MSTkrxvdkUeckcJPZh+35Xdh2XCq/OzD2Qh048KkhwQnoOZDl6kDHRj7Bv3 Qy8JkfnTSsrMlU5VnX+2kH5imfI6K4Dgevq+ob7z1scYzXO+3tYEGrUE4n1ReJudoQWnT hTveWA7DRF8iLs/D3HGsXt+AGwaxwR8Q7rpl4E1n4UzDf2uukCJUq71yH8OysMaN/PBrq R5AJWwE0mVtspq2lZtYYFVBDjpMeKfJTZyhHgr1f2DN6qQ2edGD7Sv/8XJzE1Anhj6Sjr /JwaT+0GfCrsjlZSLxYer9SHZmCy7zadHgR6Pp/OQKgZxRYh62a2+5cZ3fghNmaYDpQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796138080; h=DMARC-Filter:DKIM-Signature:Received:Received: Content-Transfer-Encoding:Content-Type:Date:Message-Id:To:Cc:Subject: From:References: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-MS-Exchange-AntiSpam-MessageData-1: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=PJWTy/hpDyMxCCmWJ3p3rij1HBj5N5+CoIXgRZE4i60=; b=pqmxnJiwhGiVDvwA5VCnZ49DiqLyeugv5d6MAPmE3Wa+oeQ58hv12xtRlT5+UxcGWYht I3uUzgIc/Ywgn1dB1JAU+xPMRZQuIZdp/+IPtkHQF8/RP+vNlQsDOsCLFKu29LvWPTL9+ LFpGoN4oJyMQqXvpzV4gpAIQQwtfNvOwqWkU+l0BLdwHZaiVvpcY1CadgShoCJNrkY5Rs U7AJKwDaH4H5ZltcmEmBd0nBXyxCNJCdT+dbfToJDY5WrtepitPTyjbDXZGZqfrRN9Vyb NG+mbP35EoCJuseZZ5Ik9BIiVuafLw0m+fTJQFo4TzFuysvEcwOqOqIavOnZLgOm+OQ== 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=WJW6FGOu; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.85.24 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11010024.outbound.protection.outlook.com [52.101.85.24]) (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 8E248606A325 for ; Tue, 1 Dec 2026 15:14:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8E248606A325 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=WJW6FGOu ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NIzYgdQ9NCKqflyxjmnv80UVMHbkLABt1tSkphiEh6icxlKzeStgRWdR3/vXU5nCzy+3UsenLZPF9GkULsDBdCOaXxRL9FTV2SmHWxnfwFwnN95xIsgQwTaFzmwxWyt0y64FJjUhBVPnOI1AN4A1/T1Wf93DtWCrxBqfpyaO9/f1rI7dvroLoqcmvBLIsbSSsyINMs+07/CKBKMnDYAEr76bgNSp66HNBVuLH7hJEOtEWenV/kJUj40G55bBy2KXjK9TZkmS1/3ELsEW2oqNcuCwRcdtiTVSJkYQ8qVftS1wCrW10IubAL1FQA+Vpdgk3KFZoFOqrydHNBHvZ8a5rA== 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=PJWTy/hpDyMxCCmWJ3p3rij1HBj5N5+CoIXgRZE4i60=; b=KhYI1DRcIWCCcITgr+IEX8qQA7jwte8jiVkRoPFswJuB49pNbuKXjJ8lIGs7zUGCB+P+tf931yzBTceCNG6oY0LCFrEl+VgSezHB+B7UJ1cBdbTiUyjh9UOWLiHWenjNsF13/GAFshTK7NNFy5j4Xz974UHvfxseUfOWPJJUxGZvMpfSPakzkKjY3nIdF339EpEQpmKsTvoLw5cRXRAeD5MJbOBKiTbhI51wAkIdQwNamzL19Ambayce/S/PfgnnuI+h0pa3wt8225zxJWR7SPfhFnUy/ktbWCVVSJ2A7aaVz3fLivUZrDz6Loq9SIBm6WaRl3l0bdnpaxVlEctITw== 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=PJWTy/hpDyMxCCmWJ3p3rij1HBj5N5+CoIXgRZE4i60=; b=WJW6FGOuNqjs5PeVbMIa9XC6813h2+G0PnG2eA0okqX2QOVpyhCYzU1MP3QwAhaB7kEitj7ibMmRktY8kGpmYHHUivMkN0nOuCf2REpeHa0UB3CURmLf0zeuzQ1UfHRZYL4Mc4UPU6XclQYF+Oa0BCnBWQQJcIT+Dz4vaz1CcC6DYVmBx21KQQu0A/T2e9MwZ+EQvvNmjReGneuCMzpedLwzeaZdaeVeS+JIaRs+Pb3tbG49vR41Ou711325q6Digifr13rAs09SbVk/vlBHEgXhlt1fHoR5qU1EY7pmVOFrSz1620pFh26OQUuswGlj3jzk8bHv34qGNI8z16L+gw== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MW4PR12MB6873.namprd12.prod.outlook.com (2603:10b6:303:20c::17) by DS4PR12MB9706.namprd12.prod.outlook.com (2603:10b6:8:277::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Tue, 1 Dec 2026 15:14:10 +0000 Received: from MW4PR12MB6873.namprd12.prod.outlook.com ([fe80::a338:bd2c:3a38:ece1]) by MW4PR12MB6873.namprd12.prod.outlook.com ([fe80::a338:bd2c:3a38:ece1%5]) with mapi id 15.21.0662.001; Tue, 1 Dec 2026 15:14:09 +0000 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 02 Dec 2026 00:14:07 +0900 Message-Id: To: "Eliot Courtney" Cc: "Danilo Krummrich" , "Alice Ryhl" , "David Airlie" , "Simona Vetter" , "John Hubbard" , "Alistair Popple" , "Timur Tabi" , "Zhi Wang" , , , Subject: Re: [PATCH 13/14] gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler From: "Alexandre Courbot" References: <20261130-falcon-v1-0-cb94f87b5674@nvidia.com> <20261130-falcon-v1-13-cb94f87b5674@nvidia.com> In-Reply-To: <20261130-falcon-v1-13-cb94f87b5674@nvidia.com> X-ClientProxiedBy: TYWPR01CA0022.jpnprd01.prod.outlook.com (2603:1096:400:aa::9) To MW4PR12MB6873.namprd12.prod.outlook.com (2603:10b6:303:20c::17) 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 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR12MB6873:EE_|DS4PR12MB9706:EE_ X-MS-Office365-Filtering-Correlation-Id: a17c2e00-a535-4ba7-38c6-08df4fbdbfdc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016|23010399003|10070799003|22082099003|18002099003|6133799003|261009221227099003|261009223027099003|261022075727099003|261022105027099003|261028144727099003|261026121527099003|261026140227099003|261022115727099003|261021121427099003|56012099006|4143699003|11063799006|5023799004|10067099003|261102123227099003; X-Microsoft-Antispam-Message-Info: Sjs68omhNX2IvtGe1KG8lZTDr/PjNUwR/hJ/tIDQtjNssMFpdRqxjUi4WP3ACGaQwZHlGNrIeS+PShtNOp3mkdYq3aWfFAvoQZbiDshOyCtXLaOyb7mWMh5+Mk8H9oOMlnujSEr1GL4rJ08SlXwpQvx5RW/RP+I3ITfTeK+DTEr4FY0ZS9jNvUJKsTKgnFnqkO8gew/6QJKJBv+IQRav94nCg1VcC0k/qri50bTxU9mXjoM5XBXXtuzj+WcQKpzkEUzY56eYRdQDV7yaTnRN4RJCSx8ZuhTtuRU2owx8gcLneia9EJIxN5WP0koAOnuUZRHOhNgx8y9CoYH8kKdekNoVw+DIIiW9vkasmzYmaDw2IXxBo1SHuYfZsPOyx4BlqUA4I2xU+mrlg+gpcs3ZO9S95U4Q57xSWUZEEzO2OoeandRv8D8RRoASmbksP8ILGVt4flntPpNdO0ElOpwuCtsy/mm4z8HzOQ3Rm2Oyf+A/RNJY2uwrwfheTxhb2jjLMz+X+37W0lk9/lDAt+RJilN4rplwAsg/aePKQLx8AT/26lhSiDqLwpqEt5iXhXHLP3+gNVmr49925JJ5x/KZrv0Jk0ov7L6PhwxPtGn8pKiFISN7Ra8ksCTcdoW8hbx51zuh+e0lr45uE3weNEbJY0r3WVH/saEi8l9u3M1FLcM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR12MB6873.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(23010399003)(10070799003)(22082099003)(18002099003)(6133799003)(261009221227099003)(261009223027099003)(261022075727099003)(261022105027099003)(261028144727099003)(261026121527099003)(261026140227099003)(261022115727099003)(261021121427099003)(56012099006)(4143699003)(11063799006)(5023799004)(10067099003)(261102123227099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bDM1MTUwdWxOeHZtWU5OdHYxQisxcWN1Z1VxckNsNmRWWHFlL3dGdHk3aFV4?= =?utf-8?B?UW90dGlGQjJNaThuSG1jQlBrVXhmdDI1a2JJY0cyMGduQnU4V2xTNXMrWGlt?= =?utf-8?B?UFlKdXlpaTQzRFAvZ1l3VmU5WmlMZ09vNDVWeEhYaEp0YXM1SEpUVTEzdWlW?= =?utf-8?B?TWZUdGRvMFdDSWlObzBnNTQwLys4dWFiTDNxcmMwVFY2cG1tV3dnSkFQTC95?= =?utf-8?B?TmEwYkVvRlpHNjFDZEtkVG5qQzhCUzVZNkF5eTZSS3ArTk1YVFhFWmIySXE5?= =?utf-8?B?V1VVajhWU0FHK1NsOURoK0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= =?utf-8?B?S0hpaVVjOWR4bWhaalF4cGJDUW1mZjA2R1A2MW5YV3N4dEpHOTZpT2tSUUcx?= =?utf-8?B?ejl6Z1VVc3pRN1M3RUlDSkluSmViL0Q2ZGFVLzh6YjVtQzlTRHprTmFCb0dD?= =?utf-8?B?c2ltQUZPR1dIOHg1c0FMUnZ3N0N0YU1QYnh1K2FpVTdZc3dlNVA2ZXJIdUY3?= =?utf-8?B?UjI5WmdVYlVDQTdVdHdRUTVDNGtTQ2NqNkVFYjE5cE8wZWRLT1ZhY3ZoWnVZ?= =?utf-8?Q?CE/FsUK1q7/xp8clXvt+Vb8vBLlGwWrWSI6+GXQAWwAAf?= X-MS-Exchange-AntiSpam-MessageData-1: WYvUNWlTyJB/Eg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a17c2e00-a535-4ba7-38c6-08df4fbdbfdc X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB6873.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 15:14:09.8284 (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: haJ8SgkcPGA25XvttW6COuc1mKXkXb+EFp6OZuUjwdKpaj3dNyy1yUJAGQodmuaq215E7sx077eWC3Cesj8iAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS4PR12MB9706 On Mon Nov 30, 2026 at 6:28 PM JST, Eliot Courtney wrote: <...> > @@ -172,6 +177,88 @@ fn handle_hs_binary(&self, params: &HsBinaryParams) = -> Result { > ); > }) > } > + > + /// Runs the image of a `GMCAPI_CMD_EXEC_GENERIC_BOOTLOADER` event o= n the > + /// falcon core of the GSP falcon, through the generic falcon bootlo= ader, and > + /// returns `MAILBOX0` once the image has halted. > + /// > + /// `params` holds the descriptor of the image. The generic falcon b= ootloader > + /// loads and starts the image that the descriptor names, per > + /// [`GenericBootloader::run`]. The handler: > + /// > + /// 1. Checks that the descriptor in `params` has the size of > + /// [`BootloaderDmemDescV2`], and gets the FBIF (Framebuffer Inte= rface) > + /// target that `params` selects. > + /// 2. Waits until GSP-RM has suspended the RISC-V core, for up to f= ive > + /// seconds. > + /// 3. Resets the GSP falcon, which selects the falcon core. > + /// 4. Runs `bootloader` with the descriptor and with > + /// [`FLCN_ERR_BINARY_NOT_STARTED`] in `MAILBOX0`, and waits unti= l the > + /// falcon core halts, for up to two seconds. The image halts the= falcon > + /// core when it is done, so the handler learns from the halt tha= t the > + /// image has finished. > + /// > + /// # Errors > + /// > + /// - `EINVAL` if `bootloader` is `None`, if the descriptor size in = `params` > + /// is not the size of [`BootloaderDmemDescV2`], or if the address= space and > + /// the cache attribute in `params` select no FBIF target. > + /// - `ETIMEDOUT` if GSP-RM has not suspended the RISC-V core within= five > + /// seconds, or if the falcon core has not halted within two secon= ds of > + /// its start. > + /// > + /// Errors from the reset of the GSP falcon and the run of the bootl= oader are > + /// propagated as-is. > + #[expect(dead_code)] > + fn handle_generic_bootloader( > + &self, > + bootloader: Option<&GenericBootloader>, > + params: &GenericBootloaderParams, > + ) -> Result { > + /// Expected size of the descriptor, in bytes. > + const DMEM_DESC_SIZE: u32 =3D cv!(size_of::()); > + > + let dev =3D self.dev(); > + let gsp_falcon =3D self.gsp_falcon; > + let Some(bootloader) =3D bootloader else { > + dev_err!( > + dev, > + "No generic bootloader for the load-and-execute event\n" > + ); > + return Err(EINVAL); > + }; It looked a bit sus to me that we have a function handling a generic bootloader event that can fail because there is no bootloader. And indeed this method signature cascaded into more complexity down the r000 switch (notably by introducing [1] and more churn during the switch). If GSP-RM (a trusted component) asks us to run a bootloader event, this means we are capable of running a bootloader and there is no reason to second-guess it. WDYT of the patch below? It simplifies things a bit, and these simplifications then cascade into the next patch and the r000 switch. [1] https://lore.kernel.org/all/20260918010719.1176945-26-jhubbard@nvidia.c= om/ diff --git a/drivers/gpu/nova-core/gsp/load_exec.rs b/drivers/gpu/nova-core= /gsp/load_exec.rs index 4dbb27dc03a1..1eab4c00e4d3 100644 --- a/drivers/gpu/nova-core/gsp/load_exec.rs +++ b/drivers/gpu/nova-core/gsp/load_exec.rs @@ -189,10 +189,11 @@ fn handle_hs_binary(&self, params: &HsBinaryParams) -= > Result { /// 1. Checks that the descriptor in `params` has the size of /// [`BootloaderDmemDescV2`], and gets the FBIF (Framebuffer Interf= ace) /// target that `params` selects. - /// 2. Waits until GSP-RM has suspended the RISC-V core, for up to fiv= e + /// 2. Loads the generic falcon bootloader image for the GPU's chipset= . + /// 3. Waits until GSP-RM has suspended the RISC-V core, for up to fiv= e /// seconds. - /// 3. Resets the GSP falcon, which selects the falcon core. - /// 4. Runs `bootloader` with the descriptor and with + /// 4. Resets the GSP falcon, which selects the falcon core. + /// 5. Runs the bootloader with the descriptor and with /// [`FLCN_ERR_BINARY_NOT_STARTED`] in `MAILBOX0`, and waits until = the /// falcon core halts, for up to two seconds. The image halts the f= alcon /// core when it is done, so the handler learns from the halt that = the @@ -200,33 +201,22 @@ fn handle_hs_binary(&self, params: &HsBinaryParams) -= > Result { /// /// # Errors /// - /// - `EINVAL` if `bootloader` is `None`, if the descriptor size in `p= arams` - /// is not the size of [`BootloaderDmemDescV2`], or if the address s= pace and - /// the cache attribute in `params` select no FBIF target. + /// - `EINVAL` if the descriptor size in `params` is not the size of + /// [`BootloaderDmemDescV2`], or if the address space and the cache + /// attribute in `params` select no FBIF target. /// - `ETIMEDOUT` if GSP-RM has not suspended the RISC-V core within f= ive /// seconds, or if the falcon core has not halted within two seconds= of /// its start. /// - /// Errors from the reset of the GSP falcon and the run of the bootloa= der are - /// propagated as-is. + /// Errors from loading the bootloader, the reset of the GSP falcon, a= nd the + /// run of the bootloader are propagated as-is. #[expect(dead_code)] - fn handle_generic_bootloader( - &self, - bootloader: Option<&GenericBootloader>, - params: &GenericBootloaderParams, - ) -> Result { + fn handle_generic_bootloader(&self, params: &GenericBootloaderParams) = -> Result { /// Expected size of the descriptor, in bytes. const DMEM_DESC_SIZE: u32 =3D cv!(size_of::(= )); =20 let dev =3D self.dev(); let gsp_falcon =3D self.gsp_falcon; - let Some(bootloader) =3D bootloader else { - dev_err!( - dev, - "No generic bootloader for the load-and-execute event\n" - ); - return Err(EINVAL); - }; =20 if params.dmem_desc_size !=3D DMEM_DESC_SIZE { dev_err!( @@ -239,6 +229,7 @@ fn handle_generic_bootloader( } =20 let fbif_target =3D params.fbif_target()?; + let bootloader =3D GenericBootloader::new(dev, self.chipset)?; =20 self.reset_gsp_falcon_after_suspend()?;