git: 34185c0a1af7 - stable/13 - icl_soft: Use PHYS_TO_DMAP instead of pmap_map_io_transient.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 11 May 2022 21:04:39 UTC
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=34185c0a1af7322069e48ce9a64441d0dda02238

commit 34185c0a1af7322069e48ce9a64441d0dda02238
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-03-11 02:20:28 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-05-11 20:52:41 +0000

    icl_soft: Use PHYS_TO_DMAP instead of pmap_map_io_transient.
    
    The latter API is not actually MI but is only supported on amd64,
    arm64, and RISC-V.
    
    Sponsored by:   Chelsio Communications
    
    (cherry picked from commit 832acea92fc8cdb55859a6a4b1bc38bf766780f1)
---
 sys/dev/iscsi/icl_soft.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c
index a1e07057a959..016f70ae9c52 100644
--- a/sys/dev/iscsi/icl_soft.c
+++ b/sys/dev/iscsi/icl_soft.c
@@ -1106,7 +1106,6 @@ icl_soft_conn_pdu_append_bio(struct icl_conn *ic, struct icl_pdu *request,
 	struct mbuf *m, *m_tail;
 	vm_offset_t vaddr;
 	size_t mtodo, page_offset, todo;
-	boolean_t mapped;
 	int i;
 
 	KASSERT(len > 0, ("len == 0"));
@@ -1189,9 +1188,7 @@ icl_soft_conn_pdu_append_bio(struct icl_conn *ic, struct icl_pdu *request,
 
 	while (len > 0) {
 		todo = MIN(len, PAGE_SIZE - page_offset);
-
-		mapped = pmap_map_io_transient(bp->bio_ma + i, &vaddr, 1,
-		    FALSE);
+		vaddr = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(bp->bio_ma[i]));
 
 		do {
 			mtodo = min(todo, M_SIZE(m) - m->m_len);
@@ -1204,10 +1201,6 @@ icl_soft_conn_pdu_append_bio(struct icl_conn *ic, struct icl_pdu *request,
 			todo -= mtodo;
 		} while (todo > 0);
 
-		if (__predict_false(mapped))
-			pmap_unmap_io_transient(bp->bio_ma + 1, &vaddr, 1,
-			    FALSE);
-
 		page_offset = 0;
 		len -= todo;
 		i++;
@@ -1270,7 +1263,6 @@ icl_soft_conn_pdu_get_bio(struct icl_conn *ic, struct icl_pdu *ip,
 {
 	vm_offset_t vaddr;
 	size_t page_offset, todo;
-	boolean_t mapped;
 	int i;
 
 	MPASS(bp->bio_flags & BIO_UNMAPPED);
@@ -1287,13 +1279,9 @@ icl_soft_conn_pdu_get_bio(struct icl_conn *ic, struct icl_pdu *ip,
 	while (len > 0) {
 		todo = MIN(len, PAGE_SIZE - page_offset);
 
-		mapped = pmap_map_io_transient(bp->bio_ma + i, &vaddr, 1,
-		    FALSE);
+		vaddr = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(bp->bio_ma[i]));
 		m_copydata(ip->ip_data_mbuf, pdu_off, todo, (char *)vaddr +
 		    page_offset);
-		if (__predict_false(mapped))
-			pmap_unmap_io_transient(bp->bio_ma + 1, &vaddr, 1,
-			    FALSE);
 
 		page_offset = 0;
 		pdu_off += todo;