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]
Date:	Wed, 6 Jun 2012 16:15:01 +0800
From:	Lai Jiangshan <laijs@...fujitsu.com>
To:	unlisted-recipients:; (no To-header on input)
Cc:	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Tejun Heo <tj@...nel.org>, Al Viro <viro@...iv.linux.org.uk>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Ian Campbell <ian.campbell@...rix.com>,
	Paul Gortmaker <paul.gortmaker@...driver.com>,
	Mel Gorman <mgorman@...e.de>, Michal Hocko <mhocko@...e.cz>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Lai Jiangshan <laijs@...fujitsu.com>
Subject: [PATCH 7/7] highmem: avoid page_address() in flush_all_zero_pkmaps()

We can get the virtual address from PKMAP_ADDR(i),
we don't need to call page_address() here.

Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
---
 mm/highmem.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/mm/highmem.c b/mm/highmem.c
index 6f028cb..994fd68 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -103,8 +103,6 @@ static void flush_all_zero_pkmaps(void)
 	flush_cache_kmaps();
 
 	for (i = 0; i < LAST_PKMAP; i++) {
-		struct page *page;
-
 		/*
 		 * zero means we don't have anything to do,
 		 * >1 means that it is still in use. Only
@@ -125,9 +123,7 @@ static void flush_all_zero_pkmaps(void)
 		 * getting the kmap_lock (which is held here).
 		 * So no dangers, even with speculative execution.
 		 */
-		page = pte_page(pkmap_page_table[i]);
-		pte_clear(&init_mm, (unsigned long)page_address(page),
-			  &pkmap_page_table[i]);
+		pte_clear(&init_mm, PKMAP_ADDR(i), &pkmap_page_table[i]);
 
 		clear_high_page_map(i);
 		need_flush = 1;
-- 
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