Re: [PATCH] vfio/nvgrace-gpu: Skip PFN registration for empty memory regions

From: Ankit Agrawal

Date: Wed Oct 14 2026 - 06:40:47 EST


> Agreed, that's a better fix.  For v2 I have:
>
> 1/2 gives nvgrace_gpu_pci_core_ops its own open_device, which only
>   calls vfio_pci_core_enable() and vfio_pci_core_finish_enable(),
>   to pair with vfio_pci_core_close_device().  The usemem.memlength
>   guards from v1 are gone.

Thanks Andrea, and Alex for the suggestion. I agree with this approach.

>  2/2 drops the remaining usemem.memlength check in
>  nvgrace_gpu_open_device(), since only devices with the ACPI
>  memory properties reach it now.  Not for stable.
>
> One visible change in fallback mode: open no longer fails when BAR0
> cannot be mapped, the same as vfio-pci.  BAR0 was only mapped there for
> the readiness check, which fallback mode never runs.  Ankit, please
> shout if the fallback path relies on anything else from
> nvgrace_gpu_open_device().

Yeah, this should be fine. The device missing ACPI entries is not a
grace superchip system anyways. So not keeping the special bar0
check for the fallback is appropriate.

Thanks for fixing this!