]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
parisc: Define mb() and add memory barriers to assembler unlock sequences
authorJohn David Anglin <dave.anglin@bell.net>
Sun, 5 Aug 2018 17:30:31 +0000 (13:30 -0400)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:41:57 +0000 (19:41 -0600)
commit584f33ed2bccef907e3790c57415a3bfcb6768a8
treec30bd2f6cead74a3ab0695f839a8702ef018e246
parent7b6c63cfa2dfac26c519b861e80dcfc31768aeef
parisc: Define mb() and add memory barriers to assembler unlock sequences

BugLink: https://bugs.launchpad.net/bugs/1835845
commit fedb8da96355f5f64353625bf96dc69423ad1826 upstream.

For years I thought all parisc machines executed loads and stores in
order. However, Jeff Law recently indicated on gcc-patches that this is
not correct. There are various degrees of out-of-order execution all the
way back to the PA7xxx processor series (hit-under-miss). The PA8xxx
series has full out-of-order execution for both integer operations, and
loads and stores.

This is described in the following article:
http://web.archive.org/web/20040214092531/http://www.cpus.hp.com/technical_references/advperf.shtml

For this reason, we need to define mb() and to insert a memory barrier
before the store unlocking spinlocks. This ensures that all memory
accesses are complete prior to unlocking. The ldcw instruction performs
the same function on entry.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/parisc/include/asm/barrier.h [new file with mode: 0644]
arch/parisc/kernel/entry.S
arch/parisc/kernel/pacache.S
arch/parisc/kernel/syscall.S