From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
qemu-s390x@nongnu.org, "Ilya Leoshkevich" <iii@linux.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 1/4] hw/s390x/css: Have css_do_sic() take S390CPU instead of CPUS390XState
Date: Mon, 6 Nov 2023 12:44:56 +0100 [thread overview]
Message-ID: <20231106114500.5269-2-philmd@linaro.org> (raw)
In-Reply-To: <20231106114500.5269-1-philmd@linaro.org>
"hw/s390x/css.h" is a header used by target-agnostic objects
(such hw/s390x/virtio-ccw-gpu.c), thus can not use target-specific
types, such CPUS390XState.
Have css_do_sic() take S390CPU a pointer, which is target-agnostic.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/s390x/css.h | 2 +-
hw/s390x/css.c | 3 ++-
target/s390x/kvm/kvm.c | 2 +-
target/s390x/tcg/misc_helper.c | 3 ++-
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h
index 75e5381613..ba72ee3dd2 100644
--- a/include/hw/s390x/css.h
+++ b/include/hw/s390x/css.h
@@ -233,7 +233,7 @@ typedef enum {
} CssIoAdapterType;
void css_adapter_interrupt(CssIoAdapterType type, uint8_t isc);
-int css_do_sic(CPUS390XState *env, uint8_t isc, uint16_t mode);
+int css_do_sic(S390CPU *cpu, uint8_t isc, uint16_t mode);
uint32_t css_get_adapter_id(CssIoAdapterType type, uint8_t isc);
void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maskable,
uint8_t flags, Error **errp);
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 95d1b3a3ce..bcedec2fc8 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -644,8 +644,9 @@ void css_conditional_io_interrupt(SubchDev *sch)
}
}
-int css_do_sic(CPUS390XState *env, uint8_t isc, uint16_t mode)
+int css_do_sic(S390CPU *cpu, uint8_t isc, uint16_t mode)
{
+ CPUS390XState *env = &cpu->env;
S390FLICState *fs = s390_get_flic();
S390FLICStateClass *fsc = s390_get_flic_class(fs);
int r;
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index 0f0e784b2a..1ddad0bec1 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -1358,7 +1358,7 @@ static int kvm_sic_service_call(S390CPU *cpu, struct kvm_run *run)
mode = env->regs[r1] & 0xffff;
isc = (env->regs[r3] >> 27) & 0x7;
- r = css_do_sic(env, isc, mode);
+ r = css_do_sic(cpu, isc, mode);
if (r) {
kvm_s390_program_interrupt(cpu, -r);
}
diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c
index e85658ce22..56c7f00cf9 100644
--- a/target/s390x/tcg/misc_helper.c
+++ b/target/s390x/tcg/misc_helper.c
@@ -761,10 +761,11 @@ void HELPER(stpcifc)(CPUS390XState *env, uint32_t r1, uint64_t fiba,
void HELPER(sic)(CPUS390XState *env, uint64_t r1, uint64_t r3)
{
+ S390CPU *cpu = env_archcpu(env);
int r;
qemu_mutex_lock_iothread();
- r = css_do_sic(env, (r3 >> 27) & 0x7, r1 & 0xffff);
+ r = css_do_sic(cpu, (r3 >> 27) & 0x7, r1 & 0xffff);
qemu_mutex_unlock_iothread();
/* css_do_sic() may actually return a PGM_xxx value to inject */
if (r) {
--
2.41.0
next prev parent reply other threads:[~2023-11-06 11:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 11:44 [PATCH 0/4] target/s390x/cpu: Restrict CPUS390XState declaration to 'cpu.h' Philippe Mathieu-Daudé
2023-11-06 11:44 ` Philippe Mathieu-Daudé [this message]
2023-11-06 11:44 ` [PATCH 2/4] hw/s390x/sclp: Have sclp_service_call[_protected]() take S390CPU* Philippe Mathieu-Daudé
2023-11-07 12:10 ` Philippe Mathieu-Daudé
2023-11-06 11:44 ` [PATCH 3/4] target/s390x/cpu: Restrict cpu_get_tb_cpu_state() definition to TCG Philippe Mathieu-Daudé
2023-11-06 11:44 ` [PATCH 4/4] target/s390x/cpu: Restrict CPUS390XState declaration to 'cpu.h' Philippe Mathieu-Daudé
2023-11-07 15:29 ` Zhao Liu
2023-11-07 10:44 ` [PATCH 0/4] " Thomas Huth
2023-11-07 12:12 ` Philippe Mathieu-Daudé
2023-11-07 13:30 ` Thomas Huth
2023-11-07 11:21 ` Thomas Huth
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=20231106114500.5269-2-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=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--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).