Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145246
b: refs/heads/master
c: a8cd024
h: refs/heads/master
v: v3
  • Loading branch information
Avi Kivity committed May 25, 2009
1 parent 0af5998 commit e3abb4d
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 68 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0c1af135a93ee25b07cbc61762fb957fd2f3733
refs/heads/master: a8cd0244e9cebcf9b358d24c7e7410062f3665cb
4 changes: 0 additions & 4 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1535,10 +1535,6 @@ 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: 16 additions & 13 deletions trunk/arch/x86/boot/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,25 @@

#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 e820entry buf; /* static so it is zeroed */
static struct e820_ext_entry buf; /* static so it is zeroed */

/*
* 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.
* Set this here so that if the BIOS doesn't change this field
* but still doesn't change %ecx, we're still okay...
*/
buf.ext_flags = 1;

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

*desc++ = buf;
/* 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;
count++;
} while (next && count < ARRAY_SIZE(boot_params.e820_map));

Expand Down
7 changes: 0 additions & 7 deletions trunk/arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ 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: 0 additions & 8 deletions trunk/arch/x86/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,6 @@ 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: 1 addition & 3 deletions trunk/arch/x86/kernel/setup_percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,8 @@ 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 (true || !cpu_has_pse || !pcpu_need_numa())
if (!cpu_has_pse || !pcpu_need_numa())
return -EINVAL;

/*
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2897,8 +2897,7 @@ static int kvm_pv_mmu_write(struct kvm_vcpu *vcpu,

static int kvm_pv_mmu_flush_tlb(struct kvm_vcpu *vcpu)
{
kvm_x86_ops->tlb_flush(vcpu);
set_bit(KVM_REQ_MMU_SYNC, &vcpu->requests);
kvm_set_cr3(vcpu, vcpu->arch.cr3);
return 1;
}

Expand Down
12 changes: 3 additions & 9 deletions trunk/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 >= 4)
if (cache && boot_cpu_data.x86_model >= 4)
wbinvd();
}

Expand Down Expand Up @@ -204,11 +204,6 @@ 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 @@ -223,9 +218,8 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,

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

if (boot_cpu_data.x86_model >= 4)
wbinvd();
return;
}
/*
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ static void dpm_power_up(pm_message_t state)
{
struct device *dev;

mutex_lock(&dpm_list_mtx);
list_for_each_entry(dev, &dpm_list, power.entry)
if (dev->power.status > DPM_OFF) {
int error;
Expand All @@ -367,7 +366,6 @@ static void dpm_power_up(pm_message_t state)
if (error)
pm_dev_err(dev, state, " early", error);
}
mutex_unlock(&dpm_list_mtx);
}

/**
Expand Down Expand Up @@ -616,7 +614,6 @@ int device_power_down(pm_message_t state)
int error = 0;

suspend_device_irqs();
mutex_lock(&dpm_list_mtx);
list_for_each_entry_reverse(dev, &dpm_list, power.entry) {
error = suspend_device_noirq(dev, state);
if (error) {
Expand All @@ -625,7 +622,6 @@ int device_power_down(pm_message_t state)
}
dev->power.status = DPM_OFF_IRQ;
}
mutex_unlock(&dpm_list_mtx);
if (error)
device_power_up(resume_event(state));
return error;
Expand Down
3 changes: 2 additions & 1 deletion trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@ asmlinkage void __init start_kernel(void)
tick_init();
boot_cpu_init();
page_address_init();
printk(KERN_NOTICE "%s", linux_banner);
printk(KERN_NOTICE);
printk(linux_banner);
setup_arch(&command_line);
mm_init_owner(&init_mm, &init_task);
setup_command_line(command_line);
Expand Down
20 changes: 8 additions & 12 deletions trunk/kernel/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,19 @@ extern int initcall_debug;
static async_cookie_t __lowest_in_progress(struct list_head *running)
{
struct async_entry *entry;
async_cookie_t ret = next_cookie; /* begin with "infinity" value */

