From patchwork Tue Nov 7 12:24:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 741869 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1587949wrr; Tue, 7 Nov 2023 04:28:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1jk4w1Ou/J+8LscIeAx83eyE5pyy2eHQIm1497HbecKtT/AywQ6GH4YVcPHWjIc4bcoa4 X-Received: by 2002:a05:6808:2394:b0:3a6:fb16:c782 with SMTP id bp20-20020a056808239400b003a6fb16c782mr40882193oib.30.1699360092887; Tue, 07 Nov 2023 04:28:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699360092; cv=none; d=google.com; s=arc-20160816; b=iQePpvn5rm09NOJ9aa8oIUEHG+79+Mof1AwlLkH1kYJjEc3Apn4sWY/8FnCST8EHIr dKVmf5AJWOQMt7pFR69yBtyXf/bLaFDFC6MFpUleYMP8tfqXCkAk8ed4k+5rIydjmzn9 Y7ZWeIeRjK3alglF6ugQTl5TNguGme00rQZwaaBemryxHmRVjFYrRiB2ac6V0DcdJfzA z7WHoUWnLRtL/lSlQV5SYK5X2CC7AxYleoYdTXQ+2ut4U+crRaRMIdCW3n8j2Fv5BExx 00G4m/yMHhweUCqxKmoLJKXrvQsIh3jWYBvfdxD/wHdOVrhcavA+t6GjOt460rfPuwNj abjQ== 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=oCI52AvMWABS83lFYxVvO8TS7PMofgyHZSbSztgXemQ=; fh=jaTVlK7hrJgn83CZVzTjLDxNv9IBdB/6li9Pe02QIGM=; b=QLd9RCz/55JmiPtJkG01COjP+7Vk1Lx02P8t/xU96QB1nRJBck/F5+CWwvLuh7dQMQ XdWdFdP8TUpiErdYJuqtStpOudO4XpIPCjujs5pwnkkZgSkQxDzDFMgc6HR9Hc6cNXIH Z2qtHPD8Zxc540fev7EnoYlzFAUjoksP9/e5aVMYOpN1CNOKGh7MPcsPft5cVU6BbvIg HwMpJTJ2PUBhLxvxKHiQR5daZb1rnOgMC+EgMeIfJatbkWR5HiHGjriSZIhGk2m0r+kS xR9BvMSeZ/sJlfMNJ0YNqzj9MI0/r1WNU0471CQNYBEoY5Qaqv7Ujx5VhoaoBqugn/S0 6b2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f02lqKVv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=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 bk15-20020a05620a1a0f00b007777245a955si6793588qkb.407.2023.11.07.04.28.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2023 04:28:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=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=f02lqKVv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=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 1r0L9z-0006tD-UU; Tue, 07 Nov 2023 07:26:23 -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 1r0L9R-00067y-4U for qemu-devel@nongnu.org; Tue, 07 Nov 2023 07:25:54 -0500 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0L98-00052s-HY for qemu-devel@nongnu.org; Tue, 07 Nov 2023 07:25:47 -0500 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-507f1c29f25so7361746e87.1 for ; Tue, 07 Nov 2023 04:25:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699359927; x=1699964727; 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=oCI52AvMWABS83lFYxVvO8TS7PMofgyHZSbSztgXemQ=; b=f02lqKVvoZtJeGUnWhd2Fw7uQwcMI/NqvHCM4UKR1+MwOPJZnJsP0AtneWO1Xv4GIn nE2J5CkQdr/yOnc3kNQGBHFij0MxucQKc8BtpbpglzU66H2gRyFqLXJpTz/r9tfLyIZb MlQQcSJW6QX9Fwn+UWQEdaKcWXgIHah+Cf/44FkK953serGSE3aSWN0kJnEtp67CsMtG Yso14n4sF3ja/xYAXSvW1xkxNLxyt4kwXBkYgUtzlWF92sCYjynE4Evl3Z1QJUaxDxcp A+5f3TkiFXxT7P2iaDEh1AdwfrB6ftVJ+OkjddWFNzGHwwaFPp06HBlZC/n74VlytMtr P4fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699359927; x=1699964727; 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=oCI52AvMWABS83lFYxVvO8TS7PMofgyHZSbSztgXemQ=; b=RQ//jtyZtgTco33ivBJvliEzuEmJ0THESt/uYiZ2spsEkC+LgU9gjWKG9zg8ICdkxb 8iNmaqjW84Bjsvf7fgluQ10rVEti32ue4eoW+jfcu9jkuUoyOHZJmVqOJu80Q5BrsCPG wD9fU3IeZ97Vx1hDaQlDCAOIVHwAjLp9TzogkU7tL+SpIENpSOLKZxZBDRgx/mpnYtvF De1fAp0gqwbdXR9uIvkXHYZ7bppF9u+CHLhlz/7udeZNTAXJZQwWSZJpktw0Oju9Ya63 niH1nyizqZcvYv5nIGvFZxxJ285ezxvvQZ5hwCSVYVI2okGZortgAkylfavIAKYR0I5r 0FxQ== X-Gm-Message-State: AOJu0YxoS6uy527wGWghFW8Gr1ohz/DbzsilREVm9KH1ErE3oX7QoBl6 eZDogFxN1XGKgRvBdzOCeAUWp445m6bngy9b1kg= X-Received: by 2002:a05:6512:3caa:b0:509:f6b:1de1 with SMTP id h42-20020a0565123caa00b005090f6b1de1mr28646589lfv.12.1699359927307; Tue, 07 Nov 2023 04:25:27 -0800 (PST) Received: from m1x-phil.lan ([176.187.216.69]) by smtp.gmail.com with ESMTPSA id m17-20020adff391000000b0032cc35c2ef7sm2235837wro.29.2023.11.07.04.25.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Nov 2023 04:25:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Thomas Huth , Halil Pasic , Christian Borntraeger , Eric Farman , Richard Henderson , David Hildenbrand , Ilya Leoshkevich Subject: [PULL 42/75] hw/s390x/css: Have css_do_sic() take S390CPU instead of CPUS390XState Date: Tue, 7 Nov 2023 13:24:32 +0100 Message-ID: <20231107122442.58674-8-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 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=philmd@linaro.org; helo=mail-lf1-x12b.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-devel@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-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.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é Reviewed-by: Thomas Huth Message-Id: <20231106114500.5269-2-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) {