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:
 <SA1PR12MB719916B48AD0A9F0FFCCBC3EB01B2@SA1PR12MB7199.namprd12.prod.outlook.com>
Date: Fri, 17 Jan 2025 18:48:51 +0000
From: Ankit Agrawal <ankita@...dia.com>
To: Alex Williamson <alex.williamson@...hat.com>
CC: Jason Gunthorpe <jgg@...dia.com>, Yishai Hadas <yishaih@...dia.com>,
	"shameerali.kolothum.thodi@...wei.com"
	<shameerali.kolothum.thodi@...wei.com>, "kevin.tian@...el.com"
	<kevin.tian@...el.com>, Zhi Wang <zhiw@...dia.com>, 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 v3 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.
>> +              *
>> +              * 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.
>> +              */
>> +             nvdev->usemem.memlength = round_down(nvdev->usemem.memlength,
>> +                                                  MEMBLK_SIZE);
>> +             if (nvdev->usemem.memlength == 0) {
>> +                     ret = -EINVAL;
>> +                     goto done;
>> +             }
>
> Why does this operation need to be predicated on the buggy device?
> Does GB have memory that's not a multiple of 512MB?  I was expecting
> this would be a no-op on GB and therefore wouldn't need to be
> conditional.  Thanks,
> 
> Alex

Thanks Alex, yeah the device memory size is not necessarily 512M aligned.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