Re: [PATCH v3] gpu: nova-core: gsp: fix undefined behavior in command queue code
From: Alexandre Courbot
Date: Mon Mar 30 2026 - 07:20:22 EST
On Sat Mar 28, 2026 at 2:53 PM JST, kernel test robot wrote:
> Hi Alexandre,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on dff8302ca1d0e773c90dbeeb05e759f995c95482]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Alexandre-Courbot/gpu-nova-core-gsp-fix-undefined-behavior-in-command-queue-code/20260327-003216
> base: dff8302ca1d0e773c90dbeeb05e759f995c95482
> patch link: https://lore.kernel.org/r/20260326-cmdq-ub-fix-v3-1-96af2148ca5c%40nvidia.com
> patch subject: [PATCH v3] gpu: nova-core: gsp: fix undefined behavior in command queue code
> config: x86_64-randconfig-102-20260327 (https://download.01.org/0day-ci/archive/20260328/202603281331.1ESuqgfz-lkp@xxxxxxxxx/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260328/202603281331.1ESuqgfz-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202603281331.1ESuqgfz-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
>>> ld.lld: error: undefined symbol: rust_build_error
> >>> referenced by build_assert.rs:28 (rust/kernel/build_assert.rs:28)
> >>> vmlinux.o:(<nova_core::gsp::cmdq::DmaGspMem>::allocate_command)
Been able to reproduce this, but only if I use the 0day compiler (i.e.
just taking the `.config` is not enough).
Bisected all the pointer projections, and the one that triggers this
failure is this line of `driver_write_area`:
ptr::project!(mut data, [tx..rx - 1]),
... more precisely, the `rx - 1` bit (no problem if I just use `rx`).
This really shouldn't happen because the conditional block we are in has
already determined that `rx != 0 ` and `tx > rx`, so the expression
should be perfectly safe.
I'll keep turning the knobs until I find something that works.