linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Michael Neuling <mikey@neuling.org>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: [PATCH 4.9 02/61] powerpc/64s: Clear PCR on boot
Date: Tue,  5 Jun 2018 19:01:23 +0200	[thread overview]
Message-ID: <20180605170117.775646752@linuxfoundation.org> (raw)
In-Reply-To: <20180605170117.643936916@linuxfoundation.org>

4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Michael Neuling <mikey@neuling.org>

commit faf37c44a105f3608115785f17cbbf3500f8bc71 upstream.

Clear the PCR (Processor Compatibility Register) on boot to ensure we
are not running in a compatibility mode.

We've seen this cause problems when a crash (and kdump) occurs while
running compat mode guests. The kdump kernel then runs with the PCR
set and causes problems. The symptom in the kdump kernel (also seen in
petitboot after fast-reboot) is early userspace programs taking
sigills on newer instructions (seen in libc).

Signed-off-by: Michael Neuling <mikey@neuling.org>
Cc: stable@vger.kernel.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/cpu_setup_power.S |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/arch/powerpc/kernel/cpu_setup_power.S
+++ b/arch/powerpc/kernel/cpu_setup_power.S
@@ -28,6 +28,7 @@ _GLOBAL(__setup_cpu_power7)
 	beqlr
 	li	r0,0
 	mtspr	SPRN_LPID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr	r3,SPRN_LPCR
 	bl	__init_LPCR
 	bl	__init_tlb_power7
@@ -41,6 +42,7 @@ _GLOBAL(__restore_cpu_power7)
 	beqlr
 	li	r0,0
 	mtspr	SPRN_LPID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr	r3,SPRN_LPCR
 	bl	__init_LPCR
 	bl	__init_tlb_power7
@@ -57,6 +59,7 @@ _GLOBAL(__setup_cpu_power8)
 	beqlr
 	li	r0,0
 	mtspr	SPRN_LPID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr	r3,SPRN_LPCR
 	ori	r3, r3, LPCR_PECEDH
 	bl	__init_LPCR
@@ -78,6 +81,7 @@ _GLOBAL(__restore_cpu_power8)
 	beqlr
 	li	r0,0
 	mtspr	SPRN_LPID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr   r3,SPRN_LPCR
 	ori	r3, r3, LPCR_PECEDH
 	bl	__init_LPCR
@@ -98,6 +102,7 @@ _GLOBAL(__setup_cpu_power9)
 	li	r0,0
 	mtspr	SPRN_LPID,r0
 	mtspr	SPRN_PID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr	r3,SPRN_LPCR
 	LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE)
 	or	r3, r3, r4
@@ -121,6 +126,7 @@ _GLOBAL(__restore_cpu_power9)
 	li	r0,0
 	mtspr	SPRN_LPID,r0
 	mtspr	SPRN_PID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr   r3,SPRN_LPCR
 	LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE)
 	or	r3, r3, r4

  parent reply	other threads:[~2018-06-05 17:04 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-05 17:01 [PATCH 4.9 00/61] 4.9.107-stable review Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 01/61] arm64: lse: Add early clobbers to some input/output asm operands Greg Kroah-Hartman
