Skip to content

Commit 181da3c

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Peter Anvin: "A somewhat unpleasantly large collection of small fixes. The big ones are the __visible tree sweep and a fix for 'earlyprintk=efi,keep'. It was using __init functions with predictably suboptimal results. Another key fix is a build fix which would produce output that simply would not decompress correctly in some configuration, due to the existing Makefiles picking up an unfortunate local label and mistaking it for the global symbol _end. Additional fixes include the handling of 64-bit numbers when setting the vdso data page (a latent bug which became manifest when i386 started exporting a vdso with time functions), a fix to the new MSR manipulation accessors which would cause features to not get properly unblocked, a build fix for 32-bit userland, and a few new platform quirks" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, vdso, time: Cast tv_nsec to u64 for proper shifting in update_vsyscall() x86: Fix typo in MSR_IA32_MISC_ENABLE_LIMIT_CPUID macro x86: Fix typo preventing msr_set/clear_bit from having an effect x86/intel: Add quirk to disable HPET for the Baytrail platform x86/hpet: Make boot_hpet_disable extern x86-64, build: Fix stack protector Makefile breakage with 32-bit userland x86/reboot: Add reboot quirk for Certec BPC600 asmlinkage: Add explicit __visible to drivers/*, lib/*, kernel/* asmlinkage, x86: Add explicit __visible to arch/x86/* asmlinkage: Revert "lto: Make asmlinkage __visible" x86, build: Don't get confused by local symbols x86/efi: earlyprintk=efi,keep fix
2 parents afcf0a2 + 28b92e0 commit 181da3c

File tree

38 files changed

+150
-77
lines changed

38 files changed

+150
-77
lines changed

arch/x86/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ else
7979
UTS_MACHINE := x86_64
8080
CHECKFLAGS += -D__x86_64__ -m64
8181

82+
biarch := -m64
8283
KBUILD_AFLAGS += -m64
8384
KBUILD_CFLAGS += -m64
8485

arch/x86/boot/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
7171

7272
SETUP_OBJS = $(addprefix $(obj)/,$(setup-y))
7373

74-
sed-voffset := -e 's/^\([0-9a-fA-F]*\) . \(_text\|_end\)$$/\#define VO_\2 0x\1/p'
74+
sed-voffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(_text\|_end\)$$/\#define VO_\2 0x\1/p'
7575

7676
quiet_cmd_voffset = VOFFSET $@
7777
cmd_voffset = $(NM) $< | sed -n $(sed-voffset) > $@
@@ -80,7 +80,7 @@ targets += voffset.h
8080
$(obj)/voffset.h: vmlinux FORCE
8181
$(call if_changed,voffset)
8282

83-
sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
83+
sed-zoffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
8484

8585
quiet_cmd_zoffset = ZOFFSET $@
8686
cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@

arch/x86/boot/compressed/misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static void parse_elf(void *output)
354354
free(phdrs);
355355
}
356356

357-
asmlinkage void *decompress_kernel(void *rmode, memptr heap,
357+
asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap,
358358
unsigned char *input_data,
359359
unsigned long input_len,
360360
unsigned char *output,

arch/x86/include/asm/hpet.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
/* hpet memory map physical address */
6464
extern unsigned long hpet_address;
6565
extern unsigned long force_hpet_address;
66+
extern int boot_hpet_disable;
6667
extern u8 hpet_blockid;
6768
extern int hpet_force_user;
6869
extern u8 hpet_msi_disable;

arch/x86/include/uapi/asm/msr-index.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@
384384
#define MSR_IA32_MISC_ENABLE_MWAIT_BIT 18
385385
#define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << MSR_IA32_MISC_ENABLE_MWAIT_BIT)
386386
#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT 22
387-
#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT);
387+
#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT)
388388
#define MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT 23
389389
#define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT)
390390
#define MSR_IA32_MISC_ENABLE_XD_DISABLE_BIT 34

arch/x86/kernel/acpi/sleep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static char temp_stack[4096];
3131
*
3232
* Wrapper around acpi_enter_sleep_state() to be called by assmebly.
3333
*/
34-
acpi_status asmlinkage x86_acpi_enter_sleep_state(u8 state)
34+
acpi_status asmlinkage __visible x86_acpi_enter_sleep_state(u8 state)
3535
{
3636
return acpi_enter_sleep_state(state);
3737
}

