lkml.org 
[lkml]   [2023]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v7 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper
Date
>> +
>> + /*
>> + * Handle read on the BAR2 region. Map to the target device memory
>> + * physical address and copy to the request read buffer.
>> + */
>> + if (copy_to_user(buf, (u8 *)addr + offset, read_count))
>> + return -EFAULT;
>
> Just to verify, does this memory allow access of arbitrary alignment
> and size?

Please correct me if I'm wrong, but based on following gdb dump data on
the corresponding MemoryRegion->ops, unaligned access isn't supported, and
a read of size upto 8 may be done.

(gdb) p/x *(mr->ops)
$7 = {read = 0xaaab5e0b1c50, write = 0xaaab5e0b1a50, read_with_attrs = 0x0, write_with_attrs = 0x0,
endianness = 0x2, valid = {min_access_size = 0x1, max_access_size = 0x8, unaligned = 0x0, accepts = 0x0},
impl = {min_access_size = 0x1, max_access_size = 0x8, unaligned = 0x0}}

Thanks
Ankit Agrawal
\
 
 \ /
  Last update: 2023-08-23 16:20    [W:0.780 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site