All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [PATCH 3/9] UML - Remove pte_mkexec
@ 2006-06-29 21:36 ` Jeff Dike
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Dike @ 2006-06-29 21:36 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, user-mode-linux-devel, ak

Andi is making pte_mkexec go away, and UML had one of the last uses.

This removes the use and the definition.

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: linux-2.6.16-rc-mm/arch/um/kernel/skas/mmu.c
===================================================================
--- linux-2.6.16-rc-mm.orig/arch/um/kernel/skas/mmu.c	2006-06-26 14:49:53.000000000 -0400
+++ linux-2.6.16-rc-mm/arch/um/kernel/skas/mmu.c	2006-06-28 13:07:26.000000000 -0400
@@ -61,8 +61,10 @@ static int init_stub_pte(struct mm_struc
 #endif
 
 	*pte = mk_pte(virt_to_page(kernel), __pgprot(_PAGE_PRESENT));
-	*pte = pte_mkexec(*pte);
-	*pte = pte_wrprotect(*pte);
+	/* This is wrong for the code page, but it doesn't matter since the
+	 * stub is mapped by hand with the correct permissions.
+	 */
+	*pte = pte_mkwrite(*pte);
 	return(0);
 
  out_pmd:
Index: linux-2.6.16-rc-mm/include/asm-um/pgtable.h
===================================================================
--- linux-2.6.16-rc-mm.orig/include/asm-um/pgtable.h	2006-01-03 17:39:53.000000000 -0500
+++ linux-2.6.16-rc-mm/include/asm-um/pgtable.h	2006-06-26 14:54:42.000000000 -0400
@@ -274,12 +274,6 @@ static inline pte_t pte_mkread(pte_t pte
 	return(pte_mknewprot(pte)); 
 }
 
-static inline pte_t pte_mkexec(pte_t pte)
-{ 
-	pte_set_bits(pte, _PAGE_USER);
-	return(pte_mknewprot(pte)); 
-}
-
 static inline pte_t pte_mkdirty(pte_t pte)
 { 
 	pte_set_bits(pte, _PAGE_DIRTY);


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/9] UML - Remove pte_mkexec
@ 2006-06-29 21:36 ` Jeff Dike
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Dike @ 2006-06-29 21:36 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, user-mode-linux-devel, ak

Andi is making pte_mkexec go away, and UML had one of the last uses.

This removes the use and the definition.

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: linux-2.6.16-rc-mm/arch/um/kernel/skas/mmu.c
===================================================================
--- linux-2.6.16-rc-mm.orig/arch/um/kernel/skas/mmu.c	2006-06-26 14:49:53.000000000 -0400
+++ linux-2.6.16-rc-mm/arch/um/kernel/skas/mmu.c	2006-06-28 13:07:26.000000000 -0400
@@ -61,8 +61,10 @@ static int init_stub_pte(struct mm_struc
 #endif
 
 	*pte = mk_pte(virt_to_page(kernel), __pgprot(_PAGE_PRESENT));
-	*pte = pte_mkexec(*pte);
-	*pte = pte_wrprotect(*pte);
+	/* This is wrong for the code page, but it doesn't matter since the
+	 * stub is mapped by hand with the correct permissions.
+	 */
+	*pte = pte_mkwrite(*pte);
 	return(0);
 
  out_pmd:
Index: linux-2.6.16-rc-mm/include/asm-um/pgtable.h
===================================================================
--- linux-2.6.16-rc-mm.orig/include/asm-um/pgtable.h	2006-01-03 17:39:53.000000000 -0500
+++ linux-2.6.16-rc-mm/include/asm-um/pgtable.h	2006-06-26 14:54:42.000000000 -0400
@@ -274,12 +274,6 @@ static inline pte_t pte_mkread(pte_t pte
 	return(pte_mknewprot(pte)); 
 }
 
-static inline pte_t pte_mkexec(pte_t pte)
-{ 
-	pte_set_bits(pte, _PAGE_USER);
-	return(pte_mknewprot(pte)); 
-}
-
 static inline pte_t pte_mkdirty(pte_t pte)
 { 
 	pte_set_bits(pte, _PAGE_DIRTY);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [uml-devel] [PATCH 3/9] UML - Remove pte_mkexec
  2006-06-29 21:36 ` Jeff Dike
@ 2006-06-29 21:41   ` Andi Kleen
  -1 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2006-06-29 21:41 UTC (permalink / raw)
  To: Jeff Dike; +Cc: akpm, linux-kernel, user-mode-linux-devel

On Thursday 29 June 2006 23:36, Jeff Dike wrote:
> Andi is making pte_mkexec go away, and UML had one of the last uses.

Actually not go away, but do the correct thing on i386/x86-64.
Just relying on its side effects of setting _USER was bad.

Thanks,
-Andi

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/9] UML - Remove pte_mkexec
@ 2006-06-29 21:41   ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2006-06-29 21:41 UTC (permalink / raw)
  To: Jeff Dike; +Cc: akpm, linux-kernel, user-mode-linux-devel

On Thursday 29 June 2006 23:36, Jeff Dike wrote:
> Andi is making pte_mkexec go away, and UML had one of the last uses.

Actually not go away, but do the correct thing on i386/x86-64.
Just relying on its side effects of setting _USER was bad.

Thanks,
-Andi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-06-29 22:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-29 21:36 [uml-devel] [PATCH 3/9] UML - Remove pte_mkexec Jeff Dike
2006-06-29 21:36 ` Jeff Dike
2006-06-29 21:41 ` [uml-devel] " Andi Kleen
2006-06-29 21:41   ` Andi Kleen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.