Skip to content

Commit

Permalink
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Remove remap percpu allocator for the time being
  x86: cpa_flush_array wbinvd should be done on all CPUs
  x86: bugfix wbinvd() model check instead of family check
  x86: introduce noxsave boot parameter
  x86, setup: revert ACPI 3 E820 extended attributes support
  x86: DMI match for the Sony VGN-Z540N as it needs BIOS reboot
  • Loading branch information
Linus Torvalds committed May 25, 2009
2 parents 93c3248 + 71c9d8b commit a0c1af1
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 20 deletions.
4 changes: 4 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,10 @@ and is between 256 and 4096 characters. It is defined in the file
register save and restore. The kernel will only save
legacy floating-point registers on task switch.

noxsave [BUGS=X86] Disables x86 extended register state save
and restore using xsave. The kernel will fallback to
enabling legacy floating-point and sse state.

nohlt [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or
wfi(ARM) instruction doesn't work correctly and not to
use it. This is also useful when using JTAG debugger.
Expand Down
29 changes: 13 additions & 16 deletions arch/x86/boot/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,28 @@

#define SMAP 0x534d4150 /* ASCII "SMAP" */

struct e820_ext_entry {
struct e820entry std;
u32 ext_flags;
} __attribute__((packed));

static int detect_memory_e820(void)
{
int count = 0;
u32 next = 0;
u32 size, id, edi;
u8 err;
struct e820entry *desc = boot_params.e820_map;
static struct e820_ext_entry buf; /* static so it is zeroed */
static struct e820entry buf; /* static so it is zeroed */

/*
* Set this here so that if the BIOS doesn't change this field
* but still doesn't change %ecx, we're still okay...
* Note: at least one BIOS is known which assumes that the
* buffer pointed to by one e820 call is the same one as
* the previous call, and only changes modified fields. Therefore,
* we use a temporary buffer and copy the results entry by entry.
*
* This routine deliberately does not try to account for
* ACPI 3+ extended attributes. This is because there are
* BIOSes in the field which report zero for the valid bit for
* all ranges, and we don't currently make any use of the
* other attribute bits. Revisit this if we see the extended
* attribute bits deployed in a meaningful way in the future.
*/
buf.ext_flags = 1;

do {
size = sizeof buf;
Expand Down Expand Up @@ -66,13 +69,7 @@ static int detect_memory_e820(void)
break;
}

/* ACPI 3.0 added the extended flags support. If bit 0
in the extended flags is zero, we're supposed to simply
ignore the entry -- a backwards incompatible change! */
if (size > 20 && !(buf.ext_flags & 1))
continue;

*desc++ = buf.std;
*desc++ = buf;
count++;
} while (next && count < ARRAY_SIZE(boot_params.e820_map));

Expand Down
7 changes: 7 additions & 0 deletions arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
} };
EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);

static int __init x86_xsave_setup(char *s)
{
setup_clear_cpu_cap(X86_FEATURE_XSAVE);
return 1;
}
__setup("noxsave", x86_xsave_setup);

#ifdef CONFIG_X86_32
static int cachesize_override __cpuinitdata = -1;
static int disable_x86_serial_nr __cpuinitdata = 1;
Expand Down
8 changes: 8 additions & 0 deletions arch/x86/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
},
},
{ /* Handle problems with rebooting on Sony VGN-Z540N */
.callback = set_bios_reboot,
.ident = "Sony VGN-Z540N",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
},
},
{ }
};

Expand Down
4 changes: 3 additions & 1 deletion arch/x86/kernel/setup_percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ static ssize_t __init setup_pcpu_remap(size_t static_size)
/*
* If large page isn't supported, there's no benefit in doing
* this. Also, on non-NUMA, embedding is better.
*
* NOTE: disabled for now.
*/
if (!cpu_has_pse || !pcpu_need_numa())
if (true || !cpu_has_pse || !pcpu_need_numa())
return -EINVAL;

/*
Expand Down
12 changes: 9 additions & 3 deletions arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static void __cpa_flush_all(void *arg)
*/
__flush_tlb_all();

if (cache && boot_cpu_data.x86_model >= 4)
if (cache && boot_cpu_data.x86 >= 4)
wbinvd();
}

Expand Down Expand Up @@ -204,6 +204,11 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache)
}
}

static void wbinvd_local(void *unused)
{
wbinvd();
}

static void cpa_flush_array(unsigned long *start, int numpages, int cache,
int in_flags, struct page **pages)
{
Expand All @@ -218,8 +223,9 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,

/* 4M threshold */
if (numpages >= 1024) {
if (boot_cpu_data.x86_model >= 4)
wbinvd();
if (boot_cpu_data.x86 >= 4)
on_each_cpu(wbinvd_local, NULL, 1);

return;
}
/*
Expand Down

0 comments on commit a0c1af1

Please sign in to comment.