提交 e81cfd21 编写于 作者: L Linus Torvalds

Merge branch 'x86-fixes-for-linus' of...

Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/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 setup: fix asm constraints in vesa_store_edid
  xen: make sysfs files behave as their names suggest
  x86: tone down mtrr_trim_uncached_memory() warning
  x86: correct the CPUID pattern for MSR_IA32_MISC_ENABLE availability
...@@ -269,9 +269,8 @@ void vesa_store_edid(void) ...@@ -269,9 +269,8 @@ void vesa_store_edid(void)
we genuinely have to assume all registers are destroyed here. */ we genuinely have to assume all registers are destroyed here. */
asm("pushw %%es; movw %2,%%es; "INT10"; popw %%es" asm("pushw %%es; movw %2,%%es; "INT10"; popw %%es"
: "+a" (ax), "+b" (bx) : "+a" (ax), "+b" (bx), "+c" (cx), "+D" (di)
: "c" (cx), "D" (di) : : "esi", "edx");
: "esi");
if (ax != 0x004f) if (ax != 0x004f)
return; /* No EDID */ return; /* No EDID */
...@@ -285,9 +284,9 @@ void vesa_store_edid(void) ...@@ -285,9 +284,9 @@ void vesa_store_edid(void)
dx = 0; /* EDID block number */ dx = 0; /* EDID block number */
di =(size_t) &boot_params.edid_info; /* (ES:)Pointer to block */ di =(size_t) &boot_params.edid_info; /* (ES:)Pointer to block */
asm(INT10 asm(INT10
: "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info) : "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info),
: "c" (cx), "D" (di) "+c" (cx), "+D" (di)
: "esi"); : : "esi");
#endif /* CONFIG_FIRMWARE_EDID */ #endif /* CONFIG_FIRMWARE_EDID */
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
{ {
/* Unmask CPUID levels if masked: */ /* Unmask CPUID levels if masked: */
if (c->x86 == 6 && c->x86_model >= 15) { if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
u64 misc_enable; u64 misc_enable;
rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable); rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
......
...@@ -1594,8 +1594,7 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn) ...@@ -1594,8 +1594,7 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
/* kvm/qemu doesn't have mtrr set right, don't trim them all */ /* kvm/qemu doesn't have mtrr set right, don't trim them all */
if (!highest_pfn) { if (!highest_pfn) {
WARN(!kvm_para_available(), KERN_WARNING printk(KERN_INFO "CPU MTRRs all blank - virtualized system.\n");
"WARNING: strange, CPU MTRRs all blank?\n");
return 0; return 0;
} }
......
...@@ -498,7 +498,7 @@ static ssize_t store_target_kb(struct sys_device *dev, ...@@ -498,7 +498,7 @@ static ssize_t store_target_kb(struct sys_device *dev,
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
target_bytes = memparse(buf, &endchar); target_bytes = simple_strtoull(buf, &endchar, 0) * 1024;
balloon_set_new_target(target_bytes >> PAGE_SHIFT); balloon_set_new_target(target_bytes >> PAGE_SHIFT);
...@@ -508,8 +508,39 @@ static ssize_t store_target_kb(struct sys_device *dev, ...@@ -508,8 +508,39 @@ static ssize_t store_target_kb(struct sys_device *dev,
static SYSDEV_ATTR(target_kb, S_IRUGO | S_IWUSR, static SYSDEV_ATTR(target_kb, S_IRUGO | S_IWUSR,
show_target_kb, store_target_kb); show_target_kb, store_target_kb);
static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr,
char *buf)
{
return sprintf(buf, "%llu\n",
(u64)balloon_stats.target_pages << PAGE_SHIFT);
}
static ssize_t store_target(struct sys_device *dev,
struct sysdev_attribute *attr,
const char *buf,
size_t count)
{
char *endchar;
unsigned long long target_bytes;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
target_bytes = memparse(buf, &endchar);
balloon_set_new_target(target_bytes >> PAGE_SHIFT);
return count;
}
static SYSDEV_ATTR(target, S_IRUGO | S_IWUSR,
show_target, store_target);
static struct sysdev_attribute *balloon_attrs[] = { static struct sysdev_attribute *balloon_attrs[] = {
&attr_target_kb, &attr_target_kb,
&attr_target,
}; };
static struct attribute *balloon_info_attrs[] = { static struct attribute *balloon_info_attrs[] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册