Skip to content

Commit cc9f7a0

Browse files
yhluIngo Molnar
authored andcommitted
x86: kill bad_ppro
so don't punish all other cpus without that problem when init highmem Signed-off-by: Yinghai Lu <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 41c094f commit cc9f7a0

File tree

5 files changed

+25
-35
lines changed

5 files changed

+25
-35
lines changed

arch/x86/kernel/setup_32.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#include <asm/cacheflush.h>
6969
#include <asm/processor.h>
7070
#include <asm/efi.h>
71+
#include <asm/bugs.h>
7172

7273
/* This value is set up by the early boot code to point to the value
7374
immediately after the boot time page tables. It contains a *physical*
@@ -764,6 +765,14 @@ void __init setup_arch(char **cmdline_p)
764765
if (efi_enabled)
765766
efi_init();
766767

768+
if (ppro_with_ram_bug()) {
769+
e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM,
770+
E820_RESERVED);
771+
sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
772+
printk(KERN_INFO "fixed physical RAM map:\n");
773+
e820_print_map("bad_ppro");
774+
}
775+
767776
e820_register_active_regions(0, 0, -1UL);
768777
/*
769778
* partially used pages are not usable - thus

arch/x86/mm/discontig_32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ void __init zone_sizes_init(void)
427427
return;
428428
}
429429

430-
void __init set_highmem_pages_init(int bad_ppro)
430+
void __init set_highmem_pages_init(void)
431431
{
432432
#ifdef CONFIG_HIGHMEM
433433
struct zone *zone;
@@ -447,7 +447,7 @@ void __init set_highmem_pages_init(int bad_ppro)
447447
zone->name, nid, zone_start_pfn, zone_end_pfn);
448448

449449
add_highpages_with_active_regions(nid, zone_start_pfn,
450-
zone_end_pfn, bad_ppro);
450+
zone_end_pfn);
451451
}
452452
totalram_pages += totalhigh_pages;
453453
#endif

arch/x86/mm/init_32.c

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,6 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
220220
}
221221
}
222222

223-
static inline int page_kills_ppro(unsigned long pagenr)
224-
{
225-
if (pagenr >= 0x70000 && pagenr <= 0x7003F)
226-
return 1;
227-
return 0;
228-
}
229-
230223
/*
231224
* devmem_is_allowed() checks to see if /dev/mem access to a certain address
232225
* is valid. The argument is a physical page number.
@@ -287,22 +280,17 @@ static void __init permanent_kmaps_init(pgd_t *pgd_base)
287280
pkmap_page_table = pte;
288281
}
289282

290-
static void __init
291-
add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
283+
static void __init add_one_highpage_init(struct page *page, int pfn)
292284
{
293-
if (!(bad_ppro && page_kills_ppro(pfn))) {
294-
ClearPageReserved(page);
295-
init_page_count(page);
296-
__free_page(page);
297-
totalhigh_pages++;
298-
} else
299-
SetPageReserved(page);
285+
ClearPageReserved(page);
286+
init_page_count(page);
287+
__free_page(page);
288+
totalhigh_pages++;
300289
}
301290

302291
struct add_highpages_data {
303292
unsigned long start_pfn;
304293
unsigned long end_pfn;
305-
int bad_ppro;
306294
};
307295

308296
static void __init add_highpages_work_fn(unsigned long start_pfn,
@@ -312,10 +300,8 @@ static void __init add_highpages_work_fn(unsigned long start_pfn,
312300
struct page *page;
313301
unsigned long final_start_pfn, final_end_pfn;
314302
struct add_highpages_data *data;
315-
int bad_ppro;
316303

317304
data = (struct add_highpages_data *)datax;
318-
bad_ppro = data->bad_ppro;
319305

320306
final_start_pfn = max(start_pfn, data->start_pfn);
321307
final_end_pfn = min(end_pfn, data->end_pfn);
@@ -327,29 +313,26 @@ static void __init add_highpages_work_fn(unsigned long start_pfn,
327313
if (!pfn_valid(node_pfn))
328314
continue;
329315
page = pfn_to_page(node_pfn);
330-
add_one_highpage_init(page, node_pfn, bad_ppro);
316+
add_one_highpage_init(page, node_pfn);
331317
}
332318

333319
}
334320

335321
void __init add_highpages_with_active_regions(int nid, unsigned long start_pfn,
336-
unsigned long end_pfn,
337-
int bad_ppro)
322+
unsigned long end_pfn)
338323
{
339324
struct add_highpages_data data;
340325

341326
data.start_pfn = start_pfn;
342327
data.end_pfn = end_pfn;
343-
data.bad_ppro = bad_ppro;
344328

345329
work_with_active_regions(nid, add_highpages_work_fn, &data);
346330
}
347331

348332
#ifndef CONFIG_NUMA
349-
static void __init set_highmem_pages_init(int bad_ppro)
333+
static void __init set_highmem_pages_init(void)
350334
{
351-
add_highpages_with_active_regions(0, highstart_pfn, highend_pfn,
352-
bad_ppro);
335+
add_highpages_with_active_regions(0, highstart_pfn, highend_pfn);
353336

354337
totalram_pages += totalhigh_pages;
355338
}
@@ -358,7 +341,7 @@ static void __init set_highmem_pages_init(int bad_ppro)
358341
#else
359342
# define kmap_init() do { } while (0)
360343
# define permanent_kmaps_init(pgd_base) do { } while (0)
361-
# define set_highmem_pages_init(bad_ppro) do { } while (0)
344+
# define set_highmem_pages_init() do { } while (0)
362345
#endif /* CONFIG_HIGHMEM */
363346

364347
pteval_t __PAGE_KERNEL = _PAGE_KERNEL;
@@ -605,13 +588,11 @@ static struct kcore_list kcore_mem, kcore_vmalloc;
605588
void __init mem_init(void)
606589
{
607590
int codesize, reservedpages, datasize, initsize;
608-
int tmp, bad_ppro;
591+
int tmp;
609592

610593
#ifdef CONFIG_FLATMEM
611594
BUG_ON(!mem_map);
612595
#endif
613-
bad_ppro = ppro_with_ram_bug();
614-
615596
#ifdef CONFIG_HIGHMEM
616597
/* check that fixmap and pkmap do not overlap */
617598
if (PKMAP_BASE + LAST_PKMAP*PAGE_SIZE >= FIXADDR_START) {
@@ -634,7 +615,7 @@ void __init mem_init(void)
634615
if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp)))
635616
reservedpages++;
636617

637-
set_highmem_pages_init(bad_ppro);
618+
set_highmem_pages_init();
638619

639620
codesize = (unsigned long) &_etext - (unsigned long) &_text;
640621
datasize = (unsigned long) &_edata - (unsigned long) &_etext;

include/asm-x86/highmem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct page *kmap_atomic_to_page(void *ptr);
7575
#define flush_cache_kmaps() do { } while (0)
7676

7777
extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
78-
unsigned long end_pfn, int bad_ppro);
78+
unsigned long end_pfn);
7979

8080
#endif /* __KERNEL__ */
8181

include/asm-x86/numa_32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern int pxm_to_nid(int pxm);
55

66
#ifdef CONFIG_NUMA
77
extern void __init remap_numa_kva(void);
8-
extern void set_highmem_pages_init(int);
8+
extern void set_highmem_pages_init(void);
99
#else
1010
static inline void remap_numa_kva(void)
1111
{

0 commit comments

Comments
 (0)