Commit 4cb92025 authored by David S. Miller's avatar David S. Miller Committed by Linus Torvalds

[SPARC64]: Get hugetlb support back into working shape.

parent 59488495
...@@ -211,6 +211,22 @@ config RWSEM_XCHGADD_ALGORITHM ...@@ -211,6 +211,22 @@ config RWSEM_XCHGADD_ALGORITHM
bool bool
default y default y
choice
prompt "SPARC64 Huge TLB Page Size"
depends on HUGETLB_PAGE
default HUGETLB_PAGE_SIZE_4MB
config HUGETLB_PAGE_SIZE_4MB
bool "4MB"
config HUGETLB_PAGE_SIZE_512K
bool "512K"
config HUGETLB_PAGE_SIZE_64K
bool "64K"
endchoice
config GENERIC_ISA_DMA config GENERIC_ISA_DMA
bool bool
default y default y
......
...@@ -62,6 +62,9 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=m ...@@ -62,6 +62,9 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_SPARC64=y CONFIG_SPARC64=y
CONFIG_HOTPLUG=y CONFIG_HOTPLUG=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_HUGETLB_PAGE_SIZE_4MB=y
# CONFIG_HUGETLB_PAGE_SIZE_512K is not set
# CONFIG_HUGETLB_PAGE_SIZE_64K is not set
CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_ISA_DMA=y
CONFIG_SBUS=y CONFIG_SBUS=y
CONFIG_SBUSCHAR=y CONFIG_SBUSCHAR=y
...@@ -315,6 +318,11 @@ CONFIG_AIC79XX_DEBUG_MASK=0 ...@@ -315,6 +318,11 @@ CONFIG_AIC79XX_DEBUG_MASK=0
# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set # CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
# CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_MEGARAID is not set
CONFIG_SCSI_SATA=y
CONFIG_SCSI_SATA_SVW=m
CONFIG_SCSI_ATA_PIIX=m
CONFIG_SCSI_SATA_PROMISE=m
CONFIG_SCSI_SATA_VIA=m
# CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_CPQFCTS is not set
CONFIG_SCSI_DMX3191D=m CONFIG_SCSI_DMX3191D=m
...@@ -713,7 +721,6 @@ CONFIG_SIS900=m ...@@ -713,7 +721,6 @@ CONFIG_SIS900=m
CONFIG_EPIC100=m CONFIG_EPIC100=m
CONFIG_SUNDANCE=m CONFIG_SUNDANCE=m
CONFIG_SUNDANCE_MMIO=y CONFIG_SUNDANCE_MMIO=y
# CONFIG_TLAN is not set
CONFIG_VIA_RHINE=m CONFIG_VIA_RHINE=m
# CONFIG_VIA_RHINE_MMIO is not set # CONFIG_VIA_RHINE_MMIO is not set
...@@ -784,7 +791,6 @@ CONFIG_NET_WIRELESS=y ...@@ -784,7 +791,6 @@ CONFIG_NET_WIRELESS=y
# #
# CONFIG_TR is not set # CONFIG_TR is not set
CONFIG_NET_FC=y CONFIG_NET_FC=y
# CONFIG_RCPCI is not set
CONFIG_SHAPER=m CONFIG_SHAPER=m
# #
...@@ -1115,8 +1121,8 @@ CONFIG_DEVPTS_FS=y ...@@ -1115,8 +1121,8 @@ CONFIG_DEVPTS_FS=y
CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_XATTR=y
# CONFIG_DEVPTS_FS_SECURITY is not set # CONFIG_DEVPTS_FS_SECURITY is not set
# CONFIG_TMPFS is not set # CONFIG_TMPFS is not set
# CONFIG_HUGETLBFS is not set CONFIG_HUGETLBFS=y
# CONFIG_HUGETLB_PAGE is not set CONFIG_HUGETLB_PAGE=y
CONFIG_RAMFS=y CONFIG_RAMFS=y
# #
......
This diff is collapsed.
...@@ -1166,7 +1166,11 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) ...@@ -1166,7 +1166,11 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
pte_t *pte; pte_t *pte;
#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */ #if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
set_page_count(page, 1);
ClearPageCompound(page);
set_page_count((page + 1), 1); set_page_count((page + 1), 1);
ClearPageCompound(page + 1);
#endif #endif
paddr = (unsigned long) page_address(page); paddr = (unsigned long) page_address(page);
memset((char *)paddr, 0, (PAGE_SIZE << DC_ALIAS_SHIFT)); memset((char *)paddr, 0, (PAGE_SIZE << DC_ALIAS_SHIFT));
...@@ -1680,13 +1684,6 @@ static void __init taint_real_pages(void) ...@@ -1680,13 +1684,6 @@ static void __init taint_real_pages(void)
} }
} }
#ifdef CONFIG_HUGETLB_PAGE
long htlbpagemem = 0;
int htlbpage_max;
long htlbzone_pages;
extern struct list_head htlbpage_freelist;
#endif
void __init mem_init(void) void __init mem_init(void)
{ {
unsigned long codepages, datapages, initpages; unsigned long codepages, datapages, initpages;
...@@ -1763,32 +1760,6 @@ void __init mem_init(void) ...@@ -1763,32 +1760,6 @@ void __init mem_init(void)
if (tlb_type == cheetah || tlb_type == cheetah_plus) if (tlb_type == cheetah || tlb_type == cheetah_plus)
cheetah_ecache_flush_init(); cheetah_ecache_flush_init();
#ifdef CONFIG_HUGETLB_PAGE
{
long i, j;
struct page *page, *map;
/* For now reserve quarter for hugetlb_pages. */
htlbzone_pages = (num_physpages >> ((HPAGE_SHIFT - PAGE_SHIFT) + 2)) ;
/* Will make this kernel command line. */
INIT_LIST_HEAD(&htlbpage_freelist);
for (i = 0; i < htlbzone_pages; i++) {
page = alloc_pages(GFP_ATOMIC, HUGETLB_PAGE_ORDER);
if (page == NULL)
break;
map = page;
for (j = 0; j < (HPAGE_SIZE / PAGE_SIZE); j++) {
SetPageReserved(map);
map++;
}
list_add(&page->list, &htlbpage_freelist);
}
printk("Total Huge_TLB_Page memory pages allocated %ld\n", i);
htlbzone_pages = htlbpagemem = i;
htlbpage_max = i;
}
#endif
} }
void free_initmem (void) void free_initmem (void)
......
...@@ -90,7 +90,13 @@ typedef unsigned long iopgprot_t; ...@@ -90,7 +90,13 @@ typedef unsigned long iopgprot_t;
#endif /* (STRICT_MM_TYPECHECKS) */ #endif /* (STRICT_MM_TYPECHECKS) */
#if defined(CONFIG_HUGETLB_PAGE_SIZE_4MB)
#define HPAGE_SHIFT 22 #define HPAGE_SHIFT 22
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K)
#define HPAGE_SHIFT 19
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
#define HPAGE_SHIFT 16
#endif
#ifdef CONFIG_HUGETLB_PAGE #ifdef CONFIG_HUGETLB_PAGE
#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* the SpitFire page tables. * the SpitFire page tables.
*/ */
#include <linux/config.h>
#include <asm/spitfire.h> #include <asm/spitfire.h>
#include <asm/asi.h> #include <asm/asi.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -136,11 +137,19 @@ ...@@ -136,11 +137,19 @@
#elif PAGE_SHIFT == 19 #elif PAGE_SHIFT == 19
#define _PAGE_SZBITS _PAGE_SZ512K #define _PAGE_SZBITS _PAGE_SZ512K
#elif PAGE_SHIFT == 22 #elif PAGE_SHIFT == 22
#define _PAGE_SZBITS _PAGE_SZ4M #define _PAGE_SZBITS _PAGE_SZ4MB
#else #else
#error Wrong PAGE_SHIFT specified #error Wrong PAGE_SHIFT specified
#endif #endif
#if defined(CONFIG_HUGETLB_PAGE_SIZE_4MB)
#define _PAGE_SZHUGE _PAGE_SZ4MB
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K)
#define _PAGE_SZHUGE _PAGE_512K
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
#define _PAGE_SZHUGE _PAGE_64K
#endif
#define _PAGE_CACHE (_PAGE_CP | _PAGE_CV) #define _PAGE_CACHE (_PAGE_CP | _PAGE_CV)
#define __DIRTY_BITS (_PAGE_MODIFIED | _PAGE_WRITE | _PAGE_W) #define __DIRTY_BITS (_PAGE_MODIFIED | _PAGE_WRITE | _PAGE_W)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment