long format VHPT
Hi
This is an updated version of the long format VHPT patch posted earlier.
Changes:
Added #ifdef to allow compile without long format Updated compute_vhpt_size(void) to remove compiler warnings
Added comments to explain some code fragments.
Tested with
- SMP
- UP
Require
- NUMA testing.
- comments
Thanks
--------------------------------------------------
Darren Williams <[email protected]>
Gelato@UNSW <www.gelato.unsw.edu.au>
--------------------------------------------------
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet v2.6.0-test6 -> 1.1376
# include/asm-ia64/mmu_context.h 1.15 -> 1.17
# include/asm-ia64/page.h 1.21 -> 1.22
# arch/ia64/kernel/setup.c 1.59 -> 1.61
# arch/ia64/kernel/ivt.S 1.23 -> 1.24
# include/asm-ia64/kregs.h 1.6 -> 1.7
# include/asm-ia64/asmmacro.h 1.12 -> 1.13
# arch/ia64/kernel/smpboot.c 1.39 -> 1.40
# include/asm-ia64/pgtable.h 1.28 -> 1.29
# include/asm-ia64/tlb.h 1.16 -> 1.17
# arch/ia64/mm/init.c 1.48 -> 1.50
# Makefile 1.432 -> 1.433
# arch/ia64/kernel/patch.c 1.5 -> 1.6
# arch/ia64/mm/tlb.c 1.19 -> 1.20
# include/asm-ia64/tlbflush.h 1.9 -> 1.10
# arch/ia64/Kconfig 1.46 -> 1.47
# arch/ia64/kernel/traps.c 1.39 -> 1.40
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/09/27 [email protected] 1.1375
# Linux 2.6.0-test6
# --------------------------------------------
# 03/10/03 dsw@quasar.(none) 1.1376
# Clean up compiler warnings and add comments
# --------------------------------------------
#
Makefile +1 -1
@@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 0 -EXTRAVERSION = -test6 +EXTRAVERSION = -test6-vhpt # *DOCUMENTATION* # To see a list of typical targets execute "make help"
arch/ia64/Kconfig +4 -1
@@ -685,7 +685,10 @@ debugging info resulting in a larger kernel image. Say Y here only if you plan to use gdb to debug the kernel. If you don't debug the kernel, you can say N. - + +config IA64_LONG_FORMAT_VHPT + bool "Long format VHPT" + endmenu source "security/Kconfig"
arch/ia64/kernel/ivt.S +48 -80
287 lines not on this page · raw message
arch/ia64/kernel/patch.c +0 -2
@@ -145,7 +145,6 @@extern unsigned long fsyscall_table[NR_syscalls];s32 *offp = (s32 *) start;u64 ip; -while (offp < (s32 *) end) { ip = (u64 )ia64_imva ((char *) offp + *offp);ia64_patch_imm64 (ip, (u64 ) fsyscall_table);
@@ -179,7 +178,6 @@ {# define START (name) ((unsigned long) __start_gate_##name##_patchlist)# define END (name) ((unsigned long)__end_gate_##name##_patchlist) -patch_fsyscall_table (START (fsyscall),END (fsyscall));patch_brl_fsys_bubble_down (START (brl_fsys_bubble_down),END (brl_fsys_bubble_down));ia64_patch_vtop (START (vtop),END (vtop));
arch/ia64/kernel/setup.c +13 -0
@@ -225,6 +225,15 @@#endif } +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +void __init +compute_vhpt_size (void ) +{ + long_vhpt_bits =22 ; + long_vhpt_size =1 << long_vhpt_bits; +} +#endif +void __init setup_arch (char **cmdline_p) {
@@ -240,6 +249,10 @@efi_init ();find_memory (); + +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +compute_vhpt_size (); +#endif #ifdef CONFIG_ACPI_BOOT /* Initialize the ACPI boot-time table parser */
arch/ia64/kernel/smpboot.c +7 -1
@@ -381,7 +381,13 @@unhash_process (idle); task_for_booting_cpu = idle; - +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +if (alloc_vhpt (cpu)) { +panic ("Couldn't allocate VHPT on CPU%d, size: %lx\n" , cpu, long_vhpt_size); + } +printk (KERN_INFO "Allocated long format VHPT for CPU%d at: %lx, size: 0x%lx\n" , cpu, vhpt_base[cpu], long_vhpt_size); +#endif /* CONFIG_IA64_LONG_FORMAT_VHPT */ +Dprintk ("Sending wakeup vector %lu to AP 0x%x/0x%x.\n" , ap_wakeup_vector, cpu, sapicid);platform_send_ipi (cpu, ap_wakeup_vector,IA64_IPI_DM_INT ,0 );
arch/ia64/kernel/traps.c +1 -1
@@ -454,7 +454,7 @@"Unknown fault 9" ,"Unknown fault 10" ,"Unknown fault 11" ,"Unknown fault 12" , "Unknown fault 13", "Unknown fault 14", "Unknown fault 15" }; - +if ((isr &IA64_ISR_NA ) && ((isr &IA64_ISR_CODE_MASK ) ==IA64_ISR_CODE_LFETCH )) {/* * This fault was due to lfetch.fault, set "ed" bit in the psr to cancel
arch/ia64/mm/init.c +65 -4
131 lines not on this page · raw message
arch/ia64/mm/tlb.c +47 -0
65 lines not on this page · raw message
include/asm-ia64/asmmacro.h +131 -0
142 lines not on this page · raw message
include/asm-ia64/kregs.h +1 -0
@@ -30,6 +30,7 @@#define IA64_TR_PALCODE 1/* itr1: maps PALcode as required by EFI */ #define IA64_TR_PERCPU_DATA 1/* dtr1: percpu data */ #define IA64_TR_CURRENT_STACK 2/* dtr2: maps kernel's memory- & register-stacks */ +#define IA64_TR_LONG_VHPT 3/* dtr3: maps long format VHPT */ /* Processor status register bits: */ #define IA64_PSR_BE_BIT 1
include/asm-ia64/mmu_context.h +24 -1
@@ -17,7 +17,21 @@#define IA64_REGION_ID_KERNEL 0/* the kernel's region id (tlb.c depends on this being 0) */ -#define ia64_rid (ctx,addr) (((ctx) << 3) | (addr >> 61)) +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +/* +* Due to a high number of collisions in the long format VHPT walker hash function +* when RIDs and similar address space layout occur "eg. fork()". The following is +* used to space out the RIDs we present to the hardware without messing with Linux's +* sequential allocation scheme. +* Refer to 'Intel Itanium Processor Reference Manual for Software Development' +* http://www.intel.com/design/itanium/manuals.htm +*/ +#define redistribute_rid (rid) (((rid) & ~0xffff) | (((rid) << 8) & 0xff00) | (((rid) >> 8) & 0xff)) +#else +#define redistribute_rid (rid) (rid) +#endif + +#define ia64_rid (ctx,addr) redistribute_rid(((ctx) << 3) | (addr >> 61))# ifndef __ASSEMBLY__
@@ -141,7 +155,12 @@unsigned long rr0, rr1, rr2, rr3, rr4; rid = context <<3 ;/* make space for encoding the region number */ +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT + rid =redistribute_rid (rid); + rid_incr =1 <<16 ; +#else rid_incr =1 <<8 ; +#endif /* encode the region id, preferred page size, and VHPT enable bit: */ rr0 = (rid <<8 ) | (PAGE_SHIFT <<2 ) |1 ;
@@ -173,6 +192,10 @@MMU_TRACE ('a' ,smp_processor_id (), mm, context);/* in the unlikely event of a TLB-flush by another thread, redo the load: */ }while (unlikely (context != mm->context)); + +#if defined(CONFIG_IA64_LONG_FORMAT_VHPT ) && defined(CONFIG_SMP ) +set_bit (smp_processor_id (), &mm->cpu_vm_mask); +#endif }#define deactivate_mm (tsk,mm) \
include/asm-ia64/page.h +3 -0
@@ -151,6 +151,9 @@return order; } +/* Long format VHPT entry */ +typedef struct {unsigned long pte, itir, tag, ig; }long_pte_t ; +# endif /* __KERNEL__ */ #endif /* !__ASSEMBLY__ */
include/asm-ia64/pgtable.h +11 -0
@@ -474,6 +474,12 @@extern void memmap_init (struct page *start,unsigned long size,int nid,unsigned long zone,unsigned long start_pfn);# endif /* CONFIG_VIRTUAL_MEM_MAP */ + +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +extern unsigned long vhpt_base[NR_CPUS ]; +extern unsigned long long_vhpt_bits, long_vhpt_size; +#endif +# endif /* !__ASSEMBLY__ */ /*
@@ -492,6 +498,11 @@*/ #define KERNEL_TR_PAGE_SHIFT _PAGE_SIZE_64M#define KERNEL_TR_PAGE_SIZE (1 << KERNEL_TR_PAGE_SHIFT) + +/* +* Long format VHPT +*/ +#define LONG_VHPT_BASE (0xc000000000000000 - long_vhpt_size)/* * No page table caches to initialise
include/asm-ia64/tlb.h +2 -0
@@ -105,8 +105,10 @@ vma.vm_mm = tlb->mm;/* flush the address range from the tlb: */ flush_tlb_range (&vma, start, end); +#ifndef CONFIG_IA64_LONG_FORMAT_VHPT /* now flush the virt. page-table area mapping the address range: */ flush_tlb_range (&vma,ia64_thash (start),ia64_thash (end)); +#endif }/* lastly, release the freed pages */
include/asm-ia64/tlbflush.h +19 -0
@@ -19,6 +19,21 @@* can be very expensive, so try to avoid them whenever possible. */ +/* Flushing a translation from the long format VHPT */ +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +# define INVALID_TAG (1UL << 63) + +static inline void +flush_vhpt_page (unsigned long addr) +{ +long_pte_t *hpte; + hpte = (long_pte_t *)ia64_thash (addr); + hpte->tag =INVALID_TAG ; +} +#else +# define flush_vhpt_page (addr) do { } while (0) +#endif +/* * Flush everything (kernel mapping may also have changed due to * vmalloc/vfree).
@@ -53,6 +68,7 @@ goto out; mm->context =0 ; + mm->cpu_vm_mask =0 ;if (atomic_read (&mm->mm_users) ==0 ) goto out;/* happens as a result of exit_mmap() */
@@ -78,7 +94,10 @@flush_tlb_range (vma, (addr &PAGE_MASK ), (addr &PAGE_MASK ) +PAGE_SIZE );#else if (vma->vm_mm == current->active_mm) + { +flush_vhpt_page (addr);ia64_ptcl (addr, (PAGE_SHIFT <<2 )); + }else vma->vm_mm->context =0 ;#endif
Quoted 6 lines · Darren Williams
Hi
This is an updated version of the long format VHPT patch posted earlier.
Changes:
Added #ifdef to allow compile without long format Updatedcompute_vhpt_size(void)to remove compiler warnings
Actually, I moved compute_vhpt_size() to arch/ia64/mm/init.c, where I think it belongs and added lvhpt_adjust to let the user override whatever "intellligent" algorithm we come up with. This required adding parse_early_cmdline().
-Arun
include/asm-ia64/asmmacro.h +131 -0
@@ -4,6 +4,11 @@/* * Copyright (C) 2000-2001, 2003 Hewlett-Packard Co * David Mosberger-Tang <[email protected]> +* +* 25/09/03 Darren Williams <[email protected]> move Long format VHPT MACROS +* from ivt.S to here. I though that this would keep the placement of +* code and MACROS correct. +* */ #include <linux/config.h>
@@ -84,4 +89,130 @@# define MCKINLEY_E9_WORKAROUND #endif + +/* +* Find a page table entry with the long format VHPT walker +*/ +#define temp r24 +#define rgn r25 +#define mbz r26 +/* va=r16 ppte=r19 fail=p6 ok=p7 */ +#define FIND_PTE (va, ppte, fail, ok) \ + rsm psr.dt;/* switch to using physical data addressing */ \ +mov ppte=IA64_KR (PT_BASE );/* get the page table base address */ \ + shl mbz=va,3; /* shift bit 60 into sign bit */ \ + shr.u rgn=va,61; /* get the region number into 'rgn' */ \ + ;; \ + cmp.eq p6,p7=5,rgn; /* is faulting address in region 5? */ \ + shr.u temp=va,PGDIR_SHIFT; /* get bits 33-63 of faulting address */ \ + ;; \ +(p7) dep ppte=rgn,ppte,(PAGE_SHIFT-3),3; /* put region number bits in place */ \ + srlz.d; \ +LOAD_PHYSICAL (p6, ppte, swapper_pg_dir);/* region 5 is rooted at swapper_pg_dir */ \ + \ + .pred.rel "mutex", p6, p7; \ +(p6) shr.u mbz=mbz,PGDIR_SHIFT+PAGE_SHIFT; \ +(p7) shr.u mbz=mbz,PGDIR_SHIFT+PAGE_SHIFT-3; \ + ;; \ +(p6) dep ppte=temp,ppte,3,(PAGE_SHIFT-3); /* ppte=PTA + IFA(33,42)*8 */ \ +(p7) dep ppte=temp,ppte,3,(PAGE_SHIFT-6); /* ppte=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8) */ \ + cmp.eq ok,fail=0,mbz; /* unused address bits all zeroes? */ \ + shr.u temp=va,PMD_SHIFT; /* shift L2 index into position */ \ + ;; \ + ld8 ppte=[ppte]; /* fetch the L1 entry (may be 0)*/ \ + ;; \ +(ok) cmp.eq fail,ok=ppte,r0; /* was L1 entry NULL?*/ \ + dep ppte=temp,ppte,3,(PAGE_SHIFT-3); /* compute address of L2 page table entry*/ \ + ;; \ +(ok) ld8 ppte=[ppte]; /* fetch the L2 entry (may be 0)*/ \ + shr.u temp=va,PAGE_SHIFT; /* shift L3 index into position*/ \ + ;; \ +(ok) cmp.eq.or.andcm fail,ok=ppte,r0; /* was L2 entry NULL?*/ \ + dep ppte=temp,ppte,3,(PAGE_SHIFT-3); /* compute address of L3 page table entry*/ + +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT + +#define LOAD_PTE_MISS (va, ppte, pte, hpte, failfn) \ + ;; \ + FIND_PTE(va, ppte, p6, p7) \ + ;; \ +(p7) ld8 pte=[ppte]; \ + ;; \ +(p7) tbit.z p6,p0=pte,_PAGE_P_BIT;/* page present bit cleared? */ \ +(p6) br.cond.spnt failfn; + +/* Since we access the page table physically, we access the long VHPT physically as well +* to avoid switching back and forth */ + + +#define tag r25 +#define htag r26 +#define LOAD_PTE_FAULT(va, ppte, pte, hpte, failfn) \ + thash hpte=va; \ + rsm psr.dt; \ + ;; \ + tpa hpte=hpte; /* make hash address physical */ \ + ttag tag=va; \ + ;; \ + srlz.d; \ + add temp=16,hpte; \ + add ppte=24,hpte; \ + ;; \ + ld8 htag=[temp]; \ + ld8 ppte=[ppte]; \ + ;; \ + cmp.ne p6,p7=htag, tag;/* verify tag */ \ + ;; \ +(p7) ld8 pte=[ppte]; \ +(p6) br.cond.spnt failfn; + +#define tir r26 +#define VHPT_INSERT (va, ppte, pte, hpte) \ + mov hpte=cr.iha; \ + mov tir=cr.itir; \ + ;; \ + tpa hpte=hpte;/* make hash address physical */ \ +ttag tag=va; \ + ;; \ +add temp=16 ,hpte; \ + ;; \ + st8 [hpte]=pte,8 ;/* fill out VHPT entry */ \ + st8 [temp]=tag,8 ; \ + ;; \ + st8 [hpte]=tir,8 ; \ + st8 [temp]=ppte; + +#define VHPT_UPDATE (cond, pte, hpte) \ +(cond) st8 [hpte]=pte,16; + +#define VHPT_PURGE (cond, hpte) \ +(cond) dep tag=-1,r0,63,1;/* set tag-invalid bit */ \ + ;; \ +(cond ) st8 [hpte]=tag;/* hpte already points to tag (see above) */ + +#else /* !CONFIG_IA64_LONG_FORMAT_VHPT */ + +#define LOAD_PTE_MISS (va, ppte, pte, hpte, failfn) \ + mov ppte=cr.iha;/* get virtual address of L3 PTE */ \ +movl r30=1f ;/* load continuation point */ \ + ;; \ +1: ld8 pte=[ppte]; \ +mov b0=r29;/* restore possibly destroyed b0 */ \ + ;; \ + tbit.z p6,p0=pte,_PAGE_P_BIT; /* page present bit cleared? */ \ +(p6) br.cond.spnt failfn; + +#define LOAD_PTE_FAULT (va, ppte, pte, hpte, failfn) \ + thash ppte=va;/* get virtual address of L3 PTE */ \ +movl r30=1f ;/* load continuation point */ \ + ;; \ +1: ld8 pte=[ppte]; \ +mov b0=r29;/* restore possibly destroyed b0 */ + +#define VHPT_INSERT (va, ppte, pte, hpte)/* nothing */ +#define VHPT_UPDATE (cond, pte, hpte)/* nothing */ +#define VHPT_PURGE (cond, hpte)/* nothing */ +#endif + +#endif /* _ASM_IA64_ASMMACRO_H */
include/asm-ia64/tlb.h +2 -0
@@ -105,8 +105,10 @@ vma.vm_mm = tlb->mm;/* flush the address range from the tlb: */ flush_tlb_range (&vma, start, end); +#ifndef CONFIG_IA64_LONG_FORMAT_VHPT /* now flush the virt. page-table area mapping the address range: */ flush_tlb_range (&vma,ia64_thash (start),ia64_thash (end)); +#endif }/* lastly, release the freed pages */
include/asm-ia64/tlbflush.h +19 -0
@@ -19,6 +19,21 @@* can be very expensive, so try to avoid them whenever possible. */ +/* Flushing a translation from the long format VHPT */ +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +# define INVALID_TAG (1UL << 63) + +static inline void +flush_vhpt_page (unsigned long addr) +{ +long_pte_t *hpte; + hpte = (long_pte_t *)ia64_thash (addr); + hpte->tag =INVALID_TAG ; +} +#else +# define flush_vhpt_page (addr) do { } while (0) +#endif +/* * Flush everything (kernel mapping may also have changed due to * vmalloc/vfree).
@@ -53,6 +68,7 @@ goto out; mm->context =0 ; + mm->cpu_vm_mask =0 ;if (atomic_read (&mm->mm_users) ==0 ) goto out;/* happens as a result of exit_mmap() */
@@ -78,7 +94,10 @@flush_tlb_range (vma, (addr &PAGE_MASK ), (addr &PAGE_MASK ) +PAGE_SIZE );#else if (vma->vm_mm == current->active_mm) + { +flush_vhpt_page (addr);ia64_ptcl (addr, (PAGE_SHIFT <<2 )); + }else vma->vm_mm->context =0 ;#endif
include/asm-ia64/mmu_context.h +24 -1
@@ -17,8 +17,22 @@#define IA64_REGION_ID_KERNEL 0/* the kernel's region id (tlb.c depends on this being 0) */ -#define ia64_rid (ctx,addr) (((ctx) << 3) | (addr >> 61)) +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +/* +* Due to a high number of collisions in the long format VHPT walker hash function +* when RIDs and similar address space layout occur "eg. fork()". The following is +* used to space out the RIDs we present to the hardware without messing with Linux's +* sequential allocation scheme. +* Refer to 'Intel Itanium Processor Reference Manual for Software Development' +* http://www.intel.com/design/itanium/manuals.htm +*/ +#define redistribute_rid (rid) (((rid) & ~0xffff) | (((rid) << 8) & 0xff00) | (((rid) >> 8) & 0xff)) +#else +#define redistribute_rid (rid) (rid) +#endif +#define ia64_rid (ctx,addr) redistribute_rid(((ctx) << 3) | (addr >> 61)) +# ifndef __ASSEMBLY__#include <linux/compiler.h>
@@ -141,7 +155,12 @@unsigned long rr0, rr1, rr2, rr3, rr4; rid = context <<3 ;/* make space for encoding the region number */ +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT + rid =redistribute_rid (rid); + rid_incr =1 <<16 ; +#else rid_incr =1 <<8 ; +#endif /* encode the region id, preferred page size, and VHPT enable bit: */ rr0 = (rid <<8 ) | (PAGE_SHIFT <<2 ) |1 ;
@@ -173,6 +192,10 @@MMU_TRACE ('a' ,smp_processor_id (), mm, context);/* in the unlikely event of a TLB-flush by another thread, redo the load: */ }while (unlikely (context != mm->context)); + +#if defined(CONFIG_IA64_LONG_FORMAT_VHPT ) && defined(CONFIG_SMP ) +set_bit (smp_processor_id (), &mm->cpu_vm_mask); +#endif }#define deactivate_mm (tsk,mm) \
include/asm-ia64/pgtable.h +11 -0
@@ -473,6 +473,12 @@extern void memmap_init (struct page *start,unsigned long size,int nid,unsigned long zone,unsigned long start_pfn);# endif /* CONFIG_VIRTUAL_MEM_MAP */ + +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +extern unsigned long vhpt_base[NR_CPUS ]; +extern unsigned long long_vhpt_bits, long_vhpt_size; +#endif +# endif /* !__ASSEMBLY__ */ /*
@@ -492,6 +498,11 @@#define KERNEL_TR_PAGE_SHIFT _PAGE_SIZE_64M#define KERNEL_TR_PAGE_SIZE (1 << KERNEL_TR_PAGE_SHIFT) +/* +* Long format VHPT +*/ +#define LONG_VHPT_BASE (0xc000000000000000 - long_vhpt_size) +/* * No page table caches to initialise */
include/asm-ia64/kregs.h +1 -0
@@ -30,6 +30,7 @@#define IA64_TR_PALCODE 1/* itr1: maps PALcode as required by EFI */ #define IA64_TR_PERCPU_DATA 1/* dtr1: percpu data */ #define IA64_TR_CURRENT_STACK 2/* dtr2: maps kernel's memory- & register-stacks */ +#define IA64_TR_LONG_VHPT 3/* dtr3: maps long format VHPT */ /* Processor status register bits: */ #define IA64_PSR_BE_BIT 1
include/asm-ia64/page.h +3 -0
@@ -151,6 +151,9 @@return order; } +/* Long format VHPT entry */ +typedef struct {unsigned long pte, itir, tag, ig; }long_pte_t ; +# endif /* __KERNEL__ */ #endif /* !__ASSEMBLY__ */
arch/ia64/Kconfig +4 -1
@@ -685,7 +685,10 @@ debugging info resulting in a larger kernel image. Say Y here only if you plan to use gdb to debug the kernel. If you don't debug the kernel, you can say N. - + +config IA64_LONG_FORMAT_VHPT + bool "Long format VHPT" + endmenu source "security/Kconfig"
arch/ia64/kernel/setup.c +20 -1
@@ -225,6 +225,17 @@#endif } +static void __init parse_cmdline_early (char ** cmdline_p) +{ +char *p; +extern int lvhpt_adj_setup (char *s); + +strlcpy (saved_command_line, *cmdline_p,sizeof (saved_command_line)); +if ((p =strstr (*cmdline_p,"lvhpt_adjust=" ))) { +lvhpt_adj_setup (p +13 ); + } +} +void __init setup_arch (char **cmdline_p) {
@@ -235,12 +246,20 @@ia64_patch_vtop ((u64 ) __start___vtop_patchlist, (u64 ) __end___vtop_patchlist); + *cmdline_p =__va (ia64_boot_param->command_line); -strlcpy (saved_command_line, *cmdline_p,sizeof (saved_command_line)); +parse_cmdline_early (cmdline_p);efi_init ();find_memory (); +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT + { +extern void compute_vhpt_size (void ); +compute_vhpt_size (); + } +#endif +#ifdef CONFIG_ACPI_BOOT /* Initialize the ACPI boot-time table parser */ acpi_table_init ();
arch/ia64/kernel/ivt.S +48 -80
287 lines not on this page · raw message
arch/ia64/kernel/smpboot.c +7 -1
@@ -381,7 +381,13 @@unhash_process (idle); task_for_booting_cpu = idle; - +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT +if (alloc_vhpt (cpu)) { +panic ("Couldn't allocate VHPT on CPU%d, size: %lx\n" , cpu, long_vhpt_size); + } +printk (KERN_INFO "Allocated long format VHPT for CPU%d at: %lx, size: 0x%lx\n" , cpu, vhpt_base[cpu], long_vhpt_size); +#endif /* CONFIG_IA64_LONG_FORMAT_VHPT */ +Dprintk ("Sending wakeup vector %lu to AP 0x%x/0x%x.\n" , ap_wakeup_vector, cpu, sapicid);platform_send_ipi (cpu, ap_wakeup_vector,IA64_IPI_DM_INT ,0 );
arch/ia64/kernel/patch.c +0 -2
@@ -145,7 +145,6 @@extern unsigned long fsyscall_table[NR_syscalls];s32 *offp = (s32 *) start;u64 ip; -while (offp < (s32 *) end) { ip = (u64 )ia64_imva ((char *) offp + *offp);ia64_patch_imm64 (ip, (u64 ) fsyscall_table);
@@ -179,7 +178,6 @@ {# define START (name) ((unsigned long) __start_gate_##name##_patchlist)# define END (name) ((unsigned long)__end_gate_##name##_patchlist) -patch_fsyscall_table (START (fsyscall),END (fsyscall));patch_brl_fsys_bubble_down (START (brl_fsys_bubble_down),END (brl_fsys_bubble_down));ia64_patch_vtop (START (vtop),END (vtop));
arch/ia64/mm/tlb.c +47 -0
65 lines not on this page · raw message
arch/ia64/mm/init.c +85 -4
152 lines not on this page · raw message
Here's an incremental patch that adds Huge TLB support.
-Arun
Quoted 10 lines · Arun Sharma
Quoted 6 lines · Darren Williams
Hi
This is an updated version of the long format VHPT patch posted earlier.
Changes:
Added #ifdef to allow compile without long format Updatedcompute_vhpt_size(void)to remove compiler warnings
Quoted 5 lines
Actually, I moved
compute_vhpt_size()toarch/ia64/mm/init.c, where I think it belongs and addedlvhpt_adjustto let the user override whatever "intellligent" algorithm we come up with. This required addingparse_early_cmdline().-Arun
include/asm-ia64/asmmacro.h +24 -4
@@ -98,18 +98,38 @@/* * Find a page table entry with the long format VHPT walker */ +#define eva r22/* effective va after accounting for hugepages */ #define temp r24#define rgn r25 -#define mbz r26 +#define tir r26 +#define mbz r27 + +#ifdef CONFIG_HUGETLB_PAGE +#define HUGETLB_GET_ITIR (tir) mov tir=cr.itir +#define HUGETLB_GET_EVA (tir, temp, va, eva) \ + extr.u temp=tir,2,6/* extract the default page size bits */ \ + ;; \ + cmp.eq p6,p7=HPAGE_SHIFT,temp /* default page size is huge page size ? */ \ + ;; \ +(p6) shr eva=va,HPAGE_SHIFT-PAGE_SHIFT; \ +(p7) mov eva=va \ + ;; +#else /* !CONFIG_HUGETLB_PAGE */ +#define HUGETLB_GET_ITIR (tir) +#define HUGETLB_GET_EVA (tir, temp, va, eva) mov eva=va;; +#endif /* !CONFIG_HUGETLB_PAGE */ +/* va=r16 ppte=r19 fail=p6 ok=p7 */ #define FIND_PTE (va, ppte, fail, ok) \ + HUGETLB_GET_ITIR(tir); \ rsm psr.dt;/* switch to using physical data addressing */ \mov ppte=IA64_KR (PT_BASE );/* get the page table base address */ \ shl mbz=va,3; /* shift bit 60 into sign bit */ \ shr.u rgn=va,61; /* get the region number into 'rgn' */ \ ;; \ +HUGETLB_GET_EVA (tir, temp, va, eva) \ cmp.eq p6,p7=5,rgn; /* is faulting address in region 5? */ \ - shr.u temp=va,PGDIR_SHIFT; /* get bits 33-63 of faulting address */ \ + shr.u temp=eva,PGDIR_SHIFT; /* get bits 33-63 of faulting address */ \ ;; \ (p7) dep ppte=rgn,ppte,(PAGE_SHIFT-3),3; /* put region number bits in place */ \ srlz.d; \
@@ -122,7 +142,7 @@ (p6) dep ppte=temp,ppte,3,(PAGE_SHIFT-3); /* ppte=PTA + IFA(33,42)*8 */ \ (p7) dep ppte=temp,ppte,3,(PAGE_SHIFT-6); /* ppte=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8) */ \ cmp.eq ok,fail=0,mbz; /* unused address bits all zeroes? */ \ - shr.u temp=va,PMD_SHIFT; /* shift L2 index into position */ \ + shr.u temp=eva,PMD_SHIFT; /* shift L2 index into position */ \ ;; \ ld8 ppte=[ppte]; /* fetch the L1 entry (may be 0)*/ \ ;; \
@@ -130,7 +150,7 @@ dep ppte=temp,ppte,3,(PAGE_SHIFT-3); /* compute address of L2 page table entry*/ \ ;; \ (ok) ld8 ppte=[ppte]; /* fetch the L2 entry (may be 0)*/ \ - shr.u temp=va,PAGE_SHIFT; /* shift L3 index into position*/ \ + shr.u temp=eva,PAGE_SHIFT; /* shift L3 index into position*/ \ ;; \ (ok) cmp.eq.or.andcm fail,ok=ppte,r0; /* was L2 entry NULL?*/ \ dep ppte=temp,ppte,3,(PAGE_SHIFT-3); /* compute address of L3 page table entry*/