From nobody Sat Oct 4 23:29:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1759205658; cv=none; d=zohomail.com; s=zohoarc; b=ZFzgCUEMDlNHat4od2oJ+wO737p6odESfFNjd4qI7edCyZ0dVPGErOglS8wacDX/D09f7Qm/bFk+7A5gfNyoAxGaI5/tMfWzQIASk5W5ZDMyEz+lrN+fIigbwrD2XFcQmFWwQUsiCAexg6SfaseQLnpV2tGgNaXdTKISn3EOrWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759205658; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UsPYBf9Y41DYeMpdEdOkBi/mu9mpDrkpGT9A+u43FVY=; b=LAoi3yhZHdM0VqTBMJ5Koc3hBjaEY3UOA85frIvNs5Diq1C2LO2rclf1aj82KSf8raT2sEcPxy4hK+OHtZaIqfkdPAmqBJjq+MnDWNOVT3U26iUUUXSrXyf6IpgsryZzgsMDru8O+Xsen201/FpxXBErVfv8nnDKWJtdeuqSKkc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1759205658047845.9463587143043; Mon, 29 Sep 2025 21:14:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1133448.1471589 (Exim 4.92) (envelope-from ) id 1v3RkV-0008Lw-Cp; Tue, 30 Sep 2025 04:13:59 +0000 Received: by outflank-mailman (output) from mailman id 1133448.1471589; Tue, 30 Sep 2025 04:13:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1v3RkV-0008Lp-7o; Tue, 30 Sep 2025 04:13:59 +0000 Received: by outflank-mailman (input) for mailman id 1133448; Tue, 30 Sep 2025 04:13:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1v3RkU-0006tq-0w for xen-devel@lists.xenproject.org; Tue, 30 Sep 2025 04:13:58 +0000 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [2a00:1450:4864:20::429]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e2abb080-9db3-11f0-9d14-b5c5bf9af7f9; Tue, 30 Sep 2025 06:13:57 +0200 (CEST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3fa528f127fso4221194f8f.1 for ; Mon, 29 Sep 2025 21:13:57 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e2ab31e97sm251610955e9.14.2025.09.29.21.13.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Sep 2025 21:13:56 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e2abb080-9db3-11f0-9d14-b5c5bf9af7f9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1759205637; x=1759810437; darn=lists.xenproject.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=UsPYBf9Y41DYeMpdEdOkBi/mu9mpDrkpGT9A+u43FVY=; b=EOltNrgaoPb01blgoG8FhMbkMNs42aJp+3jl6NEtrplaKslDjHAwMKagldcrT0QbO6 RlDv5ardTLkf/rjliK7D12I3wC2SS5Z+FZKFl6q9ybKoseD31QU47Pl0v3/Iz00bKQjq nsQji94mkLt8yN3wqimjvK0Q8uMXS/DZE5mVfrTbnbB51i4YMPGmZuHlayihkKaQzzg6 3N/to+1Z4HbkxodoNlG+tZyI149VgTHHz6vlki25XMnXYe/XHk204mfg8fURq5l1m2kp dBN0Ibo/VZlPe3s1dGZnTNeu69eJ7Kk1omln7lF9P861PJz6Y6RIXNMRcwte4i+YYLFf wMNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759205637; x=1759810437; 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=UsPYBf9Y41DYeMpdEdOkBi/mu9mpDrkpGT9A+u43FVY=; b=CXf3xF8D7eY3mulRfhvSD9wKI5WB7aaf6Jph5qjT3vsyYQRDEvzlvG4p/y/XlEZtcy Y6F2TfYBZfeZLteWz79STyN5JBWtdT+iHgZQdROUmVMAQIfG5mhuR7xzVc+j9yFF8tAl urPqUTK4YXMD75QDN5u6IHSZovou02NwGTTUnFCf0YFOq6PkhXC3PlKlt/jVGwSoVxGi NFjYeau9PRM4hxx+8IFDa0pd3ukG4daGiHqAdKfz1Ia4vod4PR4KvBASkdof2pk7tx/i XN9t3isvzGjKGzuq4jHKjo2T6/dxHT6qNrGsyWTZCVRy4CLIpmNuKSICmm8JCd1Ufv8e 7ITw== X-Forwarded-Encrypted: i=1; AJvYcCVwtWr7/jFbO9S+tzx29xXGr+j9d0jpv2ZZlS7w/rbCtIeBp9TXkosZwGkHCUAGzylR/YHWVY5ymCo=@lists.xenproject.org X-Gm-Message-State: AOJu0YwKV+whCc3WbRuEMnEDkJGETeJNKcWHivzAlyChHLFUBf/4s3ay hd8uQQNb5eCSdp6J1sPBFM8jtTGZ8bsppJ2rdZ792ES7n1ljiy92A5S7FU3jMtZBYwc= X-Gm-Gg: ASbGnctX+PhzVlUT6X/9Wq0UR0wqY0JHaL4fZtuWH+ZfXLjoG5faVUJmZOms16/28J3 NRBEmAokvTeJYMnce8mfhrGiuRV8SsTnzd0/VxTrOHnOMCz6vb/U8CC/ZYdLle6IjtPH5w74WNK CHPQR7vwBP0hQsEo3d+nZPD9k4yM34qLXfgfEZK1B/ksy7WNASd2H3SqIDD75Imtq7OibQKyL8Z ywM8TH6Sg0hsUpRWFHkLF4t8G2Od1gZ58yb8vEoYSZ0oZgFDoqsLYpJ1jQ+G4MgxWxaniZMtFyM Jup+p0ie+LRdo53vTFnsAr2zcXWGfT7wKwdmwjh03c+gZPi3IV8jd6rugCuEkWgbpNuHnYuQLdo Oi5uKsKZI/c1OhsycwCwrnm4M9t2zFt9hxHQi7R7eQiFF++g7WkkgtA80ZwuegcNfdUEIi39TMm pWHUywHEBtSoW+7FeBwJKm X-Google-Smtp-Source: AGHT+IH3He/bgDcAVA0O1uM4KAZUJWAOZ5pxrLV0agMvoc3nOriIeKi2nLWEPRWZf/BAWQ6cyeIFXA== X-Received: by 2002:a05:6000:40c7:b0:407:d776:4434 with SMTP id ffacd0b85a97d-4241227789emr2285457f8f.30.1759205636900; Mon, 29 Sep 2025 21:13:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Herne , Stefano Stabellini , Stefano Garzarella , xen-devel@lists.xenproject.org, Paolo Bonzini , Ilya Leoshkevich , Anthony PERARD , Paul Durrant , Eric Farman , Marcelo Tosatti , Halil Pasic , Matthew Rosato , Reinoud Zandijk , Zhao Liu , David Woodhouse , Christian Borntraeger , Sunil Muthuswamy , kvm@vger.kernel.org, "Michael S. Tsirkin" , Peter Xu , Thomas Huth , qemu-s390x@nongnu.org, "Edgar E. Iglesias" , Richard Henderson , David Hildenbrand Subject: [PATCH v2 05/17] hw/s390x/sclp: Use address_space_memory_is_io() in sclp_service_call() Date: Tue, 30 Sep 2025 06:13:13 +0200 Message-ID: <20250930041326.6448-6-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250930041326.6448-1-philmd@linaro.org> References: <20250930041326.6448-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1759205659160116600 When cpu_address_space_init() isn't called during vCPU creation, its single address space is the global &address_space_memory. As s390x boards don't call cpu_address_space_init(), cpu_get_address_space(CPU(cpu), 0) returns &address_space_memory. We can then replace cpu_physical_memory_is_io() by the semantically equivalent address_space_memory_is_io() call. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/s390x/sclp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 9718564fa42..f507b36cd91 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -16,6 +16,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "hw/boards.h" +#include "system/memory.h" #include "hw/s390x/sclp.h" #include "hw/s390x/event-facility.h" #include "hw/s390x/s390-pci-bus.h" @@ -301,6 +302,7 @@ int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint= 32_t code) CPUS390XState *env =3D &cpu->env; SCLPDevice *sclp =3D get_sclp_device(); SCLPDeviceClass *sclp_c =3D SCLP_GET_CLASS(sclp); + AddressSpace *as =3D cpu_get_address_space(CPU(cpu), 0); SCCBHeader header; g_autofree SCCB *work_sccb =3D NULL; =20 @@ -308,7 +310,7 @@ int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint= 32_t code) if (env->psw.mask & PSW_MASK_PSTATE) { return -PGM_PRIVILEGED; } - if (cpu_physical_memory_is_io(sccb)) { + if (address_space_is_io(as, sccb)) { return -PGM_ADDRESSING; } if ((sccb & ~0x1fffUL) =3D=3D 0 || (sccb & ~0x1fffUL) =3D=3D env->psa --=20 2.51.0