kernel-fxtec-pro1x/arch/powerpc/kernel
Michael Ellerman f81b1d34b5 powerpc/64s: Don't init FSCR_DSCR in __init_FSCR()
commit 0828137e8f16721842468e33df0460044a0c588b upstream.

__init_FSCR() was added originally in commit 2468dcf641 ("powerpc:
Add support for context switching the TAR register") (Feb 2013), and
only set FSCR_TAR.

At that point FSCR (Facility Status and Control Register) was not
context switched, so the setting was permanent after boot.

Later we added initialisation of FSCR_DSCR to __init_FSCR(), in commit
54c9b2253d ("powerpc: Set DSCR bit in FSCR setup") (Mar 2013), again
that was permanent after boot.

Then commit 2517617e0d ("powerpc: Fix context switch DSCR on
POWER8") (Aug 2013) added a limited context switch of FSCR, just the
FSCR_DSCR bit was context switched based on thread.dscr_inherit. That
commit said "This clears the H/FSCR DSCR bit initially", but it
didn't, it left the initialisation of FSCR_DSCR in __init_FSCR().
However the initial context switch from init_task to pid 1 would clear
FSCR_DSCR because thread.dscr_inherit was 0.

That commit also introduced the requirement that FSCR_DSCR be clear
for user processes, so that we can take the facility unavailable
interrupt in order to manage dscr_inherit.

Then in commit 152d523e63 ("powerpc: Create context switch helpers
save_sprs() and restore_sprs()") (Dec 2015) FSCR was added to
thread_struct. However it still wasn't fully context switched, we just
took the existing value and set FSCR_DSCR if the new thread had
dscr_inherit set. FSCR was still initialised at boot to FSCR_DSCR |
FSCR_TAR, but that value was not propagated into the thread_struct, so
the initial context switch set FSCR_DSCR back to 0.

Finally commit b57bd2de8c ("powerpc: Improve FSCR init and context
switching") (Jun 2016) added a full context switch of the FSCR, and
added an initialisation of init_task.thread.fscr to FSCR_TAR |
FSCR_EBB, but omitted FSCR_DSCR.

The end result is that swapper runs with FSCR_DSCR set because of the
initialisation in __init_FSCR(), but no other processes do, they use
the value from init_task.thread.fscr.

Having FSCR_DSCR set for swapper allows it to access SPR 3 from
userspace, but swapper never runs userspace, so it has no useful
effect. It's also confusing to have the value initialised in two
places to two different values.

So remove FSCR_DSCR from __init_FSCR(), this at least gets us to the
point where there's a single value of FSCR, even if it's still set in
two places.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Alistair Popple <alistair@popple.id.au>
Link: https://lore.kernel.org/r/20200527145843.2761782-1-mpe@ellerman.id.au
Cc: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-03 11:24:16 +02:00
..
trace powerpc: consolidate -mno-sched-epilog into FTRACE flags 2019-01-13 09:51:05 +01:00
vdso32 powerpc: Fix vDSO clock_getres() 2019-12-17 20:35:40 +01:00
vdso64 powerpc: Fix vDSO clock_getres() 2019-12-17 20:35:40 +01:00
.gitignore
align.c powerpc/sstep: Introduce GETTYPE macro 2018-06-03 21:19:40 +10:00
asm-offsets.c powerpc: Fix vDSO clock_getres() 2019-12-17 20:35:40 +01:00
audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
btext.c powerpc: Make function btext_initialize static 2018-05-25 12:04:44 +10:00
cacheinfo.c powerpc/cacheinfo: add cacheinfo_teardown, cacheinfo_rebuild 2020-01-27 14:50:55 +01:00
cacheinfo.h powerpc/cacheinfo: add cacheinfo_teardown, cacheinfo_rebuild 2020-01-27 14:50:55 +01:00
compat_audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpu_setup_6xx.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
cpu_setup_44x.S
cpu_setup_fsl_booke.S powerpc: Free up CPU feature bits on 64-bit machines 2018-03-24 00:38:51 +11:00
cpu_setup_pa6t.S
cpu_setup_power.S powerpc/64s: Don't init FSCR_DSCR in __init_FSCR() 2020-09-03 11:24:16 +02:00
cpu_setup_ppc970.S
cputable.c powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems 2020-03-11 14:15:12 +01:00
crash.c powerpc: remove kdump.h from page.h 2018-07-30 22:47:53 +10:00
crash_dump.c
dbell.c KVM: PPC: Book3S HV: use smp_mb() when setting/clearing host_ipi flag 2020-01-09 10:19:08 +01:00
dma-iommu.c powerpc: rename dma_direct_ to dma_nommu_ 2018-01-10 16:41:14 +01:00
dma-swiotlb.c swiotlb: rename swiotlb_free to swiotlb_exit 2018-01-15 09:35:39 +01:00
dma.c PCI: Call dma_debug_add_bus() for pci_bus_type from PCI core 2018-07-30 15:58:01 -05:00
dt_cpu_ftrs.c powerpc/64s: Don't let DT CPU features set FSCR_DSCR 2020-06-22 09:05:29 +02:00
eeh.c powerpc/eeh: Handle hugepages in ioremap space 2019-07-31 07:27:07 +02:00
eeh_cache.c powerpc/eeh: Fix misleading comment in __eeh_addr_cache_get_device() 2018-03-27 23:44:58 +11:00
eeh_dev.c powerpc/eeh: Create PHB PEs after EEH is initialized 2017-09-21 14:56:00 +10:00
eeh_driver.c powerpc/powernv/iov: Ensure the pdn for VFs always contains a valid PE number 2020-02-24 08:34:36 +01:00
eeh_event.c powerpc/eeh: Manage EEH_PE_RECOVERING inside eeh_handle_normal_event() 2018-03-27 23:44:58 +11:00
eeh_pe.c powerpc/eeh: Fix use of EEH_PE_KEEP on wrong field 2019-12-01 09:16:18 +01:00
eeh_sysfs.c powerpc/eeh: Add EEH notify resume sysfs 2018-01-27 20:02:52 +11:00
entry_32.S powerpc/32: Clear on-stack exception marker upon exception return 2019-03-23 20:10:07 +01:00
entry_64.S powerpc/book3s64: Fix link stack flush on context switch 2019-12-01 09:17:46 +01:00
epapr_hcalls.S
epapr_paravirt.c
exceptions-64e.S powerpc/fsl: Fix the flush of branch predictor. 2019-04-03 06:26:20 +02:00
exceptions-64s.S powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y 2019-12-05 09:20:48 +01:00
fadump.c powerpc/fadump: Do not allow hot-remove memory from fadump reserved area. 2019-02-12 19:47:16 +01:00
firmware.c
fpu.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
fsl_booke_entry_mapping.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
head_8xx.S powerpc/8xx: fix setting of pagetable for Abatron BDI debug tool. 2019-02-27 10:08:54 +01:00
head_32.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
head_40x.S powerpc/405: move PPC405_ERR77 in asm-405.h 2018-07-30 22:48:13 +10:00
head_44x.S
head_64.S powerpc/64: Don't initialise init_task->thread.regs 2020-06-25 15:32:56 +02:00
head_booke.h powerpc/fsl: Fixed warning: orphan section `__btb_flush_fixup' 2019-04-03 06:26:20 +02:00
head_fsl_booke.S powerpc/fsl: Flush the branch predictor at each kernel entry (32 bit) 2019-04-03 06:26:20 +02:00
hw_breakpoint.c perf/arch/powerpc: Implement hw_breakpoint_arch_parse() 2018-06-26 09:07:55 +02:00
idle.c
idle_6xx.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
idle_book3e.S powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely 2018-07-24 22:03:14 +10:00
idle_book3s.S powerpc/powernv/idle: Restore AMR/UAMOR/AMOR after idle 2020-04-17 10:48:53 +02:00
idle_e500.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
idle_power4.S powerpc/64s: Fix PACA_IRQ_HARD_DIS accounting in idle_power4() 2018-08-14 15:36:02 +10:00
ima_kexec.c
io-workarounds.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
io.c
iomap.c powerpc: iomap.c: introduce io{read|write}64_{lo_hi|hi_lo} 2018-04-05 14:59:26 +10:00
iommu.c powerpc/iommu: Avoid derefence before pointer check 2019-11-20 18:46:58 +01:00
irq.c powerpc/irq: fix stack overflow verification 2019-12-31 16:36:32 +01:00
isa-bridge.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
jump_label.c jump_label: move 'asm goto' support test to Kconfig 2019-06-04 08:02:34 +02:00
kexec_elf_64.c kernel/kexec_file.c: allow archs to set purgatory load address 2018-04-13 17:10:28 -07:00
kgdb.c powerpc/kgdb: add kgdb_arch_set/remove_breakpoint() 2020-01-27 14:50:00 +01:00
kprobes-ftrace.c bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe 2018-06-21 12:33:19 +02:00
kprobes.c powerpc/kprobes: Ignore traps that happened in real mode 2020-04-17 10:48:53 +02:00
kvm.c kmemleak: powerpc: skip scanning holes in the .bss section 2019-05-08 07:21:50 +02:00
kvm_emul.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
l2cr_6xx.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
legacy_serial.c powerpc: Look for "stdout-path" when setting up legacy consoles 2018-12-19 19:19:52 +01:00
machine_kexec.c powerpc/crashkernel: Take "mem=" option into account 2020-06-25 15:32:51 +02:00
machine_kexec_32.c
machine_kexec_64.c powerpc/64/kexec: fix race in kexec when XIVE is shutdown 2018-05-10 23:25:08 +10:00
machine_kexec_file_64.c powerpc/kexec: Use common error handling code in setup_new_fdt() 2018-08-10 22:12:36 +10:00
Makefile powerpc: Make setjmp/longjmp signature standard 2020-04-17 10:48:54 +02:00
mce.c powerpc/mce: Schedule work from irq_work 2019-10-11 18:20:49 +02:00
mce_power.c powerpc/mm/mce: Keep irqs disabled during lockless page table walk 2020-01-27 14:51:14 +01:00
misc.S powerpc/misc: merge reloc_offset() and add_reloc_offset() 2018-06-04 00:39:17 +10:00
misc_32.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
misc_64.S powerpc: Allow flush_icache_range to work across ranges >4GB 2019-12-17 20:35:16 +01:00
module.c powerpc64/module elfv1: Set opd addresses after module relocation 2018-11-13 11:08:50 -08:00
module.lds powerpc/modules: Fix alignment of .toc section in kernel modules 2017-12-11 13:03:35 +11:00
module_32.c powerpc/sparse: Fix plain integer as NULL pointer warning 2018-05-25 12:04:38 +10:00
module_64.c powerpc/64/module: REL32 relocation range check 2018-11-21 09:19:08 +01:00
msi.c powerpc/msi: Fix NULL pointer access in teardown code 2018-12-19 19:19:52 +01:00
nvram_64.c pstore: Convert buf_lock to semaphore 2019-06-11 12:20:52 +02:00
of_platform.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
optprobes.c powerpc/kprobes: Do not disable interrupts for optprobes and kprobes_on_ftrace 2017-11-12 23:51:41 +11:00
optprobes_head.S powerpc/64: Rename soft_enabled to irq_soft_mask 2018-01-19 22:37:01 +11:00
paca.c Merge branch 'topic/paca' into next 2018-03-31 09:09:36 +11:00
pci-common.c powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
pci-hotplug.c powerpc/pci: Unroll two pass loop when scanning bridges 2017-12-18 23:05:52 -06:00
pci_32.c powerpc: Remove -Wattribute-alias pragmas 2018-06-25 23:21:13 +09:00
pci_64.c powerpc: Remove -Wattribute-alias pragmas 2018-06-25 23:21:13 +09:00
pci_dn.c powerpc/sriov: Remove VF eeh_dev state when disabling SR-IOV 2020-02-24 08:34:50 +01:00
pci_of_scan.c powerpc/pci/of: Parse unassigned resources 2020-05-10 10:30:06 +02:00
pmc.c
ppc32.h
ppc_save_regs.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
proc_powerpc.c powerpc: Use octal numbers for file permissions 2018-01-22 05:48:33 +11:00
process.c powerpc/process: Fix flush_all_to_thread for SPE 2019-12-01 09:17:01 +01:00
prom.c powerpc/64s: Save FSCR to init_task.thread.fscr after feature init 2020-06-22 09:05:29 +02:00
prom_init.c powerpc/pseries: Enable support for ibm,drc-info property 2020-01-27 14:49:52 +01:00
prom_init_check.sh powerpc/mm/radix: Update command line parsing for disable_radix 2018-04-04 16:59:50 +10:00
prom_parse.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ptrace.c powerpc/ptrace: Simplify vr_get/set() to avoid GCC warning 2019-03-23 20:10:07 +01:00
ptrace32.c
reloc_32.S
reloc_64.S powerpc/asm: Convert .llong directives to .8byte 2017-08-31 14:26:47 +10:00
rtas-proc.c powerpc updates for 4.18 2018-06-07 10:23:33 -07:00
rtas-rtc.c powerpc: use time64_t in read_persistent_clock 2018-06-03 20:43:33 +10:00
rtas.c powerpc/pseries: Disable CPU hotplug across migrations 2019-11-20 18:46:59 +01:00
rtas_flash.c powerpc: Use octal numbers for file permissions 2018-01-22 05:48:33 +11:00
rtas_pci.c powerpc/kernel: Change retrieval of pci_dn 2017-08-31 14:26:40 +10:00
rtasd.c powerpc/pseries: Remove prrn_work workqueue 2019-04-20 09:16:01 +02:00
security.c powerpc/security: Fix wrong message when RFI Flush is disable 2020-01-04 19:12:56 +01:00
setup-common.c powerpc/fsl: Enable runtime patching if nospectre_v2 boot arg is used 2019-04-03 06:26:20 +02:00
setup.h powerpc/tau: Synchronize function prototypes and body 2018-05-25 12:04:43 +10:00
setup_32.c powerpc/32: Include setup.h header file to fix warnings 2018-08-10 22:12:38 +10:00
setup_64.c powerpc/setup_64: Set cache-line-size based on cache-block-size 2020-04-29 16:31:32 +02:00
signal.c powerpc/tm: Fix clearing MSR[TS] in current when reclaiming on signal delivery 2020-02-28 16:38:48 +01:00
signal.h powerpc/syscalls: signal_{32, 64} - switch to SYSCALL_DEFINE 2018-05-10 23:25:13 +10:00
signal_32.c powerpc/tm: Fix clearing MSR[TS] in current when reclaiming on signal delivery 2020-02-28 16:38:48 +01:00
signal_64.c powerpc/64/tm: Don't let userspace set regs->trap via sigreturn 2020-04-17 10:48:53 +02:00
smp-tbsync.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smp.c powerpc/smp: Fix NMI IPI xmon timeout 2019-05-16 19:41:26 +02:00
stacktrace.c powerpc/64s: Fix build failures with CONFIG_NMI_IPI=n 2018-06-19 23:03:50 +10:00
suspend.c
swsusp.c
swsusp_32.S powerpc/32s: fix suspend/resume when IBATs 4-7 are used 2019-07-26 09:14:29 +02:00
swsusp_64.c
swsusp_asm64.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
swsusp_booke.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sys_ppc32.c powerpc/syscalls: kill ppc32_select() 2018-05-10 23:25:15 +10:00
syscalls.c powerpc: Remove -Wattribute-alias pragmas 2018-06-25 23:21:13 +09:00
sysfs.c Merge branch 'topic/paca' into next 2018-03-31 09:09:36 +11:00
systbl.S powerpc/syscalls: Add COMPAT_SPU_NEW() macro 2018-05-10 23:25:14 +10:00
systbl_chk.c powerpc/syscalls: Add COMPAT_SPU_NEW() macro 2018-05-10 23:25:14 +10:00
systbl_chk.sh powerpc: Make it clearer that systbl check errors are errors 2018-05-10 23:25:16 +10:00
tau_6xx.c powerpc/tau: Make some function static 2018-05-25 12:04:44 +10:00
time.c Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled" 2020-04-29 16:31:14 +02:00
tm.S powerpc/tm: Avoid possible userspace r1 corruption on reclaim 2018-09-25 22:51:32 +10:00
traps.c powerpc: dump kernel log before carrying out fadump or kdump 2019-10-07 18:57:02 +02:00
udbg.c
udbg_16550.c
uprobes.c powerpc/uprobes: Implement arch_uretprobe_is_alive() 2017-08-24 16:19:21 +10:00
vdso.c powerpc/vdso: Fix vdso cpu truncation 2020-08-19 08:14:57 +02:00
vecemu.c powerpc: Add a missing include header 2018-05-25 12:04:46 +10:00
vector.S powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
vmlinux.lds.S powerpc: Include .BTF section 2020-03-25 08:06:05 +01:00
watchdog.c powerpc/watchdog: Use hrtimers for per-CPU heartbeat 2019-05-31 06:46:12 -07:00