Thread (34 messages) 34 messages, 7 authors, 2025-10-06

Re: [PATCH v1 3/9] parisc: Convert DMA map_page to map_phys interface

From: John David Anglin <hidden>
Date: 2025-10-03 20:29:25
Also in: linux-alpha, linux-iommu, linux-mips, lkml, sparclinux, virtualization, xen-devel

On 2025-10-03 1:26 p.m., Jason Gunthorpe wrote:
On Fri, Oct 03, 2025 at 01:18:32PM -0400, John David Anglin wrote:
quoted
On 2025-10-03 11:01 a.m., Jason Gunthorpe wrote:
quoted
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.
After unfolding everything the expression is

  lpa(phys_to_virt(pa))

So if that is always equal to pa then lets just drop it.
If lpa() was replaced by virt_to_phys(), the result would always be equal to pa.  So, I think it
can be dropped.

Dave
-- 
John David Anglin  dave.anglin@bell.net
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help