diff options
-rw-r--r-- | arch/x86/boot/compressed/eboot.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 40 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/numa_emulation.c | 2 |
4 files changed, 38 insertions, 14 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index fec216f4fbc3..0cdfc0d2315e 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
@@ -539,7 +539,7 @@ static efi_status_t handle_ramdisks(efi_loaded_image_t *image, | |||
539 | struct initrd *initrd; | 539 | struct initrd *initrd; |
540 | efi_file_handle_t *h; | 540 | efi_file_handle_t *h; |
541 | efi_file_info_t *info; | 541 | efi_file_info_t *info; |
542 | efi_char16_t filename[256]; | 542 | efi_char16_t filename_16[256]; |
543 | unsigned long info_sz; | 543 | unsigned long info_sz; |
544 | efi_guid_t info_guid = EFI_FILE_INFO_ID; | 544 | efi_guid_t info_guid = EFI_FILE_INFO_ID; |
545 | efi_char16_t *p; | 545 | efi_char16_t *p; |
@@ -552,14 +552,14 @@ static efi_status_t handle_ramdisks(efi_loaded_image_t *image, | |||
552 | str += 7; | 552 | str += 7; |
553 | 553 | ||
554 | initrd = &initrds[i]; | 554 | initrd = &initrds[i]; |
555 | p = filename; | 555 | p = filename_16; |
556 | 556 | ||
557 | /* Skip any leading slashes */ | 557 | /* Skip any leading slashes */ |
558 | while (*str == '/' || *str == '\\') | 558 | while (*str == '/' || *str == '\\') |
559 | str++; | 559 | str++; |
560 | 560 | ||
561 | while (*str && *str != ' ' && *str != '\n') { | 561 | while (*str && *str != ' ' && *str != '\n') { |
562 | if (p >= filename + sizeof(filename)) | 562 | if ((u8 *)p >= (u8 *)filename_16 + sizeof(filename_16)) |
563 | break; | 563 | break; |
564 | 564 | ||
565 | *p++ = *str++; | 565 | *p++ = *str++; |
@@ -583,7 +583,7 @@ static efi_status_t handle_ramdisks(efi_loaded_image_t *image, | |||
583 | goto free_initrds; | 583 | goto free_initrds; |
584 | } | 584 | } |
585 | 585 | ||
586 | status = efi_call_phys5(fh->open, fh, &h, filename, | 586 | status = efi_call_phys5(fh->open, fh, &h, filename_16, |
587 | EFI_FILE_MODE_READ, (u64)0); | 587 | EFI_FILE_MODE_READ, (u64)0); |
588 | if (status != EFI_SUCCESS) | 588 | if (status != EFI_SUCCESS) |
589 | goto close_handles; | 589 | goto close_handles; |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index fb072754bc1d..6d10a66fc5a9 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -3967,18 +3967,36 @@ int mp_find_ioapic_pin(int ioapic, u32 gsi) | |||
3967 | static __init int bad_ioapic(unsigned long address) | 3967 | static __init int bad_ioapic(unsigned long address) |
3968 | { | 3968 | { |
3969 | if (nr_ioapics >= MAX_IO_APICS) { | 3969 | if (nr_ioapics >= MAX_IO_APICS) { |
3970 | printk(KERN_WARNING "WARNING: Max # of I/O APICs (%d) exceeded " | 3970 | pr_warn("WARNING: Max # of I/O APICs (%d) exceeded (found %d), skipping\n", |
3971 | "(found %d), skipping\n", MAX_IO_APICS, nr_ioapics); | 3971 | MAX_IO_APICS, nr_ioapics); |
3972 | return 1; | 3972 | return 1; |
3973 | } | 3973 | } |
3974 | if (!address) { | 3974 | if (!address) { |
3975 | printk(KERN_WARNING "WARNING: Bogus (zero) I/O APIC address" | 3975 | pr_warn("WARNING: Bogus (zero) I/O APIC address found in table, skipping!\n"); |
3976 | " found in table, skipping!\n"); | ||
3977 | return 1; | 3976 | return 1; |
3978 | } | 3977 | } |
3979 | return 0; | 3978 | return 0; |
3980 | } | 3979 | } |
3981 | 3980 | ||
3981 | static __init int bad_ioapic_register(int idx) | ||
3982 | { | ||
3983 | union IO_APIC_reg_00 reg_00; | ||
3984 | union IO_APIC_reg_01 reg_01; | ||
3985 | union IO_APIC_reg_02 reg_02; | ||
3986 | |||
3987 | reg_00.raw = io_apic_read(idx, 0); | ||
3988 | reg_01.raw = io_apic_read(idx, 1); | ||
3989 | reg_02.raw = io_apic_read(idx, 2); | ||
3990 | |||
3991 | if (reg_00.raw == -1 && reg_01.raw == -1 && reg_02.raw == -1) { | ||
3992 | pr_warn("I/O APIC 0x%x registers return all ones, skipping!\n", | ||
3993 | mpc_ioapic_addr(idx)); | ||
3994 | return 1; | ||
3995 | } | ||
3996 | |||
3997 | return 0; | ||
3998 | } | ||
3999 | |||
3982 | void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) | 4000 | void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) |
3983 | { | 4001 | { |
3984 | int idx = 0; | 4002 | int idx = 0; |
@@ -3995,6 +4013,12 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) | |||
3995 | ioapics[idx].mp_config.apicaddr = address; | 4013 | ioapics[idx].mp_config.apicaddr = address; |
3996 | 4014 | ||
3997 | set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); | 4015 | set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); |
4016 | |||
4017 | if (bad_ioapic_register(idx)) { | ||
4018 | clear_fixmap(FIX_IO_APIC_BASE_0 + idx); | ||
4019 | return; | ||
4020 | } | ||
4021 | |||
3998 | ioapics[idx].mp_config.apicid = io_apic_unique_id(id); | 4022 | ioapics[idx].mp_config.apicid = io_apic_unique_id(id); |
3999 | ioapics[idx].mp_config.apicver = io_apic_get_version(idx); | 4023 | ioapics[idx].mp_config.apicver = io_apic_get_version(idx); |
4000 | 4024 | ||
@@ -4015,10 +4039,10 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) | |||
4015 | if (gsi_cfg->gsi_end >= gsi_top) | 4039 | if (gsi_cfg->gsi_end >= gsi_top) |
4016 | gsi_top = gsi_cfg->gsi_end + 1; | 4040 | gsi_top = gsi_cfg->gsi_end + 1; |
4017 | 4041 | ||
4018 | printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%x, " | 4042 | pr_info("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, GSI %d-%d\n", |
4019 | "GSI %d-%d\n", idx, mpc_ioapic_id(idx), | 4043 | idx, mpc_ioapic_id(idx), |
4020 | mpc_ioapic_ver(idx), mpc_ioapic_addr(idx), | 4044 | mpc_ioapic_ver(idx), mpc_ioapic_addr(idx), |
4021 | gsi_cfg->gsi_base, gsi_cfg->gsi_end); | 4045 | gsi_cfg->gsi_base, gsi_cfg->gsi_end); |
4022 | 4046 | ||
4023 | nr_ioapics++; | 4047 | nr_ioapics++; |
4024 | } | 4048 | } |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index c614bd4de0f3..d086a09c087d 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -191,7 +191,7 @@ static void drain_mcelog_buffer(void) | |||
191 | { | 191 | { |
192 | unsigned int next, i, prev = 0; | 192 | unsigned int next, i, prev = 0; |
193 | 193 | ||
194 | next = rcu_dereference_check_mce(mcelog.next); | 194 | next = ACCESS_ONCE(mcelog.next); |
195 | 195 | ||
196 | do { | 196 | do { |
197 | struct mce *m; | 197 | struct mce *m; |
diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c index 740b0a355431..53489ff6bf82 100644 --- a/arch/x86/mm/numa_emulation.c +++ b/arch/x86/mm/numa_emulation.c | |||
@@ -28,7 +28,7 @@ static int __init emu_find_memblk_by_nid(int nid, const struct numa_meminfo *mi) | |||
28 | return -ENOENT; | 28 | return -ENOENT; |
29 | } | 29 | } |
30 | 30 | ||
31 | static u64 mem_hole_size(u64 start, u64 end) | 31 | static u64 __init mem_hole_size(u64 start, u64 end) |
32 | { | 32 | { |
33 | unsigned long start_pfn = PFN_UP(start); | 33 | unsigned long start_pfn = PFN_UP(start); |
34 | unsigned long end_pfn = PFN_DOWN(end); | 34 | unsigned long end_pfn = PFN_DOWN(end); |