From nobody Sat Nov 15 17:43:58 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1749654652; cv=none; d=zohomail.com; s=zohoarc; b=ADp1dr1gKlFri73kX5UE6OTEE1XzCd30LZUDtX2LOWok8miMCILJKGi2EfpQBkSqt3mWij/QInrRyr3NB6r/CwVEMB+HIlKBSG8lVfMfz8wIcPKLqyRQBWAtcciTM4AG9PZOcReslb9KsLT+sakuAtR8Xped9X+ocm4hO7szUV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749654652; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v+Z6bEAFtbPbilkZ0EIqHvHGBwZUqeGe9jszTIGujG4=; b=eMjeVgowt08xvBp67jkd5K4908Nd60+ujm/Cjm1JlQlW3PLFGTnr9UtxA3OUKQYbRupVq6ykZ+jP2OckznwYniFZwedPDCjcRGhuHPRaOxL1LaSoaJO42OSha9pTpyMrBcOM0/jaG+/DsN1BW4mE92X8qmbSnGhJ+wE6oOdiueY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749654652584967.744178058723; Wed, 11 Jun 2025 08:10:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPN2V-0004TH-BF; Wed, 11 Jun 2025 11:06:55 -0400 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 1uPN2M-0004Qu-BS for qemu-devel@nongnu.org; Wed, 11 Jun 2025 11:06:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPN2K-000753-DM for qemu-devel@nongnu.org; Wed, 11 Jun 2025 11:06:46 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-527-4460fcEyM46f_1rZVVUDUA-1; Wed, 11 Jun 2025 11:06:41 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 607DA1955F44; Wed, 11 Jun 2025 15:06:40 +0000 (UTC) Received: from corto.redhat.com (unknown [10.45.225.191]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 05A8718002B6; Wed, 11 Jun 2025 15:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749654403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v+Z6bEAFtbPbilkZ0EIqHvHGBwZUqeGe9jszTIGujG4=; b=PsGgD16HkB1BP3H5569ooBUxESyjWLoEmG7sf2fBURtGxGq4oH5yVDFtPYpB0dhvQ1/hHf LX/jldqGgg1H7zSMbj38eIIgunHQnkDy90DjxnlRCdUhF1J7mcdNIvDPCN2Nw8UAp5IiAb EcSeSTOhRsOR8D5Gr5YK8dokU7CgsCQ= X-MC-Unique: 4460fcEyM46f_1rZVVUDUA-1 X-Mimecast-MFC-AGG-ID: 4460fcEyM46f_1rZVVUDUA_1749654400 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Rorie Reyes , Anthony Krowiak , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 06/27] s390: implementing CHSC SEI for AP config change Date: Wed, 11 Jun 2025 17:05:58 +0200 Message-ID: <20250611150620.701903-7-clg@redhat.com> In-Reply-To: <20250611150620.701903-1-clg@redhat.com> References: <20250611150620.701903-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1749655224643116600 From: Rorie Reyes Handle interception of the CHSC SEI instruction for requests indicating the guest's AP configuration has changed. If configuring --without-default-devices, hw/s390x/ap-stub.c was created to handle such circumstance. Also added the following to hw/s390x/meson.build if CONFIG_VFIO_AP is false, it will use the stub file. Signed-off-by: Rorie Reyes Reviewed-by: Anthony Krowiak Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20250609164418.17585-5-rreyes@linu= x.ibm.com Signed-off-by: C=C3=A9dric Le Goater --- MAINTAINERS | 1 + hw/s390x/ap-stub.c | 21 +++++++++++++++++++++ target/s390x/ioinst.c | 11 +++++++++-- hw/s390x/meson.build | 1 + 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 hw/s390x/ap-stub.c diff --git a/MAINTAINERS b/MAINTAINERS index aa6763077ea87af0d527319f1cb13e4468b1f299..1e84bfeaeec7f9e5cecb7dd083a= ff52bc61fe884 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -112,6 +112,7 @@ F: hw/intc/s390_flic.c F: hw/intc/s390_flic_kvm.c F: hw/s390x/ F: hw/vfio/ap.c +F: hw/s390x/ap-stub.c F: hw/vfio/ccw.c F: hw/watchdog/wdt_diag288.c F: include/hw/s390x/ diff --git a/hw/s390x/ap-stub.c b/hw/s390x/ap-stub.c new file mode 100644 index 0000000000000000000000000000000000000000..001fe5f8b015e05e6e06a9c3797= d54d6718f7716 --- /dev/null +++ b/hw/s390x/ap-stub.c @@ -0,0 +1,21 @@ +/* + * VFIO based AP matrix device assignment + * + * Copyright 2025 IBM Corp. + * Author(s): Rorie Reyes + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/s390x/ap-bridge.h" + +int ap_chsc_sei_nt0_get_event(void *res) +{ + return EVENT_INFORMATION_NOT_STORED; +} + +bool ap_chsc_sei_nt0_have_event(void) +{ + return false; +} diff --git a/target/s390x/ioinst.c b/target/s390x/ioinst.c index fe62ba5b06bd8a92101ee8ed010a5fc655c26223..2320dd4c1224e6e4a9396e23f06= cc7cf4ffb358d 100644 --- a/target/s390x/ioinst.c +++ b/target/s390x/ioinst.c @@ -18,6 +18,7 @@ #include "trace.h" #include "hw/s390x/s390-pci-bus.h" #include "target/s390x/kvm/pv.h" +#include "hw/s390x/ap-bridge.h" =20 /* All I/O instructions but chsc use the s format */ static uint64_t get_address_from_regs(CPUS390XState *env, uint32_t ipb, @@ -574,13 +575,19 @@ out: =20 static int chsc_sei_nt0_get_event(void *res) { - /* no events yet */ + if (s390_has_feat(S390_FEAT_AP)) { + return ap_chsc_sei_nt0_get_event(res); + } + return 1; } =20 static int chsc_sei_nt0_have_event(void) { - /* no events yet */ + if (s390_has_feat(S390_FEAT_AP)) { + return ap_chsc_sei_nt0_have_event(); + } + return 0; } =20 diff --git a/hw/s390x/meson.build b/hw/s390x/meson.build index 3bbebfd817dfaadd55ee8d669be000aee8d5d517..99cbcbd7d633c1379be484d01f2= 96f7c7c7b8a2f 100644 --- a/hw/s390x/meson.build +++ b/hw/s390x/meson.build @@ -33,6 +33,7 @@ s390x_ss.add(when: 'CONFIG_S390_CCW_VIRTIO', if_true: fil= es( )) s390x_ss.add(when: 'CONFIG_TERMINAL3270', if_true: files('3270-ccw.c')) s390x_ss.add(when: 'CONFIG_VFIO', if_true: files('s390-pci-vfio.c')) +s390x_ss.add(when: 'CONFIG_VFIO_AP', if_false: files('ap-stub.c')) =20 virtio_ss =3D ss.source_set() virtio_ss.add(files('virtio-ccw.c')) --=20 2.49.0