* [PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels
@ 2017-11-24 3:51 Michael Ellerman
2017-11-24 4:13 ` Balbir Singh
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Michael Ellerman @ 2017-11-24 3:51 UTC (permalink / raw)
To: linuxppc-dev; +Cc: david, bsingharora, yilzhang
The code that cleans up the IAMR/AMOR before kexec'ing failed to
remember that when we're running as a guest AMOR is not writable, it's
hypervisor privileged.
They symptom is that the kexec stops before entering purgatory and
nothing else is seen on the console. If you examine the state of the
system all threads will be in the 0x700 program check handler.
Fix it by making the write to AMOR dependent on HV mode.
Fixes: 1e2a516e89fc ("powerpc/kexec: Fix radix to hash kexec due to IAMR/AMOR")
Cc: stable@vger.kernel.org # v4.10+
Reported-by: Yilin Zhang <yilzhang@redhat.com>
Debugged-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/kernel/misc_64.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index 8ac0bd2bddb0..3280953a82cf 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -623,7 +623,9 @@ BEGIN_FTR_SECTION
* NOTE, we rely on r0 being 0 from above.
*/
mtspr SPRN_IAMR,r0
+BEGIN_FTR_SECTION_NESTED(42)
mtspr SPRN_AMOR,r0
+END_FTR_SECTION_NESTED_IFSET(CPU_FTR_HVMODE, 42)
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
/* save regs for local vars on new stack.
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels
2017-11-24 3:51 [PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels Michael Ellerman
@ 2017-11-24 4:13 ` Balbir Singh
2017-11-24 4:24 ` David Gibson
2017-11-24 9:46 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Balbir Singh @ 2017-11-24 4:13 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, David Gibson, yilzhang
On Fri, Nov 24, 2017 at 2:51 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> The code that cleans up the IAMR/AMOR before kexec'ing failed to
> remember that when we're running as a guest AMOR is not writable, it's
> hypervisor privileged.
>
> They symptom is that the kexec stops before entering purgatory and
> nothing else is seen on the console. If you examine the state of the
> system all threads will be in the 0x700 program check handler.
>
> Fix it by making the write to AMOR dependent on HV mode.
>
> Fixes: 1e2a516e89fc ("powerpc/kexec: Fix radix to hash kexec due to IAMR/AMOR")
> Cc: stable@vger.kernel.org # v4.10+
> Reported-by: Yilin Zhang <yilzhang@redhat.com>
> Debugged-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
Acked-by: Balbir Singh <bsingharora@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels
2017-11-24 3:51 [PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels Michael Ellerman
2017-11-24 4:13 ` Balbir Singh
@ 2017-11-24 4:24 ` David Gibson
2017-11-24 9:46 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2017-11-24 4:24 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, bsingharora, yilzhang
[-- Attachment #1: Type: text/plain, Size: 1729 bytes --]
On Fri, Nov 24, 2017 at 02:51:02PM +1100, Michael Ellerman wrote:
> The code that cleans up the IAMR/AMOR before kexec'ing failed to
> remember that when we're running as a guest AMOR is not writable, it's
> hypervisor privileged.
>
> They symptom is that the kexec stops before entering purgatory and
> nothing else is seen on the console. If you examine the state of the
> system all threads will be in the 0x700 program check handler.
>
> Fix it by making the write to AMOR dependent on HV mode.
>
> Fixes: 1e2a516e89fc ("powerpc/kexec: Fix radix to hash kexec due to IAMR/AMOR")
> Cc: stable@vger.kernel.org # v4.10+
> Reported-by: Yilin Zhang <yilzhang@redhat.com>
> Debugged-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Tested-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> arch/powerpc/kernel/misc_64.S | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
> index 8ac0bd2bddb0..3280953a82cf 100644
> --- a/arch/powerpc/kernel/misc_64.S
> +++ b/arch/powerpc/kernel/misc_64.S
> @@ -623,7 +623,9 @@ BEGIN_FTR_SECTION
> * NOTE, we rely on r0 being 0 from above.
> */
> mtspr SPRN_IAMR,r0
> +BEGIN_FTR_SECTION_NESTED(42)
> mtspr SPRN_AMOR,r0
> +END_FTR_SECTION_NESTED_IFSET(CPU_FTR_HVMODE, 42)
> END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
>
> /* save regs for local vars on new stack.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: powerpc/kexec: Fix kexec/kdump in P9 guest kernels
2017-11-24 3:51 [PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels Michael Ellerman
2017-11-24 4:13 ` Balbir Singh
2017-11-24 4:24 ` David Gibson
@ 2017-11-24 9:46 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2017-11-24 9:46 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: yilzhang, david
On Fri, 2017-11-24 at 03:51:02 UTC, Michael Ellerman wrote:
> The code that cleans up the IAMR/AMOR before kexec'ing failed to
> remember that when we're running as a guest AMOR is not writable, it's
> hypervisor privileged.
>
> They symptom is that the kexec stops before entering purgatory and
> nothing else is seen on the console. If you examine the state of the
> system all threads will be in the 0x700 program check handler.
>
> Fix it by making the write to AMOR dependent on HV mode.
>
> Fixes: 1e2a516e89fc ("powerpc/kexec: Fix radix to hash kexec due to IAMR/AMOR")
> Cc: stable@vger.kernel.org # v4.10+
> Reported-by: Yilin Zhang <yilzhang@redhat.com>
> Debugged-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Acked-by: Balbir Singh <bsingharora@gmail.com>
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> Tested-by: David Gibson <david@gibson.dropbear.id.au>
Applied to powerpc fixes.
https://git.kernel.org/powerpc/c/2621e945fbf1d6df5f3f0ba7be5bae
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-24 9:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-24 3:51 [PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels Michael Ellerman
2017-11-24 4:13 ` Balbir Singh
2017-11-24 4:24 ` David Gibson
2017-11-24 9:46 ` Michael Ellerman
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).