lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4a887fce-a04a-4c85-8051-50afe88fd098@ghiti.fr>
Date: Thu, 31 Jul 2025 16:39:08 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: Yunhui Cui <cuiyunhui@...edance.com>, paul.walmsley@...ive.com,
 palmer@...belt.com, aou@...s.berkeley.edu, akpm@...ux-foundation.org,
 catalin.marinas@....com, anshuman.khandual@....com, kas@...nel.org,
 ryan.roberts@....com, samuel.holland@...ive.com, namcao@...utronix.de,
 willy@...radead.org, abrestic@...osinc.com, yongxuan.wang@...ive.com,
 apopple@...dia.com, linux-riscv@...ts.infradead.org,
 linux-kernel@...r.kernel.org
Cc: Qingfang Deng <qingfang.deng@...lower.com.cn>
Subject: Re: [PATCH 1/1] riscv: introduce ioremap_wc()

Hi Yunhui,

On 7/22/25 11:15, Yunhui Cui wrote:
> Compared with IO attributes, NC attributes can improve performance,
> specifically in these aspects: Relaxed Order, Gathering, Supports Read
> Speculation, Supports Unaligned Access.
>
> Signed-off-by: Yunhui Cui <cuiyunhui@...edance.com>
> Signed-off-by: Qingfang Deng <qingfang.deng@...lower.com.cn>
> ---
>   arch/riscv/include/asm/io.h      | 4 ++++
>   arch/riscv/include/asm/pgtable.h | 1 +
>   2 files changed, 5 insertions(+)
>
> diff --git a/arch/riscv/include/asm/io.h b/arch/riscv/include/asm/io.h
> index a0e51840b9db4..09bb5f57a9d34 100644
> --- a/arch/riscv/include/asm/io.h
> +++ b/arch/riscv/include/asm/io.h
> @@ -28,6 +28,10 @@
>   #ifdef CONFIG_MMU
>   #define IO_SPACE_LIMIT		(PCI_IO_SIZE - 1)
>   #define PCI_IOBASE		((void __iomem *)PCI_IO_START)
> +
> +#define ioremap_wc(addr, size)	\
> +	ioremap_prot((addr), (size), __pgprot(_PAGE_KERNEL_NC))
> +
>   #endif /* CONFIG_MMU */
>   
>   /*
> diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
> index 91697fbf1f901..3d17399a06c77 100644
> --- a/arch/riscv/include/asm/pgtable.h
> +++ b/arch/riscv/include/asm/pgtable.h
> @@ -203,6 +203,7 @@ extern struct pt_alloc_ops pt_ops __meminitdata;
>   
>   #define PAGE_TABLE		__pgprot(_PAGE_TABLE)
>   
> +#define _PAGE_KERNEL_NC ((_PAGE_KERNEL & ~_PAGE_MTMASK) | _PAGE_NOCACHE)
>   #define _PAGE_IOREMAP	((_PAGE_KERNEL & ~_PAGE_MTMASK) | _PAGE_IO)
>   #define PAGE_KERNEL_IO		__pgprot(_PAGE_IOREMAP)
>   


I have just confirmed with Ved that mapping WC to NC is the correct 
thing to do, so:

Reviewed-by: Alexandre Ghiti <alexghiti@...osinc.com>

And I'll take that for 6.17.

Thanks,

Alex


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