[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/4] hw/s390x/sclp: Have sclp_service_call[_protected]() take S39
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 2/4] hw/s390x/sclp: Have sclp_service_call[_protected]() take S390CPU* |
Date: |
Mon, 6 Nov 2023 12:44:57 +0100 |
"hw/s390x/sclp.h" is a header used by target-agnostic objects
(such hw/char/sclpconsole[-lm].c), thus can not use target-specific
types, such CPUS390XState.
Have sclp_service_call[_protected]() take a S390CPU pointer, which
is target-agnostic.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/s390x/sclp.h | 5 ++---
hw/s390x/sclp.c | 7 ++++---
target/s390x/kvm/kvm.c | 2 +-
target/s390x/tcg/misc_helper.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h
index 9aef6d9370..e229b81a67 100644
--- a/include/hw/s390x/sclp.h
+++ b/include/hw/s390x/sclp.h
@@ -227,8 +227,7 @@ static inline int sccb_data_len(SCCB *sccb)
void s390_sclp_init(void);
void sclp_service_interrupt(uint32_t sccb);
void raise_irq_cpu_hotplug(void);
-int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code);
-int sclp_service_call_protected(CPUS390XState *env, uint64_t sccb,
- uint32_t code);
+int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t code);
+int sclp_service_call_protected(S390CPU *cpu, uint64_t sccb, uint32_t code);
#endif
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index d339cbb7e4..893e71a41b 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -269,9 +269,9 @@ static void sclp_execute(SCLPDevice *sclp, SCCB *sccb,
uint32_t code)
* service_interrupt call.
*/
#define SCLP_PV_DUMMY_ADDR 0x4000
-int sclp_service_call_protected(CPUS390XState *env, uint64_t sccb,
- uint32_t code)
+int sclp_service_call_protected(S390CPU *cpu, uint64_t sccb, uint32_t code)
{
+ CPUS390XState *env = &cpu->env;
SCLPDevice *sclp = get_sclp_device();
SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
SCCBHeader header;
@@ -296,8 +296,9 @@ out_write:
return 0;
}
-int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code)
+int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t code)
{
+ CPUS390XState *env = &cpu->env;
SCLPDevice *sclp = get_sclp_device();
SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
SCCBHeader header;
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index 1ddad0bec1..a12fbfc026 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -1174,7 +1174,7 @@ static void kvm_sclp_service_call(S390CPU *cpu, struct
kvm_run *run,
break;
case ICPT_PV_INSTR:
g_assert(s390_is_pv());
- sclp_service_call_protected(env, sccb, code);
+ sclp_service_call_protected(cpu, sccb, code);
/* Setting the CC is done by the Ultravisor. */
break;
case ICPT_INSTRUCTION:
diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c
index 56c7f00cf9..6aa7907438 100644
--- a/target/s390x/tcg/misc_helper.c
+++ b/target/s390x/tcg/misc_helper.c
@@ -102,7 +102,7 @@ uint64_t HELPER(stck)(CPUS390XState *env)
uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2)
{
qemu_mutex_lock_iothread();
- int r = sclp_service_call(env, r1, r2);
+ int r = sclp_service_call(env_archcpu(env), r1, r2);
qemu_mutex_unlock_iothread();
if (r < 0) {
tcg_s390_program_interrupt(env, -r, GETPC());
--
2.41.0
- [PATCH 0/4] target/s390x/cpu: Restrict CPUS390XState declaration to 'cpu.h', Philippe Mathieu-Daudé, 2023/11/06
- [PATCH 1/4] hw/s390x/css: Have css_do_sic() take S390CPU instead of CPUS390XState, Philippe Mathieu-Daudé, 2023/11/06
- [PATCH 3/4] target/s390x/cpu: Restrict cpu_get_tb_cpu_state() definition to TCG, Philippe Mathieu-Daudé, 2023/11/06
- [PATCH 2/4] hw/s390x/sclp: Have sclp_service_call[_protected]() take S390CPU*,
Philippe Mathieu-Daudé <=
- [PATCH 4/4] target/s390x/cpu: Restrict CPUS390XState declaration to 'cpu.h', Philippe Mathieu-Daudé, 2023/11/06
- Re: [PATCH 0/4] target/s390x/cpu: Restrict CPUS390XState declaration to 'cpu.h', Thomas Huth, 2023/11/07
- Re: [PATCH 0/4] target/s390x/cpu: Restrict CPUS390XState declaration to 'cpu.h', Thomas Huth, 2023/11/07