On 1/2/2026 11:59 PM, Timur Tabi wrote:
>
> fn imem_ns_load_params(&self) -> Option<FalconLoadTarget> {
> - // Only used on Turing and GA100, so return None for now
> - None
> + match &self.desc {
> + FalconUCodeDesc::V2(v2) => Some(FalconLoadTarget {
> + src_start: 0,
> + dst_start: v2.imem_phys_base,
> + len: v2.imem_load_size - v2.imem_sec_size,
Since this subtraction's values comes from fw, it would be good to use
checked_sub(). Otherwise, this could:
1. blow up if overflow checking is enabled.
2. len can underflow and be entirely plausible but incorrect, causing
unpredictable failures.
I am fixing other similar existing issues in nova-core as well but since this
patch is in flight, it'd be great to fix it in the next posting (it sounds like
there will be a next posting).
thanks,
- Joel
- [PATCH v5 03/11] gpu: nova-core: support header parsing ... Timur Tabi
- [PATCH v5 07/11] gpu: nova-core: Add basic Turing HAL Timur Tabi
- [PATCH v5 01/11] gpu: nova-core: rename Imem to ImemSecu... Timur Tabi
- [PATCH v5 06/11] gpu: nova-core: move some functions int... Timur Tabi
- [PATCH v5 09/11] gpu: nova-core: add FalconUCodeDescV2 s... Timur Tabi
- Re: [PATCH v5 09/11] gpu: nova-core: add FalconUCod... John Hubbard
- Re: [PATCH v5 09/11] gpu: nova-core: add Falcon... Timur Tabi
- Re: [PATCH v5 09/11] gpu: nova-core: add Fa... John Hubbard
- Re: [PATCH v5 09/11] gpu: nova-core: ad... John Hubbard
- Re: [PATCH v5 09/11] gpu: nova-cor... John Hubbard
- Re: [PATCH v5 09/11] gpu: nova-core: add FalconUCod... Joel Fernandes
- Re: [PATCH v5 09/11] gpu: nova-core: add Falcon... Timur Tabi
- Re: [PATCH v5 09/11] gpu: nova-core: add Fa... Joel Fernandes
- [PATCH v5 04/11] gpu: nova-core: add support for Turing/... Timur Tabi
- [PATCH v5 11/11] gpu: nova-core: add PIO support for loa... Timur Tabi
- Re: [PATCH v5 11/11] gpu: nova-core: add PIO suppor... kernel test robot
- [PATCH v5 08/11] gpu: nova-core: add Falcon HAL method s... Timur Tabi
- [PATCH v5 05/11] gpu: nova-core: add NV_PFALCON_FALCON_D... Timur Tabi
- [PATCH v5 10/11] gpu: nova-core: align LibosMemoryRegion... Timur Tabi
