OpenCloudOS-Kernel/arch/powerpc
Jordan Niethe 5c88a17e15 powerpc/sstep: Fix VSX instruction emulation
Commit af99da7433 ("powerpc/sstep: Support VSX vector paired storage
access instructions") added loading and storing 32 word long data into
adjacent VSRs. However the calculation used to determine if two VSRs
needed to be loaded/stored inadvertently prevented the load/storing
taking place for instructions with a data length less than 16 words.

This causes the emulation to not function correctly, which can be seen
by the alignment_handler selftest:

$ ./alignment_handler
[snip]
test: test_alignment_handler_vsx_207
tags: git_version:powerpc-5.12-1-0-g82d2c16b350f
VSX: 2.07B
        Doing lxsspx:   PASSED
        Doing lxsiwax:  FAILED: Wrong Data
        Doing lxsiwzx:  PASSED
        Doing stxsspx:  PASSED
        Doing stxsiwx:  PASSED
failure: test_alignment_handler_vsx_207
test: test_alignment_handler_vsx_300
tags: git_version:powerpc-5.12-1-0-g82d2c16b350f
VSX: 3.00B
        Doing lxsd:     PASSED
        Doing lxsibzx:  PASSED
        Doing lxsihzx:  PASSED
        Doing lxssp:    FAILED: Wrong Data
        Doing lxv:      PASSED
        Doing lxvb16x:  PASSED
        Doing lxvh8x:   PASSED
        Doing lxvx:     PASSED
        Doing lxvwsx:   FAILED: Wrong Data
        Doing lxvl:     PASSED
        Doing lxvll:    PASSED
        Doing stxsd:    PASSED
        Doing stxsibx:  PASSED
        Doing stxsihx:  PASSED
        Doing stxssp:   PASSED
        Doing stxv:     PASSED
        Doing stxvb16x: PASSED
        Doing stxvh8x:  PASSED
        Doing stxvx:    PASSED
        Doing stxvl:    PASSED
        Doing stxvll:   PASSED
failure: test_alignment_handler_vsx_300
[snip]

Fix this by making sure all VSX instruction emulation correctly
load/store from the VSRs.

Fixes: af99da7433 ("powerpc/sstep: Support VSX vector paired storage access instructions")
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210225031946.1458206-1-jniethe5@gmail.com
2021-03-02 22:41:51 +11:00
..
boot powerpc/boot: Fix build of dts/fsl 2020-12-21 22:06:09 +11:00
configs Modules updates for v5.12 2021-02-23 10:15:33 -08:00
crypto crypto: powerpc/sha256 - remove unneeded semicolon 2021-02-10 17:55:57 +11:00
include powerpc: Force inlining of mmu_has_feature to fix build failure 2021-03-02 22:41:50 +11:00
kernel powerpc/syscall: Force inlining of __prep_irq_for_enabled_exit() 2021-03-01 12:33:31 +11:00
kexec powerpc/kexec_file: fix FDT size estimation for kdump kernel 2021-02-11 23:35:07 +11:00
kvm x86: 2021-02-26 10:00:12 -08:00
lib powerpc/sstep: Fix VSX instruction emulation 2021-03-02 22:41:51 +11:00
math-emu treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mm powerpc updates for 5.12 2021-02-22 14:34:00 -08:00
net bpf: Rename BPF_XADD and prepare to encode other atomics in .imm 2021-01-14 18:34:29 -08:00
perf powerpc/perf: Fix handling of privilege level checks in perf interrupt context 2021-03-02 22:41:51 +11:00
platforms vio: make remove callback return void 2021-03-02 22:41:23 +11:00
purgatory powerpc/kexec_file: Enable early kernel OPAL calls 2020-07-29 23:47:55 +10:00
sysdev powerpc/xive: Improve error reporting of OPAL calls 2020-12-11 09:53:11 +11:00
tools powerpc/tools: Remove 90 line limit in checkpatch script 2020-09-08 22:57:11 +10:00
xmon powerpc/32s: mfsrin()/mtsrin() become mfsr()/mtsr() 2021-02-09 01:10:15 +11:00
Kbuild powerpc/kexec: Move kexec files into a dedicated subdir. 2019-11-21 15:41:34 +11:00
Kconfig Rework of the X86 irq stack handling: 2021-02-24 16:32:23 -08:00
Kconfig.debug powerpc/xmon: Select CONSOLE_POLL for the 8xx 2021-01-31 22:35:51 +11:00
Makefile Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
Makefile.postlink powerpc: unrel_branch_check.sh: use nm to find symbol value 2020-09-02 11:00:22 +10:00