Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 2003 19:09:52 -0800 (PST)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 28139 for review
Message-ID:  <200304050309.h3539qXx097978@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28139

Change 28139 by peter@peter_overcee on 2003/04/04 19:09:10

	shoot for an x86-PAE-like VM layout where there is 32 bits of
	address space.  This keeps it simpler for now.  A lot.

Affected files ...

.. //depot/projects/hammer/sys/x86_64/include/param.h#9 edit
.. //depot/projects/hammer/sys/x86_64/include/pmap.h#9 edit
.. //depot/projects/hammer/sys/x86_64/include/vmparam.h#4 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/genassym.c#13 edit

Differences ...

==== //depot/projects/hammer/sys/x86_64/include/param.h#9 (text+ko) ====

@@ -111,11 +111,15 @@
 #define	NBPML4T		(1ul<<PML4SHIFT)/* bytes/page map lev4 table */
 #define	PML4MASK	(NBPML4T-1)
 
+#define NPGPTD          4
+#define PDRSHIFT        21              /* LOG2(NBPDR) */
+ 
+#define NBPTD           (NPGPTD<<PAGE_SHIFT)
+#define NPDEPTD         (NBPTD/(sizeof (pd_entry_t)))
+
 #define IOPAGES	2		/* pages of i/o permission bitmap */
 
-#ifndef KSTACK_PAGES
 #define	KSTACK_PAGES	4	/* pages of kstack (with pcb) */
-#endif
 #define UAREA_PAGES	1	/* holds struct user WITHOUT PCB (see def.) */
 
 #define KSTACK_GUARD	1	/* compile in the kstack guard page */

==== //depot/projects/hammer/sys/x86_64/include/pmap.h#9 (text+ko) ====

@@ -87,8 +87,8 @@
  * entries.  We use half of them for the kernel due to the 48 bit
  * virtual address sign extension.
  */
-#define KVA_PAGES	256
-
+#define KVA_PAGES	512
+  
 /*
  * Pte related macros.  This is complicated by having to deal with
  * the sign extension of the 48th bit.
@@ -103,18 +103,19 @@
 
 
 #ifndef NKPT
-#define	NKPT		30	/* initial number of kernel page tables */
+#define	NKPT		120	/* initial number of kernel page tables */
+#endif
+#ifndef	NKPDE
+#define	NKPDE	(KVA_PAGES - 1)	/* number of page tables/pde's */
 #endif
-#define NKPML4E	(KVA_PAGES - 1)	/* addressable number of page tables/pde's */
+#define NKPML4E	(1)		/* addressable number of page tables/pde's */
+#define NKPDPE	(1)		/* addressable number of page tables/pde's */
 
 /*
  * The *PTDI values control the layout of virtual memory
  */
-#define	APML4PML4I	(NPML4EPG-1)	/* alt ptd entry that points to APTD */
-#define	KPML4I		(NPML4EPG/2)	/* start of kernel virtual pde's */
-/* Hole */
-#define	PML4PML4I	(KPTDI-1)	/* pml4 entry that points to ptd! */
-#define	UMAXPML4I	(PML4PML4I-1)	/* pml4 entry for user space end */
+#define	KPTDI		((NPDEPTD-1)-NKPDE)/* start of kernel virtual pde's */
+#define	PTDPTDI		(KPTDI-NPGPTD)	/* ptd entry that points to ptd! */
 
 /*
  * XXX doesn't really belong here I guess...

==== //depot/projects/hammer/sys/x86_64/include/vmparam.h#4 (text+ko) ====

@@ -86,13 +86,13 @@
  * messy at times, but hey, we'll do anything to save a page :-)
  */
 
-#define VM_MAX_KERNEL_ADDRESS	VADDR(KPML4I+NKML4E, 0, 0, 0)
-#define VM_MIN_KERNEL_ADDRESS	VADDR(KPML4I, 0, 0, 0)
+#define VM_MAX_KERNEL_ADDRESS	VADDR(0, 0, KPTDI+NKPDE, 0)
+#define VM_MIN_KERNEL_ADDRESS	VADDR(0, 0, PTDPTDI, PTDPTDI)
 
 #define	KERNBASE		VM_MIN_KERNEL_ADDRESS
 
-#define UPT_MAX_ADDRESS		VADDR(PML4PML4I, PML4PML4I, 0, 0)
-#define UPT_MIN_ADDRESS		VADDR(PML4PML4I, 0, 0, 0)
+#define UPT_MAX_ADDRESS		VADDR(0, 0, PTDPTDI, PTDPTDI)
+#define UPT_MIN_ADDRESS		VADDR(0, 0, PTDPTDI, 0)
 
 #define VM_MAXUSER_ADDRESS	UPT_MIN_ADDRESS
 

==== //depot/projects/hammer/sys/x86_64/x86_64/genassym.c#13 (text+ko) ====

@@ -124,14 +124,12 @@
 ASSYM(PCB_GS, offsetof(struct pcb, pcb_gs));
 ASSYM(PCB_PSL, offsetof(struct pcb, pcb_psl));
 
-ASSYM(PCB_SPARE, offsetof(struct pcb, __pcb_spare));
 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
 ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save));
 ASSYM(PCB_SAVEFPU_SIZE, sizeof(struct savefpu));
 ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
 
 ASSYM(PCB_SIZE, sizeof(struct pcb));
-ASSYM(PCB_VM86CALL, PCB_VM86CALL);
 
 ASSYM(TF_TRAPNO, offsetof(struct trapframe, tf_trapno));
 ASSYM(TF_ERR, offsetof(struct trapframe, tf_err));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304050309.h3539qXx097978>