[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SA1PR12MB7199B674BAB692662C4E5878B0E72@SA1PR12MB7199.namprd12.prod.outlook.com>
Date: Mon, 20 Jan 2025 17:13:04 +0000
From: Ankit Agrawal <ankita@...dia.com>
To: "Tian, Kevin" <kevin.tian@...el.com>, Jason Gunthorpe <jgg@...dia.com>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>, Yishai Hadas
<yishaih@...dia.com>, "shameerali.kolothum.thodi@...wei.com"
<shameerali.kolothum.thodi@...wei.com>, Zhi Wang <zhiw@...dia.com>
CC: Aniket Agashe <aniketa@...dia.com>, Neo Jia <cjia@...dia.com>, Kirti
Wankhede <kwankhede@...dia.com>, "Tarun Gupta (SW-GPU)"
<targupta@...dia.com>, Vikram Sethi <vsethi@...dia.com>, Andy Currid
<acurrid@...dia.com>, Alistair Popple <apopple@...dia.com>, John Hubbard
<jhubbard@...dia.com>, Dan Williams <danw@...dia.com>, "Anuj Aggarwal
(SW-GPU)" <anuaggarwal@...dia.com>, Matt Ochs <mochs@...dia.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 2/3] vfio/nvgrace-gpu: Expose the blackwell device PF
BAR1 to the VM
>> + if (!nvdev->has_mig_hw_bug_fix) {
>> + /*
>> + * If the device memory is split to workaround the MIG bug,
>> + * the USEMEM part of the device memory has to be
>> MEMBLK_SIZE
>> + * aligned. This is a hardwired ABI value between the GPU FW
>> and
>> + * VFIO driver. The VM device driver is also aware of it and
>> make
>> + * use of the value for its calculation to determine USEMEM
>> size.
>> + * Note that the device memory may not be 512M aligned.
>> + *
>> + * If the hardware has the fix for MIG, there is no
>> requirement
>> + * for splitting the device memory to create RESMEM. The
>> entire
>> + * device memory is usable and will be USEMEM.
>
> Just double confirm. With the fix it's not required to have the usemem
> 512M aligned, or does hardware guarantee that usemem is always
> 512M aligned?
The first one - On devices without the MIG bug, the device memory
passed to the VM need not be 512M aligned. The devices may still have
non 512M aligned memory.
> And it's clearer to return early when the fix is there so the majority of
> the existing code can be left intact instead of causing unnecessary
> indent here.
I think that can be done. We calculate nvdev->usemem.bar_size down
the function, but I suppose that can be moved up before returning
early.
Powered by blists - more mailing lists