From: James Bottomley <James.Bottomley@steeleye.com>
To: PARISC list <parisc-linux@lists.parisc-linux.org>
Cc: parisc-linux-cvs@lists.parisc-linux.org
Subject: [parisc-linux] Re: [parisc-linux-cvs] linux-2.6 jejb
Date: 25 Apr 2004 09:55:40 -0500 [thread overview]
Message-ID: <1082904942.12039.1.camel@mulgrave> (raw)
In-Reply-To: <20040425145051.10F5C4942B8@palinux.hppa>
On Sun, 2004-04-25 at 09:50, James Bottomley wrote:
> CVSROOT: /var/cvs
> Module name: linux-2.6
> Changes by: jejb 04/04/25 08:50:51
>
> Modified files:
> . : Makefile
> arch/parisc/kernel: asm-offsets.c entry.S head.S head64.S
> pacache.S vmlinux.lds.S
> arch/parisc/mm : init.c
> include/asm-parisc: fixmap.h page.h pgtable.h
>
> Log message:
> Eliminate some Magic numbers
>
> Also move fixed mapping definitions into fixmap.h
Index: arch/parisc/kernel/asm-offsets.c
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/asm-offsets.c,v
retrieving revision 1.3
diff -u -r1.3 asm-offsets.c
--- a/arch/parisc/kernel/asm-offsets.c 17 Jan 2004 06:39:24 -0000 1.3
+++ b/arch/parisc/kernel/asm-offsets.c 25 Apr 2004 14:48:12 -0000
@@ -32,6 +32,7 @@
#include <linux/thread_info.h>
#include <linux/version.h>
#include <linux/ptrace.h>
+#include <asm/pgtable.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
@@ -275,6 +276,7 @@
BLANK();
DEFINE(PA_BLOCKSTEP_BIT, 31-PT_BLOCKSTEP_BIT);
DEFINE(PA_SINGLESTEP_BIT, 31-PT_SINGLESTEP_BIT);
+ DEFINE(ASM_PMD_ENTRY, ((__PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT));
BLANK();
return 0;
}
Index: arch/parisc/kernel/entry.S
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/entry.S,v
retrieving revision 1.7
diff -u -r1.7 entry.S
--- a/arch/parisc/kernel/entry.S 7 Feb 2004 18:32:50 -0000 1.7
+++ b/arch/parisc/kernel/entry.S 25 Apr 2004 14:48:14 -0000
@@ -1041,6 +1041,9 @@
cmpib,*<>,n 0,spc,dtlb_fault /* forward */
ldil L%(TMPALIAS_MAP_START),t0
+#if (TMPALIAS_MAP_START >= 0x80000000)
+ depdi 0,31,32,t0 /* clear any sign extension */
+#endif
copy va,t1
depdi 0,63,23,t1
cmpb,*<>,n t0,t1,dtlb_fault /* forward */
Index: arch/parisc/kernel/head.S
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/head.S,v
retrieving revision 1.3
diff -u -r1.3 head.S
--- a/arch/parisc/kernel/head.S 17 Jan 2004 15:00:32 -0000 1.3
+++ b/arch/parisc/kernel/head.S 25 Apr 2004 14:48:15 -0000
@@ -83,13 +83,9 @@
mtctl %r4,%cr24 /* Initialize kernel root pointer */
mtctl %r4,%cr25 /* Initialize user root pointer */
-#if (__PAGE_OFFSET != 0x10000000UL)
-Error! Code below (the next two stw's) needs to be changed
-#endif
-
- stw %r3,0x100(%r4) /* Hardwired 0x1... kernel Vaddr start*/
+ stw %r3,((__PAGE_OFFSET>>PGDIR_SHIFT)*4)(%r4)
ldo 0x1000(%r3),%r3
- stw %r3,0x104(%r4)
+ stw %r3,(((__PAGE_OFFSET>>PGDIR_SHIFT) + 1)*4)(%r4)
ldo _PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
$pgt_fill_loop:
stwm %r3,4(%r1)
Index: arch/parisc/kernel/head64.S
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/head64.S,v
retrieving revision 1.4
diff -u -r1.4 head64.S
--- a/arch/parisc/kernel/head64.S 7 Feb 2004 17:56:51 -0000 1.4
+++ b/arch/parisc/kernel/head64.S 25 Apr 2004 14:48:15 -0000
@@ -88,20 +88,16 @@
mtctl %r4,%cr24 /* Initialize kernel root pointer */
mtctl %r4,%cr25 /* Initialize user root pointer */
-#if (__PAGE_OFFSET != 0x10000000UL)
-Error! Code below (the next five std's) needs to be changed
-#endif
-
- std %r3,0x00(%r4) /* Hardwired 0x1... kernel Vaddr start*/
+ std %r3,((__PAGE_OFFSET >> PGDIR_SHIFT)*8)(%r4)
ldo _PAGE_TABLE(%r1),%r3
- std %r3,0x400(%r5) /* Hardwired 0x1... kernel Vaddr start*/
+ std %r3,(ASM_PMD_ENTRY * 8) (%r5)
ldo 0x1000(%r3),%r3
- std %r3,0x408(%r5)
+ std %r3,((ASM_PMD_ENTRY + 1)*8)(%r5)
ldo 0x1000(%r3),%r3
- std %r3,0x410(%r5)
+ std %r3,((ASM_PMD_ENTRY + 2)*8)(%r5)
ldo 0x1000(%r3),%r3
- std %r3,0x418(%r5)
+ std %r3,((ASM_PMD_ENTRY + 3)*8)(%r5)
ldo _PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
$pgt_fill_loop:
Index: arch/parisc/kernel/pacache.S
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/pacache.S,v
retrieving revision 1.5
diff -u -r1.5 pacache.S
--- a/arch/parisc/kernel/pacache.S 5 Apr 2004 02:47:39 -0000 1.5
+++ b/arch/parisc/kernel/pacache.S 25 Apr 2004 14:48:16 -0000
@@ -350,10 +350,6 @@
.procend
-#if (TMPALIAS_MAP_START >= 0x80000000UL)
-Warning TMPALIAS_MAP_START changed. If > 2 Gb, code in pacache.S is bogus
-#endif
-
/*
* NOTE: Code in clear_user_page has a hard coded dependency on the
* maximum alias boundary being 4 Mb. We've been assured by the
@@ -490,6 +486,9 @@
ldil L%(TMPALIAS_MAP_START),%r28
#ifdef __LP64__
+#if (TMPALIAS_MAP_START >= 0x80000000)
+ depdi 0,31,32,%r28 /* clear any sign extension */
+#endif
extrd,u %r26,56,32,%r26 /* convert phys addr to tlb insert format */
depd %r25,63,22,%r28 /* Form aliased virtual address 'to' */
depdi 0,63,12,%r28 /* Clear any offset bits */
Index: arch/parisc/kernel/vmlinux.lds.S
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/vmlinux.lds.S,v
retrieving revision 1.11
diff -u -r1.11 vmlinux.lds.S
--- a/arch/parisc/kernel/vmlinux.lds.S 23 Apr 2004 13:57:54 -0000 1.11
+++ b/arch/parisc/kernel/vmlinux.lds.S 25 Apr 2004 14:48:16 -0000
@@ -26,6 +26,7 @@
#include <asm-generic/vmlinux.lds.h>
/* needed for the processor specific cache alignment size */
#include <asm/cache.h>
+#include <asm/page.h>
/* ld script to make hppa Linux kernel */
#ifndef CONFIG_PARISC64
@@ -45,7 +46,7 @@
SECTIONS
{
- . = 0x10100000;
+ . = KERNEL_BINARY_TEXT_START;
_text = .; /* Text and read-only data */
.text ALIGN(16) : {
Index: arch/parisc/mm/init.c
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/mm/init.c,v
retrieving revision 1.3
diff -u -r1.3 init.c
--- a/arch/parisc/mm/init.c 29 Sep 2003 16:05:00 -0000 1.3
+++ b/arch/parisc/mm/init.c 25 Apr 2004 14:48:17 -0000
@@ -424,7 +424,12 @@
* a hole of 4kB between each vmalloced area for the same reason.
*/
-#define MAP_START 0x4000 /* Leave room for gateway page expansion */
+ /* Leave room for gateway page expansion */
+#if KERNEL_MAP_START < GATEWAY_PAGE_SIZE
+#error KERNEL_MAP_START is in gateway reserved region
+#endif
+#define MAP_START (KERNEL_MAP_START)
+
#define VM_MAP_OFFSET (32*1024)
#define SET_MAP_OFFSET(x) ((void *)(((unsigned long)(x) + VM_MAP_OFFSET) \
& ~(VM_MAP_OFFSET-1)))
Index: include/asm-parisc/fixmap.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-parisc/fixmap.h,v
retrieving revision 1.1
diff -u -r1.1 fixmap.h
--- a/include/asm-parisc/fixmap.h 29 Jul 2003 17:02:03 -0000 1.1
+++ b/include/asm-parisc/fixmap.h 25 Apr 2004 14:48:36 -0000
@@ -2,18 +2,22 @@
#define _ASM_FIXMAP_H
/*
- * Allocate a 8 Mb temporary mapping area for copy_user_page/clear_user_page.
- * This area needs to be aligned on a 8 Mb boundary.
+ * This file defines the locations of the fixed mappings on parisc.
*
- * FIXME:
+ * All of the values in this file are machine virtual addresses.
*
- * For PA-RISC, this has no meaning. It is starting to be used on x86
- * for vsyscalls. PA will probably do this using space registers.
- */
+ * All of the values in this file must be <4GB (because of assembly
+ * loading restrictions). If you place this region anywhere above
+ * __PAGE_OFFSET, you must adjust the memory map accordingly */
-/* This TMPALIAS_MAP_START reserves some of the memory where the
- * FIXMAP region is on x86. It's only real use is to constrain
- * VMALLOC_END (see pktable.h) */
-#define TMPALIAS_MAP_START (__PAGE_OFFSET - 0x01000000)
+/* The alias region is used in kernel space to do copy/clear to or
+ * from areas congruently mapped with user space. It is 8MB large
+ * and must be 16MB aligned */
+#define TMPALIAS_MAP_START ((__PAGE_OFFSET) - 16*1024*1024)
+/* This is the kernel area for all maps (vmalloc, dma etc.) most
+ * usually, it extends up to TMPALIAS_MAP_START. Virtual addresses
+ * 0..GATEWAY_PAGE_SIZE are reserved for the gateway page */
+#define KERNEL_MAP_START (GATEWAY_PAGE_SIZE)
+#define KERNEL_MAP_END (TMPALIAS_MAP_START)
#endif
Index: include/asm-parisc/page.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-parisc/page.h,v
retrieving revision 1.2
diff -u -r1.2 page.h
--- a/include/asm-parisc/page.h 25 Sep 2003 01:07:21 -0000 1.2
+++ b/include/asm-parisc/page.h 25 Apr 2004 14:48:36 -0000
@@ -89,9 +89,22 @@
#define LINUX_GATEWAY_SPACE 0
+
+/* This governs the relationship between virtual and physical addresses.
+ * If you alter it, make sure to take care of our various fixed mapping
+ * segments in fixmap.h */
#define __PAGE_OFFSET (0x10000000)
#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
+
+/* The size of the gateway page (we leave lots of room for expansion) */
+#define GATEWAY_PAGE_SIZE 0x4000
+
+/* The start of the actual kernel binary---used in vmlinux.lds.S
+ * Leave some space after __PAGE_OFFSET for detecting kernel null
+ * ptr derefs */
+#define KERNEL_BINARY_TEXT_START (__PAGE_OFFSET + 0x100000)
+
/* These macros don't work for 64-bit C code -- don't allow in C at all */
#ifdef __ASSEMBLY__
# define PA(x) ((x)-__PAGE_OFFSET)
Index: include/asm-parisc/pgtable.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-parisc/pgtable.h,v
retrieving revision 1.4
diff -u -r1.4 pgtable.h
--- a/include/asm-parisc/pgtable.h 27 Jan 2004 18:46:14 -0000 1.4
+++ b/include/asm-parisc/pgtable.h 25 Apr 2004 14:48:37 -0000
@@ -110,7 +110,7 @@
#define PCXL_DMA_MAP_SIZE (8*1024*1024)
#define VMALLOC_START ((unsigned long)vmalloc_start)
/* this is a fixmap remnant, see fixmap.h */
-#define VMALLOC_END (TMPALIAS_MAP_START)
+#define VMALLOC_END (KERNEL_MAP_END)
#endif
/* NB: The tlb miss handlers make certain assumptions about the order */
next parent reply other threads:[~2004-04-25 14:55 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040425145051.10F5C4942B8@palinux.hppa>
2004-04-25 14:55 ` James Bottomley [this message]
[not found] <20040505204811.27F0C4945E4@palinux.hppa>
2004-05-05 20:50 ` [parisc-linux] Re: [parisc-linux-cvs] linux-2.6 jejb James Bottomley
2004-05-06 5:05 ` Randolph Chung
2004-05-06 5:22 ` Randolph Chung
2004-05-06 9:33 ` M. Grabert
2004-05-06 13:25 ` Kyle McMartin
[not found] <20040502161601.DC7C24945C7@palinux.hppa>
2004-05-03 20:51 ` James Bottomley
[not found] <20040501200312.40BB74945E1@palinux.hppa>
2004-05-01 20:09 ` James Bottomley
2004-05-03 8:57 ` Joel Soete
[not found] <20040501160556.D07DC4945CA@palinux.hppa>
2004-05-01 16:13 ` James Bottomley
[not found] <20040430162037.9D2B94945CD@palinux.hppa>
2004-04-30 16:25 ` James Bottomley
[not found] <20040427171140.706074945BD@palinux.hppa>
2004-04-27 17:15 ` James Bottomley
[not found] <20040414174535.81173494194@palinux.hppa>
2004-04-14 17:53 ` James Bottomley
[not found] <20040412154800.D31F6494194@palinux.hppa>
2004-04-12 15:55 ` James Bottomley
[not found] <20040407004901.031D3494194@palinux.hppa>
2004-04-07 0:54 ` James Bottomley
2004-04-08 6:15 ` Joel Soete
2004-04-08 12:36 ` James Bottomley
[not found] <20040406213446.CB675494194@palinux.hppa>
2004-04-06 21:37 ` James Bottomley
[not found] <20040405174131.84BF1494194@palinux.hppa>
2004-04-06 13:21 ` Carlos O'Donell
2004-04-06 14:18 ` James Bottomley
2004-04-06 15:40 ` Randolph Chung
[not found] <20040405024740.9330F494194@palinux.hppa>
2004-04-05 2:49 ` James Bottomley
2004-04-05 2:54 ` James Bottomley
[not found] <20040320210116.7A727494553@palinux.hppa>
2004-03-20 21:04 ` James Bottomley
2004-03-20 21:10 ` Helge Deller
2004-03-20 21:13 ` Helge Deller
[not found] <20040228212407.DB126494190@palinux.hppa>
2004-02-28 22:21 ` Joel Soete
2004-02-28 22:42 ` James Bottomley
2004-02-29 9:39 ` Joel Soete
2004-03-04 16:39 ` Joel Soete
2004-02-06 7:31 [parisc-linux] " Joel Soete
2004-02-06 17:50 ` Grant Grundler
2004-02-06 18:06 ` bame
2004-02-06 19:16 ` Randolph Chung
2004-02-06 17:08 ` Joel Soete
2004-02-07 6:40 ` Randolph Chung
2004-02-09 7:26 ` Joel Soete
[not found] <20040204182455.1CC11494191@palinux.hppa>
2004-02-05 9:20 ` [parisc-linux] " Randolph Chung
2004-02-05 15:19 ` James Bottomley
2004-02-05 15:29 ` [parisc-linux] " Joel Soete
2004-02-05 20:31 ` Randolph Chung
2004-02-05 18:49 ` Joel Soete
[not found] <20040113155603.CBCC249425A@palinux.hppa>
2004-01-13 15:58 ` [parisc-linux] " James Bottomley
[not found] <20030924175431.D51BC49408B@palinux.hppa>
2003-09-24 18:01 ` James Bottomley
[not found] <20030919010356.148684940A4@palinux.hppa>
2003-09-19 1:06 ` James Bottomley
2003-09-19 11:24 ` Randolph Chung
2003-09-19 14:02 ` James Bottomley
2003-09-19 18:24 ` Jim Hull
[not found] <20030903200300.8B7B7494064@palinux.hppa>
2003-09-03 20:07 ` James Bottomley
[not found] <20030903165113.138BF494064@palinux.hppa>
2003-09-03 16:56 ` James Bottomley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1082904942.12039.1.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=parisc-linux-cvs@lists.parisc-linux.org \
--cc=parisc-linux@lists.parisc-linux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox