target/s390x/tcg: Fix and improve the SACF instruction
commit21be74a9a59d1e4954ebb59dcbee0fda0b19de00
authorThomas Huth <thuth@redhat.com>
Thu, 1 Dec 2022 18:44:43 +0000 (1 19:44 +0100)
committerThomas Huth <thuth@redhat.com>
Sat, 3 Dec 2022 21:04:40 +0000 (3 22:04 +0100)
tree08c7b4fc054bcc9e9c79d92a4256bcfb6e2d7573
parent0f0a9e4e5c38c45ca7e6ac09cb36db21d42ec6dd
target/s390x/tcg: Fix and improve the SACF instruction

The SET ADDRESS SPACE CONTROL FAST instruction is not privileged, it can be
used from problem space, too. Just the switching to the home address space
is privileged and should still generate a privilege exception. This bug is
e.g. causing programs like Java that use the "getcpu" vdso kernel function
to crash (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990417#26 ).

While we're at it, also check if DAT is not enabled. In that case the
instruction is supposed to generate a special operation exception.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/655
Message-Id: <20221201184443.136355-1-thuth@redhat.com>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
target/s390x/tcg/cc_helper.c
target/s390x/tcg/insn-data.h.inc