Commit 16ad5697 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'stable/bug-fixes-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

* 'stable/bug-fixes-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: Allow PV-OPS kernel to detect whether XSAVE is supported
  xen: just completely disable XSAVE
  xen/debug: Don't be so verbose with WARN on 1-1 mapping errors.
  xen: events: fix error checks in bind_*_to_irqhandler()
parents a6360dd3 947ccf9c
...@@ -238,6 +238,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, ...@@ -238,6 +238,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
static __init void xen_init_cpuid_mask(void) static __init void xen_init_cpuid_mask(void)
{ {
unsigned int ax, bx, cx, dx; unsigned int ax, bx, cx, dx;
unsigned int xsave_mask;
cpuid_leaf1_edx_mask = cpuid_leaf1_edx_mask =
~((1 << X86_FEATURE_MCE) | /* disable MCE */ ~((1 << X86_FEATURE_MCE) | /* disable MCE */
...@@ -249,24 +250,16 @@ static __init void xen_init_cpuid_mask(void) ...@@ -249,24 +250,16 @@ static __init void xen_init_cpuid_mask(void)
cpuid_leaf1_edx_mask &= cpuid_leaf1_edx_mask &=
~((1 << X86_FEATURE_APIC) | /* disable local APIC */ ~((1 << X86_FEATURE_APIC) | /* disable local APIC */
(1 << X86_FEATURE_ACPI)); /* disable ACPI */ (1 << X86_FEATURE_ACPI)); /* disable ACPI */
ax = 1; ax = 1;
cx = 0;
xen_cpuid(&ax, &bx, &cx, &dx); xen_cpuid(&ax, &bx, &cx, &dx);
/* cpuid claims we support xsave; try enabling it to see what happens */ xsave_mask =
if (cx & (1 << (X86_FEATURE_XSAVE % 32))) { (1 << (X86_FEATURE_XSAVE % 32)) |
unsigned long cr4; (1 << (X86_FEATURE_OSXSAVE % 32));
set_in_cr4(X86_CR4_OSXSAVE);
cr4 = read_cr4();
if ((cr4 & X86_CR4_OSXSAVE) == 0) /* Xen will set CR4.OSXSAVE if supported and not disabled by force */
cpuid_leaf1_ecx_mask &= ~(1 << (X86_FEATURE_XSAVE % 32)); if ((cx & xsave_mask) != xsave_mask)
cpuid_leaf1_ecx_mask &= ~xsave_mask; /* disable XSAVE & OSXSAVE */
clear_in_cr4(X86_CR4_OSXSAVE);
}
} }
static void xen_set_debugreg(int reg, unsigned long val) static void xen_set_debugreg(int reg, unsigned long val)
......
...@@ -565,13 +565,13 @@ pte_t xen_make_pte_debug(pteval_t pte) ...@@ -565,13 +565,13 @@ pte_t xen_make_pte_debug(pteval_t pte)
if (io_page && if (io_page &&
(xen_initial_domain() || addr >= ISA_END_ADDRESS)) { (xen_initial_domain() || addr >= ISA_END_ADDRESS)) {
other_addr = pfn_to_mfn(addr >> PAGE_SHIFT) << PAGE_SHIFT; other_addr = pfn_to_mfn(addr >> PAGE_SHIFT) << PAGE_SHIFT;
WARN(addr != other_addr, WARN_ONCE(addr != other_addr,
"0x%lx is using VM_IO, but it is 0x%lx!\n", "0x%lx is using VM_IO, but it is 0x%lx!\n",
(unsigned long)addr, (unsigned long)other_addr); (unsigned long)addr, (unsigned long)other_addr);
} else { } else {
pteval_t iomap_set = (_pte.pte & PTE_FLAGS_MASK) & _PAGE_IOMAP; pteval_t iomap_set = (_pte.pte & PTE_FLAGS_MASK) & _PAGE_IOMAP;
other_addr = (_pte.pte & PTE_PFN_MASK); other_addr = (_pte.pte & PTE_PFN_MASK);
WARN((addr == other_addr) && (!io_page) && (!iomap_set), WARN_ONCE((addr == other_addr) && (!io_page) && (!iomap_set),
"0x%lx is missing VM_IO (and wasn't fixed)!\n", "0x%lx is missing VM_IO (and wasn't fixed)!\n",
(unsigned long)addr); (unsigned long)addr);
} }
......
...@@ -912,8 +912,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn, ...@@ -912,8 +912,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
unsigned long irqflags, unsigned long irqflags,
const char *devname, void *dev_id) const char *devname, void *dev_id)
{ {
unsigned int irq; int irq, retval;
int retval;
irq = bind_evtchn_to_irq(evtchn); irq = bind_evtchn_to_irq(evtchn);
if (irq < 0) if (irq < 0)
...@@ -955,8 +954,7 @@ int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, ...@@ -955,8 +954,7 @@ int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
irq_handler_t handler, irq_handler_t handler,
unsigned long irqflags, const char *devname, void *dev_id) unsigned long irqflags, const char *devname, void *dev_id)
{ {
unsigned int irq; int irq, retval;
int retval;
irq = bind_virq_to_irq(virq, cpu); irq = bind_virq_to_irq(virq, cpu);
if (irq < 0) if (irq < 0)
......
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