target/s390x: Use s390_skeys_get|set() helper

Commit c9274b6bf0 ("target/s390x: start moving TCG-only code
to tcg/") moved mem_helper.c, but the trace-events file is
still in the parent directory, so is the generated trace.h.

Call the s390_skeys_get|set() helper, removing the need
for the trace event shared with the tcg/ sub-directory,
fixing the following build failure:

 In file included from ../target/s390x/tcg/mem_helper.c:33:
 ../target/s390x/tcg/trace.h:1:10: fatal error: 'trace/trace-target_s390x_tcg.h' file not found
 #include "trace/trace-target_s390x_tcg.h"

Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20240613104415.9643-3-philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2024-06-13 12:30:00 +02:00
parent b926895357
commit 4860af2c4f
3 changed files with 6 additions and 25 deletions

View file

@ -25,7 +25,6 @@
#include "sysemu/tcg.h" #include "sysemu/tcg.h"
#include "exec/exec-all.h" #include "exec/exec-all.h"
#include "exec/page-protection.h" #include "exec/page-protection.h"
#include "trace.h"
#include "hw/hw.h" #include "hw/hw.h"
#include "hw/s390x/storage-keys.h" #include "hw/s390x/storage-keys.h"
#include "hw/boards.h" #include "hw/boards.h"
@ -303,7 +302,6 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags)
static S390SKeysClass *skeyclass; static S390SKeysClass *skeyclass;
static S390SKeysState *ss; static S390SKeysState *ss;
uint8_t key, old_key; uint8_t key, old_key;
int rc;
/* /*
* We expect to be called with an absolute address that has already been * We expect to be called with an absolute address that has already been
@ -341,9 +339,7 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags)
* *
* TODO: we have races between getting and setting the key. * TODO: we have races between getting and setting the key.
*/ */
rc = skeyclass->get_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); if (s390_skeys_get(ss, addr / TARGET_PAGE_SIZE, 1, &key)) {
if (rc) {
trace_get_skeys_nonzero(rc);
return; return;
} }
old_key = key; old_key = key;
@ -371,10 +367,7 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags)
key |= SK_R; key |= SK_R;
if (key != old_key) { if (key != old_key) {
rc = skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); s390_skeys_set(ss, addr / TARGET_PAGE_SIZE, 1, &key);
if (rc) {
trace_set_skeys_nonzero(rc);
}
} }
} }

View file

@ -30,7 +30,6 @@
#include "hw/core/tcg-cpu-ops.h" #include "hw/core/tcg-cpu-ops.h"
#include "qemu/int128.h" #include "qemu/int128.h"
#include "qemu/atomic128.h" #include "qemu/atomic128.h"
#include "trace.h"
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
#include "hw/s390x/storage-keys.h" #include "hw/s390x/storage-keys.h"
@ -2093,9 +2092,8 @@ uint64_t HELPER(iske)(CPUS390XState *env, uint64_t r2)
} }
} }
rc = skeyclass->get_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); rc = s390_skeys_get(ss, addr / TARGET_PAGE_SIZE, 1, &key);
if (rc) { if (rc) {
trace_get_skeys_nonzero(rc);
return 0; return 0;
} }
return key; return key;
@ -2108,7 +2106,6 @@ void HELPER(sske)(CPUS390XState *env, uint64_t r1, uint64_t r2)
static S390SKeysClass *skeyclass; static S390SKeysClass *skeyclass;
uint64_t addr = wrap_address(env, r2); uint64_t addr = wrap_address(env, r2);
uint8_t key; uint8_t key;
int rc;
addr = mmu_real2abs(env, addr); addr = mmu_real2abs(env, addr);
if (!mmu_absolute_addr_valid(addr, false)) { if (!mmu_absolute_addr_valid(addr, false)) {
@ -2124,10 +2121,7 @@ void HELPER(sske)(CPUS390XState *env, uint64_t r1, uint64_t r2)
} }
key = r1 & 0xfe; key = r1 & 0xfe;
rc = skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); s390_skeys_set(ss, addr / TARGET_PAGE_SIZE, 1, &key);
if (rc) {
trace_set_skeys_nonzero(rc);
}
/* /*
* As we can only flush by virtual address and not all the entries * As we can only flush by virtual address and not all the entries
* that point to a physical address we have to flush the whole TLB. * that point to a physical address we have to flush the whole TLB.
@ -2157,18 +2151,16 @@ uint32_t HELPER(rrbe)(CPUS390XState *env, uint64_t r2)
} }
} }
rc = skeyclass->get_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); rc = s390_skeys_get(ss, addr / TARGET_PAGE_SIZE, 1, &key);
if (rc) { if (rc) {
trace_get_skeys_nonzero(rc);
return 0; return 0;
} }
re = key & (SK_R | SK_C); re = key & (SK_R | SK_C);
key &= ~SK_R; key &= ~SK_R;
rc = skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key); rc = s390_skeys_set(ss, addr / TARGET_PAGE_SIZE, 1, &key);
if (rc) { if (rc) {
trace_set_skeys_nonzero(rc);
return 0; return 0;
} }
/* /*

View file

@ -1,9 +1,5 @@
# See docs/devel/tracing.rst for syntax documentation. # See docs/devel/tracing.rst for syntax documentation.
# mmu_helper.c
get_skeys_nonzero(int rc) "SKEY: Call to get_skeys unexpectedly returned %d"
set_skeys_nonzero(int rc) "SKEY: Call to set_skeys unexpectedly returned %d"
# ioinst.c # ioinst.c
ioinst(const char *insn) "IOINST: %s" ioinst(const char *insn) "IOINST: %s"
ioinst_sch_id(const char *insn, int cssid, int ssid, int schid) "IOINST: %s (%x.%x.%04x)" ioinst_sch_id(const char *insn, int cssid, int ssid, int schid) "IOINST: %s (%x.%x.%04x)"