linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org, mikey@neuling.org,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: [PATCH] powerpc: Fix emulate_step() on POWER6
Date: Fri, 11 May 2018 11:35:39 +1000	[thread overview]
Message-ID: <20180511013539.12239-1-mikey@neuling.org> (raw)

emulate_step() will fail on POWER6 currently with:

  emulate_step_test: lfdx           : PASS
  emulate_step_test: stfdx          : PASS
  emulate_step_test: lvx            : PASS
  emulate_step_test: stvx           : PASS
  Oops: Exception in kernel mode, sig: 4 [#1]
  BE SMP NR_CPUS=2048 NUMA pSeries
  Modules linked in:
  CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.17.0-rc4-gcc5x-g036db8b #1
  NIP:  c000000000095c24 LR: c000000000094bdc CTR: c00000000008f4a0
  REGS: c0000000494c34f0 TRAP: 0700   Not tainted  (4.17.0-rc4-gcc5x-g036db8b)
  MSR:  8000000000089032 <SF,EE,ME,IR,DR,RI>  CR: 48004224  XER: 20000009
  CFAR: c000000000094bd0 SOFTE: 0
  GPR00: c000000000094bdc c0000000494c3770 c000000001238400 0000000000000027
  GPR04: c0000000494c3870 0000000000000008 8000000000009032 8000000000809032
  GPR08: 0000000000000070 800000000280b032 c0000000494c0000 0000000000000000
  GPR12: 0000000044000428 c000000007fff300 c00000000000e1c0 0000000000000000
  GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  GPR20: 0000000000000000 bfffffffffffffff c0000000494c3870 0000000000000027
  GPR24: c0000000494c3860 0000000000000000 c000000000da0538 c0000000494c3b90
  GPR28: 0000000000000000 c0000000494c3970 c0000000494c3a20 0000000000000008
  NIP [c000000000095c24] .load_vsrn+0x28/0x54
  LR [c000000000094bdc] .emulate_loadstore+0x167c/0x17b0
  Call Trace:
  [c0000000494c3770] [40fe240c7ae147ae] 0x40fe240c7ae147ae (unreliable)
  [c0000000494c37f0] [c000000000094bdc] .emulate_loadstore+0x167c/0x17b0
  [c0000000494c3900] [c000000000094f6c] .emulate_step+0x25c/0x5bc
  [c0000000494c39b0] [c000000000ec90dc] .test_lxvd2x_stxvd2x+0x64/0x154
  [c0000000494c3b90] [c000000000ec9204] .test_emulate_step+0x38/0x4c
  [c0000000494c3c00] [c00000000000de2c] .do_one_initcall+0x5c/0x2c0
  [c0000000494c3cd0] [c000000000eb4bf8] .kernel_init_freeable+0x314/0x4cc
  [c0000000494c3db0] [c00000000000e1e4] .kernel_init+0x24/0x160
  [c0000000494c3e30] [c00000000000bc24] .ret_from_kernel_thread+0x58/0xb4

The below fixes this by gating the VSX tests on CPU_FTR_VSX.

Tested on POWER9 with VSX disabled and skips the test correctly. Not
tested on POWER6 but the fix is pretty simple.

Fixes: https://github.com/linuxppc/linux/issues/148

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/lib/test_emulate_step.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/lib/test_emulate_step.c b/arch/powerpc/lib/test_emulate_step.c
index 2534c14475..f2f2d6e728 100644
--- a/arch/powerpc/lib/test_emulate_step.c
+++ b/arch/powerpc/lib/test_emulate_step.c
@@ -371,6 +371,12 @@ static void __init test_lxvd2x_stxvd2x(void)
 	u32 cached_b[4];
 	int stepped = -1;
 
+	if (!cpu_has_feature(CPU_FTR_VSX)) {
+		show_result("lxvd2x", "SKIP (no VSX on this CPU)");
+		show_result("stxvd2x", "SKIP (no VSX on this CPU)");
+		return;
+	}
+
 	init_pt_regs(&regs);
 
 
-- 
2.14.1

             reply	other threads:[~2018-05-11  1:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11  1:35 Michael Neuling [this message]
2018-05-11  3:38 ` [PATCH] powerpc: Fix emulate_step() on POWER6 Ravi Bangoria

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=20180511013539.12239-1-mikey@neuling.org \
    --to=mikey@neuling.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    /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).