public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] PATCH:  Building on ia32
@ 2001-01-17 18:12 William Taber
  2001-01-18  2:35 ` David Mosberger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: William Taber @ 2001-01-17 18:12 UTC (permalink / raw)
  To: linux-ia64

When I downloaded Linux 2.4.0 and applied the linux-2.4.0-ia64-010109.diff
patch, I discovered that I could no longer compile ia32 kernels.  It turned
out that there were reletively few changes needed to get the ia32 kernel to
compile cleanly and come up and run. As I promised yesterday, here are the
patches I needed to make.  This may not be exhaustive, since I do not have
all options turned on and I didn't try to build many drivers. Note that this
patch will remove the buggy code that I reported yesterday, rather than 
just conditionalizing it.  Since the code was broken and would not run
properly, as well as being non-portable, I just took it out pending a fix.
In the interest of getting the latest ia64 changes ready for merging into the
the main 2.4.x tree at some point, here are the diffs. 

Enjoy.

Will Taber

diff -Nur linux-2.4.0-base/drivers/char/mem.c linux-2.4.0/drivers/char/mem.c
--- linux-2.4.0-base/drivers/char/mem.c	Mon Jan 15 10:40:33 2001
+++ linux-2.4.0/drivers/char/mem.c	Mon Jan 15 16:17:14 2001
@@ -205,8 +205,10 @@
 	    || vma->vm_flags & VM_NONCACHED)
 		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
+#if defined(__ia64__)
 	if (vma->vm_flags & VM_WRITECOMBINED)
 		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+#endif
 
 	/* Don't try to swap out physical pages.. */
 	vma->vm_flags |= VM_RESERVED;
diff -Nur linux-2.4.0-base/fs/fcntl.c linux-2.4.0/fs/fcntl.c
--- linux-2.4.0-base/fs/fcntl.c	Mon Jan 15 10:40:34 2001
+++ linux-2.4.0/fs/fcntl.c	Tue Jan 16 14:07:39 2001
@@ -269,7 +269,9 @@
 			 * to fix this will be in libc.
 			 */
 			err = filp->f_owner.pid;
+#if (__ia64__)
 			force_successful_syscall_return();
+#endif
 			break;
 		case F_SETOWN:
 			lock_kernel();
diff -Nur linux-2.4.0-base/include/asm-ia64/irq.h 
linux-2.4.0/include/asm-ia64/irq.h
--- linux-2.4.0-base/include/asm-ia64/irq.h	Fri Mar 10 18:24:02 2000
+++ linux-2.4.0/include/asm-ia64/irq.h	Tue Jan 16 10:46:28 2001
@@ -27,5 +27,8 @@
 extern void disable_irq (unsigned int);
 extern void disable_irq_nosync (unsigned int);
 extern void enable_irq (unsigned int);
+extern unsigned int do_IRQ (unsigned long irq, struct pt_regs *regs);
+extern void do_IRQ_per_cpu (unsigned long irq, struct pt_regs *regs);
+
 
 #endif /* _ASM_IA64_IRQ_H */
diff -Nur linux-2.4.0-base/include/asm-ia64/pgalloc.h 
linux-2.4.0/include/asm-ia64/pgalloc.h
--- linux-2.4.0-base/include/asm-ia64/pgalloc.h	Thu Jan  4 15:50:18 2001
+++ linux-2.4.0/include/asm-ia64/pgalloc.h	Mon Jan 15 14:38:09 2001
@@ -281,14 +281,14 @@
 }
 
 static inline void
-clear_user_page (void *addr, unsigned long vaddr, struct page *page)
+clear_user_page (void *addr, struct page *page)
 {
 	clear_page(addr);
 	flush_dcache_page(page);
 }
 
 static inline void
-copy_user_page (void *to, void *from, unsigned long vaddr, struct page *page)
+copy_user_page (void *to, void *from, struct page *page)
 {
 	copy_page(to, from);
 	flush_dcache_page(page);
diff -Nur linux-2.4.0-base/include/linux/highmem.h 
linux-2.4.0/include/linux/highmem.h
--- linux-2.4.0-base/include/linux/highmem.h	Mon Jan 15 15:46:09 2001
+++ linux-2.4.0/include/linux/highmem.h	Tue Jan 16 10:52:19 2001
@@ -45,7 +45,7 @@
 /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */
 static inline void clear_user_highpage(struct page *page, unsigned long vaddr)
 {
-	clear_user_page(kmap(page), vaddr);
+	clear_user_page(kmap(page), page);
 	kunmap(page);
 }
 
@@ -87,7 +87,7 @@
 
 	vfrom = kmap(from);
 	vto = kmap(to);
-	copy_user_page(vto, vfrom, vaddr);
+	copy_user_page(vto, vfrom, to);
 	kunmap(from);
 	kunmap(to);
 }
diff -Nur linux-2.4.0-base/include/linux/irq.h linux-2.4.0/include/linux/irq.h
--- linux-2.4.0-base/include/linux/irq.h	Mon Jan 15 10:40:34 2001
+++ linux-2.4.0/include/linux/irq.h	Tue Jan 16 10:47:15 2001
@@ -56,8 +56,6 @@
 
 #include <asm/hw_irq.h> /* the arch dependent stuff */
 
-extern unsigned int do_IRQ (unsigned long irq, struct pt_regs *regs);
-extern void do_IRQ_per_cpu (unsigned long irq, struct pt_regs *regs);
 extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction 
*);
 extern int setup_irq(unsigned int , struct irqaction * );
 
diff -Nur linux-2.4.0-base/mm/memory.c linux-2.4.0/mm/memory.c
--- linux-2.4.0-base/mm/memory.c	Mon Jan 15 10:40:34 2001
+++ linux-2.4.0/mm/memory.c	Tue Jan 16 12:58:33 2001
@@ -1150,10 +1150,8 @@
  */
 static inline int handle_pte_fault(struct mm_struct *mm,
 	struct vm_area_struct * vma, unsigned long address,
-	int access_type, pte_t * pte)
+	int write_access, pte_t * pte)
 {
-	int write_access = is_write_access(access_type);
-	int exec_access = is_exec_access(access_type);
 	pte_t entry;
 
 	/*
@@ -1180,8 +1178,6 @@
 
 		entry = pte_mkdirty(entry);
 	}
-	if (exec_access)
-		entry = pte_mkexec(entry);
 	entry = pte_mkyoung(entry);
 	establish_pte(vma, address, pte, entry);
 	spin_unlock(&mm->page_table_lock);


+---------------------------------------------------------------------+
| Will Taber                                                          |
| Software Engineer, CMBU                 E-mail  wtaber@rational.com |
| Rational Software Corporation           Phone:  781-676-2436        |
| 20 Maguire Road, Lexington, Mass. 02421                             |
+---------------------------------------------------------------------+



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

* Re: [Linux-ia64] PATCH:  Building on ia32
  2001-01-17 18:12 [Linux-ia64] PATCH: Building on ia32 William Taber
@ 2001-01-18  2:35 ` David Mosberger
  2001-01-18 15:47 ` William Taber
  2001-01-18 16:29 ` David Mosberger
  2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2001-01-18  2:35 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Wed, 17 Jan 2001 13:12:41 -0500 (EST), William Taber <wtaber@rational.com> said:

  William> When I downloaded Linux 2.4.0 and applied the
  William> linux-2.4.0-ia64-010109.diff patch, I discovered that I could no
  William> longer compile ia32 kernels.  It turned out that there were
  William> reletively few changes needed to get the ia32 kernel to compile
  William> cleanly and come up and run. As I promised yesterday, here are the
  William> patches I needed to make.  This may not be exhaustive, since I do not
  William> have all options turned on and I didn't try to build many
  William> drivers. Note that this patch will remove the buggy code that I
  William> reported yesterday, rather than just conditionalizing it.  Since the
  William> code was broken and would not run properly, as well as being
  William> non-portable, I just took it out pending a fix.  In the interest of
  William> getting the latest ia64 changes ready for merging into the the main
  William> 2.4.x tree at some point, here are the diffs.

