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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240131060142.2823-1-yan.y.zhao@intel.com>
Date: Wed, 31 Jan 2024 14:01:42 +0800
From: Yan Zhao <yan.y.zhao@...el.com>
To: arnd@...db.de,
	linus.walleij@...aro.org,
	guoren@...nel.org,
	bcain@...cinc.com,
	jonas@...thpole.se,
	stefan.kristiansson@...nalahti.fi,
	shorne@...il.com
Cc: linux-arch@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-csky@...r.kernel.org,
	linux-hexagon@...r.kernel.org,
	linux-openrisc@...r.kernel.org,
	Yan Zhao <yan.y.zhao@...el.com>
Subject: [PATCH 4/4] openrisc: apply page shift to PFN instead of VA in pfn_to_virt

Apply the page shift to PFN to get physical address for final VA.
The macro __va should take physical address instead of PFN as input.

Fixes: 232ba1630c66 ("openrisc: Make pfn accessors statics inlines")
Signed-off-by: Yan Zhao <yan.y.zhao@...el.com>
---
 arch/openrisc/include/asm/page.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h
index 44fc1fd56717..55c66f6cb1bd 100644
--- a/arch/openrisc/include/asm/page.h
+++ b/arch/openrisc/include/asm/page.h
@@ -79,7 +79,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr)
 
 static inline void * pfn_to_virt(unsigned long pfn)
 {
-	return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
+	return __va(pfn << PAGE_SHIFT);
 }
 
 #define virt_to_page(addr) \
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