From patchwork Mon Nov 6 11:44:57 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: 741389 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1040062wrr; Mon, 6 Nov 2023 03:53:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbY1nHLvg8aNqyV2ENPUzqLSeu2QmPGL65lNyIhqlV7zVzgr4JUglq8MI2KokTfonKEA0F X-Received: by 2002:a05:622a:1350:b0:41e:2423:f0be with SMTP id w16-20020a05622a135000b0041e2423f0bemr5455099qtk.40.1699271599307; Mon, 06 Nov 2023 03:53:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699271599; cv=none; d=google.com; s=arc-20160816; b=TP7L/dY9/eSps/79hNt5I9a7LBGYo6oIs1PYqhC/7M5esAeHSVb45D4qrkydZQmRGA /IUjjIkBytYHr6EXw5jL1dxTNPXAvpGkHz29SKb53PyYfo/lInfOBl2Ey9+Xitxb7K0K aq4D9DuzverOKL3/RpT1ivu2zoSiNnctySZ+LKcwM5QYaDBRmecZfjJK1MmqKytQ7iuI wdCATKokNso+EkZ2YzmvJH+gZ6GijIu36zmO+ZAxS4wD72QHVWuJKJib9qxfBH5VZbxt yWeFaQ9IA9OE0AOLkyjeOXEIXfzb3wdoikhMjSOWSwjbuzFF3RXrpZM2pPHO9vhcm5y7 imdw== 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=bQYHw6k/VszA0YDIuQME8N6TDwm343Fq2i1eGs6ZHqM=; fh=iyPtDenH/bpJiwn6+MxCUj0FPuOI6mBlLIyfrvrbZlI=; b=gnZNNVepeEh0jEtiFJilquCXDuix8QhXe0t5GNKi2/Dp/98WavFb8pbZ7JvIIlFmkJ AADyoiax4F2MbXPcPfPRCMP01apqgm8hk3RfivD3EGXYTQ+/ikLpHvOAHvOaUdTQMZ5k Vj+hrvmj07DawSx140vy2h7TqVjGQkUFWpm9MV2u9ucRKSb0L0eq1WXO25OQRy5yly83 ydIZeeZXzf7r+aQQuXBR6xXfJhyTcXc2nRfCzRvvGeEOL5VdUF0G6es/pToooH1jwaxT jeSUWFXhqRY1f7Pw/kGUizzsXirV3njPCBveuQqPZxnl4+fL/am+TgWUHIEuZPh/YsIB p92Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NB7lmMhO; 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 s25-20020a05622a1a9900b004180b2c7741si5248146qtc.85.2023.11.06.03.53.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 03:53:19 -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=NB7lmMhO; 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 1qzy2r-0002EN-C6; Mon, 06 Nov 2023 06:45:29 -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 1qzy2i-00028b-8R for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:45:26 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzy2g-00056H-HX for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:45:20 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4084de32db5so38525485e9.0 for ; Mon, 06 Nov 2023 03:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699271117; x=1699875917; 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=bQYHw6k/VszA0YDIuQME8N6TDwm343Fq2i1eGs6ZHqM=; b=NB7lmMhO6jLP5SC1OI42zvrjro/VbM33tncHEY2i76bIrJis4z+kKRJ5FZ9DfY3Mnz H8BmA4a6DgsLILzKXAPQvbVj0Zyupbyo2bU9du0bbJTyfaUCac4etmICSuoljostYQ9T NEA/f0goXH9ArioCHeF090O3myVXlolk2DdDgZDL4ekTzjWf9HC8LJWZIzP7y575hLmG B8jx9d1CQaMrfblIrhuh0qdxzTzqw168OS0PTGRvX1iIPdnPDvnDVOEqxztXN5l4YJ+2 rh+f6g9rk6IzTWlhIH9bA8lrW8j0FMKcwbvi2ZDwzN9e+wmTw4lsfmB75AaPz6oWqlf0 /1sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699271117; x=1699875917; 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=bQYHw6k/VszA0YDIuQME8N6TDwm343Fq2i1eGs6ZHqM=; b=WQEysMOCoLdGxVq8TP1VcPnIGRS+bDWeZp7FgqFgQt564HREnqZOEIdDGPLgNKw0YN ORlGu7pzixaUjPFsa+TtZt7fQc/0zSM43jMIIf9jR5hkSZAhAh0vqT3oVANFyBrr0ZqJ lAHYRym+X33z3nKptY33daBBiX+TcZ0wKDL5U/rgJscXHBBK+m7bBsKfFSo7XozvNmCC 4RioTY5arckwDzqOnSlooIMny4WSMnt0pU+ilB1DJgo4HJG7jG29sDoFw1x0Ybk4iBUW /bNoHgGoT5RsnvQkmOpuYgNfk1lQQ5NqrvFFvKQ3DiuJVwPP3QA33Yy+XazF+Ka/tI0t V0ug== X-Gm-Message-State: AOJu0YwjVaozCpiOvPAGDP0Hbw7/Ld2fIctnxm6zQ0UWNKXsORtHNK72 f4ynGUIXEDsaZundN5cDLURveLUGGDdhhKSGmzk= X-Received: by 2002:a05:600c:c0f:b0:409:5d7d:b26d with SMTP id fm15-20020a05600c0c0f00b004095d7db26dmr12085647wmb.15.1699271116243; Mon, 06 Nov 2023 03:45:16 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id b15-20020a05600010cf00b00318147fd2d3sm9172759wrx.41.2023.11.06.03.45.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:45:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Thomas Huth , David Hildenbrand , Halil Pasic , Eric Farman , Christian Borntraeger , qemu-s390x@nongnu.org, Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/4] hw/s390x/sclp: Have sclp_service_call[_protected]() take S390CPU* Date: Mon, 6 Nov 2023 12:44:57 +0100 Message-ID: <20231106114500.5269-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106114500.5269-1-philmd@linaro.org> References: <20231106114500.5269-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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/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é --- 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());