2018-06-05 17:01 ` Greg Kroah-Hartman [this message]
2018-06-05 17:01 ` [PATCH 4.9 03/61] USB: serial: cp210x: use tcflag_t to fix incompatible pointer type Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 04/61] Revert "pinctrl: msm: Use dynamic GPIO numbering" Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 05/61] xfs: detect agfl count corruption and reset agfl Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 06/61] Revert "ima: limit file hash setting by user to fix and log modes" Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 07/61] Input: elan_i2c_smbus - fix corrupted stack Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 08/61] tracing: Fix crash when freeing instances with event triggers Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 09/61] selinux: KASAN: slab-out-of-bounds in xattr_getsecurity Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 10/61] cfg80211: further limit wiphy names to 64 bytes Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 11/61] dma-buf: remove redundant initialization of sg_table Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 12/61] rtlwifi: rtl8192cu: Remove variable self-assignment in rf.c Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 13/61] ASoC: Intel: sst: remove redundant variable dma_dev_name Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 14/61] platform/chrome: cros_ec_lpc: remove redundant pointer request Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 15/61] x86/amd: revert commit 944e0fc51a89c9827b9 Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 16/61] xen: set cpu capabilities from xen_start_kernel() Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 17/61] x86/amd: dont set X86_BUG_SYSRET_SS_ATTRS when running under Xen Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 18/61] tcp: avoid integer overflows in tcp_rcv_space_adjust() Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 19/61] scsi: ufs: fix failure to read the string descriptor Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 20/61] scsi: ufs: refactor device descriptor reading Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 21/61] scsi: ufs: Factor out ufshcd_read_desc_param Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 22/61] arm64: Add hypervisor safe helper for checking constant capabilities Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 23/61] arm64/cpufeature: dont use mutex in bringup path Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 24/61] powerpc/rfi-flush: Move out of HARDLOCKUP_DETECTOR #ifdef Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 25/61] powerpc/pseries: Support firmware disable of RFI flush Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 26/61] powerpc/powernv: " Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 27/61] powerpc/rfi-flush: Move the logic to avoid a redo into the debugfs code Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 28/61] powerpc/rfi-flush: Make it possible to call setup_rfi_flush() again Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 29/61] powerpc/rfi-flush: Always enable fallback flush on pseries Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 30/61] powerpc/rfi-flush: Differentiate enabled and patched flush types Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 31/61] powerpc/rfi-flush: Call setup_rfi_flush() after LPM migration Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 32/61] powerpc/pseries: Add new H_GET_CPU_CHARACTERISTICS flags Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 33/61] powerpc: Add security feature flags for Spectre/Meltdown Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 34/61] powerpc/pseries: Set or clear security feature flags Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 35/61] powerpc/powernv: " Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 36/61] powerpc/64s: Move cpu_show_meltdown() Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 37/61] powerpc/64s: Enhance the information in cpu_show_meltdown() Greg Kroah-Hartman
2018-06-05 17:01 ` [PATCH 4.9 38/61] powerpc/powernv: Use the security flags in pnv_setup_rfi_flush() Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 39/61] powerpc/pseries: Use the security flags in pseries_setup_rfi_flush() Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 40/61] powerpc/64s: Wire up cpu_show_spectre_v1() Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 41/61] powerpc/64s: Wire up cpu_show_spectre_v2() Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 42/61] powerpc/pseries: Fix clearing of security feature flags Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 43/61] powerpc: Move default " Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 44/61] powerpc/pseries: Restore default security feature flags on setup Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 45/61] powerpc/64s: Fix section mismatch warnings from setup_rfi_flush() Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 47/61] net/mlx4_en: fix potential use-after-free with dma_unmap_page Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 48/61] iio:kfifo_buf: check for uint overflow Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 49/61] MIPS: ptrace: Fix PTRACE_PEEKUSR requests for 64-bit FGRs Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 50/61] MIPS: prctl: Disallow FRE without FR with PR_SET_FP_MODE requests Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 51/61] scsi: scsi_transport_srp: Fix shost to rport translation Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 52/61] stm class: Use vmalloc for the master map Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 53/61] hwtracing: stm: fix build error on some arches Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 54/61] IB/core: Fix error code for invalid GID entry Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 58/61] fix io_destroy()/aio_complete() race Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 59/61] mm: fix the NULL mapping case in __isolate_lru_page() Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 60/61] sparc64: Dont clibber fixed registers in __multi4 Greg Kroah-Hartman
2018-06-05 17:02 ` [PATCH 4.9 61/61] serial: pl011: add console matching function Greg Kroah-Hartman
2018-06-05 22:01 ` [PATCH 4.9 00/61] 4.9.107-stable review Shuah Khan
2018-06-06  8:06   ` Greg Kroah-Hartman
2018-06-06 11:24 ` Naresh Kamboju
2018-06-06 13:29 ` Guenter Roeck
2018-06-06 13:32   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180605170117.775646752@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).