linux/Documentation
Cyril Bur 78a3e8889b powerpc: signals: Discard transaction state from signal frames
Userspace can begin and suspend a transaction within the signal
handler which means they might enter sys_rt_sigreturn() with the
processor in suspended state.

sys_rt_sigreturn() wants to restore process context (which may have
been in a transaction before signal delivery). To do this it must
restore TM SPRS. To achieve this, any transaction initiated within the
signal frame must be discarded in order to be able to restore TM SPRs
as TM SPRs can only be manipulated non-transactionally..
>From the PowerPC ISA:
  TM Bad Thing Exception [Category: Transactional Memory]
   An attempt is made to execute a mtspr targeting a TM register in
   other than Non-transactional state.

Not doing so results in a TM Bad Thing:
[12045.221359] Kernel BUG at c000000000050a40 [verbose debug info unavailable]
[12045.221470] Unexpected TM Bad Thing exception at c000000000050a40 (msr 0x201033)
[12045.221540] Oops: Unrecoverable exception, sig: 6 [#1]
[12045.221586] SMP NR_CPUS=2048 NUMA PowerNV
[12045.221634] Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE
 nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4
 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp bridge stp llc ebtable_filter
 ebtables ip6table_filter ip6_tables iptable_filter ip_tables x_tables kvm_hv kvm
 uio_pdrv_genirq ipmi_powernv uio powernv_rng ipmi_msghandler autofs4 ses enclosure
 scsi_transport_sas bnx2x ipr mdio libcrc32c
[12045.222167] CPU: 68 PID: 6178 Comm: sigreturnpanic Not tainted 4.7.0 #34
[12045.222224] task: c0000000fce38600 ti: c0000000fceb4000 task.ti: c0000000fceb4000
[12045.222293] NIP: c000000000050a40 LR: c0000000000163bc CTR: 0000000000000000
[12045.222361] REGS: c0000000fceb7ac0 TRAP: 0700   Not tainted (4.7.0)
[12045.222418] MSR: 9000000300201033 <SF,HV,ME,IR,DR,RI,LE,TM[SE]> CR: 28444280  XER: 20000000
[12045.222625] CFAR: c0000000000163b8 SOFTE: 0 PACATMSCRATCH: 900000014280f033
GPR00: 01100000b8000001 c0000000fceb7d40 c00000000139c100 c0000000fce390d0
GPR04: 900000034280f033 0000000000000000 0000000000000000 0000000000000000
GPR08: 0000000000000000 b000000000001033 0000000000000001 0000000000000000
GPR12: 0000000000000000 c000000002926400 0000000000000000 0000000000000000
GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR24: 0000000000000000 00003ffff98cadd0 00003ffff98cb470 0000000000000000
GPR28: 900000034280f033 c0000000fceb7ea0 0000000000000001 c0000000fce390d0
[12045.223535] NIP [c000000000050a40] tm_restore_sprs+0xc/0x1c
[12045.223584] LR [c0000000000163bc] tm_recheckpoint+0x5c/0xa0
[12045.223630] Call Trace:
[12045.223655] [c0000000fceb7d80] [c000000000026e74] sys_rt_sigreturn+0x494/0x6c0
[12045.223738] [c0000000fceb7e30] [c0000000000092e0] system_call+0x38/0x108
[12045.223806] Instruction dump:
[12045.223841] 7c800164 4e800020 7c0022a6 f80304a8 7c0222a6 f80304b0 7c0122a6 f80304b8
[12045.223955] 4e800020 e80304a8 7c0023a6 e80304b0 <7c0223a6> e80304b8 7c0123a6 4e800020
[12045.224074] ---[ end trace cb8002ee240bae76 ]---

It isn't clear exactly if there is really a use case for userspace
returning with a suspended transaction, however, doing so doesn't (on
its own) constitute a bad frame. As such, this patch simply discards
the transactional state of the context calling the sigreturn and
continues.

