Received: by 2002:a17:906:4a55:b0:9d0:bf65:29fa with SMTP id a21csp273761ejv; Tue, 7 Nov 2023 04:26:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDuK5yNb1V/GPcHmUMtUCDAlLDTg2u5Zgr7g7uYF0joTRDeSn+lukWacny8cA4KJYVY20C X-Received: by 2002:a05:620a:4412:b0:76f:14fc:6d2f with SMTP id v18-20020a05620a441200b0076f14fc6d2fmr41681217qkp.1.1699360010036; Tue, 07 Nov 2023 04:26:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699360010; cv=none; d=google.com; s=arc-20160816; b=JIHgRXCjxAQjbCAQtn9UQmUZBhMjzxE4xtMI9ejkIiLpHhAnNpG9r43aaB0Tp6xNSY AApiuP5FgW/PGLDeXsvB1LILzcqVPUQTjAGs/cAKj+pSLc+gZeUPd4dxpugmzuVaps1a HIa89K3KWMqFnqwtAkmIyM8TnzAe9C0uFrvqZLCVaZgVfvUPijU1Bplg1uyeIGTn8moi JhiNzkKqBPocnbUDzT6MlpCGqbKLs0JD3eYx3BEYqk59vu9CaUFgePXaIAr70XVmyNBU NIJR/fULlHkIav+u8z1dlf/8rOOawAAwSDdx21uRJDgK48LaupnPbXe8ujnLztrEsLQm NyvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8o7ytDCjKPudtYHMOoHYjJ8HM4/zixXAYrUBK2BQdgM=; fh=jaTVlK7hrJgn83CZVzTjLDxNv9IBdB/6li9Pe02QIGM=; b=XPGVetbtOYwnSHK7p+GD9+v+O96L8R8PWyb3J1SRbdBZFomxNddWHmDA31/BKYbJEG vU9z7LtaPQkKcNZlFa2yUgTX1bGdD+m6c+rTT+lsJMK14DWMzsB16gyoqo+MhfZEANl+ vxudLmflX+GGXEwZHcP9SMZpGzUPMf2+wh/e//Fx5wvs7mzymGVIgFkYYT2b1VfyCNDe sbZmRsl11RNuaRvYuN4QpKBs+Qk8SqWt+LTVJjMOUA2CE6xfFr+Y5S89UsoblzXlc21O 7yuuioDifwzkTcdKmimsOxXoRkSvoScTBHycUdIwcnpqexeXNPdOvrBPAY1PdlOXebYQ N98w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nc0Baros; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bk39-20020a05620a1a2700b0076dabcceb44si7682574qkb.378.2023.11.07.04.26.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2023 04:26:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nc0Baros; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0LA3-00075D-TF; Tue, 07 Nov 2023 07:26:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0L9b-0006EB-5X for qemu-arm@nongnu.org; Tue, 07 Nov 2023 07:26:02 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0L9E-00055Y-8y for qemu-arm@nongnu.org; Tue, 07 Nov 2023 07:25:57 -0500 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-507bd19eac8so7239806e87.0 for ; Tue, 07 Nov 2023 04:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699359933; x=1699964733; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8o7ytDCjKPudtYHMOoHYjJ8HM4/zixXAYrUBK2BQdgM=; b=nc0BarosaU0NSxT4zMtZjHrYtSGaQ4zzCHt8yg2ph+BryxA+M+vH9eYyDbAoubWcau 6wIU1S149pXAOAFeWY9Cd47TwicCXMAYxnGE26K2TOCDs8X/TdVxHRxT31lhl77V0FHE A+h+8wz9zSlztWW2V7p2ZtIZXQ09OUa/Q82Q66fxkEkXEeIzfnSyKGS8cbDyG32UywZU 27Gbf2mlFntL6gIXRxHEMxRAiNJ1Kw+G+gL27+Q0vFuFCNSk6IBYQigi6S1+FFg5LYSn D0fXwa1maX5sfrRlu5EUe8RlSYnto0IJe381Mp4X5h5Gnu3cw9wTHcfAjQ6HTv8cqc51 Zr/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699359933; x=1699964733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8o7ytDCjKPudtYHMOoHYjJ8HM4/zixXAYrUBK2BQdgM=; b=r3cRSHnyTdgHCoywbh4YHLx/+36Csq/6cdJhqLeoCy95hS2nvCH9kID8i47TeA0Um5 wxD7RqroOLnWdNX2SBDRw4q/sNR+PDu2N2wvVcugy0YElBXs5wIkmLrpelbzes6CAWBB Uk2Nx0cO/1G8Z7wYB+ifvMyqQtLZgcfphupIDkrioMKqyMCBi3Vcmmjva52kFbPCcBC0 tGw9EhGWONIKjTST8edZBQ/g/i9qzJCdCzah9GJghSQBQCSbbVznyT8pq5s32Oh/3Wc1 wYGOIJtDQvXmQhVICwcN7zM3gtbxr2FvNrAS+VeShCEuOH72E9PBM5zsNk9+gN8xScpi yUMg== X-Gm-Message-State: AOJu0Yws/Q68ZXcegjMFxfHls10Xx65kV9FpS7ZQ3Rj7KYzpJT06/UY7 jxCyTxlKTYl8FNMhRnjrUzdCKYVfHe667d82Y+8= X-Received: by 2002:ac2:43c9:0:b0:508:e4b1:a785 with SMTP id u9-20020ac243c9000000b00508e4b1a785mr21695079lfl.62.1699359933183; Tue, 07 Nov 2023 04:25:33 -0800 (PST) Received: from m1x-phil.lan ([176.187.216.69]) by smtp.gmail.com with ESMTPSA id r22-20020a05600c35d600b003fee567235bsm15654110wmq.1.2023.11.07.04.25.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Nov 2023 04:25:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Halil Pasic , Christian Borntraeger , Eric Farman , Richard Henderson , David Hildenbrand , Ilya Leoshkevich Subject: [PULL 43/75] hw/s390x/sclp: Have sclp_service_call[_protected]() take S390CPU* Date: Tue, 7 Nov 2023 13:24:33 +0100 Message-ID: <20231107122442.58674-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231107122442.58674-1-philmd@linaro.org> References: <20231107122442.58674-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: 6eWkXGnKB5IR "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é Reviewed-by: Thomas Huth Message-Id: <20231106114500.5269-3-philmd@linaro.org> --- include/hw/s390x/sclp.h | 5 ++--- hw/s390x/sclp.c | 7 ++++--- target/s390x/kvm/kvm.c | 4 ++-- target/s390x/tcg/misc_helper.c | 2 +- 4 files changed, 9 insertions(+), 9 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..33ab3551f4 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -1174,12 +1174,12 @@ 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: g_assert(!s390_is_pv()); - r = sclp_service_call(env, sccb, code); + r = sclp_service_call(cpu, sccb, code); if (r < 0) { kvm_s390_program_interrupt(cpu, -r); return; 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