git: 248109448f6a - main - arm: switch the BUSDMA buffers to normal uncached memory

From: Michal Meloun <mmel_at_FreeBSD.org>
Date: Mon, 11 Nov 2024 08:23:24 UTC
The branch main has been updated by mmel:

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

commit 248109448f6afb3d093a522677aab2975a3e7a15
Author:     Michal Meloun <mmel@FreeBSD.org>
AuthorDate: 2024-11-08 12:00:57 +0000
Commit:     Michal Meloun <mmel@FreeBSD.org>
CommitDate: 2024-11-11 08:22:37 +0000

    arm: switch the BUSDMA buffers to normal uncached memory
    
    The BUSDMA buffer is treated as normal memory during compilation and compiler
    is free to inline/optimize basic functions (i.e. memset, memcpy) accessing
    buffers, including when an instruction is generated that performs a word
    access to unaligned data. We support this, but only if the buffer in question
    is mapped as normal memory (cached or not), but not to memory mapped as
    strongly ordered or device type.
    
    MFC after:      1 month
    Differential Revision:  https://reviews.freebsd.org/D47485
---
 sys/arm/include/vm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm/include/vm.h b/sys/arm/include/vm.h
index 439dbdf440a6..697b48689bd8 100644
--- a/sys/arm/include/vm.h
+++ b/sys/arm/include/vm.h
@@ -36,7 +36,7 @@
 #define VM_MEMATTR_WRITE_THROUGH	((vm_memattr_t)4)
 
 #define VM_MEMATTR_DEFAULT		VM_MEMATTR_WB_WA
-#define VM_MEMATTR_UNCACHEABLE		VM_MEMATTR_SO 	/* misused by DMA */
+#define VM_MEMATTR_UNCACHEABLE		VM_MEMATTR_NOCACHE	/* used by BUSDMA */
 #ifdef _KERNEL
 /* Don't export aliased VM_MEMATTR to userland */
 #define VM_MEMATTR_WRITE_COMBINING 	VM_MEMATTR_WRITE_THROUGH /* for DRM */