timers/urgent for v5.8
Subsystems (5)
Linus,
please pull the latest timers/urgent branch from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-2020-06-11
up to: b91c8c42ffdd: lib/vdso: Force inlining of __cvdso_clock_gettime_common()
A small fix for the VDSO code to force inline __cvdso_clock_gettime_common() so the compiler can't generate horrible code.
Thanks,
tglx
------------------>
Christophe Leroy (1):
lib/vdso: Force inlining of __cvdso_clock_gettime_common()
lib/vdso/gettimeofday.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/vdso/gettimeofday.c +1 -1
@@ -210,7 +210,7 @@ static __always_inline int do_coarse(const struct vdso_data *vd, clockid_t clk,return 0 ; } -static __maybe_unused int +static __always_inline int__cvdso_clock_gettime_common (const struct vdso_data *vd,clockid_t clock,struct __kernel_timespec *ts) {
[GIT pull] x86/urgent for v5.8
Linus,
please pull the latest x86/urgent branch from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2020-06-11
up to: 7778d8417b74: x86/vdso: Unbreak paravirt VDSO clocks
A set of fixes and updates for x86:
- Unbreak paravirt VDSO clocks. While the VDSO code was moved into lib for sharing a subtle check for the validity of paravirt clocks got replaced. While the replacement works perfectly fine for bare metal as the update of the VDSO clock mode is synchronous, it fails for paravirt clocks because the hypervisor can invalidate them asynchronous. Bring it back as an optional function so it does not inflict this on architectures which are free of PV damage.
- Fix the jiffies to jiffies64 mapping on 64bit so it does not trigger an ODR violation on newer compilers
- Three fixes for the SSBD and *IB* speculation mitigation maze to ensure consistency, not disabling of some *IB* variants wrongly and to prevent a rogue cross process shutdown of SSBD. All marked for stable.
- Add yet more CPU models to the splitlock detection capable list !@#%$!
- Bring the pr_info() back which tells that TSC deadline timer is enabled.
- Reboot quirk for MacBook6,1
Thanks,
tglx
------------------>
Anthony Steinhauser (3):
x86/speculation: Avoid force-disabling IBPB based on STIBP and enhanced IBRS. x86/speculation: Prevent rogue cross-process SSBD shutdown x86/speculation: PR_SPEC_FORCE_DISABLE enforcement for indirect branches.
Bob Haarman (1):
x86_64: Fix jiffies ODR violation
Borislav Petkov (1):
x86/apic: Make TSC deadline timer detection message visible
Fenghua Yu (1):
x86/split_lock: Add Icelake microserver and Tigerlake CPU models
Hill Ma (1):
x86/reboot/quirks: Add MacBook6,1 reboot quirk
Thomas Gleixner (3):
clocksource: Remove obsolete ifdef lib/vdso: Provide sanity check for cycles (again) x86/vdso: Unbreak paravirt VDSO clocks
Tony Luck (1):
x86/cpu: Add Sapphire Rapids CPU model number
arch/x86/include/asm/intel-family.h | 2 + arch/x86/include/asm/vdso/gettimeofday.h | 18 +++++++ arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/cpu/bugs.c | 92 +++++++++++++++++++------------- arch/x86/kernel/cpu/intel.c | 3 ++ arch/x86/kernel/process.c | 28 ++++------ arch/x86/kernel/reboot.c | 8 +++ arch/x86/kernel/time.c | 4 -- arch/x86/kernel/vmlinux.lds.S | 4 +- kernel/time/clocksource.c | 2 - lib/vdso/gettimeofday.c | 11 ++++ 11 files changed, 109 insertions(+), 65 deletions(-)
arch/x86/include/asm/intel-family.h +2 -0
@@ -89,6 +89,8 @@#define INTEL_FAM6_COMETLAKE 0xA5#define INTEL_FAM6_COMETLAKE_L 0xA6 +#define INTEL_FAM6_SAPPHIRERAPIDS_X 0x8F +/* "Small Core" Processors (Atom) */ #define INTEL_FAM6_ATOM_BONNELL 0x1C/* Diamondville, Pineview */
arch/x86/include/asm/vdso/gettimeofday.h +18 -0
@@ -271,6 +271,24 @@ static __always_inline const struct vdso_data *__arch_get_vdso_data(void)return __vdso_data; } +static inline bool arch_vdso_clocksource_ok (const struct vdso_data *vd) +{ +return true; +} +#define vdso_clocksource_ok arch_vdso_clocksource_ok + +/* +* Clocksource read value validation to handle PV and HyperV clocksources +* which can be invalidated asynchronously and indicate invalidation by +* returning U64_MAX, which can be effectively tested by checking for a +* negative value after casting it to s64. +*/ +static inline bool arch_vdso_cycles_ok (u64 cycles) +{ +return (s64 )cycles >=0 ; +} +#define vdso_cycles_ok arch_vdso_cycles_ok +/* * x86 specific delta calculation. *
arch/x86/kernel/apic/apic.c +1 -1
@@ -2093,7 +2093,7 @@ void __init init_apic_mappings(void)unsigned int new_apicid;if (apic_validate_deadline_timer ()) -pr_debug ("TSC deadline timer available\n" ); +pr_info ("TSC deadline timer available\n" );if (x2apic_mode) { boot_cpu_physical_apicid =read_apic_id ();
arch/x86/kernel/cpu/bugs.c +54 -38
166 lines not on this page · raw message
arch/x86/kernel/cpu/intel.c +3 -0
@@ -1135,9 +1135,12 @@ void switch_to_sld(unsigned long tifn)static const struct x86_cpu_id split_lock_cpu_ids[]__initconst = {X86_MATCH_INTEL_FAM6_MODEL (ICELAKE_X ,0 ),X86_MATCH_INTEL_FAM6_MODEL (ICELAKE_L ,0 ), +X86_MATCH_INTEL_FAM6_MODEL (ICELAKE_D ,0 ),X86_MATCH_INTEL_FAM6_MODEL (ATOM_TREMONT ,1 ),X86_MATCH_INTEL_FAM6_MODEL (ATOM_TREMONT_D ,1 ),X86_MATCH_INTEL_FAM6_MODEL (ATOM_TREMONT_L ,1 ), +X86_MATCH_INTEL_FAM6_MODEL (TIGERLAKE_L ,1 ), +X86_MATCH_INTEL_FAM6_MODEL (TIGERLAKE ,1 ), {} };
arch/x86/kernel/process.c +10 -18
@@ -545,28 +545,20 @@ static __always_inline void __speculation_ctrl_update(unsigned long tifp,lockdep_assert_irqs_disabled (); -/* -* If TIF_SSBD is different, select the proper mitigation -* method. Note that if SSBD mitigation is disabled or permanentely -* enabled this branch can't be taken because nothing can set -* TIF_SSBD. -*/ -if (tif_diff & _TIF_SSBD) { -if (static_cpu_has (X86_FEATURE_VIRT_SSBD )) { +/* Handle change of TIF_SSBD depending on the mitigation method. */ +if (static_cpu_has (X86_FEATURE_VIRT_SSBD )) { +if (tif_diff & _TIF_SSBD)amd_set_ssb_virt_state (tifn); - }else if (static_cpu_has (X86_FEATURE_LS_CFG_SSBD )) { + }else if (static_cpu_has (X86_FEATURE_LS_CFG_SSBD )) { +if (tif_diff & _TIF_SSBD)amd_set_core_ssb_state (tifn); - }else if (static_cpu_has (X86_FEATURE_SPEC_CTRL_SSBD ) || -static_cpu_has (X86_FEATURE_AMD_SSBD )) { - msr |=ssbd_tif_to_spec_ctrl (tifn); - updmsr = true; - } + }else if (static_cpu_has (X86_FEATURE_SPEC_CTRL_SSBD ) || +static_cpu_has (X86_FEATURE_AMD_SSBD )) { + updmsr |= !!(tif_diff & _TIF_SSBD); + msr |=ssbd_tif_to_spec_ctrl (tifn); } -/* -* Only evaluate TIF_SPEC_IB if conditional STIBP is enabled, -* otherwise avoid the MSR write. -*/ +/* Only evaluate TIF_SPEC_IB if conditional STIBP is enabled. */ if (IS_ENABLED (CONFIG_SMP ) &&static_branch_unlikely (&switch_to_cond_stibp)) { updmsr |= !!(tif_diff & _TIF_SPEC_IB);
arch/x86/kernel/reboot.c +8 -0
@@ -197,6 +197,14 @@ static const struct dmi_system_id reboot_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"), }, }, + { /* Handle problems with rebooting on Apple MacBook6,1 */ + .callback = set_pci_reboot, + .ident = "Apple MacBook6,1", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Apple Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "MacBook6,1"), + }, + }, { /* Handle problems with rebooting on Apple MacBookPro5 */ .callback = set_pci_reboot, .ident = "Apple MacBookPro5",
arch/x86/kernel/time.c +0 -4
@@ -25,10 +25,6 @@#include <asm/hpet.h> #include <asm/time.h> -#ifdef CONFIG_X86_64 -__visible volatile unsigned long jiffies __cacheline_aligned_in_smp = INITIAL_JIFFIES; -#endif -unsigned long profile_pc (struct pt_regs *regs) {unsigned long pc =instruction_pointer (regs);
arch/x86/kernel/vmlinux.lds.S +2 -2
@@ -40,13 +40,13 @@ OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT) #ifdef CONFIG_X86_32 OUTPUT_ARCH(i386) ENTRY(phys_startup_32) -jiffies = jiffies_64; #else OUTPUT_ARCH(i386:x86-64) ENTRY(phys_startup_64) -jiffies_64 = jiffies; #endif +jiffies = jiffies_64; + #if defined(CONFIG_X86_64) /* * On 64-bit, align RODATA to 2MB so we retain large page mappings for
kernel/time/clocksource.c +0 -2
@@ -928,14 +928,12 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)clocksource_arch_init (cs); -#ifdef CONFIG_GENERIC_VDSO_CLOCK_MODE if (cs->vdso_clock_mode <0 || cs->vdso_clock_mode >=VDSO_CLOCKMODE_MAX ) {pr_warn ("clocksource %s registered with invalid VDSO mode %d. Disabling VDSO support.\n" , cs->name, cs->vdso_clock_mode); cs->vdso_clock_mode =VDSO_CLOCKMODE_NONE ; } -#endif /* Initialize mult/shift and max_idle_ns */ __clocksource_update_freq_scale (cs, scale, freq);
lib/vdso/gettimeofday.c +11 -0
@@ -38,6 +38,13 @@ static inline bool vdso_clocksource_ok(const struct vdso_data *vd) }#endif +#ifndef vdso_cycles_ok +static inline bool vdso_cycles_ok (u64 cycles) +{ +return true; +} +#endif +#ifdef CONFIG_TIME_NS static int do_hres_timens (const struct vdso_data *vdns,clockid_t clk,struct __kernel_timespec *ts)
@@ -62,6 +69,8 @@ static int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,return -1 ; cycles =__arch_get_hw_counter (vd->clock_mode); +if (unlikely (!vdso_cycles_ok (cycles))) +return -1 ; ns = vdso_ts->nsec; last = vd->cycle_last; ns +=vdso_calc_delta (cycles, last, vd->mask, vd->mult);
@@ -130,6 +139,8 @@ static __always_inline int do_hres(const struct vdso_data *vd, clockid_t clk,return -1 ; cycles =__arch_get_hw_counter (vd->clock_mode); +if (unlikely (!vdso_cycles_ok (cycles))) +return -1 ; ns = vdso_ts->nsec; last = vd->cycle_last; ns +=vdso_calc_delta (cycles, last, vd->mask, vd->mult);
Re: [GIT pull] x86/urgent for v5.8
The pull request you sent on Thu, 11 Jun 2020 18:46:23 -0000:
The pull request you sent on Thu, 11 Jun 2020 18:46:23 -0000:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitx86-urgent-2020-06-11
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/6a45a65888393eda692fce0851c40d9f5ce4ef66
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker
The pull request you sent on Thu, 11 Jun 2020 18:46:22 -0000:
The pull request you sent on Thu, 11 Jun 2020 18:46:22 -0000:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gittimers-urgent-2020-06-11
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/92ac971219a29336e466921156b16f8fa88d91aa
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker