The branch main has been updated by kib:

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

commit cb193bdf8aa685f0f161ee8c57c6d05d1ee6ef67
Author:     Konstantin Belousov <k...@freebsd.org>
AuthorDate: 2025-07-15 23:42:56 +0000
Commit:     Konstantin Belousov <k...@freebsd.org>
CommitDate: 2025-07-16 03:48:45 +0000

    amd64: restore semantic for VIRT_IN_DMAP()
    
    The macro should check if the virtual address falls into working direct
    map, not that it falls into KVA potentially belonging to DMAP.  This was
    its previous meaning, as can be seen in the only use by DMAP_TO_PHYS().
    
    Fixes:  4dd828c80828637452a8a4e07a64e294c82e5d8b
    Sponsored by:   The FreeBSD Foundation
    Differential revision:  https://reviews.freebsd.org/D51334
---
 sys/amd64/include/vmparam.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h
index 59053665dc40..e4cc05cbb889 100644
--- a/sys/amd64/include/vmparam.h
+++ b/sys/amd64/include/vmparam.h
@@ -249,7 +249,7 @@
  */
 #define        PHYS_IN_DMAP(pa)        (dmaplimit == 0 || (pa) < dmaplimit)
 #define        VIRT_IN_DMAP(va)        \
-    ((va) >= kva_layout.dmap_low && (va) < kva_layout.dmap_high)
+    ((va) >= kva_layout.dmap_low && (va) < kva_layout.dmap_low + dmaplimit)
 
 #define        PMAP_HAS_DMAP   1
 #define        PHYS_TO_DMAP(x) __extension__ ({                                
\

Reply via email to