>> Ankit Agrawal (3):
>> vfio/pci: rename and export do_io_rw()
>> vfio/pci: rename and export range_intersect_range
>> vfio/nvgrace-gpu: Add vfio pci variant module for grace hopper
>>
>> MAINTAINERS | 16 +-
>> d
>> diff --git a/drivers/vfio/pci/nvgrace-gpu/main.c
>> b/drivers/vfio/pci/nvgrace-gpu/main.c new file mode 100644
>> index ..5a251a6a782e
>> --- /dev/null
>> +++ b/drivers/vfio/pci/nvgrace-gpu/main.c
>> @@ -0,0 +1,888 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +/*
>> + *
>> +
>> +/**
>> + * vfio_pci_core_range_intersect_range() - Determine overlap between a
>> buffer
>> + * and register offset ranges.
>> + * @buf_start: start offset of the buffer
>> + * @buf_cnt: number of buffer bytes.
>
> You could drop
+ * use of the value for its calculation to determine USEMEM size.
>> + */
>> + nvdev->usemem.memlength = round_down(nvdev->usemem.memlength,
>> + MEMBLK_SIZE);
>> + if ((check_add_overflow(nvdev->usemem.memp
>> >
>> > IMO, this seems like adding too much code to reduce the call length for a
>> > very specific case. If there aren't any strong opinion on this, I'm
>> > planning to
>> > leave this code as it is.
>>
>> a slight difference. if mem_count==0 the result should always succeed
>> no matter
Thanks Kevin for the review. Comments inline.
>>
>> Note that the usemem memory is added by the VM Nvidia device driver [5]
>> to the VM kernel as memblocks. Hence make the usable memory size
>> memblock
>> aligned.
>
> Is memblock size defined in spec or purely a guest implementation choice?
>> >>
>> >> If mem_count == 0, going through nvgrace_gpu_map_and_read() is not
>> >> necessary.
>> >
>> > Harmless, other than the possibly unnecessary call through to
>> > nvgrace_gpu_map_device_mem(). Maybe both
>> nvgrace_gpu_map_and_read()
>> > and nvgrace_gpu_map_and_write() could
>> > +/* Memory size expected as non cached and reserved by the VM driver
>> > */ +#define RESMEM_SIZE 0x4000
>> > +#define MEMBLK_SIZE 0x2000
>> > +
>>
>> Maybe use SZ_* definitions in linux/size.h
>
> Good suggestion.
Ack.
>>
>> Better move this part to the place between
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 8999497011a2..529ec8966f58 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -23103,6 +23103,12 @@ L: k...@vger.kernel.org
>> S: Maintained
>> F: drivers/vfio/platform/
>>
>> +VFIO
Thanks Kevin.
>> range_intesect_range determines an overlap between two ranges. If an
>
> s/intesect/intersect/
Will fix the typo.
>> + * vfio_pci_core_range_intersect_range() - Determine overlap between a
>> buffer
>> + * and register offset ranges.
>> + *
10 matches
Mail list logo