Merge 5.10-rc6 into android-mainline
Linux 5.10-rc6 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: If86eed9a017e59d6e92d173f089f98102424d052
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc5
|
||||
EXTRAVERSION = -rc6
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
||||
@@ -57,7 +57,7 @@ EXPORT_SYMBOL(pm_power_off);
|
||||
void arch_cpu_idle(void)
|
||||
{
|
||||
wtint(0);
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
void arch_cpu_idle_dead(void)
|
||||
|
||||
@@ -71,7 +71,7 @@ void arch_cpu_idle(void)
|
||||
arm_pm_idle();
|
||||
else
|
||||
cpu_do_idle();
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
void arch_cpu_idle_prepare(void)
|
||||
|
||||
@@ -126,7 +126,7 @@ void arch_cpu_idle(void)
|
||||
* tricks
|
||||
*/
|
||||
cpu_do_idle();
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
|
||||
@@ -102,6 +102,6 @@ void arch_cpu_idle(void)
|
||||
#ifdef CONFIG_CPU_PM_STOP
|
||||
asm volatile("stop\n");
|
||||
#endif
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,7 @@ asmlinkage void ret_from_kernel_thread(void);
|
||||
*/
|
||||
void arch_cpu_idle(void)
|
||||
{
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
__asm__("sleep");
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ void arch_cpu_idle(void)
|
||||
{
|
||||
__vmwait();
|
||||
/* interrupts wake us up, but irqs are still disabled */
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -239,7 +239,7 @@ void arch_cpu_idle(void)
|
||||
if (mark_idle)
|
||||
(*mark_idle)(1);
|
||||
|
||||
safe_halt();
|
||||
raw_safe_halt();
|
||||
|
||||
if (mark_idle)
|
||||
(*mark_idle)(0);
|
||||
|
||||
@@ -149,5 +149,5 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs)
|
||||
|
||||
void arch_cpu_idle(void)
|
||||
{
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
@@ -33,19 +33,19 @@ static void __cpuidle r3081_wait(void)
|
||||
{
|
||||
unsigned long cfg = read_c0_conf();
|
||||
write_c0_conf(cfg | R30XX_CONF_HALT);
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
static void __cpuidle r39xx_wait(void)
|
||||
{
|
||||
if (!need_resched())
|
||||
write_c0_conf(read_c0_conf() | TX39_CONF_HALT);
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
void __cpuidle r4k_wait(void)
|
||||
{
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
__r4k_wait();
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ void __cpuidle r4k_wait_irqoff(void)
|
||||
" .set arch=r4000 \n"
|
||||
" wait \n"
|
||||
" .set pop \n");
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -84,7 +84,7 @@ static void __cpuidle rm7k_wait_irqoff(void)
|
||||
" wait \n"
|
||||
" mtc0 $1, $12 # stalls until W stage \n"
|
||||
" .set pop \n");
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -257,7 +257,7 @@ void arch_cpu_idle(void)
|
||||
if (cpu_wait)
|
||||
cpu_wait();
|
||||
else
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CPU_IDLE
|
||||
|
||||
@@ -33,7 +33,7 @@ EXPORT_SYMBOL(pm_power_off);
|
||||
|
||||
void arch_cpu_idle(void)
|
||||
{
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -79,7 +79,7 @@ void machine_power_off(void)
|
||||
*/
|
||||
void arch_cpu_idle(void)
|
||||
{
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
if (mfspr(SPR_UPR) & SPR_UPR_PMP)
|
||||
mtspr(SPR_PMR, mfspr(SPR_PMR) | SPR_PMR_DME);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ void __cpuidle arch_cpu_idle_dead(void)
|
||||
|
||||
void __cpuidle arch_cpu_idle(void)
|
||||
{
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
|
||||
/* nop on real hardware, qemu will idle sleep. */
|
||||
asm volatile("or %%r10,%%r10,%%r10\n":::);
|
||||
|
||||
@@ -52,9 +52,9 @@ void arch_cpu_idle(void)
|
||||
* interrupts enabled, some don't.
|
||||
*/
|
||||
if (irqs_disabled())
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
} else {
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
/*
|
||||
* Go into low thread priority and possibly
|
||||
* low power mode.
|
||||
|
||||
@@ -36,7 +36,7 @@ extern asmlinkage void ret_from_kernel_thread(void);
|
||||
void arch_cpu_idle(void)
|
||||
{
|
||||
wait_for_interrupt();
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
void show_regs(struct pt_regs *regs)
|
||||
|
||||
@@ -33,10 +33,10 @@ void enabled_wait(void)
|
||||
PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK;
|
||||
clear_cpu_flag(CIF_NOHZ_DELAY);
|
||||
|
||||
local_irq_save(flags);
|
||||
raw_local_irq_save(flags);
|
||||
/* Call the assembler magic in entry.S */
|
||||
psw_idle(idle, psw_mask);
|
||||
local_irq_restore(flags);
|
||||
raw_local_irq_restore(flags);
|
||||
|
||||
/* Account time spent with enabled wait psw loaded as idle time. */
|
||||
raw_write_seqcount_begin(&idle->seqcount);
|
||||
@@ -123,7 +123,7 @@ void arch_cpu_idle_enter(void)
|
||||
void arch_cpu_idle(void)
|
||||
{
|
||||
enabled_wait();
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
void arch_cpu_idle_exit(void)
|
||||
|
||||
@@ -22,7 +22,7 @@ static void (*sh_idle)(void);
|
||||
void default_idle(void)
|
||||
{
|
||||
set_bl_bit();
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
/* Isn't this racy ? */
|
||||
cpu_sleep();
|
||||
clear_bl_bit();
|
||||
|
||||
@@ -50,7 +50,7 @@ static void pmc_leon_idle_fixup(void)
|
||||
register unsigned int address = (unsigned int)leon3_irqctrl_regs;
|
||||
|
||||
/* Interrupts need to be enabled to not hang the CPU */
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"wr %%g0, %%asr19\n"
|
||||
@@ -66,7 +66,7 @@ static void pmc_leon_idle_fixup(void)
|
||||
static void pmc_leon_idle(void)
|
||||
{
|
||||
/* Interrupts need to be enabled to not hang the CPU */
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
|
||||
/* For systems without power-down, this will be no-op */
|
||||
__asm__ __volatile__ ("wr %g0, %asr19\n\t");
|
||||
|
||||
@@ -74,7 +74,7 @@ void arch_cpu_idle(void)
|
||||
{
|
||||
if (sparc_idle)
|
||||
(*sparc_idle)();
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
/* XXX cli/sti -> local_irq_xxx here, check this works once SMP is fixed. */
|
||||
|
||||
@@ -62,11 +62,11 @@ void arch_cpu_idle(void)
|
||||
{
|
||||
if (tlb_type != hypervisor) {
|
||||
touch_nmi_watchdog();
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
} else {
|
||||
unsigned long pstate;
|
||||
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
|
||||
/* The sun4v sleeping code requires that we have PSTATE.IE cleared over
|
||||
* the cpu sleep hypervisor call.
|
||||
|
||||
@@ -217,7 +217,7 @@ void arch_cpu_idle(void)
|
||||
{
|
||||
cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
|
||||
um_idle_sleep();
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
int __cant_sleep(void) {
|
||||
|
||||
@@ -88,8 +88,6 @@ static inline void __mwaitx(unsigned long eax, unsigned long ebx,
|
||||
|
||||
static inline void __sti_mwait(unsigned long eax, unsigned long ecx)
|
||||
{
|
||||
trace_hardirqs_on();
|
||||
|
||||
mds_idle_clear_cpu_buffers();
|
||||
/* "mwait %eax, %ecx;" */
|
||||
asm volatile("sti; .byte 0x0f, 0x01, 0xc9;"
|
||||
|
||||
@@ -739,11 +739,13 @@ spectre_v2_user_select_mitigation(enum spectre_v2_mitigation_cmd v2_cmd)
|
||||
if (boot_cpu_has(X86_FEATURE_IBPB)) {
|
||||
setup_force_cpu_cap(X86_FEATURE_USE_IBPB);
|
||||
|
||||
spectre_v2_user_ibpb = mode;
|
||||
switch (cmd) {
|
||||
case SPECTRE_V2_USER_CMD_FORCE:
|
||||
case SPECTRE_V2_USER_CMD_PRCTL_IBPB:
|
||||
case SPECTRE_V2_USER_CMD_SECCOMP_IBPB:
|
||||
static_branch_enable(&switch_mm_always_ibpb);
|
||||
spectre_v2_user_ibpb = SPECTRE_V2_USER_STRICT;
|
||||
break;
|
||||
case SPECTRE_V2_USER_CMD_PRCTL:
|
||||
case SPECTRE_V2_USER_CMD_AUTO:
|
||||
@@ -757,8 +759,6 @@ spectre_v2_user_select_mitigation(enum spectre_v2_mitigation_cmd v2_cmd)
|
||||
pr_info("mitigation: Enabling %s Indirect Branch Prediction Barrier\n",
|
||||
static_key_enabled(&switch_mm_always_ibpb) ?
|
||||
"always-on" : "conditional");
|
||||
|
||||
spectre_v2_user_ibpb = mode;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1384,8 +1384,10 @@ noinstr void do_machine_check(struct pt_regs *regs)
|
||||
* When there's any problem use only local no_way_out state.
|
||||
*/
|
||||
if (!lmce) {
|
||||
if (mce_end(order) < 0)
|
||||
no_way_out = worst >= MCE_PANIC_SEVERITY;
|
||||
if (mce_end(order) < 0) {
|
||||
if (!no_way_out)
|
||||
no_way_out = worst >= MCE_PANIC_SEVERITY;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* If there was a fatal machine check we should have
|
||||
|
||||
@@ -507,6 +507,24 @@ unlock:
|
||||
return ret ?: nbytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* rdtgroup_remove - the helper to remove resource group safely
|
||||
* @rdtgrp: resource group to remove
|
||||
*
|
||||
* On resource group creation via a mkdir, an extra kernfs_node reference is
|
||||
* taken to ensure that the rdtgroup structure remains accessible for the
|
||||
* rdtgroup_kn_unlock() calls where it is removed.
|
||||
*
|
||||
* Drop the extra reference here, then free the rdtgroup structure.
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static void rdtgroup_remove(struct rdtgroup *rdtgrp)
|
||||
{
|
||||
kernfs_put(rdtgrp->kn);
|
||||
kfree(rdtgrp);
|
||||
}
|
||||
|
||||
struct task_move_callback {
|
||||
struct callback_head work;
|
||||
struct rdtgroup *rdtgrp;
|
||||
@@ -529,7 +547,7 @@ static void move_myself(struct callback_head *head)
|
||||
(rdtgrp->flags & RDT_DELETED)) {
|
||||
current->closid = 0;
|
||||
current->rmid = 0;
|
||||
kfree(rdtgrp);
|
||||
rdtgroup_remove(rdtgrp);
|
||||
}
|
||||
|
||||
if (unlikely(current->flags & PF_EXITING))
|
||||
@@ -1769,7 +1787,6 @@ static int rdtgroup_mkdir_info_resdir(struct rdt_resource *r, char *name,
|
||||
if (IS_ERR(kn_subdir))
|
||||
return PTR_ERR(kn_subdir);
|
||||
|
||||
kernfs_get(kn_subdir);
|
||||
ret = rdtgroup_kn_set_ugid(kn_subdir);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -1792,7 +1809,6 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn)
|
||||
kn_info = kernfs_create_dir(parent_kn, "info", parent_kn->mode, NULL);
|
||||
if (IS_ERR(kn_info))
|
||||
return PTR_ERR(kn_info);
|
||||
kernfs_get(kn_info);
|
||||
|
||||
ret = rdtgroup_add_files(kn_info, RF_TOP_INFO);
|
||||
if (ret)
|
||||
@@ -1813,12 +1829,6 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn)
|
||||
goto out_destroy;
|
||||
}
|
||||
|
||||
/*
|
||||
* This extra ref will be put in kernfs_remove() and guarantees
|
||||
* that @rdtgrp->kn is always accessible.
|
||||
*/
|
||||
kernfs_get(kn_info);
|
||||
|
||||
ret = rdtgroup_kn_set_ugid(kn_info);
|
||||
if (ret)
|
||||
goto out_destroy;
|
||||
@@ -1847,12 +1857,6 @@ mongroup_create_dir(struct kernfs_node *parent_kn, struct rdtgroup *prgrp,
|
||||
if (dest_kn)
|
||||
*dest_kn = kn;
|
||||
|
||||
/*
|
||||
* This extra ref will be put in kernfs_remove() and guarantees
|
||||
* that @rdtgrp->kn is always accessible.
|
||||
*/
|
||||
kernfs_get(kn);
|
||||
|
||||
ret = rdtgroup_kn_set_ugid(kn);
|
||||
if (ret)
|
||||
goto out_destroy;
|
||||
@@ -2079,8 +2083,7 @@ void rdtgroup_kn_unlock(struct kernfs_node *kn)
|
||||
rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED)
|
||||
rdtgroup_pseudo_lock_remove(rdtgrp);
|
||||
kernfs_unbreak_active_protection(kn);
|
||||
kernfs_put(rdtgrp->kn);
|
||||
kfree(rdtgrp);
|
||||
rdtgroup_remove(rdtgrp);
|
||||
} else {
|
||||
kernfs_unbreak_active_protection(kn);
|
||||
}
|
||||
@@ -2139,13 +2142,11 @@ static int rdt_get_tree(struct fs_context *fc)
|
||||
&kn_mongrp);
|
||||
if (ret < 0)
|
||||
goto out_info;
|
||||
kernfs_get(kn_mongrp);
|
||||
|
||||
ret = mkdir_mondata_all(rdtgroup_default.kn,
|
||||
&rdtgroup_default, &kn_mondata);
|
||||
if (ret < 0)
|
||||
goto out_mongrp;
|
||||
kernfs_get(kn_mondata);
|
||||
rdtgroup_default.mon.mon_data_kn = kn_mondata;
|
||||
}
|
||||
|
||||
@@ -2357,7 +2358,7 @@ static void free_all_child_rdtgrp(struct rdtgroup *rdtgrp)
|
||||
if (atomic_read(&sentry->waitcount) != 0)
|
||||
sentry->flags = RDT_DELETED;
|
||||
else
|
||||
kfree(sentry);
|
||||
rdtgroup_remove(sentry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2399,7 +2400,7 @@ static void rmdir_all_sub(void)
|
||||
if (atomic_read(&rdtgrp->waitcount) != 0)
|
||||
rdtgrp->flags = RDT_DELETED;
|
||||
else
|
||||
kfree(rdtgrp);
|
||||
rdtgroup_remove(rdtgrp);
|
||||
}
|
||||
/* Notify online CPUs to update per cpu storage and PQR_ASSOC MSR */
|
||||
update_closid_rmid(cpu_online_mask, &rdtgroup_default);
|
||||
@@ -2499,11 +2500,6 @@ static int mkdir_mondata_subdir(struct kernfs_node *parent_kn,
|
||||
if (IS_ERR(kn))
|
||||
return PTR_ERR(kn);
|
||||
|
||||
/*
|
||||
* This extra ref will be put in kernfs_remove() and guarantees
|
||||
* that kn is always accessible.
|
||||
*/
|
||||
kernfs_get(kn);
|
||||
ret = rdtgroup_kn_set_ugid(kn);
|
||||
if (ret)
|
||||
goto out_destroy;
|
||||
@@ -2838,8 +2834,8 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
|
||||
/*
|
||||
* kernfs_remove() will drop the reference count on "kn" which
|
||||
* will free it. But we still need it to stick around for the
|
||||
* rdtgroup_kn_unlock(kn} call below. Take one extra reference
|
||||
* here, which will be dropped inside rdtgroup_kn_unlock().
|
||||
* rdtgroup_kn_unlock(kn) call. Take one extra reference here,
|
||||
* which will be dropped by kernfs_put() in rdtgroup_remove().
|
||||
*/
|
||||
kernfs_get(kn);
|
||||
|
||||
@@ -2880,6 +2876,7 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
|
||||
out_idfree:
|
||||
free_rmid(rdtgrp->mon.rmid);
|
||||
out_destroy:
|
||||
kernfs_put(rdtgrp->kn);
|
||||
kernfs_remove(rdtgrp->kn);
|
||||
out_free_rgrp:
|
||||
kfree(rdtgrp);
|
||||
@@ -2892,7 +2889,7 @@ static void mkdir_rdt_prepare_clean(struct rdtgroup *rgrp)
|
||||
{
|
||||
kernfs_remove(rgrp->kn);
|
||||
free_rmid(rgrp->mon.rmid);
|
||||
kfree(rgrp);
|
||||
rdtgroup_remove(rgrp);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3049,11 +3046,6 @@ static int rdtgroup_rmdir_mon(struct kernfs_node *kn, struct rdtgroup *rdtgrp,
|
||||
WARN_ON(list_empty(&prdtgrp->mon.crdtgrp_list));
|
||||
list_del(&rdtgrp->mon.crdtgrp_list);
|
||||
|
||||
/*
|
||||
* one extra hold on this, will drop when we kfree(rdtgrp)
|
||||
* in rdtgroup_kn_unlock()
|
||||
*/
|
||||
kernfs_get(kn);
|
||||
kernfs_remove(rdtgrp->kn);
|
||||
|
||||
return 0;
|
||||
@@ -3065,11 +3057,6 @@ static int rdtgroup_ctrl_remove(struct kernfs_node *kn,
|
||||
rdtgrp->flags = RDT_DELETED;
|
||||
list_del(&rdtgrp->rdtgroup_list);
|
||||
|
||||
/*
|
||||
* one extra hold on this, will drop when we kfree(rdtgrp)
|
||||
* in rdtgroup_kn_unlock()
|
||||
*/
|
||||
kernfs_get(kn);
|
||||
kernfs_remove(rdtgrp->kn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ void arch_cpu_idle(void)
|
||||
*/
|
||||
void __cpuidle default_idle(void)
|
||||
{
|
||||
safe_halt();
|
||||
raw_safe_halt();
|
||||
}
|
||||
#if defined(CONFIG_APM_MODULE) || defined(CONFIG_HALTPOLL_CPUIDLE_MODULE)
|
||||
EXPORT_SYMBOL(default_idle);
|
||||
@@ -736,6 +736,8 @@ void stop_this_cpu(void *dummy)
|
||||
/*
|
||||
* AMD Erratum 400 aware idle routine. We handle it the same way as C3 power
|
||||
* states (local apic timer and TSC stop).
|
||||
*
|
||||
* XXX this function is completely buggered vs RCU and tracing.
|
||||
*/
|
||||
static void amd_e400_idle(void)
|
||||
{
|
||||
@@ -757,9 +759,9 @@ static void amd_e400_idle(void)
|
||||
* The switch back from broadcast mode needs to be called with
|
||||
* interrupts disabled.
|
||||
*/
|
||||
local_irq_disable();
|
||||
raw_local_irq_disable();
|
||||
tick_broadcast_exit();
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -801,9 +803,9 @@ static __cpuidle void mwait_idle(void)
|
||||
if (!need_resched())
|
||||
__sti_mwait(0, 0);
|
||||
else
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
} else {
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
__current_clr_polling();
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ config EFI_DEV_PATH_PARSER
|
||||
|
||||
config EFI_EARLYCON
|
||||
def_bool y
|
||||
depends on SERIAL_EARLYCON && !ARM && !IA64
|
||||
depends on EFI && SERIAL_EARLYCON && !ARM && !IA64
|
||||
select FONT_SUPPORT
|
||||
select ARCH_USE_MEMREMAP_PROT
|
||||
|
||||
|
||||
@@ -390,10 +390,10 @@ static int __init efisubsys_init(void)
|
||||
|
||||
if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
|
||||
EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)) {
|
||||
efivar_ssdt_load();
|
||||
error = generic_ops_register();
|
||||
if (error)
|
||||
goto err_put;
|
||||
efivar_ssdt_load();
|
||||
platform_device_register_simple("efivars", 0, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
+20
-17
@@ -126,26 +126,9 @@ static __cpuidle int intel_idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_state *state = &drv->states[index];
|
||||
unsigned long eax = flg2MWAIT(state->flags);
|
||||
unsigned long ecx = 1; /* break on interrupt flag */
|
||||
bool tick;
|
||||
|
||||
if (!static_cpu_has(X86_FEATURE_ARAT)) {
|
||||
/*
|
||||
* Switch over to one-shot tick broadcast if the target C-state
|
||||
* is deeper than C1.
|
||||
*/
|
||||
if ((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) {
|
||||
tick = true;
|
||||
tick_broadcast_enter();
|
||||
} else {
|
||||
tick = false;
|
||||
}
|
||||
}
|
||||
|
||||
mwait_idle_with_hints(eax, ecx);
|
||||
|
||||
if (!static_cpu_has(X86_FEATURE_ARAT) && tick)
|
||||
tick_broadcast_exit();
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
@@ -1227,6 +1210,20 @@ static bool __init intel_idle_acpi_cst_extract(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool __init intel_idle_state_needs_timer_stop(struct cpuidle_state *state)
|
||||
{
|
||||
unsigned long eax = flg2MWAIT(state->flags);
|
||||
|
||||
if (boot_cpu_has(X86_FEATURE_ARAT))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Switch over to one-shot tick broadcast if the target C-state
|
||||
* is deeper than C1.
|
||||
*/
|
||||
return !!((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK);
|
||||
}
|
||||
|
||||
static void __init intel_idle_init_cstates_acpi(struct cpuidle_driver *drv)
|
||||
{
|
||||
int cstate, limit = min_t(int, CPUIDLE_STATE_MAX, acpi_state_table.count);
|
||||
@@ -1269,6 +1266,9 @@ static void __init intel_idle_init_cstates_acpi(struct cpuidle_driver *drv)
|
||||
if (disabled_states_mask & BIT(cstate))
|
||||
state->flags |= CPUIDLE_FLAG_OFF;
|
||||
|
||||
if (intel_idle_state_needs_timer_stop(state))
|
||||
state->flags |= CPUIDLE_FLAG_TIMER_STOP;
|
||||
|
||||
state->enter = intel_idle;
|
||||
state->enter_s2idle = intel_idle_s2idle;
|
||||
}
|
||||
@@ -1507,6 +1507,9 @@ static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
|
||||
!(cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_ALWAYS_ENABLE)))
|
||||
drv->states[drv->state_count].flags |= CPUIDLE_FLAG_OFF;
|
||||
|
||||
if (intel_idle_state_needs_timer_stop(&drv->states[drv->state_count]))
|
||||
drv->states[drv->state_count].flags |= CPUIDLE_FLAG_TIMER_STOP;
|
||||
|
||||
drv->state_count++;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1ULL << 0)
|
||||
#define ITS_FLAGS_WORKAROUND_CAVIUM_22375 (1ULL << 1)
|
||||
#define ITS_FLAGS_WORKAROUND_CAVIUM_23144 (1ULL << 2)
|
||||
#define ITS_FLAGS_SAVE_SUSPEND_STATE (1ULL << 3)
|
||||
|
||||
#define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0)
|
||||
#define RDIST_FLAGS_RD_TABLES_PREALLOCATED (1 << 1)
|
||||
@@ -4741,9 +4740,6 @@ static int its_save_disable(void)
|
||||
list_for_each_entry(its, &its_nodes, entry) {
|
||||
void __iomem *base;
|
||||
|
||||
if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE))
|
||||
continue;
|
||||
|
||||
base = its->base;
|
||||
its->ctlr_save = readl_relaxed(base + GITS_CTLR);
|
||||
err = its_force_quiescent(base);
|
||||
@@ -4762,9 +4758,6 @@ err:
|
||||
list_for_each_entry_continue_reverse(its, &its_nodes, entry) {
|
||||
void __iomem *base;
|
||||
|
||||
if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE))
|
||||
continue;
|
||||
|
||||
base = its->base;
|
||||
writel_relaxed(its->ctlr_save, base + GITS_CTLR);
|
||||
}
|
||||
@@ -4784,9 +4777,6 @@ static void its_restore_enable(void)
|
||||
void __iomem *base;
|
||||
int i;
|
||||
|
||||
if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE))
|
||||
continue;
|
||||
|
||||
base = its->base;
|
||||
|
||||
/*
|
||||
@@ -4794,7 +4784,10 @@ static void its_restore_enable(void)
|
||||
* don't restore it since writing to CBASER or BASER<n>
|
||||
* registers is undefined according to the GIC v3 ITS
|
||||
* Specification.
|
||||
*
|
||||
* Firmware resuming with the ITS enabled is terminally broken.
|
||||
*/
|
||||
WARN_ON(readl_relaxed(base + GITS_CTLR) & GITS_CTLR_ENABLE);
|
||||
ret = its_force_quiescent(base);
|
||||
if (ret) {
|
||||
pr_err("ITS@%pa: failed to quiesce on resume: %d\n",
|
||||
@@ -5074,9 +5067,6 @@ static int __init its_probe_one(struct resource *res,
|
||||
ctlr |= GITS_CTLR_ImDe;
|
||||
writel_relaxed(ctlr, its->base + GITS_CTLR);
|
||||
|
||||
if (GITS_TYPER_HCC(typer))
|
||||
its->flags |= ITS_FLAGS_SAVE_SUSPEND_STATE;
|
||||
|
||||
err = its_init_domain(handle, its);
|
||||
if (err)
|
||||
goto out_free_tables;
|
||||
|
||||
@@ -136,7 +136,7 @@ static int exiu_domain_translate(struct irq_domain *domain,
|
||||
if (fwspec->param_count != 2)
|
||||
return -EINVAL;
|
||||
*hwirq = fwspec->param[0];
|
||||
*type = fwspec->param[2] & IRQ_TYPE_SENSE_MASK;
|
||||
*type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <linux/efi.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/kmemleak.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/uuid.h>
|
||||
|
||||
@@ -103,6 +104,7 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry,
|
||||
var->var.VariableName[i] = '\0';
|
||||
|
||||
inode->i_private = var;
|
||||
kmemleak_ignore(var);
|
||||
|
||||
err = efivar_entry_add(var, &efivarfs_list);
|
||||
if (err)
|
||||
|
||||
@@ -21,7 +21,6 @@ LIST_HEAD(efivarfs_list);
|
||||
static void efivarfs_evict_inode(struct inode *inode)
|
||||
{
|
||||
clear_inode(inode);
|
||||
kfree(inode->i_private);
|
||||
}
|
||||
|
||||
static const struct super_operations efivarfs_ops = {
|
||||
|
||||
+27
-1
@@ -78,7 +78,7 @@ void __weak arch_cpu_idle_dead(void) { }
|
||||
void __weak arch_cpu_idle(void)
|
||||
{
|
||||
cpu_idle_force_poll = 1;
|
||||
local_irq_enable();
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,9 +94,35 @@ void __cpuidle default_idle_call(void)
|
||||
|
||||
trace_cpu_idle(1, smp_processor_id());
|
||||
stop_critical_timings();
|
||||
|
||||
/*
|
||||
* arch_cpu_idle() is supposed to enable IRQs, however
|
||||
* we can't do that because of RCU and tracing.
|
||||
*
|
||||
* Trace IRQs enable here, then switch off RCU, and have
|
||||
* arch_cpu_idle() use raw_local_irq_enable(). Note that
|
||||
* rcu_idle_enter() relies on lockdep IRQ state, so switch that
|
||||
* last -- this is very similar to the entry code.
|
||||
*/
|
||||
trace_hardirqs_on_prepare();
|
||||
lockdep_hardirqs_on_prepare(_THIS_IP_);
|
||||
rcu_idle_enter();
|
||||
lockdep_hardirqs_on(_THIS_IP_);
|
||||
|
||||
arch_cpu_idle();
|
||||
|
||||
/*
|
||||
* OK, so IRQs are enabled here, but RCU needs them disabled to
|
||||
* turn itself back on.. funny thing is that disabling IRQs
|
||||
* will cause tracing, which needs RCU. Jump through hoops to
|
||||
* make it 'work'.
|
||||
*/
|
||||
raw_local_irq_disable();
|
||||
lockdep_hardirqs_off(_THIS_IP_);
|
||||
rcu_idle_exit();
|
||||
lockdep_hardirqs_on(_THIS_IP_);
|
||||
raw_local_irq_enable();
|
||||
|
||||
start_critical_timings();
|
||||
trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user