arch/x86/kernel/apic/io_apic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2189,7 +2189,7 @@ void send_cleanup_vector(struct irq_cfg *cfg)
21892189
cfg->move_in_progress = 0;
21902190
}
21912191

2192-
asmlinkage void smp_irq_move_cleanup_interrupt(void)
2192+
asmlinkage __visible void smp_irq_move_cleanup_interrupt(void)
21932193
{
21942194
unsigned vector, me;
21952195

arch/x86/kernel/cpu/mcheck/therm_throt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,14 @@ static inline void __smp_thermal_interrupt(void)
429429
smp_thermal_vector();
430430
}
431431

432-
asmlinkage void smp_thermal_interrupt(struct pt_regs *regs)
432+
asmlinkage __visible void smp_thermal_interrupt(struct pt_regs *regs)
433433
{
434434
entering_irq();
435435
__smp_thermal_interrupt();
436436
exiting_ack_irq();
437437
}
438438

439-
asmlinkage void smp_trace_thermal_interrupt(struct pt_regs *regs)
439+
asmlinkage __visible void smp_trace_thermal_interrupt(struct pt_regs *regs)
440440
{
441441
entering_irq();
442442
trace_thermal_apic_entry(THERMAL_APIC_VECTOR);

arch/x86/kernel/cpu/mcheck/threshold.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ static inline void __smp_threshold_interrupt(void)
2424
mce_threshold_vector();
2525
}
2626

27-
asmlinkage void smp_threshold_interrupt(void)
27+
asmlinkage __visible void smp_threshold_interrupt(void)
2828
{
2929
entering_irq();
3030
__smp_threshold_interrupt();
3131
exiting_ack_irq();
3232
}
3333

34-
asmlinkage void smp_trace_threshold_interrupt(void)
34+
asmlinkage __visible void smp_trace_threshold_interrupt(void)
3535
{
3636
entering_irq();
3737
trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR);

arch/x86/kernel/early-quirks.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <asm/dma.h>
1818
#include <asm/io_apic.h>
1919
#include <asm/apic.h>
20+
#include <asm/hpet.h>
2021
#include <asm/iommu.h>
2122
#include <asm/gart.h>
2223
#include <asm/irq_remapping.h>
@@ -530,6 +531,15 @@ static void __init intel_graphics_stolen(int num, int slot, int func)
530531
}
531532
}
532533

534+
static void __init force_disable_hpet(int num, int slot, int func)
535+
{
536+
#ifdef CONFIG_HPET_TIMER
537+
boot_hpet_disable = 1;
538+
pr_info("x86/hpet: Will disable the HPET for this platform because it's not reliable\n");
539+
#endif
540+
}
541+
542+
533543
#define QFLAG_APPLY_ONCE 0x1
534544
#define QFLAG_APPLIED 0x2
535545
#define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED)
@@ -567,6 +577,12 @@ static struct chipset early_qrk[] __initdata = {
567577
PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
568578
{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA, PCI_ANY_ID,
569579
QFLAG_APPLY_ONCE, intel_graphics_stolen },
580+
/*
581+
* HPET on current version of Baytrail platform has accuracy
582+
* problems, disable it for now:
583+
*/
584+
{ PCI_VENDOR_ID_INTEL, 0x0f00,
585+
PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, force_disable_hpet},
570586
{}
571587
};
572588

arch/x86/kernel/head32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static void __init i386_default_early_setup(void)
2929
reserve_ebda_region();
3030
}
3131

32-
asmlinkage void __init i386_start_kernel(void)
32+
asmlinkage __visible void __init i386_start_kernel(void)
3333
{
3434
sanitize_boot_params(&boot_params);
3535

arch/x86/kernel/head64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static void __init copy_bootdata(char *real_mode_data)
137137
}
138138
}
139139