But your patch breaks the lazy-execute bit scheme that IA-64 relies on to avoid
cache flushing.  Your kernel will probably hang on any app that does dynamic
code generation (e.g., such as due to nested C functions).

You're probably better off implementing is_exec_access() on x86 as always
returning 0.

	--david


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

* Re: [Linux-ia64] PATCH:  Building on ia32
  2001-01-17 18:12 [Linux-ia64] PATCH: Building on ia32 William Taber
  2001-01-18  2:35 ` David Mosberger
@ 2001-01-18 15:47 ` William Taber
  2001-01-18 16:29 ` David Mosberger
  2 siblings, 0 replies; 4+ messages in thread
From: William Taber @ 2001-01-18 15:47 UTC (permalink / raw)
  To: linux-ia64

>
>But your patch breaks the lazy-execute bit scheme that IA-64 relies on to avoid
>cache flushing.  Your kernel will probably hang on any app that does dynamic
>code generation (e.g., such as due to nested C functions).
>
>You're probably better off implementing is_exec_access() on x86 as always
>returning 0.
>
>	--david

David,

Actually, I think the best solution is to move is_exec_access() and
is_write_access() out of asm-ia64/pgtable.h, and into some machine independent
header (perhaps mm.h ?), redefining the magic numbers 2 and 4 to be VM_WRITE
and VM_EXEC respectively.  This still leaves the question of who is 
responsible for changing all of the platform specific callers of 
handle_mm_fault to reflect the new semantics?

Will

+---------------------------------------------------------------------+
| Will Taber                                                          |
| Software Engineer, CMBU                 E-mail  wtaber@rational.com |
| Rational Software Corporation           Phone:  781-676-2436        |
| 20 Maguire Road, Lexington, Mass. 02421                             |
+---------------------------------------------------------------------+



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

* Re: [Linux-ia64] PATCH:  Building on ia32
  2001-01-17 18:12 [Linux-ia64] PATCH: Building on ia32 William Taber
  2001-01-18  2:35 ` David Mosberger
  2001-01-18 15:47 ` William Taber
@ 2001-01-18 16:29 ` David Mosberger
  2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2001-01-18 16:29 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Thu, 18 Jan 2001 10:47:07 -0500 (EST), William Taber <wtaber@rational.com> said:

  William> Actually, I think the best solution is to move
  William> is_exec_access() and is_write_access() out of
  William> asm-ia64/pgtable.h, and into some machine independent
  William> header (perhaps mm.h ?), redefining the magic numbers 2 and
  William> 4 to be VM_WRITE and VM_EXEC respectively.  This still
  William> leaves the question of who is responsible for changing all
  William> of the platform specific callers of handle_mm_fault to
  William> reflect the new semantics?

The sole reason for the existence of those macros is so they can be
defined in a platform-specific way.  No other platform is currently
using lazy-execute bits and on those platforms, there is no need to
check the executable bit in the page fault handler.  However, I don't
think is_exec_access() is the final answer either---that's why I don't
bother updating the other ports: it's still very much works in
progress.

	--david


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

end of thread, other threads:[~2001-01-18 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-17 18:12 [Linux-ia64] PATCH: Building on ia32 William Taber
2001-01-18  2:35 ` David Mosberger
2001-01-18 15:47 ` William Taber
2001-01-18 16:29 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox