From nobody Fri Nov 7 10:14:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548152845390711.7487369218057; Tue, 22 Jan 2019 02:27:25 -0800 (PST) Received: from localhost ([127.0.0.1]:42385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gltHA-0004Sm-4E for importer@patchew.org; Tue, 22 Jan 2019 05:27:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glsZ2-0001M7-7p for qemu-devel@nongnu.org; Tue, 22 Jan 2019 04:41:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glsZ1-0003cH-GS for qemu-devel@nongnu.org; Tue, 22 Jan 2019 04:41:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53746) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1glsZ1-0003bi-AB; Tue, 22 Jan 2019 04:41:47 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FA5C89ACB; Tue, 22 Jan 2019 09:41:46 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-215.ams2.redhat.com [10.36.117.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id B63D11A7EA; Tue, 22 Jan 2019 09:41:44 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2019 10:41:43 +0100 Message-Id: <20190122094143.8857-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 22 Jan 2019 09:41:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1] s390x/pci: Warn when adding PCI devices without the 'zpci' feature X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Collin Walling , Christian Borntraeger , qemu-s390x@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We decided to always create the PCI host bridge, even if 'zpci' is not enabled (due to migration compatibility). This however right now allows to add zPCI/PCI devices to a VM although the guest will never actually see them, confusing people that are using a simple CPU model that has no 'zpci' enabled - "Why isn't this working" (David Hildenbrand) Let's check for 'zpci' and at least print a warning that this will not work as expected. We could also bail out, however that might break existing QEMU commandlines. Signed-off-by: David Hildenbrand Reviewed-by: Thomas Huth --- hw/s390x/s390-pci-bus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index b86a8bdcd4..e7d4f49611 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -863,6 +863,11 @@ static void s390_pcihost_pre_plug(HotplugHandler *hotp= lug_dev, DeviceState *dev, { S390pciState *s =3D S390_PCI_HOST_BRIDGE(hotplug_dev); =20 + if (!s390_has_feat(S390_FEAT_ZPCI)) { + warn_report("Adding PCI or zPCI devices without the 'zpci' CPU fea= ture." + " The guest will not be able to see/use these devices.= "); + } + if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { PCIDevice *pdev =3D PCI_DEVICE(dev); =20 --=20 2.17.2