140-
asmlinkage void __init x86_64_start_kernel(char * real_mode_data)
140+
asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data)
141141
{
142142
int i;
143143

arch/x86/kernel/hpet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static inline void hpet_clear_mapping(void)
8888
/*
8989
* HPET command line enable / disable
9090
*/
91-
static int boot_hpet_disable;
91+
int boot_hpet_disable;
9292
int hpet_force_user;
9393
static int hpet_verbose;
9494

arch/x86/kernel/process_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
asmlinkage extern void ret_from_fork(void);
5454

55-
asmlinkage DEFINE_PER_CPU(unsigned long, old_rsp);
55+
__visible DEFINE_PER_CPU(unsigned long, old_rsp);
5656

5757
/* Prints also some state that isn't saved in the pt_regs */
5858
void __show_regs(struct pt_regs *regs, int all)

arch/x86/kernel/reboot.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,16 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
191191
},
192192
},
193193

194+
/* Certec */
195+
{ /* Handle problems with rebooting on Certec BPC600 */
196+
.callback = set_pci_reboot,
197+
.ident = "Certec BPC600",
198+
.matches = {
199+
DMI_MATCH(DMI_SYS_VENDOR, "Certec"),
200+
DMI_MATCH(DMI_PRODUCT_NAME, "BPC600"),
201+
},
202+
},
203+
194204
/* Dell */
195205
{ /* Handle problems with rebooting on Dell DXP061 */
196206
.callback = set_bios_reboot,

arch/x86/kernel/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)
168168
* this function calls the 'stop' function on all other CPUs in the system.
169169
*/
170170

