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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 16 Jan 2008 23:14:59 +0100 (CET)
From:	Andi Kleen <ak@...e.de>
To:	linux-kernel@...r.kernel.org, mingo@...e.hu, tglx@...utronix.de,
	jbeulich@...ell.com, venkatesh.pallipadi@...el.com
Subject: [PATCH] [1/36] Undo pat cpa patch


Going to implement this differently

 commit 5ec5c5a2302ca8794da03f8bedec931a2a814ae9
 Author: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
 Date:   Tue Jan 15 09:36:03 2008 +0100

    patches/x86-pat-cpa_i386.patch
    
    This makes 32 bit cpa similar to x86_64 and makes it easier for following PA
T
    patches.

Signed-off-by: Andi Kleen <ak@...e.de>

---
 arch/x86/mm/pageattr_32.c |   24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

Index: linux/arch/x86/mm/pageattr_32.c
===================================================================
--- linux.orig/arch/x86/mm/pageattr_32.c
+++ linux/arch/x86/mm/pageattr_32.c
@@ -153,12 +153,15 @@ static inline void save_page(struct page
 		list_add(&kpte_page->lru, &df_list);
 }
 
-static int __change_page_attr(unsigned long address, unsigned long pfn,
-                              pgprot_t prot)
+static int __change_page_attr(struct page *page, pgprot_t prot)
 {
 	struct page *kpte_page;
+	unsigned long address;
 	pte_t *kpte;
 
+	BUG_ON(PageHighMem(page));
+	address = (unsigned long)page_address(page);
+
 	kpte = lookup_address(address);
 	if (!kpte)
 		return -EINVAL;
@@ -169,7 +172,7 @@ static int __change_page_attr(unsigned l
 
 	if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) {
 		if (!pte_huge(*kpte)) {
-			set_pte_atomic(kpte, pfn_pte(pfn, prot));
+			set_pte_atomic(kpte, mk_pte(page, prot));
 		} else {
 			struct page *split;
 			pgprot_t ref_prot;
@@ -187,7 +190,7 @@ static int __change_page_attr(unsigned l
 		page_private(kpte_page)++;
 	} else {
 		if (!pte_huge(*kpte)) {
-			set_pte_atomic(kpte, pfn_pte(pfn, PAGE_KERNEL));
+			set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL));
 			BUG_ON(page_private(kpte_page) == 0);
 			page_private(kpte_page)--;
 		} else
@@ -228,15 +231,14 @@ static inline void flush_map(struct list
  *
  * Caller must call global_flush_tlb() after this.
  */
-int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
+int change_page_attr(struct page *page, int numpages, pgprot_t prot)
 {
 	unsigned long flags;
 	int err = 0, i;
 
 	spin_lock_irqsave(&cpa_lock, flags);
-	for (i = 0; i < numpages; i++, address += PAGE_SIZE) {
-		unsigned long pfn = __pa(address) >> PAGE_SHIFT;
-		err = __change_page_attr(address, pfn, prot);
+	for (i = 0; i < numpages; i++, page++) {
+		err = __change_page_attr(page, prot);
 		if (err)
 			break;
 	}
@@ -246,12 +248,6 @@ int change_page_attr_addr(unsigned long 
 }
 EXPORT_SYMBOL(change_page_attr);
 
-int change_page_attr(struct page *page, int numpages, pgprot_t prot)
-{
-	unsigned long addr = (unsigned long)page_address(page);
-	return change_page_attr_addr(addr, numpages, prot);
-}
-
 void global_flush_tlb(void)
 {
 	struct page *pg, *next;
--
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