Commit 4a53ada8 authored by Andrew Morton's avatar Andrew Morton Committed by Jeff Garzik

[PATCH] x440 SRAT parsing

Use the early ioremap code to parse the Static Resource Affinity Table on
x440 machines.
parent 68e72499
...@@ -75,6 +75,11 @@ config X86_SUMMIT ...@@ -75,6 +75,11 @@ config X86_SUMMIT
If you don't have one of these computers, you should say N here. If you don't have one of these computers, you should say N here.
config ACPI_SRAT
bool
default y
depends on NUMA && X86_SUMMIT
config X86_BIGSMP config X86_BIGSMP
bool "Support for other sub-arch SMP systems with more than 8 CPUs" bool "Support for other sub-arch SMP systems with more than 8 CPUs"
help help
...@@ -483,7 +488,7 @@ config NR_CPUS ...@@ -483,7 +488,7 @@ config NR_CPUS
# Common NUMA Features # Common NUMA Features
config NUMA config NUMA
bool "Numa Memory Allocation Support" bool "Numa Memory Allocation Support"
depends on X86_NUMAQ depends on (HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT && ACPI && !ACPI_HT_ONLY)))
config DISCONTIGMEM config DISCONTIGMEM
bool bool
......
...@@ -28,6 +28,7 @@ obj-$(CONFIG_X86_NUMAQ) += numaq.o ...@@ -28,6 +28,7 @@ obj-$(CONFIG_X86_NUMAQ) += numaq.o
obj-$(CONFIG_EDD) += edd.o obj-$(CONFIG_EDD) += edd.o
obj-$(CONFIG_MODULES) += module.o obj-$(CONFIG_MODULES) += module.o
obj-y += sysenter.o obj-y += sysenter.o
obj-$(CONFIG_ACPI_SRAT) += srat.o
EXTRA_AFLAGS := -traditional EXTRA_AFLAGS := -traditional
......
This diff is collapsed.
...@@ -284,6 +284,7 @@ void __init zone_sizes_init(void) ...@@ -284,6 +284,7 @@ void __init zone_sizes_init(void)
for (nid = 0; nid < numnodes; nid++) { for (nid = 0; nid < numnodes; nid++) {
unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
unsigned long *zholes_size;
unsigned int max_dma; unsigned int max_dma;
unsigned long low = max_low_pfn; unsigned long low = max_low_pfn;
...@@ -307,6 +308,7 @@ void __init zone_sizes_init(void) ...@@ -307,6 +308,7 @@ void __init zone_sizes_init(void)
#endif #endif
} }
} }
zholes_size = get_zholes_size(nid);
/* /*
* We let the lmem_map for node 0 be allocated from the * We let the lmem_map for node 0 be allocated from the
* normal bootmem allocator, but other nodes come from the * normal bootmem allocator, but other nodes come from the
...@@ -315,10 +317,10 @@ void __init zone_sizes_init(void) ...@@ -315,10 +317,10 @@ void __init zone_sizes_init(void)
if (nid) if (nid)
free_area_init_node(nid, NODE_DATA(nid), free_area_init_node(nid, NODE_DATA(nid),
node_remap_start_vaddr[nid], zones_size, node_remap_start_vaddr[nid], zones_size,
start, 0); start, zholes_size);
else else
free_area_init_node(nid, NODE_DATA(nid), 0, free_area_init_node(nid, NODE_DATA(nid), 0,
zones_size, start, 0); zones_size, start, zholes_size);
} }
return; return;
} }
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#ifdef CONFIG_X86_NUMAQ #ifdef CONFIG_X86_NUMAQ
#include <asm/numaq.h> #include <asm/numaq.h>
#elif CONFIG_X86_SUMMIT
#include <asm/srat.h>
#else #else
#define pfn_to_nid(pfn) (0) #define pfn_to_nid(pfn) (0)
#endif /* CONFIG_X86_NUMAQ */ #endif /* CONFIG_X86_NUMAQ */
......
...@@ -168,6 +168,10 @@ struct sys_cfg_data { ...@@ -168,6 +168,10 @@ struct sys_cfg_data {
struct eachquadmem eq[MAX_NUMNODES]; /* indexed by quad id */ struct eachquadmem eq[MAX_NUMNODES]; /* indexed by quad id */
}; };
static inline unsigned long get_zholes_size(int nid)
{
return 0;
}
#endif /* CONFIG_X86_NUMAQ */ #endif /* CONFIG_X86_NUMAQ */
#endif /* NUMAQ_H */ #endif /* NUMAQ_H */
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifdef CONFIG_X86_NUMAQ #ifdef CONFIG_X86_NUMAQ
#include <asm/numaq.h> #include <asm/numaq.h>
#elif CONFIG_X86_SUMMIT
#include <asm/srat.h>
#else #else
#define MAX_NUMNODES 1 #define MAX_NUMNODES 1
#endif /* CONFIG_X86_NUMAQ */ #endif /* CONFIG_X86_NUMAQ */
......
/*
* Some of the code in this file has been gleaned from the 64 bit
* discontigmem support code base.
*
* Copyright (C) 2002, IBM Corp.
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Send feedback to Pat Gaughen <gone@us.ibm.com>
*/
#ifndef _ASM_SRAT_H_
#define _ASM_SRAT_H_
/*
* each element in pfnnode_map represents 256 MB (2^28) of pages.
* so, to represent 64GB we need 256 elements.
*/
#define MAX_ELEMENTS 256
#define PFN_TO_ELEMENT(pfn) ((pfn)>>(28 - PAGE_SHIFT))
extern int pfnnode_map[];
#define pfn_to_nid(pfn) ({ pfnnode_map[PFN_TO_ELEMENT(pfn)]; })
#define pfn_to_pgdat(pfn) NODE_DATA(pfn_to_nid(pfn))
#define PHYSADDR_TO_NID(pa) pfn_to_nid(pa >> PAGE_SHIFT)
#define MAX_NUMNODES 8
extern void get_memcfg_from_srat(void);
extern unsigned long *get_zholes_size(int);
#define get_memcfg_numa() get_memcfg_from_srat()
#endif /* _ASM_SRAT_H_ */
...@@ -79,7 +79,7 @@ typedef struct { ...@@ -79,7 +79,7 @@ typedef struct {
struct acpi_table_rsdt { struct acpi_table_rsdt {
struct acpi_table_header header; struct acpi_table_header header;
u32 entry[1]; u32 entry[8];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Extended System Description Table (XSDT) */ /* Extended System Description Table (XSDT) */
......
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