Commit faf80d62 authored by Linus Torvalds's avatar 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: fix usage of bios intcall()
  x86: Remove unused function lapic_watchdog_ok()
  x86: Remove unused variable disable_x2apic
  x86, kvm: Fix section mismatches in kvm.c
  x86: Add missing annotation to arch/x86/lib/copy_user_64.S::copy_to_user
  x86: Fix fixmap page order for FIX_TEXT_POKE0,1
  amd-iommu: set evt_buf_size correctly
  amd-iommu: handle alias entries correctly in init code
  x86: Fix printk call in print_local_apic()
  x86: Declare check_efer() before it gets used
  x86: Mark device_nb as static and fix NULL noise
  x86: Remove double declaration of MSR_P6_EVNTSEL0 and MSR_P6_EVNTSEL1
  xen: Use kcalloc() in xen_init_IRQ()
  x86: Fix fixmap ordering
  x86: Fix symbol annotation for arch/x86/lib/clear_page_64.S::clear_page_c
parents eca4ee0d febe04de
...@@ -37,14 +37,13 @@ static int set_bios_mode(u8 mode) ...@@ -37,14 +37,13 @@ static int set_bios_mode(u8 mode)
ireg.al = mode; /* AH=0x00 Set Video Mode */ ireg.al = mode; /* AH=0x00 Set Video Mode */
intcall(0x10, &ireg, NULL); intcall(0x10, &ireg, NULL);
ireg.ah = 0x0f; /* Get Current Video Mode */ ireg.ah = 0x0f; /* Get Current Video Mode */
intcall(0x10, &ireg, &oreg); intcall(0x10, &ireg, &oreg);
do_restore = 1; /* Assume video contents were lost */ do_restore = 1; /* Assume video contents were lost */
/* Not all BIOSes are clean with the top bit */ /* Not all BIOSes are clean with the top bit */
new_mode = ireg.al & 0x7f; new_mode = oreg.al & 0x7f;
if (new_mode == mode) if (new_mode == mode)
return 0; /* Mode change OK */ return 0; /* Mode change OK */
......
...@@ -45,7 +45,7 @@ static int vesa_probe(void) ...@@ -45,7 +45,7 @@ static int vesa_probe(void)
ireg.di = (size_t)&vginfo; ireg.di = (size_t)&vginfo;
intcall(0x10, &ireg, &oreg); intcall(0x10, &ireg, &oreg);
if (ireg.ax != 0x004f || if (oreg.ax != 0x004f ||
vginfo.signature != VESA_MAGIC || vginfo.signature != VESA_MAGIC ||
vginfo.version < 0x0102) vginfo.version < 0x0102)
return 0; /* Not present */ return 0; /* Not present */
...@@ -70,7 +70,7 @@ static int vesa_probe(void) ...@@ -70,7 +70,7 @@ static int vesa_probe(void)
ireg.di = (size_t)&vminfo; ireg.di = (size_t)&vminfo;
intcall(0x10, &ireg, &oreg); intcall(0x10, &ireg, &oreg);
if (ireg.ax != 0x004f) if (oreg.ax != 0x004f)
continue; continue;
if ((vminfo.mode_attr & 0x15) == 0x05) { if ((vminfo.mode_attr & 0x15) == 0x05) {
......
...@@ -111,12 +111,9 @@ enum fixed_addresses { ...@@ -111,12 +111,9 @@ enum fixed_addresses {
#ifdef CONFIG_PARAVIRT #ifdef CONFIG_PARAVIRT
FIX_PARAVIRT_BOOTMAP, FIX_PARAVIRT_BOOTMAP,
#endif #endif
FIX_TEXT_POKE0, /* reserve 2 pages for text_poke() */ FIX_TEXT_POKE1, /* reserve 2 pages for text_poke() */
FIX_TEXT_POKE1, FIX_TEXT_POKE0, /* first page is last, because allocation is backward */
__end_of_permanent_fixed_addresses, __end_of_permanent_fixed_addresses,
#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
FIX_OHCI1394_BASE,
#endif
/* /*
* 256 temporary boot-time mappings, used by early_ioremap(), * 256 temporary boot-time mappings, used by early_ioremap(),
* before ioremap() is functional. * before ioremap() is functional.
...@@ -129,6 +126,9 @@ enum fixed_addresses { ...@@ -129,6 +126,9 @@ enum fixed_addresses {
FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
(__end_of_permanent_fixed_addresses & 255), (__end_of_permanent_fixed_addresses & 255),
FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1, FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
FIX_OHCI1394_BASE,
#endif
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
FIX_WP_TEST, FIX_WP_TEST,
#endif #endif
......
...@@ -246,10 +246,6 @@ ...@@ -246,10 +246,6 @@
#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << 38) #define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << 38)
#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << 39) #define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << 39)
/* Intel Model 6 */
#define MSR_P6_EVNTSEL0 0x00000186
#define MSR_P6_EVNTSEL1 0x00000187
/* P4/Xeon+ specific */ /* P4/Xeon+ specific */
#define MSR_IA32_MCG_EAX 0x00000180 #define MSR_IA32_MCG_EAX 0x00000180
#define MSR_IA32_MCG_EBX 0x00000181 #define MSR_IA32_MCG_EBX 0x00000181
......
...@@ -72,7 +72,6 @@ void lapic_watchdog_stop(void); ...@@ -72,7 +72,6 @@ void lapic_watchdog_stop(void);
int lapic_watchdog_init(unsigned nmi_hz); int lapic_watchdog_init(unsigned nmi_hz);
int lapic_wd_event(unsigned nmi_hz); int lapic_wd_event(unsigned nmi_hz);
unsigned lapic_adjust_nmi_hz(unsigned hz); unsigned lapic_adjust_nmi_hz(unsigned hz);
int lapic_watchdog_ok(void);
void disable_lapic_nmi_watchdog(void); void disable_lapic_nmi_watchdog(void);
void enable_lapic_nmi_watchdog(void); void enable_lapic_nmi_watchdog(void);
void stop_nmi(void); void stop_nmi(void);
......
...@@ -1192,7 +1192,7 @@ static int device_change_notifier(struct notifier_block *nb, ...@@ -1192,7 +1192,7 @@ static int device_change_notifier(struct notifier_block *nb,
return 0; return 0;
} }
struct notifier_block device_nb = { static struct notifier_block device_nb = {
.notifier_call = device_change_notifier, .notifier_call = device_change_notifier,
}; };
...@@ -1763,7 +1763,7 @@ static void *alloc_coherent(struct device *dev, size_t size, ...@@ -1763,7 +1763,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
flag |= __GFP_ZERO; flag |= __GFP_ZERO;
virt_addr = (void *)__get_free_pages(flag, get_order(size)); virt_addr = (void *)__get_free_pages(flag, get_order(size));
if (!virt_addr) if (!virt_addr)
return 0; return NULL;
paddr = virt_to_phys(virt_addr); paddr = virt_to_phys(virt_addr);
......
...@@ -472,6 +472,8 @@ static u8 * __init alloc_event_buffer(struct amd_iommu *iommu) ...@@ -472,6 +472,8 @@ static u8 * __init alloc_event_buffer(struct amd_iommu *iommu)
if (iommu->evt_buf == NULL) if (iommu->evt_buf == NULL)
return NULL; return NULL;
iommu->evt_buf_size = EVT_BUFFER_SIZE;
return iommu->evt_buf; return iommu->evt_buf;
} }
...@@ -691,6 +693,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, ...@@ -691,6 +693,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
devid = e->devid; devid = e->devid;
devid_to = e->ext >> 8; devid_to = e->ext >> 8;
set_dev_entry_from_acpi(iommu, devid , e->flags, 0);
set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0); set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0);
amd_iommu_alias_table[devid] = devid_to; amd_iommu_alias_table[devid] = devid_to;
break; break;
...@@ -749,11 +752,13 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, ...@@ -749,11 +752,13 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
devid = e->devid; devid = e->devid;
for (dev_i = devid_start; dev_i <= devid; ++dev_i) { for (dev_i = devid_start; dev_i <= devid; ++dev_i) {
if (alias) if (alias) {
amd_iommu_alias_table[dev_i] = devid_to; amd_iommu_alias_table[dev_i] = devid_to;
set_dev_entry_from_acpi(iommu, set_dev_entry_from_acpi(iommu,
amd_iommu_alias_table[dev_i], devid_to, flags, ext_flags);
flags, ext_flags); }
set_dev_entry_from_acpi(iommu, dev_i,
flags, ext_flags);
} }
break; break;
default: default:
......
...@@ -140,7 +140,6 @@ int x2apic_mode; ...@@ -140,7 +140,6 @@ int x2apic_mode;
#ifdef CONFIG_X86_X2APIC #ifdef CONFIG_X86_X2APIC
/* x2apic enabled before OS handover */ /* x2apic enabled before OS handover */
static int x2apic_preenabled; static int x2apic_preenabled;
static int disable_x2apic;
static __init int setup_nox2apic(char *str) static __init int setup_nox2apic(char *str)
{ {
if (x2apic_enabled()) { if (x2apic_enabled()) {
...@@ -149,7 +148,6 @@ static __init int setup_nox2apic(char *str) ...@@ -149,7 +148,6 @@ static __init int setup_nox2apic(char *str)
return 0; return 0;
} }
disable_x2apic = 1;
setup_clear_cpu_cap(X86_FEATURE_X2APIC); setup_clear_cpu_cap(X86_FEATURE_X2APIC);
return 0; return 0;
} }
......
...@@ -1716,25 +1716,19 @@ __apicdebuginit(void) print_IO_APIC(void) ...@@ -1716,25 +1716,19 @@ __apicdebuginit(void) print_IO_APIC(void)
return; return;
} }
__apicdebuginit(void) print_APIC_bitfield(int base) __apicdebuginit(void) print_APIC_field(int base)
{ {
unsigned int v; int i;
int i, j;
if (apic_verbosity == APIC_QUIET) if (apic_verbosity == APIC_QUIET)
return; return;
printk(KERN_DEBUG "0123456789abcdef0123456789abcdef\n" KERN_DEBUG); printk(KERN_DEBUG);
for (i = 0; i < 8; i++) {
v = apic_read(base + i*0x10); for (i = 0; i < 8; i++)
for (j = 0; j < 32; j++) { printk(KERN_CONT "%08x", apic_read(base + i*0x10));
if (v & (1<<j))
printk("1"); printk(KERN_CONT "\n");
else
printk("0");
}
printk("\n");
}
} }
__apicdebuginit(void) print_local_APIC(void *dummy) __apicdebuginit(void) print_local_APIC(void *dummy)
...@@ -1745,7 +1739,8 @@ __apicdebuginit(void) print_local_APIC(void *dummy) ...@@ -1745,7 +1739,8 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
if (apic_verbosity == APIC_QUIET) if (apic_verbosity == APIC_QUIET)
return; return;
printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", printk(KERN_DEBUG "\n");
printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
smp_processor_id(), hard_smp_processor_id()); smp_processor_id(), hard_smp_processor_id());
v = apic_read(APIC_ID); v = apic_read(APIC_ID);
printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id()); printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id());
...@@ -1786,11 +1781,11 @@ __apicdebuginit(void) print_local_APIC(void *dummy) ...@@ -1786,11 +1781,11 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
printk(KERN_DEBUG "... APIC SPIV: %08x\n", v); printk(KERN_DEBUG "... APIC SPIV: %08x\n", v);
printk(KERN_DEBUG "... APIC ISR field:\n"); printk(KERN_DEBUG "... APIC ISR field:\n");
print_APIC_bitfield(APIC_ISR); print_APIC_field(APIC_ISR);
printk(KERN_DEBUG "... APIC TMR field:\n"); printk(KERN_DEBUG "... APIC TMR field:\n");
print_APIC_bitfield(APIC_TMR); print_APIC_field(APIC_TMR);
printk(KERN_DEBUG "... APIC IRR field:\n"); printk(KERN_DEBUG "... APIC IRR field:\n");
print_APIC_bitfield(APIC_IRR); print_APIC_field(APIC_IRR);
if (APIC_INTEGRATED(ver)) { /* !82489DX */ if (APIC_INTEGRATED(ver)) { /* !82489DX */
if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
......
...@@ -803,8 +803,3 @@ int __kprobes lapic_wd_event(unsigned nmi_hz) ...@@ -803,8 +803,3 @@ int __kprobes lapic_wd_event(unsigned nmi_hz)
wd_ops->rearm(wd, nmi_hz); wd_ops->rearm(wd, nmi_hz);
return 1; return 1;
} }
int lapic_watchdog_ok(void)
{
return wd_ops != NULL;
}
...@@ -200,7 +200,7 @@ static void kvm_leave_lazy_mmu(void) ...@@ -200,7 +200,7 @@ static void kvm_leave_lazy_mmu(void)
state->mode = paravirt_get_lazy_mode(); state->mode = paravirt_get_lazy_mode();
} }
static void paravirt_ops_setup(void) static void __init paravirt_ops_setup(void)
{ {
pv_info.name = "KVM"; pv_info.name = "KVM";
pv_info.paravirt_enabled = 1; pv_info.paravirt_enabled = 1;
......
...@@ -5,15 +5,14 @@ ...@@ -5,15 +5,14 @@
* Zero a page. * Zero a page.
* rdi page * rdi page
*/ */
ALIGN ENTRY(clear_page_c)
clear_page_c:
CFI_STARTPROC CFI_STARTPROC
movl $4096/8,%ecx movl $4096/8,%ecx
xorl %eax,%eax xorl %eax,%eax
rep stosq rep stosq
ret ret
CFI_ENDPROC CFI_ENDPROC
ENDPROC(clear_page) ENDPROC(clear_page_c)
ENTRY(clear_page) ENTRY(clear_page)
CFI_STARTPROC CFI_STARTPROC
......
...@@ -75,6 +75,7 @@ ENTRY(copy_to_user) ...@@ -75,6 +75,7 @@ ENTRY(copy_to_user)
jae bad_to_user jae bad_to_user
ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
CFI_ENDPROC CFI_ENDPROC
ENDPROC(copy_to_user)
/* Standard copy_from_user with segment limit checking */ /* Standard copy_from_user with segment limit checking */
ENTRY(copy_from_user) ENTRY(copy_from_user)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/tlb.h> #include <asm/tlb.h>
#include <asm/proto.h>
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
......
...@@ -927,9 +927,9 @@ static struct irq_chip xen_dynamic_chip __read_mostly = { ...@@ -927,9 +927,9 @@ static struct irq_chip xen_dynamic_chip __read_mostly = {
void __init xen_init_IRQ(void) void __init xen_init_IRQ(void)
{ {
int i; int i;
size_t size = nr_cpu_ids * sizeof(struct cpu_evtchn_s);
cpu_evtchn_mask_p = alloc_bootmem(size); cpu_evtchn_mask_p = kcalloc(nr_cpu_ids, sizeof(struct cpu_evtchn_s),
GFP_KERNEL);
BUG_ON(cpu_evtchn_mask_p == NULL); BUG_ON(cpu_evtchn_mask_p == NULL);
init_evtchn_cpu_bindings(); init_evtchn_cpu_bindings();
......
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