Reported-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Tested-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Reviewed-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Simon Guo <wei.guo.simon@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2016-08-29 12:48:40 +10:00
..
ABI pwm: Changes for v4.8-rc1 2016-08-06 00:01:33 -04:00
accounting taskstats: fix nl parsing in accounting/getdelays.c 2016-04-27 12:50:14 -04:00
acpi Merge branches 'acpi-bus', 'acpi-pci', 'acpica' and 'acpi-doc' 2016-07-25 13:41:25 +02:00
aoe
arm ARM: at91: Documentation: update the sama5d2 entry 2016-06-21 17:09:34 +02:00
arm64 ARM64: ACPI: Update documentation for latest specification version 2016-06-21 16:26:09 +01:00
auxdisplay
backlight
blackfin
block doc: update block/queue-sysfs.txt entries 2016-08-11 09:37:23 -06:00
blockdev zram: cosmetic: cleanup documentation 2016-07-26 16:19:19 -07:00
bus-devices
cdrom
cgroup-v1 Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
cma
connector samples: connector: from Documentation to samples directory 2016-04-28 07:47:35 -06:00
console
cpu-freq Revert "cpufreq: pcc-cpufreq: update default value of cpuinfo_transition_latency" 2016-07-22 23:51:06 +02:00
cpuidle
cris
crypto crypto: doc - Fix typo 2016-05-31 16:41:55 +08:00
development-process docs: deprecate kernel-doc-nano-HOWTO.txt 2016-07-20 16:45:37 -06:00
device-mapper block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
devicetree pwm: Changes for v4.8-rc1 2016-08-06 00:01:33 -04:00
dmaengine Documentation: dmaengine: fix typo for device_resume 2016-06-03 14:00:21 -06:00
DocBook Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
driver-model ARM: SoC driver updates for v4.8 2016-08-01 18:36:01 -04:00
early-userspace
EDID
extcon
fault-injection net: Add support for CHANGEUPPER notifier error injection 2015-12-03 11:49:23 -05:00
fb Documentation: fb: fix spelling mistakes 2016-05-10 12:05:27 +03:00
features powerpc: Add HAVE_PERF_USER_STACK_DUMP support 2016-05-11 21:54:05 +10:00
filesystems Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
firmware_class Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
fmc
fpga
frv
gpio gpio: Fix paths to GPIO driver source files 2016-06-13 09:30:31 +02:00
gpu drm: add generic zpos property 2016-07-29 09:59:30 +02:00
hid HID: add Alps I2C HID Touchpad-Stick support 2016-06-17 23:12:04 +02:00
hwmon hwmon: (ftsteutates) Correct ftp urls in driver documentation 2016-08-12 05:56:34 -07:00
i2c Documentation: i2c: slave: give proper example for pm usage 2016-07-23 22:04:20 +02:00
ia64
ide
iio iio: Documentation: Add IIO configfs documentation 2015-12-03 18:19:28 +00:00
infiniband Round two of 4.7 merge window patches 2016-05-28 11:04:16 -07:00
input Input: clarify we want BTN_TOOL_<name> on proximity 2016-04-06 10:23:09 -07:00
ioctl nilfs2: move ioctl interface and disk layout to uapi separately 2016-08-02 19:35:21 -04:00
isdn isdn: i4l: move active-isdn drivers to staging 2016-03-05 15:00:38 -08:00
ja_JP Documentatio: HOWTO: remove regression postings info from translations 2016-04-16 10:49:08 -06:00
kbuild kbuild, x86: Track generated headers with generated-y 2016-07-07 15:58:44 +02:00
kdump kdump: fix dmesg gdbmacro to work with record based printk 2016-06-03 15:06:22 -07:00
ko_KR Documentation: HOWTO: update git home URL in translations 2016-04-16 10:49:18 -06:00
laptops leds: documentation: 'ide-disk' to 'disk-activity' 2016-06-27 08:58:35 +02:00
leds leds: documentation: 'ide-disk' to 'disk-activity' 2016-06-27 08:58:35 +02:00
livepatch Merge branches 'for-4.7/core', 'for-4.7/livepatching-doc' and 'for-4.7/livepatching-ppc64' into for-linus 2016-05-17 12:06:35 +02:00
locking locking/Documentation/lockdep: Fix spelling mistakes 2016-04-28 10:40:57 +02:00
m68k
media [media] cx23885-cardlist.rst: add a new card 2016-07-23 08:14:48 -03:00
memory-devices
metag
mic mpssd: fix buffer overflow warning 2016-06-03 13:31:37 -06:00
mips
misc-devices Merge char-misc-next into staging-next 2016-02-22 14:46:24 -08:00
mmc mmc: core: Extend sysfs with DSR register 2016-07-25 10:34:51 +02:00
mn10300
mtd Documentation: mtd: improve nand_ecc.txt for readability and correctness 2015-11-17 17:05:14 -08:00
namespaces
netlabel
networking rxrpc: Fix races between skb free, ACK generation and replying 2016-08-06 00:08:40 -04:00
nfc
nios2
nvdimm libnvdimm, btt: update the usage section in Documentation 2016-06-17 16:23:23 -07:00
nvmem
parisc
PCI PCI: Spread interrupt vectors in pci_alloc_irq_vectors() 2016-07-21 15:57:03 -05:00
pcmcia
phy
platform
power PM / sleep: Update some system sleep documentation 2016-08-13 02:54:04 +02:00
powerpc powerpc: signals: Discard transaction state from signal frames 2016-08-29 12:48:40 +10:00
pps Documentation: pps: fix spelling mistake 2016-04-28 07:23:59 -06:00
prctl Documentation: Fix int/unsigned int comparison 2016-02-17 14:09:43 -07:00
pti
ptp Another relatively boring cycle for the docs tree: typo fixes, translation 2016-03-17 12:09:35 -07:00
rapidio rapidio/tsi721: add messaging mbox selector parameter 2016-08-02 19:35:34 -04:00
RCU Documentation: Fix spelling mistake 2016-06-14 16:01:00 -07:00
s390 s390/Documentation: improve sort command for trace buffer 2016-06-13 15:58:23 +02:00
scheduler Documenation: update cgroup's document path 2016-08-03 15:43:58 -06:00
scsi Merge remote-tracking branch 'mkp-scsi/4.7/scsi-fixes' into fixes 2016-06-18 11:59:01 -07:00
security Some big changes this month, headlined by the addition of a new formatted 2016-07-26 13:05:11 -07:00
serial TTY and Serial driver update for 4.7-rc1 2016-05-20 20:57:27 -07:00
sh
sound ASoC: Updates for v4.8 2016-07-26 10:35:31 +02:00
sphinx Merge branch 'docs-next' of git://git.lwn.net/linux into topic/docs-next 2016-07-23 07:55:59 -03:00
sphinx-static doc-rst: customize RTD theme, drop padding of inline literal 2016-08-14 12:15:09 -06:00
spi spi: tools: move spidev_test metadata 2015-11-30 12:14:12 +00:00
sysctl printk: add kernel parameter to control writes to /dev/kmsg 2016-08-02 19:35:06 -04:00
target target: make close_session optional 2016-05-10 01:19:26 -07:00
thermal Doc: PM: Fix a typo in intel_powerclamp.txt 2016-06-30 13:05:40 -06:00
timers Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
tpm tpm: Add documentation for the tpm_vtpm_proxy device driver 2016-06-25 17:26:35 +03:00
trace tracing: expose current->comm to [ku]probe events 2016-06-20 09:54:19 -04:00
usb Documentation: tiny typo fix in usb/gadget_multi.txt 2016-06-23 08:09:10 -06:00
vDSO
virtual KVM: documentation: fix KVM_CAP_X2APIC_API information 2016-08-04 14:01:21 +02:00
vm Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
w1 w1: add ability to set (SRAM) and store (EEPROM) configuration for temp sensors like DS18B20 2016-05-01 14:37:49 -07:00
watchdog Documentation/watchdog: check return value for magic close 2016-07-25 11:02:17 +02:00
wimax
x86 Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
xtensa
zh_CN docs: deprecate kernel-doc-nano-HOWTO.txt 2016-07-20 16:45:37 -06:00
.gitignore Add .pyc files to .gitignore 2016-06-30 13:07:33 -06:00
00-INDEX docs: deprecate kernel-doc-nano-HOWTO.txt 2016-07-20 16:45:37 -06:00
adding-syscalls.txt documentation: trivial typo: adding-syscalls.txt: s/statat/fstatat/ 2016-04-18 11:31:49 -06:00
applying-patches.txt
assoc_array.txt
atomic_ops.txt
bad_memory.txt
basic_profiling.txt
bcache.txt bcache: documentation formatting, edited for clarity, stripe alignment notes 2016-06-23 07:58:38 -06:00
binfmt_misc.txt binfmt_misc: add F option description to documentation 2016-03-30 14:12:22 -07:00
braille-console.txt
bt8xxgpio.txt
btmrvl.txt
BUG-HUNTING
bus-virt-phys-mapping.txt
cachetlb.txt
cec.txt [media] cec.txt: add CEC framework documentation 2016-06-22 08:36:50 -03:00
cgroup-v2.txt Merge branch 'for-4.6-ns' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2016-03-21 10:05:13 -07:00
Changes
circular-buffers.txt
clk.txt
coccinelle.txt coccicheck: refer to Documentation/coccinelle.txt and wiki 2016-07-22 12:13:39 +02:00
CodeOfConflict
CodingStyle docs: deprecate kernel-doc-nano-HOWTO.txt 2016-07-20 16:45:37 -06:00
conf.py docs: Set the Sphinx default highlight language to "guess" 2016-08-12 14:11:12 -06:00
cpu-hotplug.txt Documentation: cpu-hotplug: Fix sysfs mount instructions 2015-12-10 11:35:30 -07:00
cpu-load.txt
cputopology.txt topology/sysfs: provide drawer id and siblings attributes 2016-06-13 15:58:27 +02:00
crc32.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
devices.txt Documentation: update the devices.txt documentation 2016-03-29 10:11:44 -07:00
digsig.txt
DMA-API-HOWTO.txt dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
DMA-API.txt dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
DMA-attributes.txt dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
dma-buf-sharing.txt dma-buf: Update docs for SYNC ioctl 2016-03-21 09:26:45 +01:00
DMA-ISA-LPC.txt
dontdiff GCC plugin infrastructure 2016-06-07 22:57:10 +02:00
dynamic-debug-howto.txt
edac.txt EDAC: Remove references to bluesmoke.sourceforge.net 2015-11-26 14:46:06 +01:00
efi-stub.txt doc: efi-stub.txt: Fix arm64 paths 2015-12-14 15:24:03 +00:00
eisa.txt
email-clients.txt A few more documentation patches that wandered in and have no reason to 2015-11-13 09:19:05 -08:00
flexible-arrays.txt
futex-requeue-pi.txt
gcc-plugins.txt GCC plugin infrastructure 2016-06-07 22:57:10 +02:00
gcov.txt
gdb-kernel-debugging.txt Revert "scripts/gdb: add documentation example for radix tree" 2016-07-15 14:54:27 +09:00
highuid.txt
HOWTO Documentation: Howto: Fixed subtitles style 2016-03-09 15:30:03 -07:00
hsi.txt
hw_random.txt
hwspinlock.txt
index.rst Merge tag 'drm-for-v4.8' of git://people.freedesktop.org/~airlied/linux 2016-08-01 21:44:08 -04:00
init.txt
initrd.txt
Intel-IOMMU.txt iommu/vt-d: Fix link to Intel IOMMU Specification 2016-01-29 12:32:12 +01:00
intel_txt.txt
io-mapping.txt
io_ordering.txt
iostats.txt
IPMI.txt ipmi watchdog : add panic_wdt_timeout parameter 2015-11-16 06:28:43 -06:00
IRQ-affinity.txt
IRQ-domain.txt Documentation/IRQ-domain.txt: Document irq_domain_create_{linear, tree} 2016-03-31 00:32:59 -06:00
IRQ.txt
irqflags-tracing.txt
isa.txt Documentation: Add ISA bus driver documentation 2016-05-02 09:32:04 -07:00
isapnp.txt
java.txt
kasan.txt mm, kasan: SLAB support 2016-03-25 16:37:42 -07:00
kcov.txt kernel: add kcov code coverage 2016-03-22 15:36:02 -07:00
kernel-doc-nano-HOWTO.txt docs: deprecate kernel-doc-nano-HOWTO.txt 2016-07-20 16:45:37 -06:00
kernel-docs.txt Documentation: update Michael K. Johnson's work 2016-04-15 15:37:25 -06:00
kernel-documentation.rst docs: kernel-documentation: remove some highlight directives 2016-08-12 15:12:36 -06:00
kernel-parameters.txt Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
kernel-per-CPU-kthreads.txt Documenation: update cgroup's document path 2016-08-03 15:43:58 -06:00
kmemcheck.txt
kmemleak.txt
kobject.txt
kprobes.txt
kref.txt
kselftest.txt Documentation: kselftest: Remove duplicate word 2016-03-09 15:33:38 -07:00
ldm.txt
local_ops.txt
lockup-watchdogs.txt
logo.gif
logo.txt
lzo.txt Documentation: lzo: fix spelling mistakes 2016-04-28 07:23:11 -06:00
magic-number.txt
mailbox.txt
Makefile [media] samples: v4l: from Documentation to samples directory 2016-05-09 18:34:37 -03:00
Makefile.sphinx Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
ManagementStyle
md-cluster.txt md-cluster: change array_sectors and update size are not supported 2016-05-04 12:39:35 -07:00
md.txt Documentation: fix wrong value in md.txt 2016-06-23 08:08:36 -06:00
memory-barriers.txt locking/Documentation: Clarify limited control-dependency scope 2016-06-17 09:54:45 +02:00
memory-hotplug.txt memory_hotplug: introduce CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE 2016-05-19 19:12:14 -07:00
men-chameleon-bus.txt
module-signing.txt Documentation/module-signing.txt: Note need for version info if reusing a key 2016-07-27 12:38:00 +09:30
mono.txt
nommu-mmap.txt
ntb.txt
numastat.txt
oops-tracing.txt
padata.txt
parport-lowlevel.txt
parport.txt
percpu-rw-semaphore.txt
phy.txt phy: core: Allow children node to be overridden 2016-04-29 16:39:39 +02:00
pi-futex.txt
pinctrl.txt pinctrl: Flag strict is a field in struct pinmux_ops 2016-06-23 10:50:10 +02:00
pnp.txt
preempt-locking.txt
printk-formats.txt mm, printk: introduce new format string for flags 2016-03-15 16:55:16 -07:00
pwm.txt pwm: Update documentation 2016-05-17 14:48:04 +02:00
ramoops.txt ramoops: use DT reserved-memory bindings 2016-08-05 11:21:36 -07:00
rbtree.txt
remoteproc.txt
rfkill.txt rfkill: Add documentation about LED triggers 2016-02-24 09:13:12 +01:00
robust-futex-ABI.txt
robust-futexes.txt Documentation: robust-futexes: fix spelling mistakes 2016-04-28 07:26:41 -06:00
rpmsg.txt rpmsg: use module_rpmsg_driver in existing drivers and examples 2016-05-06 11:09:01 -07:00
rtc.txt rtc: implement a sysfs interface for clock offset 2016-03-14 17:08:16 +01:00
SAK.txt
SecurityBugs
serial-console.txt
sgi-ioc4.txt
SM501.txt
smsc_ece1099.txt
sparse.txt
stable_api_nonsense.txt
stable_kernel_rules.txt stable_kernel_rules.txt: Remove extra space after Cc: 2015-11-20 16:54:57 -07:00
static-keys.txt
SubmitChecklist
SubmittingDrivers
SubmittingPatches SubmittingPatches: fix spelling of "git send-email" 2016-01-25 12:30:18 -07:00
svga.txt
sync_file.txt Documentation: Fix some grammar mistakes in sync_file.txt 2016-06-03 13:24:16 -06:00
sysfs-rules.txt
sysrq.txt Doc: correct the location of sysrq.c 2016-04-28 08:02:36 -06:00
this_cpu_ops.txt
ubsan.txt UBSAN: run-time undefined behavior sanity checker 2016-01-20 17:09:18 -08:00
unaligned-memory-access.txt
unicode.txt
unshare.txt
vfio.txt
VGA-softcursor.txt
vgaarbiter.txt
video-output.txt
vme_api.txt
volatile-considered-harmful.txt
workqueue.txt workqueue: Fix a typo in workqueue.txt 2016-07-06 02:37:38 -06:00
xillybus.txt Documentation: xillybus: fix spelling mistake 2016-04-28 07:44:54 -06:00
xz.txt
zorro.txt