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:	Fri, 20 Mar 2009 10:24:25 GMT
From:	"venkatesh.pallipadi@...el.com" <venkatesh.pallipadi@...el.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	venkatesh.pallipadi@...el.com, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:x86/mm] x86, CPA: Add a flag parameter to cpa set_clr()

Commit-ID:  728c9518873de0bbb92b66daa1943b12e5b9f80f
Gitweb:     http://git.kernel.org/tip/728c9518873de0bbb92b66daa1943b12e5b9f80f
Author:     venkatesh.pallipadi@...el.com <venkatesh.pallipadi@...el.com>
AuthorDate: Thu, 19 Mar 2009 14:51:13 -0700
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 20 Mar 2009 10:34:47 +0100

x86, CPA: Add a flag parameter to cpa set_clr()

Change change_page_attr_set_clr() array parameter to a flag. This helps
following patches which adds an interface to change attr to uc/wb over a
set of pages referred by struct page.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
Cc: arjan@...radead.org
Cc: eric@...olt.net
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
Cc: airlied@...hat.com
LKML-Reference: <20090319215358.611346000@...el.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>


---
 arch/x86/mm/pageattr.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 1280565..69009af 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -787,7 +787,7 @@ static inline int cache_attr(pgprot_t attr)
 
 static int change_page_attr_set_clr(unsigned long *addr, int numpages,
 				    pgprot_t mask_set, pgprot_t mask_clr,
-				    int force_split, int array)
+				    int force_split, int in_flag)
 {
 	struct cpa_data cpa;
 	int ret, cache, checkalias;
@@ -802,7 +802,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
 		return 0;
 
 	/* Ensure we are PAGE_SIZE aligned */
-	if (!array) {
+	if (!(in_flag & CPA_ARRAY)) {
 		if (*addr & ~PAGE_MASK) {
 			*addr &= PAGE_MASK;
 			/*
@@ -840,7 +840,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
 	cpa.curpage = 0;
 	cpa.force_split = force_split;
 
-	if (array)
+	if (in_flag & CPA_ARRAY)
 		cpa.flags |= CPA_ARRAY;
 
 	/* No alias checking for _NX bit modifications */
@@ -889,14 +889,14 @@ static inline int change_page_attr_set(unsigned long *addr, int numpages,
 				       pgprot_t mask, int array)
 {
 	return change_page_attr_set_clr(addr, numpages, mask, __pgprot(0), 0,
-		array);
+		(array ? CPA_ARRAY : 0));
 }
 
 static inline int change_page_attr_clear(unsigned long *addr, int numpages,
 					 pgprot_t mask, int array)
 {
 	return change_page_attr_set_clr(addr, numpages, __pgprot(0), mask, 0,
-		array);
+		(array ? CPA_ARRAY : 0));
 }
 
 int _set_memory_uc(unsigned long addr, int numpages)
--
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