On 2025-10-03 11:01 a.m., Jason Gunthorpe wrote:
> This doesn't actually use the virt at all:
> 
>       offset = ((unsigned long) addr) & ~IOVP_MASK;
>       if((size % L1_CACHE_BYTES) || ((unsigned long)addr % L1_CACHE_BYTES))
>               ccio_io_pdir_entry(pdir_start, KERNEL_SPACE, (unsigned 
> long)addr, hint);
> 
> And ccio_io_pdir_entry():
>       pa = lpa(vba);
> 
> Is a special instruction that uses virt but AI tells me that special
> LPA instruction is returning phys. Not sure if that is a different
> value than virt_to_phys()..

ccio_io_pdir_entry currently only supports KERNEL_SPACE.  For KERNEL_SPACE, 
lpa() and
virt_to_phys() are equivalent if page is mapped.  lpa() returns 0 if a 
non-access data
TLB fault occurs (i.e., page isn't mapped).  Not sure if that matters.
> IDK, I'm not feeling brave enough to drop the LPA but maybe include
> this note in the commit message.
> 

-- 
John David Anglin  [email protected]

Reply via email to