TM (Hardware Transactional Memory) instructions halt application on baremetal POWER9 DD2.1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
The Ubuntu-power-systems project |
Fix Released
|
Medium
|
Canonical Kernel Team | ||
linux (Ubuntu) |
Fix Released
|
Medium
|
Canonical Kernel Team | ||
Bionic |
Fix Released
|
Medium
|
Canonical Kernel Team | ||
Cosmic |
Fix Released
|
Medium
|
Canonical Kernel Team |
Bug Description
== Comment: #0 - Michael Ranweiler <email address hidden> - 2018-10-15 08:55:55 ==
+++ This bug was initially created as a clone of Bug #167756 +++
---Problem Description---
TM (Hardware Transactional Memory) instructions halt application on baremetal POWER9 DD2.1
Contact Information = <email address hidden>
---Additional Hardware Info---
POWER9 DD2.1 (pvr 004e 1201) baremetal. Witherspoon.
Machine Type = POWER9 DD2.1 (pvr 004e 1201) baremetal
---Debugger---
A debugger is not configured
---Steps to Reproduce---
Currently TM (Hardware Transactional Memory) on baremetal POWER9 DD2.1 (pvr 004e 1201) with the latest firmware [1] (Firmware level [2] was also tested with the same result) and running Linux from Linus' upstream tree [3] or powerpc/next branch [4] is not working as expected. Once a TM instruction is executed in a process (any instruction), the process halts completely and has to be killed.
A simple test case is to execute a 'tend.' which accordingly to POWER8 behaviour and the ISA v3.00 if executed "in Non-transactional state is treated as a no-op." [5]. It means that the instruction in the test case below should be treated simply as a 'nop' instruction and the process would terminate normally but instead it halts and the process never terminates:
root@io83:
int main() { asm ("tend.;"); }
root@io83:
make: 't' is up to date.
root@io83:
^C
<CTRL-C was pressed to kill the process since PC got stuck at 'tend.' instruction forever>
Ubuntu stock kernel 4.15.0-20-generic was also tested with the same result.
I confirmed with Erich Hauptli (FW team) that FW stack levels [1] contain all the TM fixes we have at the moment.
Thus, that issue affects any application that uses TM on a baremetal POWER9 DD2.1 (pvr 004e 1201).
[1]
IBM-witherspoon
op-
buildroot-
skiboot-
hostboot-
linux-
petitboot-
machine-
occ-ef5d466
hostboot-
capp-
sbe-7e02c23
[2]
open-power-
buildroot-
skiboot-v6.0-rc1
hostboot-
occ-f741c41
linux-
petitboot-
machine-
hostboot-
capp-ucode-
sbe-8e0105e
hcode-
[3] https:/
[4] https:/
[5] Power ISA - Book II, p. 894
Stack trace output:
no
Oops output:
no
Userspace tool common name: any tool using TM instruction set
Userspace rpm: not relevant
The userspace tool has the following bit modes: 64-bit
System Dump Info:
The system is not configured to capture a system dump.
Userspace tool obtained from project website: na
*Additional Instructions for <email address hidden>:
-Attach sysctl -a output output to the bug.
-Attach ltrace and strace of userspace application.
The following patch fixes this issue:
http://
Author: Michael Neuling <email address hidden>
Date: Tue Sep 11 13:07:56 2018 +1000
powerpc/tm: Fix HFSCR bit for no suspend case
Currently on P9N DD2.1 we end up taking infinite TM facility
unavailable exceptions on the first TM usage by userspace.
In the special case of TM no suspend (P9N DD2.1), Linux is told TM is
off via CPU dt-ftrs but told to (partially) use it via
OPAL_
dt-ftrs but we need to turn it on for the no suspend case.
This patch fixes this by enabling HFSCR TM in this case.
Cc: <email address hidden> # 4.15+
Signed-off-by: Michael Neuling <email address hidden>
== Comment: #2 - Michael Ranweiler <email address hidden> - 2018-10-15 13:52:13 ==
This is in the powerpc -next branch:
https:/
tags: | added: architecture-ppc64le bugnameltc-172351 severity-high targetmilestone-inin--- |
Changed in ubuntu: | |
assignee: | nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) |
affects: | ubuntu → kernel-package (Ubuntu) |
affects: | kernel-package (Ubuntu) → linux (Ubuntu) |
Changed in ubuntu-power-systems: | |
importance: | Undecided → High |
assignee: | nobody → Canonical Kernel Team (canonical-kernel-team) |
Changed in linux (Ubuntu Bionic): | |
assignee: | nobody → Joseph Salisbury (jsalisbury) |
Changed in linux (Ubuntu Cosmic): | |
assignee: | Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) → Joseph Salisbury (jsalisbury) |
Changed in linux (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Cosmic): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in linux (Ubuntu Cosmic): | |
status: | New → In Progress |
Changed in ubuntu-power-systems: | |
status: | New → In Progress |
Changed in linux (Ubuntu): | |
status: | In Progress → Incomplete |
Changed in linux (Ubuntu Bionic): | |
status: | In Progress → Incomplete |
Changed in linux (Ubuntu Cosmic): | |
status: | In Progress → Incomplete |
Changed in linux (Ubuntu): | |
assignee: | Joseph Salisbury (jsalisbury) → Canonical Kernel Team (canonical-kernel-team) |
Changed in linux (Ubuntu Bionic): | |
assignee: | Joseph Salisbury (jsalisbury) → Canonical Kernel Team (canonical-kernel-team) |
Changed in linux (Ubuntu Cosmic): | |
assignee: | Joseph Salisbury (jsalisbury) → Canonical Kernel Team (canonical-kernel-team) |
Changed in ubuntu-power-systems: | |
status: | Incomplete → Fix Released |
Changed in linux (Ubuntu): | |
status: | Incomplete → Fix Released |
Changed in linux (Ubuntu Bionic): | |
status: | Incomplete → Fix Released |
Changed in linux (Ubuntu Cosmic): | |
status: | Incomplete → Fix Released |
tags: | added: cscc |
I built a test kernel with commit dd9a8c5a87395b6 f0555. The test kernel can be downloaded from: kernel. ubuntu. com/~jsalisbury /lp1799388
http://
Can you test this kernel and see if it resolves this bug?
Note about installing test kernels: unsigned .deb packages.
• If the test kernel is prior to 4.15(Bionic) you need to install the linux-image and linux-image-extra .deb packages.
• If the test kernel is 4.15(Bionic) or newer, you need to install the linux-modules, linux-modules-extra and linux-image-
Thanks in advance!