171-
asmlinkage void smp_reboot_interrupt(void)
171+
asmlinkage __visible void smp_reboot_interrupt(void)
172172
{
173173
ack_APIC_irq();
174174
irq_enter();

arch/x86/kernel/traps.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ dotraplinkage void __kprobes notrace do_int3(struct pt_regs *regs, long error_co
357357
* for scheduling or signal handling. The actual stack switch is done in
358358
* entry.S
359359
*/
360-
asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
360+
asmlinkage __visible __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
361361
{
362362
struct pt_regs *regs = eregs;
363363
/* Did already sync */
@@ -601,11 +601,11 @@ do_spurious_interrupt_bug(struct pt_regs *regs, long error_code)
601601
#endif
602602
}
603603

604-
asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void)
604+
asmlinkage __visible void __attribute__((weak)) smp_thermal_interrupt(void)
605605
{
606606
}
607607

608-
asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
608+
asmlinkage __visible void __attribute__((weak)) smp_threshold_interrupt(void)
609609
{
610610
}
611611

arch/x86/kernel/vsmp_64.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static int irq_routing_comply = 1;
3636
* and vice versa.
3737
*/
3838

39-
asmlinkage unsigned long vsmp_save_fl(void)
39+
asmlinkage __visible unsigned long vsmp_save_fl(void)
4040
{
4141
unsigned long flags = native_save_fl();
4242

@@ -56,15 +56,15 @@ __visible void vsmp_restore_fl(unsigned long flags)
5656
}
5757
PV_CALLEE_SAVE_REGS_THUNK(vsmp_restore_fl);
5858

59-
asmlinkage void vsmp_irq_disable(void)
59+
asmlinkage __visible void vsmp_irq_disable(void)
6060
{
6161
unsigned long flags = native_save_fl();
6262

6363
native_restore_fl((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC);
6464
}
6565
PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_disable);
6666

67-
asmlinkage void vsmp_irq_enable(void)
67+
asmlinkage __visible void vsmp_irq_enable(void)
6868
{
6969
unsigned long flags = native_save_fl();
7070

arch/x86/kernel/vsyscall_gtod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void update_vsyscall(struct timekeeper *tk)
4343
vdata->monotonic_time_sec = tk->xtime_sec
4444
+ tk->wall_to_monotonic.tv_sec;
4545
vdata->monotonic_time_snsec = tk->xtime_nsec
46-
+ (tk->wall_to_monotonic.tv_nsec
46+
+ ((u64)tk->wall_to_monotonic.tv_nsec
4747
<< tk->shift);
4848
while (vdata->monotonic_time_snsec >=
4949
(((u64)NSEC_PER_SEC) << tk->shift)) {

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ int kvm_set_apic_base(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
280280
}
281281
EXPORT_SYMBOL_GPL(kvm_set_apic_base);
282282

283-
asmlinkage void kvm_spurious_fault(void)
283+
asmlinkage __visible void kvm_spurious_fault(void)
284284
{
285285
/* Fault while not rebooting. We want the trace. */
286286
BUG();

arch/x86/lguest/boot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ static void lguest_end_context_switch(struct task_struct *next)
233233
* flags word contains all kind of stuff, but in practice Linux only cares
234234
* about the interrupt flag. Our "save_flags()" just returns that.
235235
*/
236-
asmlinkage unsigned long lguest_save_fl(void)
236+
asmlinkage __visible unsigned long lguest_save_fl(void)
237237
{
238238
return lguest_data.irq_enabled;
239239
}
240240

241241
/* Interrupts go off... */
242-
asmlinkage void lguest_irq_disable(void)
242+
asmlinkage __visible void lguest_irq_disable(void)
243243
{
244244
lguest_data.irq_enabled = 0;
245245
}

arch/x86/lib/msr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static inline int __flip_bit(u32 msr, u8 bit, bool set)
7676
if (m1.q == m.q)
7777
return 0;
7878

79-
err = msr_write(msr, &m);
79+
err = msr_write(msr, &m1);
8080
if (err)
8181
return err;
8282

arch/x86/math-emu/errors.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static struct {
302302
0x242 in div_Xsig.S
303303
*/
304304

305-
asmlinkage void FPU_exception(int n)
305+
asmlinkage __visible void FPU_exception(int n)
306306
{
307307
int i, int_type;
308308

@@ -492,7 +492,7 @@ int real_2op_NaN(FPU_REG const *b, u_char tagb,
492492

493493
/* Invalid arith operation on Valid registers */
494494
/* Returns < 0 if the exception is unmasked */
495-
asmlinkage int arith_invalid(int deststnr)
495+
asmlinkage __visible int arith_invalid(int deststnr)
496496
{
497497

498498
EXCEPTION(EX_Invalid);
@@ -507,7 +507,7 @@ asmlinkage int arith_invalid(int deststnr)
507507
}
508508

509509
/* Divide a finite number by zero */
510-
asmlinkage int FPU_divide_by_zero(int deststnr, u_char sign)
510+
asmlinkage __visible int FPU_divide_by_zero(int deststnr, u_char sign)
511511
{
512512
FPU_REG *dest = &st(deststnr);
513513
int tag = TAG_Valid;
@@ -539,7 +539,7 @@ int set_precision_flag(int flags)
539539
}
540540

541541
/* This may be called often, so keep it lean */
542-
asmlinkage void set_precision_flag_up(void)
542+
asmlinkage __visible void set_precision_flag_up(void)
543543
{
544544
if (control_word & CW_Precision)
545545
partial_status |= (SW_Precision | SW_C1); /* The masked response */
@@ -548,7 +548,7 @@ asmlinkage void set_precision_flag_up(void)
548548
}
549549

550550
/* This may be called often, so keep it lean */
551-
asmlinkage void set_precision_flag_down(void)
551+
asmlinkage __visible void set_precision_flag_down(void)
552552
{
553553
if (control_word & CW_Precision) { /* The masked response */
554554
partial_status &= ~SW_C1;
@@ -557,7 +557,7 @@ asmlinkage void set_precision_flag_down(void)
557557
EXCEPTION(EX_Precision);
558558
}
559559

560-
asmlinkage int denormal_operand(void)
560+
asmlinkage __visible int denormal_operand(void)
561561
{
562562
if (control_word & CW_Denormal) { /* The masked response */
563563
partial_status |= SW_Denorm_Op;
@@ -568,7 +568,7 @@ asmlinkage int denormal_operand(void)
568568
}
569569
}
570570

571-
asmlinkage int arith_overflow(FPU_REG *dest)
571+
asmlinkage __visible int arith_overflow(FPU_REG *dest)
572572
{
573573
int tag = TAG_Valid;
574574

@@ -596,7 +596,7 @@ asmlinkage int arith_overflow(FPU_REG *dest)
596596

597597
}
598598

599-
asmlinkage int arith_underflow(FPU_REG *dest)
599+
asmlinkage __visible int arith_underflow(FPU_REG *dest)
600600
{
601601
int tag = TAG_Valid;
602602

0 commit comments

Comments
 (0)