From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Eric Farman" <farman@linux.ibm.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"David Hildenbrand" <david@redhat.com>,
qemu-s390x@nongnu.org, "Ilya Leoshkevich" <iii@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Thomas Huth" <thuth@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v2 2/2] target/s390x: Use s390_skeys_get|set() helper
Date: Thu, 13 Jun 2024 12:44:15 +0200 [thread overview]
Message-ID: <20240613104415.9643-3-philmd@linaro.org> (raw)
In-Reply-To: <20240613104415.9643-1-philmd@linaro.org>
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
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/s390x/mmu_helper.c | 11 ++---------
target/s390x/tcg/mem_helper.c | 16 ++++------------
target/s390x/trace-events | 4 ----
3 files changed, 6 insertions(+), 25 deletions(-)
diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
index f3a2f25a5c..6c59d0d216 100644
--- a/target/s390x/mmu_helper.c
+++ b/target/s390x/mmu_helper.c
@@ -25,7 +25,6 @@
#include "sysemu/tcg.h"
#include "exec/exec-all.h"
#include "exec/page-protection.h"
-#include "trace.h"
#include "hw/hw.h"
#include "hw/s390x/storage-keys.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 S390SKeysState *ss;
uint8_t key, old_key;
- int rc;
/*
* 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.
*/
- rc = skeyclass->get_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key);
- if (rc) {
- trace_get_skeys_nonzero(rc);
+ if (s390_skeys_get(ss, addr / TARGET_PAGE_SIZE, 1, &key)) {
return;
}
old_key = key;
@@ -371,10 +367,7 @@ static void mmu_handle_skey(target_ulong addr, int rw, int *flags)
key |= SK_R;
if (key != old_key) {
- rc = skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key);
- if (rc) {
- trace_set_skeys_nonzero(rc);
- }
+ s390_skeys_set(ss, addr / TARGET_PAGE_SIZE, 1, &key);
}
}
diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
index 6a308c5553..6cdbc34178 100644
--- a/target/s390x/tcg/mem_helper.c
+++ b/target/s390x/tcg/mem_helper.c
@@ -30,7 +30,6 @@
#include "hw/core/tcg-cpu-ops.h"
#include "qemu/int128.h"
#include "qemu/atomic128.h"
-#include "trace.h"
#if !defined(CONFIG_USER_ONLY)
#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) {
- trace_get_skeys_nonzero(rc);
return 0;
}
return key;
@@ -2108,7 +2106,6 @@ void HELPER(sske)(CPUS390XState *env, uint64_t r1, uint64_t r2)
static S390SKeysClass *skeyclass;
uint64_t addr = wrap_address(env, r2);
uint8_t key;
- int rc;
addr = mmu_real2abs(env, addr);
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;
- rc = skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key);
- if (rc) {
- trace_set_skeys_nonzero(rc);
- }
+ s390_skeys_set(ss, addr / TARGET_PAGE_SIZE, 1, &key);
/*
* 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.
@@ -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) {
- trace_get_skeys_nonzero(rc);
return 0;
}
re = key & (SK_R | SK_C);
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) {
- trace_set_skeys_nonzero(rc);
return 0;
}
/*
diff --git a/target/s390x/trace-events b/target/s390x/trace-events
index 729cb012b4..d371ef71b9 100644
--- a/target/s390x/trace-events
+++ b/target/s390x/trace-events
@@ -1,9 +1,5 @@
# 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(const char *insn) "IOINST: %s"
ioinst_sch_id(const char *insn, int cssid, int ssid, int schid) "IOINST: %s (%x.%x.%04x)"
--
2.41.0
next prev parent reply other threads:[~2024-06-13 10:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 10:44 [PATCH v2 0/2] target/s390x: Fix tracing header path in TCG mem_helper.c Philippe Mathieu-Daudé
2024-06-13 10:44 ` [PATCH v2 1/2] hw/s390x: Introduce s390_skeys_get|set() helpers Philippe Mathieu-Daudé
2024-06-13 10:44 ` Philippe Mathieu-Daudé [this message]
2024-06-18 10:39 ` [PATCH v2 0/2] target/s390x: Fix tracing header path in TCG mem_helper.c Philippe Mathieu-Daudé
2024-06-18 13:04 ` Thomas Huth
2024-06-18 15:11 ` Paolo Bonzini
2024-06-18 15:58 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240613104415.9643-3-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=farman@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=pasic@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).