lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DEYIEO1HG5KD.1UI84OJ1RNMCJ@nvidia.com>
Date: Mon, 15 Dec 2025 13:35:36 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Zhi Wang" <zhiw@...dia.com>, <rust-for-linux@...r.kernel.org>,
 <linux-pci@...r.kernel.org>, <nouveau@...ts.freedesktop.org>,
 <linux-kernel@...r.kernel.org>
Cc: <airlied@...il.com>, <dakr@...nel.org>, <aliceryhl@...gle.com>,
 <bhelgaas@...gle.com>, <kwilczynski@...nel.org>, <ojeda@...nel.org>,
 <alex.gaynor@...il.com>, <boqun.feng@...il.com>, <gary@...yguo.net>,
 <bjorn3_gh@...tonmail.com>, <lossin@...nel.org>, <a.hindborg@...nel.org>,
 <tmgross@...ch.edu>, <markus.probst@...teo.de>, <helgaas@...nel.org>,
 <cjia@...dia.com>, <alex@...zbot.org>, <smitra@...dia.com>,
 <ankita@...dia.com>, <aniketa@...dia.com>, <kwankhede@...dia.com>,
 <targupta@...dia.com>, <acourbot@...dia.com>, <joelagnelf@...dia.com>,
 <jhubbard@...dia.com>, <zhiwang@...nel.org>, "Nouveau"
 <nouveau-bounces@...ts.freedesktop.org>
Subject: Re: [RFC 6/7] gpu: nova-core: reserve a larger GSP WPR2 heap when
 vGPU is enabled.

On Sat Dec 6, 2025 at 9:42 PM JST, Zhi Wang wrote:
> To support the maximum vGPUs on devices that support vGPU, a larger
> WPR2 heap size is required. On Ada with vGPU supported, the size should
> be set to at least 581MB.
>
> When vGPU support is enabled, reserve a large WPR2 heap size up to
> 581MB, set the max supported VF to max in WPR2 meta.

This patch also sets the number of partitions, this should be
mentioned in the commit log as well.

>
> Signed-off-by: Zhi Wang <zhiw@...dia.com>
> ---
>  drivers/gpu/nova-core/fb.rs       | 19 +++++++++++++++----
>  drivers/gpu/nova-core/gsp/boot.rs |  2 +-
>  2 files changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/fb.rs b/drivers/gpu/nova-core/fb.rs
> index 3c9cf151786c..9a5c40029f3a 100644
> --- a/drivers/gpu/nova-core/fb.rs
> +++ b/drivers/gpu/nova-core/fb.rs
> @@ -119,7 +119,12 @@ pub(crate) struct FbLayout {
>  
>  impl FbLayout {
>      /// Computes the FB layout for `chipset` required to run the `gsp_fw` GSP firmware.
> -    pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<Self> {
> +    pub(crate) fn new(
> +        chipset: Chipset,
> +        bar: &Bar0,
> +        gsp_fw: &GspFirmware,
> +        vgpu_support: bool,
> +    ) -> Result<Self> {
>          let hal = hal::fb_hal(chipset);
>  
>          let fb = {
> @@ -181,8 +186,12 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
>  
>          let wpr2_heap = {
>              const WPR2_HEAP_DOWN_ALIGN: Alignment = Alignment::new::<SZ_1M>();
> -            let wpr2_heap_size =
> -                gsp::LibosParams::from_chipset(chipset).wpr_heap_size(chipset, fb.end);
> +            let wpr2_heap_size = if !vgpu_support {
> +                gsp::LibosParams::from_chipset(chipset).wpr_heap_size(chipset, fb.end)
> +            } else {
> +                581 * usize_as_u64(SZ_1M)

Do we have a constant defined somewhere in OpenRM for this 581 size? If
so, let's regenerate the bindings to add it and use it here.

> +            };
> +
>              let wpr2_heap_addr = (elf.start - wpr2_heap_size).align_down(WPR2_HEAP_DOWN_ALIGN);
>  
>              wpr2_heap_addr..(elf.start).align_down(WPR2_HEAP_DOWN_ALIGN)
> @@ -202,6 +211,8 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
>              wpr2.start - HEAP_SIZE..wpr2.start
>          };
>  
> +        let vf_partition_count = if vgpu_support { 32 } else { 0 };

Same question for the `32` magic number here. I suspect this will evolve
with future chips, so we need to have a good source of truth so we can
abstract this when needed.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