if (!list_empty(running)) {
entry = list_first_entry(running,
struct async_entry, list);
ret = entry->cookie;
}

if (!list_empty(&async_pending)) {
list_for_each_entry(entry, &async_pending, list)
if (entry->running == running) {
ret = entry->cookie;
break;
}
return entry->cookie;
} else if (!list_empty(&async_pending)) {
entry = list_first_entry(&async_pending,
struct async_entry, list);
return entry->cookie;
} else {
/* nothing in progress... next_cookie is "infinity" */
return next_cookie;
}

return ret;
}

static async_cookie_t lowest_in_progress(struct list_head *running)
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,7 @@ int kernel_kexec(void)
error = device_suspend(PMSG_FREEZE);
if (error)
goto Resume_console;
device_pm_lock();
/* At this point, device_suspend() has been called,
* but *not* device_power_down(). We *must*
* device_power_down() now. Otherwise, drivers for
Expand Down Expand Up @@ -1488,6 +1489,7 @@ int kernel_kexec(void)
enable_nonboot_cpus();
device_power_up(PMSG_RESTORE);
Resume_devices:
device_pm_unlock();
device_resume(PMSG_RESTORE);
Resume_console:
resume_console();
Expand Down
21 changes: 18 additions & 3 deletions trunk/kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ static int create_image(int platform_mode)
if (error)
return error;

device_pm_lock();

/* At this point, device_suspend() has been called, but *not*
* device_power_down(). We *must* call device_power_down() now.
* Otherwise, drivers for some devices (e.g. interrupt controllers)
Expand All @@ -225,7 +227,7 @@ static int create_image(int platform_mode)
if (error) {
printk(KERN_ERR "PM: Some devices failed to power down, "
"aborting hibernation\n");
return error;
goto Unlock;
}

error = platform_pre_snapshot(platform_mode);
Expand Down Expand Up @@ -278,6 +280,9 @@ static int create_image(int platform_mode)
device_power_up(in_suspend ?
(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);

Unlock:
device_pm_unlock();

return error;
}

Expand Down Expand Up @@ -339,11 +344,13 @@ static int resume_target_kernel(bool platform_mode)
{
int error;

device_pm_lock();

error = device_power_down(PMSG_QUIESCE);
if (error) {
printk(KERN_ERR "PM: Some devices failed to power down, "
"aborting resume\n");
return error;
goto Unlock;
}

error = platform_pre_restore(platform_mode);
Expand Down Expand Up @@ -396,6 +403,9 @@ static int resume_target_kernel(bool platform_mode)

device_power_up(PMSG_RECOVER);

Unlock:
device_pm_unlock();

return error;
}

Expand Down Expand Up @@ -454,9 +464,11 @@ int hibernation_platform_enter(void)
goto Resume_devices;
}

device_pm_lock();

error = device_power_down(PMSG_HIBERNATE);
if (error)
goto Resume_devices;
goto Unlock;

error = hibernation_ops->prepare();
if (error)
Expand All @@ -481,6 +493,9 @@ int hibernation_platform_enter(void)

device_power_up(PMSG_RESTORE);

Unlock:
device_pm_unlock();

Resume_devices:
entering_platform_hibernation = false;
device_resume(PMSG_RESTORE);
Expand Down
7 changes: 6 additions & 1 deletion trunk/kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,12 @@ static int suspend_enter(suspend_state_t state)
{
int error;

device_pm_lock();

if (suspend_ops->prepare) {
error = suspend_ops->prepare();
if (error)
return error;
goto Done;
}

error = device_power_down(PMSG_SUSPEND);
Expand Down Expand Up @@ -341,6 +343,9 @@ static int suspend_enter(suspend_state_t state)
if (suspend_ops->finish)
suspend_ops->finish();

Done:
device_pm_unlock();

return error;
}

Expand Down

0 comments on commit e3abb4d

Please sign in to comment.