From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408711; cv=none; d=zohomail.com; s=zohoarc; b=OHkPyfm7K5ZyRFp9T728gMT2/QeOR5zwAl0IHURFXUvPSpFQZewjUzWN2ND25/i43jkqVAs7gzngAkSByDpSwumuPQ6GqaFlO5+wK1b4jc7bg7QFvaSRwfVlVQZWFOM9+p2/HVYbdChL1WvhZvDjZ011e7ETAT8M0MFaK0LzHnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408711; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+z9Tw3dIc5g4KFljaVdyXYNPXxeEiGC7ErcCHnIjeRk=; b=hC+Xoi5eN1XZvlPJ4tXTusV5t5odDq/kAxQUu4Db2rUv7GuvriAqZRCWNEsI0nF1PLvvDZTaj+DE6mFaLAhTqxBGRPMe5YS2xcWb+4j9iQvt6sbXk7DfPVaxX+A+rTUTaP9a978gxMMkWYlhxyPmAKZ65SEw8yRynctzH/QOXhU= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408711203302.7276051467992; Tue, 25 Apr 2023 00:45:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDM9-00063N-9T; Tue, 25 Apr 2023 03:44:57 -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 1prDM7-000634-At for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:44:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDM5-0006Ov-ON for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:44:55 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-526-shX2rB6SP4ymR98-KZyRQg-1; Tue, 25 Apr 2023 03:44:51 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f18c2b2110so18678665e9.3 for ; Tue, 25 Apr 2023 00:44:51 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id eo9-20020a05600c82c900b003f0ad8d1c69sm11164816wmb.25.2023.04.25.00.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408693; 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=+z9Tw3dIc5g4KFljaVdyXYNPXxeEiGC7ErcCHnIjeRk=; b=Jxtm+2Eti2N58twL5/XqyKrMdpMrnTae0qRTJb3ntq8Bm7C3E/OYoahNySC1+D//paoZ1u a2lrQiolt9rO0ozDVxRdf7ZxuGvidWXsL81Ll0M/ZQc3FzXDrPWFjekZosrCNDPKqXBdKH +tO7D+d1Si9cuYh7/yaeaWrdS0DAvr0= X-MC-Unique: shX2rB6SP4ymR98-KZyRQg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408689; x=1685000689; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+z9Tw3dIc5g4KFljaVdyXYNPXxeEiGC7ErcCHnIjeRk=; b=ZhW68cJ2w8XTd7pc+3QtwTRn1pyJmjXNI96S9E/m4cU5J70bCDmEqTvjfrtkB1Mzs3 dGPW6egih81+enEMvg4RT2hbPWv9HMJJPsRYTlUNuqAUUDgrWxtxiKIHwwVEK1ZYVE57 RTy/G9Tn2Z4OjQV2z3QcYjS2yxOGMAfU6hUMzUjnVtde7c56S3tQsEAdWFWkihFOdzXp 0bfNihKJ8jSTFiqOoLlhjJKfYUernV1mUAB1seQhdvnd0/eWQP3zYWAUHiierSnLZyu2 sgH7FxnGAh99ZrUclfhK3DjEZM14ui3Cr7hcHs1S99beO8ZXr70942S0UiF8z0fMBQNL 332g== X-Gm-Message-State: AAQBX9fdQ4gFa84TYL77dG6jrpSierSNdnPwCDn+JIyqcTPoldn5Lm6t h//yeKC8U1Nuj1mWS/Wh82muso02vF+Y/eBqEwpXMRaFX4dh4b8g8PRlS0Rm52+W3bYDzAoFfv1 JuyElKjaCIhg73niFFNRpLiMFMW24C2BI3o1RrffwkY6AlyEiaRKp6If2ib8VkE1D6RG4 X-Received: by 2002:a7b:ce15:0:b0:3f1:7278:66e0 with SMTP id m21-20020a7bce15000000b003f1727866e0mr9427496wmc.30.1682408689104; Tue, 25 Apr 2023 00:44:49 -0700 (PDT) X-Google-Smtp-Source: AKy350aNmo8ZiUVf51jkPyfp6pI8P+IUL/jDoj9V6L0mujsQD9rU9ZWUiiPLqG4Ix1eSI/R5uWLaLw== X-Received: by 2002:a7b:ce15:0:b0:3f1:7278:66e0 with SMTP id m21-20020a7bce15000000b003f1727866e0mr9427465wmc.30.1682408688733; Tue, 25 Apr 2023 00:44:48 -0700 (PDT) Date: Tue, 25 Apr 2023 03:44:45 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Carlos =?utf-8?B?TMOzcGV6?= , Cornelia Huck , Halil Pasic , Eric Farman , Richard Henderson , David Hildenbrand , Ilya Leoshkevich , Christian Borntraeger , Thomas Huth , qemu-s390x@nongnu.org Subject: [PULL 01/31] virtio: refresh vring region cache after updating a virtqueue size Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408712884100003 From: Carlos L=C3=B3pez When a virtqueue size is changed by the guest via virtio_queue_set_num(), its region cache is not automatically updated. If the size was increased, this could lead to accessing the cache out of bounds. For example, in vring_get_used_event(): static inline uint16_t vring_get_used_event(VirtQueue *vq) { return vring_avail_ring(vq, vq->vring.num); } static inline uint16_t vring_avail_ring(VirtQueue *vq, int i) { VRingMemoryRegionCaches *caches =3D vring_get_region_caches(vq); hwaddr pa =3D offsetof(VRingAvail, ring[i]); if (!caches) { return 0; } return virtio_lduw_phys_cached(vq->vdev, &caches->avail, pa); } vq->vring.num will be greater than caches->avail.len, which will trigger a failed assertion down the call path of virtio_lduw_phys_cached(). Fix this by calling virtio_init_region_cache() after virtio_queue_set_num() if we are not already calling virtio_queue_set_rings(). In the legacy path this is already done by virtio_queue_update_rings(). Signed-off-by: Carlos L=C3=B3pez Message-Id: <20230317002749.27379-1-clopez@suse.de> Reviewed-by: Cornelia Huck Acked-by: Halil Pasic Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio.h | 1 + hw/s390x/virtio-ccw.c | 1 + hw/virtio/virtio-mmio.c | 1 + hw/virtio/virtio-pci.c | 1 + hw/virtio/virtio.c | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index f236e94ca6..f6b38f7e9c 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -309,6 +309,7 @@ int virtio_get_num_queues(VirtIODevice *vdev); void virtio_queue_set_rings(VirtIODevice *vdev, int n, hwaddr desc, hwaddr avail, hwaddr used); void virtio_queue_update_rings(VirtIODevice *vdev, int n); +void virtio_init_region_cache(VirtIODevice *vdev, int n); void virtio_queue_set_align(VirtIODevice *vdev, int n, int align); void virtio_queue_notify(VirtIODevice *vdev, int n); uint16_t virtio_queue_vector(VirtIODevice *vdev, int n); diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index e33e5207ab..f44de1a8c1 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -237,6 +237,7 @@ static int virtio_ccw_set_vqs(SubchDev *sch, VqInfoBloc= k *info, return -EINVAL; } virtio_queue_set_num(vdev, index, num); + virtio_init_region_cache(vdev, index); } else if (virtio_queue_get_num(vdev, index) > num) { /* Fail if we don't have a big enough queue. */ return -EINVAL; diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 23ba625eb6..c2c6d85475 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -354,6 +354,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offs= et, uint64_t value, if (proxy->legacy) { virtio_queue_update_rings(vdev, vdev->queue_sel); } else { + virtio_init_region_cache(vdev, vdev->queue_sel); proxy->vqs[vdev->queue_sel].num =3D value; } break; diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 247325c193..02fb84a8fa 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1554,6 +1554,7 @@ static void virtio_pci_common_write(void *opaque, hwa= ddr addr, proxy->vqs[vdev->queue_sel].num =3D val; virtio_queue_set_num(vdev, vdev->queue_sel, proxy->vqs[vdev->queue_sel].num); + virtio_init_region_cache(vdev, vdev->queue_sel); break; case VIRTIO_PCI_COMMON_Q_MSIX: vector =3D virtio_queue_vector(vdev, vdev->queue_sel); diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 98c4819fcc..272d930721 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -226,7 +226,7 @@ static void virtio_virtqueue_reset_region_cache(struct = VirtQueue *vq) } } =20 -static void virtio_init_region_cache(VirtIODevice *vdev, int n) +void virtio_init_region_cache(VirtIODevice *vdev, int n) { VirtQueue *vq =3D &vdev->vq[n]; VRingMemoryRegionCaches *old =3D vq->vring.caches; --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682409028; cv=none; d=zohomail.com; s=zohoarc; b=S/in6QyIYBhvq2qn0MwacnSfTiEHWrVE/GUmSnhT7gRmixU9yvqa5/gBYhkzYTIsMrFJdCY8wjmUEp8GGERDMfzljOpto4nQEsy+i+4N9N4v3keMucGokDltYICOwvCWc7QyWhI9PlBrNv3ASPWiG7liWh1mTS1mH0tB3HaeUwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682409028; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OMY9Rqubse38jh9eUiatf0essJZ5elEWamJ6/9NiODg=; b=KVbPL9wFQl+z2ghdfUDTBLzyueMxem71zXycD919TQIP2hB16OMycZBibUWj7QqSi2ms8JVsE6Xtd9gtkTKZboSz8HJwE+7qW6RMXxws0uw72I7bzrg7JEPq/jbA3gV3vwxhuB8KCQMs8c18Pfo7hhmN31do3OLy+HwtLRCD1wI= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682409028141261.4215920087173; Tue, 25 Apr 2023 00:50:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMm-00079V-Ev; Tue, 25 Apr 2023 03:45:36 -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 1prDMR-0006Nt-T5 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDMA-0006PE-QC for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:15 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-fNL9twZYNTeK4zKBmLhvnA-1; Tue, 25 Apr 2023 03:44:56 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-2ff4bc7a770so2897765f8f.3 for ; Tue, 25 Apr 2023 00:44:56 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id m4-20020adffa04000000b002fe96f0b3acsm12405845wrr.63.2023.04.25.00.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408697; 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: in-reply-to:in-reply-to:references:references; bh=OMY9Rqubse38jh9eUiatf0essJZ5elEWamJ6/9NiODg=; b=eHBVW5BYmjvEiP9ejGOy/CsliCK6QsRRUNmJwFCncDU4FOiQYd9xq/2M+tzR4FYiWGycBR Nn2FzOTz5hqiThBc13P4GIf6LHTDynvFVsTSHStgvHVOKU1ZcbYF+Ph8D7MBwSF6k5z7cQ R5/Q2S1Epm5excn2ifQVmYe3aQiZ6vI= X-MC-Unique: fNL9twZYNTeK4zKBmLhvnA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408693; x=1685000693; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OMY9Rqubse38jh9eUiatf0essJZ5elEWamJ6/9NiODg=; b=K0c/yTGQx6zZyULtj2kshoUSMOfD1GsojqQJM2wETZh6Vd429Lu17dq6uot2cdR2TT dqRQSF+HwM7l9mCoineL6H3TBwiP3psLSg3tL28/GbOcoYpCMhPlYvXQdXQdDaiJCG4T lCkxsCzbHfxdmTpk1L8tEk9EjzKzz+gpmYwELNYyGZhs7pjLGD5R608W34Md4YgvMl7c kIwwnWgklHAQHqzkdMEqzOvMWXhUEhS7CCF/GScPIrK2zNxcBeNlss2hyOIC5fuU0V21 ZaQMQ9j6gSR3wJZZ7KdjO0Yqw4RyRGHeKdkox5z0YN0CDg+nAZmKSGRn4PLvXVxO9Xc1 8ZzA== X-Gm-Message-State: AAQBX9f8fwi28Da3PmNxb6KmM/sx3E/fq9ugORcOln6HZCw1u8Jyl1wP 05NA0RCd0RgJ1gRE7hWY4mxw++j3an2Wj7g2UPUQR+jWuXt28IgwR/9pJTXFv4fBnr5o7MLf3vI dcj/pNdYjQTU5WxxLpulbu+L7W7MrSN+6OxZJkoNJ1V7nkcLg+dsXr4tC46Enrw1JrnRp X-Received: by 2002:a5d:6b46:0:b0:2db:11f3:f7ee with SMTP id x6-20020a5d6b46000000b002db11f3f7eemr10863465wrw.63.1682408692778; Tue, 25 Apr 2023 00:44:52 -0700 (PDT) X-Google-Smtp-Source: AKy350ZpfmzYntfQkex2fp0LhjnuOn7ppngb57mMkb17QNhmRTmvExznJfVneIKY8RuW/whgVVHNWw== X-Received: by 2002:a5d:6b46:0:b0:2db:11f3:f7ee with SMTP id x6-20020a5d6b46000000b002db11f3f7eemr10863446wrw.63.1682408692462; Tue, 25 Apr 2023 00:44:52 -0700 (PDT) Date: Tue, 25 Apr 2023 03:44:49 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Ani Sinha , Ani Sinha Subject: [PULL 02/31] Add my old and new work email mapping and use work email to support biosbits Message-ID: <607a079b29a896b3752ef8a14d746765473c07bf.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1682409028358100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ani Sinha Update mailmap to indicate ani@anisinha.ca and anisinha@redhat.com are one = and the same person. Additionally update MAINTAINERS and bits documentation to = use my work (redhat) email. Signed-off-by: Ani Sinha Message-Id: <20230320114233.90638-1-anisinha@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- .mailmap | 1 + MAINTAINERS | 2 +- docs/devel/acpi-bits.rst | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 7677047950..bbe6d3fd69 100644 --- a/.mailmap +++ b/.mailmap @@ -54,6 +54,7 @@ Aleksandar Markovic Aleksandar Rikalo Aleksandar Rikalo Alexander Graf +Ani Sinha Anthony Liguori Anthony Liguori Christian Borntraeger Damien Hedde diff --git a/MAINTAINERS b/MAINTAINERS index 2c2068ea5c..0bd3d1830e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1931,7 +1931,7 @@ F: hw/acpi/viot.c F: hw/acpi/viot.h =20 ACPI/AVOCADO/BIOSBITS -M: Ani Sinha +M: Ani Sinha M: Michael S. Tsirkin S: Supported F: tests/avocado/acpi-bits/* diff --git a/docs/devel/acpi-bits.rst b/docs/devel/acpi-bits.rst index 9eb4b9e666..22e2580200 100644 --- a/docs/devel/acpi-bits.rst +++ b/docs/devel/acpi-bits.rst @@ -135,7 +135,7 @@ Under ``tests/avocado/`` as the root we have: (c) They need not be loaded by avocado framework when running tests. =20 =20 -Author: Ani Sinha +Author: Ani Sinha =20 References: ----------- --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408795; cv=none; d=zohomail.com; s=zohoarc; b=CLTpSP8K33QFXFsYkRs9YDOivsTTo9n1WkCvQjaqUngihuXWikQ/mGwUifyG+WM7R3dv4U3QeSYQyH8hk37wrCW7obSVPW2GEiCS6KADO5VHUTxbY29kbM+4Df6fz12Ff4np+6MRsLnF4WegD2U/XPZX/Z2RsbwczR2gp4XE0pE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408795; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p204nU6e9RAXfoO9ghJizRo/OYq7RM/x1C2g9Tz5bYw=; b=bjsHU73Ud7S0wvHJwsKsY3jL7KgTwAvWaKAMO0O1yvELJgE8YQ9zgabhWQH6y1QFNpEfLhjYguoJo7APeLd1w2gjb9t+14ZrCwTgM5U9iwTZqb2uPGpCw6qk7fFbItzSURUmgDqDVVr1egQh7TKncWwIHNaKz+uP2LdYvIjip/4= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408795647595.3884296482638; Tue, 25 Apr 2023 00:46:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDML-0006ER-Un; Tue, 25 Apr 2023 03:45:10 -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 1prDMJ-0006Dh-VX for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:07 -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 1prDME-0006Pb-DH for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:05 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-RucyNdbTNDCy0hH6v65VFA-1; Tue, 25 Apr 2023 03:45:00 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f175a24fd1so29720325e9.1 for ; Tue, 25 Apr 2023 00:44:59 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id f22-20020a1c6a16000000b003f17e79d74asm14277648wmc.7.2023.04.25.00.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408701; 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=p204nU6e9RAXfoO9ghJizRo/OYq7RM/x1C2g9Tz5bYw=; b=Vsq3+DGqIb6RVHhlnFG+v6DBpVSKTtbYndnOeFMmQn7le1VTbkr0tYK8SldiwR56YEkPN2 /Gqyo4H+cirdXDf0iD1FJnhFsKV++JJ8pkQmqLLjhwoIO8wbbb/SaJkoz0LS6/mk56qOSU NIilPn+0NnKxHoJqd8YaXgs2L4AQWbk= X-MC-Unique: RucyNdbTNDCy0hH6v65VFA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408697; x=1685000697; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=p204nU6e9RAXfoO9ghJizRo/OYq7RM/x1C2g9Tz5bYw=; b=gY36jefDIoRhDgB72bNwPNUe2yOTQ9Tk8sjqT2iWJ3KezPaCwHpUUA9yHZZZuM7w1a VjYwvioHA1mhK2xuss+rAT7Mqxff+X1vM+xgKz5d+UUvNtmYYLORxjcH4oc9ID7Hwchf OKhXShMcqkMElN5H5vZWdpOkPYRDoMb1kKTITtWmOPOrcWNj6ZH8gITmGvc/9eu6H9Zh KjqgxIpRZJlsHiiupiLQJKEaw2TZjQwWcCs/NxXjokC9G4Wjiti0PHTJQeg+FQMIroaO lxYz6Bg5Y1nowLd5daB6GHh61pwE3iDOuAQyiheWNGsXiBZSxOn9VnAM4D3D02a8kakV YdyA== X-Gm-Message-State: AAQBX9cmUT/3KwOfcpv+LziX0m6DUvQ4QBzZpJMgBQAF9gsJVHk4QAtP rRrKy59HI0NLkQ5CcTJCNyxORenhQ+nsoDeIsQJomc4iiQ/NmAsJ3pjn+OYpktH2QsgES589h6E kdom3pdXeJlEvdTUUwaz9ZAeC6MM1v+90mtVLz6rEbmVrEh3p9Por8PKMfc4+mmBQk0+b X-Received: by 2002:a7b:c045:0:b0:3f1:662a:93c4 with SMTP id u5-20020a7bc045000000b003f1662a93c4mr10017947wmc.36.1682408697647; Tue, 25 Apr 2023 00:44:57 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5jRGEPhZnNWIYvTqyMuB8QwyKRaYg7BgL5V+IrYknN9K7EdEd3yyGtcj9TFXEwfz6LL0PIw== X-Received: by 2002:a7b:c045:0:b0:3f1:662a:93c4 with SMTP id u5-20020a7bc045000000b003f1662a93c4mr10017921wmc.36.1682408697248; Tue, 25 Apr 2023 00:44:57 -0700 (PDT) Date: Tue, 25 Apr 2023 03:44:52 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Alvaro Karsz , Jason Wang Subject: [PULL 03/31] vdpa: accept VIRTIO_NET_F_SPEED_DUPLEX in SVQ Message-ID: <0d74e2b785ed0391316479ccf97c8f1ad5966145.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408796490100002 From: Eugenio P=C3=A9rez There is no reason to block it as it has nothing to do with the vrings. All the support of the feature comes via config space. Signed-off-by: Eugenio P=C3=A9rez Suggested-by: Alvaro Karsz Message-Id: <20230307170018.260557-1-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 99904a0da7..37cdc84562 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -104,7 +104,8 @@ static const uint64_t vdpa_svq_device_features =3D /* VHOST_F_LOG_ALL is exposed by SVQ */ BIT_ULL(VHOST_F_LOG_ALL) | BIT_ULL(VIRTIO_NET_F_RSC_EXT) | - BIT_ULL(VIRTIO_NET_F_STANDBY); + BIT_ULL(VIRTIO_NET_F_STANDBY) | + BIT_ULL(VIRTIO_NET_F_SPEED_DUPLEX); =20 #define VHOST_VDPA_NET_CVQ_ASID 1 =20 --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408757; cv=none; d=zohomail.com; s=zohoarc; b=GAWHYmQUYdZuji6cLOdBCLg12woHMVF2jniJSkpJps53sETALK7I5/W4XqxCqFEy+0K6U2rkstn8e+ISJ4NZWD/zDak9SZp36awZfYg+WnMlPAOcg/xo6ZHRtv3FuD/4UhkKzyWwffROZIoeW6xLhjw7zDnVpiIu7hRuSzHaH70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408757; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=I98COpuRyuDepoEDhzUAJr/XMAii4g+6LaebKT+b88s=; b=VjLp72bdD1JeE6MxB9+W9bDYWLLpaTTegMWwyvU0YrPp2djEAq2nAvmQxHaOtDklsXoe1hpSN4LAe9zqkxWt/18pkO28wiHAB9E5FoE5UcMQdTKv++UDGnKhEC7qHL5JlwbVOqbbqnKWr9Hfsomr9LUnjPbyyxSdu72NBamOfGo= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408757579635.6620250387039; Tue, 25 Apr 2023 00:45:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMf-0006Xn-OK; Tue, 25 Apr 2023 03:45:31 -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 1prDMM-0006Ev-4H for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDMI-0006aP-DO for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:09 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-gvbjDvTuMTS9wk3F6BP4nA-1; Tue, 25 Apr 2023 03:45:04 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f173bd0d1bso33753805e9.3 for ; Tue, 25 Apr 2023 00:45:03 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id t12-20020a5d460c000000b002f6962ee703sm12443193wrq.61.2023.04.25.00.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408705; 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=I98COpuRyuDepoEDhzUAJr/XMAii4g+6LaebKT+b88s=; b=E10k9JEW5bNtEhHaiOFSWkMkhN42XPxwilz7eZXk+bBy88jsZDWqKm5AcDT/4BcRVzuNEj sAtgJhnwDnNRK3diUB/7rSG2h+O2RrDtX3UZJa+G8EHQHal5VU0kQsGUdKyQMaluyVa5xC J5zsCAyBwIF1TBlIkjiAa0DxqDAsru8= X-MC-Unique: gvbjDvTuMTS9wk3F6BP4nA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408701; x=1685000701; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=I98COpuRyuDepoEDhzUAJr/XMAii4g+6LaebKT+b88s=; b=bvzIPFmKCC5U6RxetjO9CXierJT6BPP10MdiZSpv6VMQCcaOEVEXFbbzedh3Kra07R ZGzTLVfDs81xYGrDXZ9uI/n31cAREK3se6/Fau61cFTRkLj+f87X6CON1gj5z35Z3aA6 rJHqblI3QFCS5r49fHx4cNZpQ3RE588RovwOzaW4CDW1W+GhfwxAjg7gnvaOPYEo4Ns6 1P3ASE1TWcv3j3Ss7jwZ6dVLfoHlRXU1Wtl6BWA9bLtiQu8EzJnBYJG4szSP2i2tLUBy s00c4WFN1pTpDWIqX5vK1538ZYefv/uOn/0hTki0PzOPdG8bCIndMuxlV5gxGHCpGQJa 5kmg== X-Gm-Message-State: AAQBX9cgcD1WL0T+acUhFKMRveyloubrIDtD0HLY8E5uyKe00ISMDTVG kbKRuXss1bDtRQMOzE0qRbChgXwvANZhb9EKRHohkcqTOMpodauuzYslpuZE9zbORhaZ5adXJG1 3FYNAtOgv9vu/8m8s0jN9qYXfEVGh8+7ln4DDs8YW5gHlG+CpXxQVuecdx/ym/Pnhn0pX X-Received: by 2002:adf:facb:0:b0:2f2:e638:1767 with SMTP id a11-20020adffacb000000b002f2e6381767mr10971763wrs.39.1682408701598; Tue, 25 Apr 2023 00:45:01 -0700 (PDT) X-Google-Smtp-Source: AKy350afWR0EXJoLrlaFKej6cConBleBYYVU/VThTfTh0KW5n9ByraUjMwxNQYEEBzgTZCPG+xupHw== X-Received: by 2002:adf:facb:0:b0:2f2:e638:1767 with SMTP id a11-20020adffacb000000b002f2e6381767mr10971735wrs.39.1682408701214; Tue, 25 Apr 2023 00:45:01 -0700 (PDT) Date: Tue, 25 Apr 2023 03:44:57 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Subject: [PULL 04/31] meson_options.txt: Enable qom-cast-debug by default again Message-ID: <0f220121a47fd1c8273eb3a4a67425c608307117.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408759098100004 From: Thomas Huth This switch had been disabled by default by accident in commit c55cf6ab03f. But we should enable it by default instead to avoid regressions in the QOM device hierarchy. Fixes: c55cf6ab03 ("configure, meson: move some default-disabled options to= meson_options.txt") Signed-off-by: Thomas Huth Message-Id: <20230417130037.236747-3-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Peter Maydell Reported-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- meson_options.txt | 2 +- scripts/meson-buildoptions.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index fc9447d267..2471dd02da 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -315,7 +315,7 @@ option('debug_mutex', type: 'boolean', value: false, description: 'mutex debugging support') option('debug_stack_usage', type: 'boolean', value: false, description: 'measure coroutine stack usage') -option('qom_cast_debug', type: 'boolean', value: false, +option('qom_cast_debug', type: 'boolean', value: true, description: 'cast debugging support') option('gprof', type: 'boolean', value: false, description: 'QEMU profiling with gprof', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 009fab1515..d4369a3ad8 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -14,6 +14,7 @@ meson_options_help() { printf "%s\n" ' use idef-parser to automatical= ly generate TCG' printf "%s\n" ' code for the Hexagon frontend' printf "%s\n" ' --disable-install-blobs install provided firmware blob= s' + printf "%s\n" ' --disable-qom-cast-debug cast debugging support' printf "%s\n" ' --docdir=3DVALUE Base directory for documenta= tion installation' printf "%s\n" ' (can be empty) [share/doc]' printf "%s\n" ' --enable-block-drv-whitelist-in-tools' @@ -35,7 +36,6 @@ meson_options_help() { printf "%s\n" ' --enable-module-upgrades try to load modules from alter= nate paths for' printf "%s\n" ' upgrades' printf "%s\n" ' --enable-profiler profiler support' - printf "%s\n" ' --enable-qom-cast-debug cast debugging support' printf "%s\n" ' --enable-rng-none dummy RNG, avoid using /dev/(u= )random and' printf "%s\n" ' getrandom()' printf "%s\n" ' --enable-strip Strip targets on install' --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408743; cv=none; d=zohomail.com; s=zohoarc; b=WzACXtyn4NPl2FbEJLVBevupxt73x3GtF8W73lu7csak8itAUjbCN8jzSJRrW86+ZWujzQUKDXRsh5NMOeovDEett+Vh/nDJMo8aUd3VyO5yla59W9NXQewjoygw8R8aCI3Yjw+rx0fYYjfFsPvxUrYnbyXfJFwMJiZYUZGhtNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408743; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oqT5dEfAVqgbT8QGYta7E3XoDIDCT9JGPTtaSzwWys0=; b=Dlt9qhBLFM7f+ayrktF9NgjgBdG4NqneAQCjwXL0VM2JRSyvXY8n4bb58qt00g/3wyEss3R/Pxcu/LMirTKspJwUFjpBVGlUsSbR8cNowrTUSiLwsccgUQDQRuJYWpW4G+2KHMVKZuL7TMNklB8ad7QNAFC86mamgAg0rO5Q180= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408743977791.1197707239461; Tue, 25 Apr 2023 00:45:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMS-0006Kq-BW; Tue, 25 Apr 2023 03:45:18 -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 1prDMN-0006HS-D4 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:11 -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 1prDML-0006bW-R8 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:11 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-577-IyFYZdAaOYWlpx11G1uK9w-1; Tue, 25 Apr 2023 03:45:07 -0400 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-2fbb99cb303so1927018f8f.1 for ; Tue, 25 Apr 2023 00:45:07 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id v17-20020a5d43d1000000b003047ea78b42sm3069194wrr.43.2023.04.25.00.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408709; 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=oqT5dEfAVqgbT8QGYta7E3XoDIDCT9JGPTtaSzwWys0=; b=fIX1ioePIq8ihtXBG5Rp77It51oqLUxmomRacgGyEPs2HmoqMFxVVr0HzaiHSJTY9hNTZF JvYnlx4B97w3miMebVyfw6l5Al8awiDR1sX1kIvnXqaj+dreQuFQcgOF57NCZ0NAb69bhA gbl25mNgBLi4yP3I/llRo3VRC9sLD/Y= X-MC-Unique: IyFYZdAaOYWlpx11G1uK9w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408705; x=1685000705; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oqT5dEfAVqgbT8QGYta7E3XoDIDCT9JGPTtaSzwWys0=; b=TeEsL5fK2TASBaQHtflGRObCZ62oUD6/4rY2MFp/IGu6Cg687skjpieec6rseDJR3r o5A5YqtGDWlIw11Rl1hj8LOzuRY1dlsNqkqJkYrtGeS/T8k498W5HdyxbS1B7esDl1Hf FidvIBrbx04kb7KllxXjOqSjifuvgsJEaOfa4Z9zN40fIJ7tNQ+GksejNgO2tApVAPJ5 UADtsGvk2e2vNnO4Rb4VQsUZeYUHBkyvpnEdZ13PfbnRN2yIfMTz6M3SUmbSL7InIl8V OEXIzrOwo9zws0kqTtFST0Mra8pj96dURUNhdRy05TvHd6dAMzrFSSD/omPO3tct5FaC IzUg== X-Gm-Message-State: AAQBX9co4wf7LodQNzvRYkv/lCWTQmuTEe2OuQRr2ZioBYVz9pzuA7/8 QV9Tp7nIKqsTXVegnfK7J4wNCakhWRWmX5HYGsDQK79zKopKgcOfdqxBTwIGT6qGTtrjTPQeYjj TVCCyLQC9JijMSqVv1ZibIX/vLYH3GpM7cXjiq7Toll8FTsodBCqnV55gbAqfZkp4xxJS X-Received: by 2002:adf:ec41:0:b0:2fb:599b:181e with SMTP id w1-20020adfec41000000b002fb599b181emr9475051wrn.63.1682408705336; Tue, 25 Apr 2023 00:45:05 -0700 (PDT) X-Google-Smtp-Source: AKy350ZrD6cBr+VMJ+rK4vmTj0BxR2+idXyagIya0lE1sewPKU+pWlQBAqtfVCb6wQnN7cskrhU6rQ== X-Received: by 2002:adf:ec41:0:b0:2fb:599b:181e with SMTP id w1-20020adfec41000000b002fb599b181emr9475030wrn.63.1682408705048; Tue, 25 Apr 2023 00:45:05 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:01 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Xu , Richard Henderson , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Jason Wang Subject: [PULL 05/31] vhost: Drop unused eventfd_add|del hooks Message-ID: <560a997535937df2ea3716ba56bcbe38be37682f.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408745413100004 From: Peter Xu These hooks were introduced in: 80a1ea3748 ("memory: move ioeventfd ops to MemoryListener", 2012-02-29) But they seem to be never used. Drop them. Cc: Richard Henderson Signed-off-by: Peter Xu Message-Id: <20230306193209.516011-1-peterx@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index a266396576..746d130c74 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1291,18 +1291,6 @@ void vhost_virtqueue_stop(struct vhost_dev *dev, 0, virtio_queue_get_desc_size(vdev, idx)); } =20 -static void vhost_eventfd_add(MemoryListener *listener, - MemoryRegionSection *section, - bool match_data, uint64_t data, EventNotifie= r *e) -{ -} - -static void vhost_eventfd_del(MemoryListener *listener, - MemoryRegionSection *section, - bool match_data, uint64_t data, EventNotifie= r *e) -{ -} - static int vhost_virtqueue_set_busyloop_timeout(struct vhost_dev *dev, int n, uint32_t timeout) { @@ -1457,8 +1445,6 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaq= ue, .log_sync =3D vhost_log_sync, .log_global_start =3D vhost_log_global_start, .log_global_stop =3D vhost_log_global_stop, - .eventfd_add =3D vhost_eventfd_add, - .eventfd_del =3D vhost_eventfd_del, .priority =3D 10 }; =20 --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408963; cv=none; d=zohomail.com; s=zohoarc; b=BjpUyvQMbebQJVg12uNK1qearAAUqDgo6tGGgJiLE0sLz2hdHQk8UEch0uSgx98BVOq1n3I/EqQvu8paaNNsC/slUIozU/snmb9GziAK1yOXeU+NX1RuiS3shnbTtUvW9xjfiLRJIglZH5m2KmKC9cp4NUMiMh7z645AngxzboE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408963; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7XpLwGyAuffmak/eTKXXpWJi44gue+ywAUu/QiqjzQo=; b=fcwTZ7wV1xoly4ir0StkCFkym53A0pCT+6zP+56O7eeyqAwHzqE0FDvvWs/zahioiMAftjkyZttrO97wYUq5JQ/kiA8U84POHt/teT2TjLoUQyY90pUUEh6zQydXEoW8jn0HbvrCLICEUqd2HOgvcrLKR7XDivCGIUBLfnFTrf0= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408963450140.7714546411936; Tue, 25 Apr 2023 00:49:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMd-0006V1-RZ; Tue, 25 Apr 2023 03:45:29 -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 1prDMQ-0006Ks-2a for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:14 -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 1prDMO-0006c9-AY for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:13 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-611-SH2i4_KRMpq1c5qcbfU5Fw-1; Tue, 25 Apr 2023 03:45:10 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f195c06507so51448885e9.1 for ; Tue, 25 Apr 2023 00:45:10 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id f22-20020a1c6a16000000b003f17e79d74asm14278190wmc.7.2023.04.25.00.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408711; 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=7XpLwGyAuffmak/eTKXXpWJi44gue+ywAUu/QiqjzQo=; b=FNz7bSgjOeUKc5eVafHGJ0K+2DCkjStRnbgMKQcHje8HVKnwJrqh/9AfjDuMpyustDVZQy QZc1yyd7fhZreJzwy/Tf+DeLdT6abPY+wMLdAbIQvY9gA4pHh9CJlDtHqSbntezP85MWM2 lwM2VbDYlx0lZe+NRcYl64pW2EImFqI= X-MC-Unique: SH2i4_KRMpq1c5qcbfU5Fw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408708; x=1685000708; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7XpLwGyAuffmak/eTKXXpWJi44gue+ywAUu/QiqjzQo=; b=DTEGNAPs9oTo+lW4NogqRrfg4i7JVSbD+LZ25GGCHQucKvp73CvY1GgDZ6VCZGyRlp GXZBh9gWYtoIpJSLx7RG7g6lxb+kqk25fhIY9orkfVTrSAHuhAUgNy01ucrIvI+LgsVY o2oojotZAibcVwAKOZNKQRr3h/cCMY2aR9xTRIRwTq4qLBy1RxyUtCklEwfxDiXnoroS IXO24Z42CinNzj0z5LgdWCZFiwq7jkppNCpnpvKNKV6s0VtTkZPZEUUWDIfrnQZsc43/ x2PgC1VHO38NUlGsCt/vEZyDdA4iLKOjsaMYHdyjINgiP/NgSn6K7Id5vHGDjGnxMCpj Z07w== X-Gm-Message-State: AAQBX9cwnStfc7pIKQ5Fe6OdPd2snuZwa+KlGTgsGQTcKDcHzZwXaYyp SRw3YKXN0gOF6inLaTwIF345j3tyKce4w6UEYiKRo0znEVpWo5qlqmKgpBd0TVWJAy0WUVIdNUJ JVLpo17OUSdZGtG+7L82gdcRo+1nYiJfmmJEObszXFVJFb5SC8AipzuFHIaiAZMUUJ0je X-Received: by 2002:a7b:cc15:0:b0:3f1:65cb:8156 with SMTP id f21-20020a7bcc15000000b003f165cb8156mr9786377wmh.0.1682408708616; Tue, 25 Apr 2023 00:45:08 -0700 (PDT) X-Google-Smtp-Source: AKy350b0ftLpcNmMZAotcWmhCi2AG3g1sGm/0QTnNWIGEyI04O318aNN9XkbMR4l9EWDFJl7Ar6Gkw== X-Received: by 2002:a7b:cc15:0:b0:3f1:65cb:8156 with SMTP id f21-20020a7bcc15000000b003f165cb8156mr9786349wmh.0.1682408708255; Tue, 25 Apr 2023 00:45:08 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:05 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Viresh Kumar , Stefan Hajnoczi , Alex =?utf-8?Q?Benn=C3=A9e?= Subject: [PULL 06/31] docs: vhost-user: Define memory region separately Message-ID: <17c67f6849551b2bbffb7a3a8b490b853df86129.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408964297100015 From: Viresh Kumar The same layout is defined twice, once in "single memory region description" and then in "memory regions description". Separate out details of memory region from these two and reuse the same definition later on. While at it, also rename "memory regions description" to "multiple memory regions description", to avoid potential confusion around similar names. And define single region before multiple ones. This is just a documentation optimization, the protocol remains the same. Signed-off-by: Viresh Kumar Message-Id: <7c3718e5eb99178b22696682ae73aca6df1899c7.1678351495.git.viresh= .kumar@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Reviewed-by: Alex Benn=C3=A9e --- docs/interop/vhost-user.rst | 39 +++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index 8a5924ea75..1720d68126 100644 --- a/docs/interop/vhost-user.rst +++ b/docs/interop/vhost-user.rst @@ -130,18 +130,8 @@ A vring address description Note that a ring address is an IOVA if ``VIRTIO_F_IOMMU_PLATFORM`` has been negotiated. Otherwise it is a user address. =20 -Memory regions description -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -+-------------+---------+---------+-----+---------+ -| num regions | padding | region0 | ... | region7 | -+-------------+---------+---------+-----+---------+ - -:num regions: a 32-bit number of regions - -:padding: 32-bit - -A region is: +Memory region description +^^^^^^^^^^^^^^^^^^^^^^^^^ =20 +---------------+------+--------------+-------------+ | guest address | size | user address | mmap offset | @@ -158,19 +148,26 @@ A region is: Single memory region description ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ =20 -+---------+---------------+------+--------------+-------------+ -| padding | guest address | size | user address | mmap offset | -+---------+---------------+------+--------------+-------------+ ++---------+--------+ +| padding | region | ++---------+--------+ =20 :padding: 64-bit =20 -:guest address: a 64-bit guest address of the region +A region is represented by Memory region description. =20 -:size: a 64-bit size +Multiple Memory regions description +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ =20 -:user address: a 64-bit user address ++-------------+---------+---------+-----+---------+ +| num regions | padding | region0 | ... | region7 | ++-------------+---------+---------+-----+---------+ =20 -:mmap offset: 64-bit offset where region starts in the mapped memory +:num regions: a 32-bit number of regions + +:padding: 32-bit + +A region is represented by Memory region description. =20 Log description ^^^^^^^^^^^^^^^ @@ -952,8 +949,8 @@ Front-end message types ``VHOST_USER_SET_MEM_TABLE`` :id: 5 :equivalent ioctl: ``VHOST_SET_MEM_TABLE`` - :request payload: memory regions description - :reply payload: (postcopy only) memory regions description + :request payload: multiple memory regions description + :reply payload: (postcopy only) multiple memory regions description =20 Sets the memory map regions on the back-end so it can translate the vring addresses. In the ancillary data there is an array of file --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408740; cv=none; d=zohomail.com; s=zohoarc; b=jE3aNr/OgYxI401yJGooHpkXuI0BHa7s+ATtyFq0/22zsP/mQHcbLlGvXsJWM0RqhhG0bdUumPYNVoPEnY24uvnt4ROBOJS2fOhfcrLlm3f2yPSDvRAMQ++vbEkUpy4enfRTL21v2obrsZxP/MWnwQ9gL66FVVNbp9PDGVYa+kU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408740; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5xPxndmu6u19FkD0GIHESUMsZqlnKGGs95IpGgfP/Ak=; b=ZJIMQjPOCMHJnCrhnlK8gypW/ShzgQDFmLUVm8c6JR2VoVoI8+OQJ6za8ab3/B1xc58dHBSesacQBR/fvV5lm7woyxZXSTanMREk8txrH6/Xfwn/OP5y9wAEqEIWFWr/FeyBe9u3e5p/A4Jan1TEFx+dXcqn2KE4fioyq/Jc51E= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408740580264.99611639518275; Tue, 25 Apr 2023 00:45:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMj-0006ny-SU; Tue, 25 Apr 2023 03:45:33 -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 1prDMW-0006Sd-4O for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDMU-0006cz-Fd for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:19 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-396-m4pUveJqP9a4KgS9pAAdKQ-1; Tue, 25 Apr 2023 03:45:14 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f080f46fb1so20306825e9.0 for ; Tue, 25 Apr 2023 00:45:14 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id m1-20020a7bca41000000b003f179fc6d8esm14046536wml.44.2023.04.25.00.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408716; 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=5xPxndmu6u19FkD0GIHESUMsZqlnKGGs95IpGgfP/Ak=; b=IT0q6raaXpbiQ3D9tCyLxkem49/oSJkGmD6LR2ceLhAq19cfo9cTzdOgBVew+9U5KaYhJe 6QMeNt/cWZl/ESZr5T1yH3K7h4Ki+L26Uw2JKPXc6zbIFwkPBeNghy30qICs5zdULM/jd3 G9qLvxALopjyzxriGAXKO+66Ho8ShtQ= X-MC-Unique: m4pUveJqP9a4KgS9pAAdKQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408712; x=1685000712; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5xPxndmu6u19FkD0GIHESUMsZqlnKGGs95IpGgfP/Ak=; b=HwQnD4VrgfCIwtTCyLnOLg9qb0XmfjNorYSMjnkAL51mv6e7+n5sx+fDb/jdEwCfRm uYaly+rk3OuvLqxHTS66r26lmg8IDgdvZv8aB147/od5R+YCUgYbDH37j0n4MhDkTGrD wbEMb5DTXYDNhBMhXnS/84n0qHb/eFcJ7CdOlLdj+XJ4OIPFm5NoTCWFqtJesP/MZppb 53kjHVzZ64kRwfJ3hnOiSzV/xgZ17NAFg1CQUxzaVb/2JD56g0ifF+uRJikCutUhtZ2f UJm2ZX9y9Lou0JcKODZlOC+rl1oh5XLs8ScvfbWllmsLtt+uSxr3XAd6GTEOdjU0IpK0 iuBQ== X-Gm-Message-State: AAQBX9diY1QyInl6YnBScO7HoXc3PR2a9qlap3Y8VQQ01fRL0Sk60Lny OhmokKgPxZ5RQwppdrzU1LXogm0aeLmx1Y4txvppQihe0WS1XEkroebwkecrytqRbRa5nCLuKD9 ZELRBVi+qRhDbjlkuZZhcxQWhc8Uw3j2f4VrUckeoH6qMECJUzKkolurNNGrl5qGtOkqX X-Received: by 2002:a05:600c:2059:b0:3f1:73c5:66db with SMTP id p25-20020a05600c205900b003f173c566dbmr9032319wmg.20.1682408712307; Tue, 25 Apr 2023 00:45:12 -0700 (PDT) X-Google-Smtp-Source: AKy350aoz9iqKU12pCbzZ1M0ShyYqzcNoBfALG7pBK8wfhdrNY0U+vh7JaXbRafDNk6DP/rWjnV4uA== X-Received: by 2002:a05:600c:2059:b0:3f1:73c5:66db with SMTP id p25-20020a05600c205900b003f173c566dbmr9032296wmg.20.1682408711994; Tue, 25 Apr 2023 00:45:11 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:08 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Viresh Kumar , Stefan Hajnoczi , Alex =?utf-8?Q?Benn=C3=A9e?= Subject: [PULL 07/31] docs: vhost-user: Add Xen specific memory mapping support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408741384100003 From: Viresh Kumar The current model of memory mapping at the back-end works fine where a standard call to mmap() (for the respective file descriptor) is enough before the front-end can start accessing the guest memory. There are other complex cases though where the back-end needs more information and simple mmap() isn't enough. For example Xen, a type-1 hypervisor, currently supports memory mapping via two different methods, foreign-mapping (via /dev/privcmd) and grant-dev (via /dev/gntdev). In both these cases, the back-end needs to call mmap() and ioctl(), with extra information like the Xen domain-id of the guest whose memory we are trying to map. Add a new protocol feature, 'VHOST_USER_PROTOCOL_F_XEN_MMAP', which lets the back-end know about the additional memory mapping requirements. When this feature is negotiated, the front-end will send the additional information within the memory regions themselves. Signed-off-by: Viresh Kumar Message-Id: <6d0bd7f0e1aeec3ddb603ae4ff334c75c7d0d7b3.1678351495.git.viresh= .kumar@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Reviewed-by: Alex Benn=C3=A9e --- docs/interop/vhost-user.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index 1720d68126..5a070adbc1 100644 --- a/docs/interop/vhost-user.rst +++ b/docs/interop/vhost-user.rst @@ -145,6 +145,26 @@ Memory region description =20 :mmap offset: 64-bit offset where region starts in the mapped memory =20 +When the ``VHOST_USER_PROTOCOL_F_XEN_MMAP`` protocol feature has been +successfully negotiated, the memory region description contains two extra +fields at the end. + ++---------------+------+--------------+-------------+----------------+----= ---+ +| guest address | size | user address | mmap offset | xen mmap flags | dom= id | ++---------------+------+--------------+-------------+----------------+----= ---+ + +:xen mmap flags: 32-bit bit field + +- Bit 0 is set for Xen foreign memory mapping. +- Bit 1 is set for Xen grant memory mapping. +- Bit 8 is set if the memory region can not be mapped in advance, and memo= ry + areas within this region must be mapped / unmapped only when required by= the + back-end. The back-end shouldn't try to map the entire region at once, a= s the + front-end may not allow it. The back-end should rather map only the requ= ired + amount of memory at once and unmap it after it is used. + +:domid: a 32-bit Xen hypervisor specific domain id. + Single memory region description ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ =20 @@ -864,6 +884,7 @@ Protocol features #define VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS 14 #define VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS 15 #define VHOST_USER_PROTOCOL_F_STATUS 16 + #define VHOST_USER_PROTOCOL_F_XEN_MMAP 17 =20 Front-end message types ----------------------- --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408744; cv=none; d=zohomail.com; s=zohoarc; b=Owj0H5QYTnpFmzkJcTXZZY/B4XEHpC7ywwxJdzTiffmFt+Xq9lSQ25bCgdXGSAvAdyIzfCx+RH5mTKaKsoMzflwhpO+7Rb0KiS65xGMxqCYNOmZe1tSZO0lDOr3c7w3eFZssWolBOh0/dQgomZ/BJtT4MJF+YlCMHJYlueUiKp8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408744; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xg1F/uN1S1AB6RN6Ne0LGmsnJ9OOP5fH2LaG08ayJMo=; b=NRMCYuoaBwKw6/2wGgv58bMcF2IKiEib4VBLGO4f+VwJoqzGr+/LgEuK2VRqPfb3xGVkKPmfvpeK7d3cMU9Pe88LVKS3zdP9NnniEcy3Kb1EO4Tm347Y7CWV0iXvNaRwG4MTyfL30sID6a+ZFe3ga39Ls+8YNf6i5yWf39/GbZw= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408744547237.67408178020446; Tue, 25 Apr 2023 00:45:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMj-0006az-Mx; Tue, 25 Apr 2023 03:45:33 -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 1prDMY-0006U8-VY for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:23 -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 1prDMX-0006fT-Eh for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:22 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-225-aeC-HCMgPAWmagLJhxPjLg-1; Tue, 25 Apr 2023 03:45:19 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f195c06507so51455545e9.1 for ; Tue, 25 Apr 2023 00:45:19 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id p5-20020a05600c468500b003f18141a016sm17011190wmo.18.2023.04.25.00.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408720; 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: in-reply-to:in-reply-to:references:references; bh=Xg1F/uN1S1AB6RN6Ne0LGmsnJ9OOP5fH2LaG08ayJMo=; b=P+iV4euBe/bgy4tMYOfEvSoRzSq3iKmVQzeEs4nh1yCNlVa00akX9vEgWeVkPU8MZX7zep JDkpCZE3BMg7uZyWb8c4Fao70lAcmVmTnUkjSE4KDNpOsj0/UU42UWXHWm8UW8cW+g0XYt TH5FKZEK4jTMRta+8v2ufLykWgUXq/s= X-MC-Unique: aeC-HCMgPAWmagLJhxPjLg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408717; x=1685000717; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Xg1F/uN1S1AB6RN6Ne0LGmsnJ9OOP5fH2LaG08ayJMo=; b=jp2QSkAnWtYSDpfTmjdRZLSl50vMwHeFlgzYa2qsXsrTvJVJ8HJV0ATRW3YFibFOto 5AOe09w+EZ0/GOZO8NLKKgmijwtBVauJ0MqmjpR2LrxIdi8LvoVOQUHWXlM0YQtEpdcA RJKxdNe4CUg0w51bZiUPfAfmVDLT6Lpsrh4ZtoKSZaOHTylL7QPkWswxVbx92Aswq1tl 4YbyTv84EbsjG7tDUofw6xC2yjQY9I3C8ri3E+vZM9guMSJSkkhgdlmK4xq69+9dGWJB PIqSueiUuLiS8MB21LBIibfUqI+K/DesiqtCgerKRbmZagGQG/spqfS5SPQc8i8DDq9n ZjVw== X-Gm-Message-State: AAQBX9dsfZB6CG6JmXkpxzvmA0Xdn/k8olePLyQG+1sJzyDIwG1+SBBN JIDZHohGStTlpk4xd+A3K1yx8XS/PPpaw8gvvVOXCJPGvel53A4HY3e4SUO/OnpwLEtz5BolA2e +FlwE7iJC84wQ26PbYVdgiAlwzQcem0Dgk/i3R5XOIMPzhQzLR8bhqAnx5MxAXCvc56Hz X-Received: by 2002:a05:600c:28e:b0:3f1:69cc:4765 with SMTP id 14-20020a05600c028e00b003f169cc4765mr9592285wmk.12.1682408717170; Tue, 25 Apr 2023 00:45:17 -0700 (PDT) X-Google-Smtp-Source: AKy350bgZNvwrsyEyKP3Vs7ps0GKOR0/3AgObr8TGDIu+Lv+mhCrMhBF0kDlt2d44hZZNN/KBFDH7w== X-Received: by 2002:a05:600c:28e:b0:3f1:69cc:4765 with SMTP id 14-20020a05600c028e00b003f169cc4765mr9592266wmk.12.1682408716922; Tue, 25 Apr 2023 00:45:16 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:12 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Yangming , Qi Xi , David Hildenbrand , Igor Mammedov , Xiao Guangrong , Eduardo Habkost , Marcel Apfelbaum , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Yanan Wang Subject: [PULL 08/31] virtio-balloon: optimize the virtio-balloon on the ARM platform Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408745375100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yangming Optimize the virtio-balloon feature on the ARM platform by adding a variable to keep track of the current hot-plugged pc-dimm size, instead of traversing the virtual machine's memory modules to count the current RAM size during the balloon inflation or deflation process. This variable can be updated only when plugging or unplugging the device, which will result in an increase of approximately 60% efficiency of balloon process on the ARM platform. We tested the total amount of time required for the balloon inflation proce= ss on ARM: inflate the balloon to 64GB of a 128GB guest under stress. Before: 102 seconds After: 42 seconds Signed-off-by: Qi Xi Signed-off-by: Ming Yang yangming73@huawei.com Message-Id: Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: David Hildenbrand --- include/hw/boards.h | 2 ++ hw/mem/pc-dimm.c | 7 +++++++ hw/virtio/virtio-balloon.c | 33 +++++---------------------------- 3 files changed, 14 insertions(+), 28 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 6fbbfd56c8..f840f88d54 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -292,10 +292,12 @@ struct MachineClass { * @base: address in guest physical address space where the memory * address space for memory devices starts * @mr: address space container for memory devices + * @dimm_size: the sum of plugged DIMMs' sizes */ typedef struct DeviceMemoryState { hwaddr base; MemoryRegion mr; + uint64_t dimm_size; } DeviceMemoryState; =20 /** diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 50ef83215c..37f1f4ccfd 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -81,6 +81,10 @@ void pc_dimm_plug(PCDIMMDevice *dimm, MachineState *mach= ine) =20 memory_device_plug(MEMORY_DEVICE(dimm), machine); vmstate_register_ram(vmstate_mr, DEVICE(dimm)); + /* count only "real" DIMMs, not NVDIMMs */ + if (!object_dynamic_cast(OBJECT(dimm), TYPE_NVDIMM)) { + machine->device_memory->dimm_size +=3D memory_region_size(vmstate_= mr); + } } =20 void pc_dimm_unplug(PCDIMMDevice *dimm, MachineState *machine) @@ -90,6 +94,9 @@ void pc_dimm_unplug(PCDIMMDevice *dimm, MachineState *mac= hine) =20 memory_device_unplug(MEMORY_DEVICE(dimm), machine); vmstate_unregister_ram(vmstate_mr, DEVICE(dimm)); + if (!object_dynamic_cast(OBJECT(dimm), TYPE_NVDIMM)) { + machine->device_memory->dimm_size -=3D memory_region_size(vmstate_= mr); + } } =20 static int pc_dimm_slot2bitmap(Object *obj, void *opaque) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 746f07c4d2..2814a47cb1 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -729,37 +729,14 @@ static void virtio_balloon_get_config(VirtIODevice *v= dev, uint8_t *config_data) memcpy(config_data, &config, virtio_balloon_config_size(dev)); } =20 -static int build_dimm_list(Object *obj, void *opaque) -{ - GSList **list =3D opaque; - - if (object_dynamic_cast(obj, TYPE_PC_DIMM)) { - DeviceState *dev =3D DEVICE(obj); - if (dev->realized) { /* only realized DIMMs matter */ - *list =3D g_slist_prepend(*list, dev); - } - } - - object_child_foreach(obj, build_dimm_list, opaque); - return 0; -} - static ram_addr_t get_current_ram_size(void) { - GSList *list =3D NULL, *item; - ram_addr_t size =3D current_machine->ram_size; - - build_dimm_list(qdev_get_machine(), &list); - for (item =3D list; item; item =3D g_slist_next(item)) { - Object *obj =3D OBJECT(item->data); - if (!strcmp(object_get_typename(obj), TYPE_PC_DIMM)) { - size +=3D object_property_get_int(obj, PC_DIMM_SIZE_PROP, - &error_abort); - } + MachineState *machine =3D MACHINE(qdev_get_machine()); + if (machine->device_memory) { + return machine->ram_size + machine->device_memory->dimm_size; + } else { + return machine->ram_size; } - g_slist_free(list); - - return size; } =20 static bool virtio_balloon_page_poison_support(void *opaque) --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408740; cv=none; d=zohomail.com; s=zohoarc; b=PfHk1ywVEpjKF/20mB0cuYwIBB8XUpW4dLvdOxpO3Z2m8IV1fL9KqV+HUYs9FSFhctoZdgm0BrZvGioWi16meX0mX8RyLc9kLR/E6fB4Tek5XGzbKzsTW8SHYjg5lJHpQ9IMkWC6r0syQq0gJGH2GfRue/FBmWCcDg+7jwFGSMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408740; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=E+liPnMG5SKdT9lUk2pKybI2+VnoLumIcCnDsEBtoKw=; b=bzCsBqptRIFPMMA1FZokQHPzjcz0qdWQeGFJf4s9CyJ8u7W3z44T9Fi1LhPGKpzrz12qadib/BGfb2AN8r5O55U048ajtL1BCoaXzzK1kHjHFoUrSrgy+LBLgCEsrcmY+3thB3N2Wm7rovhmVuCyCF+oR9ZWgQCEpB1nwwgib1o= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408740644632.3285280085286; Tue, 25 Apr 2023 00:45:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMl-00071d-GX; Tue, 25 Apr 2023 03:45:35 -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 1prDMb-0006V3-IZ for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDMa-0006hB-4c for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:25 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-504-8O74Dfv1NVa47JrR336R0A-1; Tue, 25 Apr 2023 03:45:22 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3f08900cad7so20473385e9.3 for ; Tue, 25 Apr 2023 00:45:22 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id p5-20020a05600c468500b003f18141a016sm17011388wmo.18.2023.04.25.00.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408723; 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=E+liPnMG5SKdT9lUk2pKybI2+VnoLumIcCnDsEBtoKw=; b=iPRESaKKbU6FpOvbkAtvHdJ3u1XvxztElhO+eNXcMHJ5hCBjXL6LNzKaMT4moCg8Qk+ieT nNpyEykCDnCYVgAaGHeh4FfIxIyz/i0SR1slhL5KnOtydGA7E0yJ6J1kHCGqxhjNWMGlS9 fVHXYgSczRK+lPejcyQMpKKZZUVI0rI= X-MC-Unique: 8O74Dfv1NVa47JrR336R0A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408720; x=1685000720; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E+liPnMG5SKdT9lUk2pKybI2+VnoLumIcCnDsEBtoKw=; b=kYcXHy8y0r3PUWRAiJoiMQbUSfUacxkM0a5IR88M2ofYgGW6NVnb/nw4125a+HeNCI yKTSkYCEV/A6m8U1/qE9En8C7NttgFDCeEXb8GtkmOBSDB5Y2MShPwFk22q7EHH1aicN DX0RMSU7flhMepM+eTKCSGS8bGUhWftmYy16AlXw4Jklf49xIg5HOqnGbMVQEJDxG1lb YmQIK1iNsCtlFSHGvuyx9LO1N8M7csO1yF5VDoTUzYT7ybKq2e38rvwDgNNtMBsWVPAb 6gUHsf6g+XBDmvS40cT8ekJKdtsuyQVts/lxTkRw4t3jupdUSBmqrLZNECZSIYd+Av8D Gn+w== X-Gm-Message-State: AAQBX9foP7sLm1qYh8fiXhDVIXoVnzJziAwuLThzXpCb8h1ZjLwyPVhd s0jAXNJC5Hl2jr84T9jh5GMADcVa/vgmQ0vhNeRLjiZ3ezdtdD23Q0f9QRJeWN5P0Gq9V9Dx4CS JlJQmzju5u9wJMnI6cEsAcE1BAkpVpT4O2BwCmOvYjSZBS5xL3x6Fz6manbB3u+6/dXDx X-Received: by 2002:a05:600c:2119:b0:3f1:98df:bc03 with SMTP id u25-20020a05600c211900b003f198dfbc03mr6398945wml.25.1682408720553; Tue, 25 Apr 2023 00:45:20 -0700 (PDT) X-Google-Smtp-Source: AKy350ZA+lHPo17vZ9PEYS9xgFUxxiA9kuF5FoHqLJDGNx7GglUZOiK49Ui8/iNZcF0Q8St61KHz4w== X-Received: by 2002:a05:600c:2119:b0:3f1:98df:bc03 with SMTP id u25-20020a05600c211900b003f198dfbc03mr6398926wml.25.1682408720349; Tue, 25 Apr 2023 00:45:20 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:17 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Roman Kapl , Wei Huang , Brijesh Singh , David Kiarie , Jean-Philippe Brucker , Richard Henderson , Thomas Huth , Alex =?utf-8?Q?Benn=C3=A9e?= Subject: [PULL 09/31] MAINTAINERS: Mark AMD-Vi emulation as orphan Message-ID: <2f5a2b35f5883fb8e049d877263eecb4c3883fb2.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408741171100001 From: Philippe Mathieu-Daud=C3=A9 hw/i386/amd_iommu.c seems unmaintained: After commit 1c7955c450 ("x86-iommu: introduce parent class", 2016-07-14), almost no feature added, 2 bug fixes, other changes are generic tree-wide API cleanups. Cc: Roman Kapl Cc: Wei Huang Cc: Brijesh Singh Cc: David Kiarie Cc: Jean-Philippe Brucker Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230313153031.86107-2-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- MAINTAINERS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0bd3d1830e..83c0373872 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3367,6 +3367,10 @@ F: hw/i386/intel_iommu.c F: hw/i386/intel_iommu_internal.h F: include/hw/i386/intel_iommu.h =20 +AMD-Vi Emulation +S: Orphan +F: hw/i386/amd_iommu.? + OpenSBI Firmware M: Bin Meng S: Supported --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408758; cv=none; d=zohomail.com; s=zohoarc; b=W6chEy+UEkOIHZwWWpe8sDvFQgHGSnP8ERA6FrW6HKh7Rn0/w0trKtxli+iciC9zlyCiEmcHV5aTpPdYc+o+yB72YhoycRpO15CmuyV2BTTtAonfxTkao3JbkbZdyQb+wBUNSovetkB92H/d+XAXhrAgK4UvzHA/Opd6HaFRD6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408758; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EdvJhVnF3qG5wb91wGjKf/B8uyjZMpU3Oo0rcoSg8ps=; b=cqIcBJYUE7YgbjiZB8TrDrcm+CtjmHz3Ca0mU3rMF7ybc8YRDXioeP4TLt+db/7Dh7QmwA9lhEJHEg6dnyLwvk6701146ilX2e89v+DATZhW20JqwWMugQlPQrib4NW6XJjUzexCLO3IV5gvM+5PkaAf5OrJRXC/kVDK+El5q6w= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408758228175.79312015714527; Tue, 25 Apr 2023 00:45:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMn-0007DG-24; Tue, 25 Apr 2023 03:45:37 -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 1prDMf-0006Yk-Rh for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDMe-0006jV-C7 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:29 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-140-RK9K-k6mNJ-dlng30RVpvw-1; Tue, 25 Apr 2023 03:45:26 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f21e35dc08so9373605e9.2 for ; Tue, 25 Apr 2023 00:45:26 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id d14-20020a5d538e000000b002efac42ff35sm12450857wrv.37.2023.04.25.00.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408727; 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=EdvJhVnF3qG5wb91wGjKf/B8uyjZMpU3Oo0rcoSg8ps=; b=OY2ENwZBZWC0Ek8Y7uX7z/2WdltUs2H1UFlPD8yB/v5XDrQV6kIziKW23MBdN6y8lm96a6 6FK2VG6bcHZus7u2kaLORZnWQtmAhORMindukGL3q3e1IAhlDyOeJn8i5aq76Lr4f6CXFb jtPEeDQos978ddIGXAhH8NNo4eyYksA= X-MC-Unique: RK9K-k6mNJ-dlng30RVpvw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408724; x=1685000724; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EdvJhVnF3qG5wb91wGjKf/B8uyjZMpU3Oo0rcoSg8ps=; b=ZpkeElEopHZlsP/tATXTvesC4cbyMqSWGj5OrHINWEHgtoBiOo7MpTJboftXGrkJTO 13z+hczTRHYr2Recub08AhOQBR24WHFqseUK8iuvQqrYWxV33rWC44n8yRRrKFzzMEn6 6K3OjvtSA/MsZnMB6XtHbMF4LLzlbkagZLsKB/wXsn9JOLH+Cjxe3MCtJXtHrBOKvY90 LN70fbKd5YXjUlkhyd9WoGtvz9Y3C4GeIi7Ct3hBqdMX7MvjU2P4d0RV7iim+L4l7whW 8MCPZIbIwXT2pZ0bSU7FWD952QzV9TFk1wxqYKAhzbU2wwpZsvO8995CFBGao6QnrAP8 /7nw== X-Gm-Message-State: AAQBX9cLhyDHc+C9/ttjO7q+ixZfwYxLbh1LMdo28RR1qkmCU0C8Ruy8 4BRf89fxl6S600c3vaTp9GY1KqRWvP403N1HsAn6TyJEnWIBd3DgrOAve+gsZ7FyOL/cOCPWIiM OakOZ/u9lptp96GIDvJRD7VOgMcVyd2c8oAztUwF/us40XUSRhepzdfcaYu9bGOvu05Sr X-Received: by 2002:a1c:7409:0:b0:3f2:4fca:1b0f with SMTP id p9-20020a1c7409000000b003f24fca1b0fmr3962952wmc.24.1682408724235; Tue, 25 Apr 2023 00:45:24 -0700 (PDT) X-Google-Smtp-Source: AKy350a7e50FCAAhyOaCoEyqBZKf6YFbgyU/hrytYUZqxgG09H+XbdKwcgVXFoCYWvQ5PgfpVA8REg== X-Received: by 2002:a1c:7409:0:b0:3f2:4fca:1b0f with SMTP id p9-20020a1c7409000000b003f24fca1b0fmr3962921wmc.24.1682408723829; Tue, 25 Apr 2023 00:45:23 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:20 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 10/31] hw/i386/amd_iommu: Explicit use of AMDVI_BASE_ADDR in amdvi_init Message-ID: <6291a28645a0656477bc5962a81b181e6a99487c.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408759084100003 From: Philippe Mathieu-Daud=C3=A9 By accessing MemoryRegion internals, amdvi_init() gives the false idea that the PCI BAR can be modified. However this isn't true (at least the model isn't ready for that): the device is explicitly maps at the BAR at the fixed AMDVI_BASE_ADDR address in amdvi_sysbus_realize(). Since the SysBus API isn't designed to remap regions, directly use the fixed address in amdvi_init(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230313153031.86107-3-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/amd_iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index bcd016f5c5..3813b341ec 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1519,9 +1519,9 @@ static void amdvi_init(AMDVIState *s) /* reset AMDVI specific capabilities, all r/o */ pci_set_long(s->pci.dev.config + s->capab_offset, AMDVI_CAPAB_FEATURES= ); pci_set_long(s->pci.dev.config + s->capab_offset + AMDVI_CAPAB_BAR_LOW, - s->mmio.addr & ~(0xffff0000)); + AMDVI_BASE_ADDR & ~(0xffff0000)); pci_set_long(s->pci.dev.config + s->capab_offset + AMDVI_CAPAB_BAR_HIG= H, - (s->mmio.addr & ~(0xffff)) >> 16); + (AMDVI_BASE_ADDR & ~(0xffff)) >> 16); pci_set_long(s->pci.dev.config + s->capab_offset + AMDVI_CAPAB_RANGE, 0xff000000); pci_set_long(s->pci.dev.config + s->capab_offset + AMDVI_CAPAB_MISC, 0= ); --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408967; cv=none; d=zohomail.com; s=zohoarc; b=HJHwDtMnyxlZ+gHhMZvvFY7iiLEb5EnW9joZYEY5+vloIrThZIkp4pQAubu/mk2mWzlryg7zrOBFzMMtGkgyoVpoLQL/yiMCefN4nqrrU4bobW88rsgH7txuKi6sQ9SoUOQxEnWDWjGA4ueHMuGcrnmKEES9EMKShBBk7jLxM6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408967; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kRkJbKTYdQMPPesksxF7xN8VfXkNWpD4bYsPHdaN2MU=; b=a/QfUphaRm3Nldpu+3PZ+EHTOC3qc0/i4i+S6p+uDy/FGOkAz3Kj6keP1JQ29/+TS8oT2IiW2G8ilv0QukOYAWZCc40wRN5lbATXMPvOrVqRNTyCvSka4CfoNgattLliwIOMr6hgrOw3GNjLCYj3h1CgGdndY+zY+L3AbXsbK8g= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168240896736813.429933080925707; Tue, 25 Apr 2023 00:49:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMn-0007FN-Fk; Tue, 25 Apr 2023 03:45:38 -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 1prDMj-0006o2-Q3 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:33 -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 1prDMi-0006jh-0x for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:33 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-igQZS5RtMaOMWkISz3RC7Q-1; Tue, 25 Apr 2023 03:45:30 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f08901fed3so32375115e9.1 for ; Tue, 25 Apr 2023 00:45:30 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id o22-20020a1c7516000000b003f18372d540sm13977119wmc.14.2023.04.25.00.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408731; 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=kRkJbKTYdQMPPesksxF7xN8VfXkNWpD4bYsPHdaN2MU=; b=eXHXHju3XabHFQuMSDokLRIE7pgaaTB1yxgdegIWusqLESt1so9Ew7GGy4sT0zIupNL9kO qb+7dqLq4kKGVOpNFGQFLqFxN03SgGHl+BIlyQXllpZXClGtYzNZjnkeDRhq5EkYjzmaGZ jXxND1tfH6hfhuu2RZI7ZUjW8F/mzvw= X-MC-Unique: igQZS5RtMaOMWkISz3RC7Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408728; x=1685000728; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kRkJbKTYdQMPPesksxF7xN8VfXkNWpD4bYsPHdaN2MU=; b=N6rBnSl+FglmJ5RKDUlLKroBXFmhGTyi5R/5eMxsa+O6hyfp5nI1ePej87Vzxy5gOC yYL59sVlC+zfqQTqFIV1c+UIPXeOdiHsxJv8cmPD+JVFJnUNkrFsn+0pMsuFsTgUgH3T cCKYh+UgcibMipgJECkosmWuvHDssM/Rgkk7HO2Q8AxLqpgSdoBnTfyzRAQSkYlNrA24 op2bgvjGT4b9IS5ckDRwGP1dgxJEYSrbjTVfDRymu0UtpvKWb4TyKlwwfvSeEqkKEAmZ zB3AxJiCFtf3Wn3Wcez9kVsKZYCWtgixunrGJaPR3aOpuCqnhgu4Qw7P7QtcjVa7RWfX sGRA== X-Gm-Message-State: AAQBX9dv7aZn+pN1N6scwK+QIhRPFzcDVNHOC9bRMfA18bmaAc5o6XrL PuS0Z/5Hxu+8axY5f0GUaZvXa3rVnesxQn1rBGdD8EyhoeLkuMZS8lrVQqwIxyoZ7g41MOF1aQh QP9KQRJTgM2QRt3ehD0+DJ1SK3ZTeqgWOARHIkO1sGTOyZ80Zh/TP8NCYIQi11LhBP39b X-Received: by 2002:adf:fd88:0:b0:2c5:5a65:79a0 with SMTP id d8-20020adffd88000000b002c55a6579a0mr10993754wrr.53.1682408727768; Tue, 25 Apr 2023 00:45:27 -0700 (PDT) X-Google-Smtp-Source: AKy350ZQtXVJ0pQd7jupwSkhr4ax1O1NHhGuoa9hXSx5yjOWIc7YjKiAz+6epykYySnHF3eZtG0PmQ== X-Received: by 2002:adf:fd88:0:b0:2c5:5a65:79a0 with SMTP id d8-20020adffd88000000b002c55a6579a0mr10993723wrr.53.1682408727419; Tue, 25 Apr 2023 00:45:27 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:24 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 11/31] hw/i386/amd_iommu: Remove intermediate AMDVIState::devid field Message-ID: <531f50ab058c6e443194cdda1a8eaf010c6e740a.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408969475100003 From: Philippe Mathieu-Daud=C3=A9 AMDVIState::devid is only accessed by build_amd_iommu() which has access to the PCIDevice state. Directly get the property calling object_property_get_int() there. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230313153031.86107-4-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/amd_iommu.h | 2 -- hw/i386/acpi-build.c | 4 +++- hw/i386/amd_iommu.c | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index 79d38a3e41..5eccaad790 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -319,8 +319,6 @@ struct AMDVIState { =20 uint64_t mmio_addr; =20 - uint32_t devid; /* auto-assigned devid */ - bool enabled; /* IOMMU enabled */ bool ats_enabled; /* address translation enabled */ bool cmdbuf_enabled; /* command buffer enabled */ diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index ec857a117e..a27bc33956 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2395,7 +2395,9 @@ build_amd_iommu(GArray *table_data, BIOSLinker *linke= r, const char *oem_id, /* IVHD length */ build_append_int_noprefix(table_data, ivhd_table_len, 2); /* DeviceID */ - build_append_int_noprefix(table_data, s->devid, 2); + build_append_int_noprefix(table_data, + object_property_get_int(OBJECT(&s->pci), "ad= dr", + &error_abort), 2); /* Capability offset */ build_append_int_noprefix(table_data, s->capab_offset, 2); /* IOMMU base address */ diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 3813b341ec..19f57e6318 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1513,7 +1513,6 @@ static void amdvi_init(AMDVIState *s) /* reset device ident */ pci_config_set_vendor_id(s->pci.dev.config, PCI_VENDOR_ID_AMD); pci_config_set_prog_interface(s->pci.dev.config, 00); - pci_config_set_device_id(s->pci.dev.config, s->devid); pci_config_set_class(s->pci.dev.config, 0x0806); =20 /* reset AMDVI specific capabilities, all r/o */ @@ -1581,7 +1580,6 @@ static void amdvi_sysbus_realize(DeviceState *dev, Er= ror **errp) sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->mmio); sysbus_mmio_map(SYS_BUS_DEVICE(s), 0, AMDVI_BASE_ADDR); pci_setup_iommu(bus, amdvi_host_dma_iommu, s); - s->devid =3D object_property_get_int(OBJECT(&s->pci), "addr", &error_a= bort); msi_init(&s->pci.dev, 0, 1, true, false, errp); amdvi_init(s); } --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682409040; cv=none; d=zohomail.com; s=zohoarc; b=l0kAU9p9zDqeVzkaXoJp+W+VKKBFc8jWhgsQJ2ZUx4DEq3WHnSmz16h4KuNICjLvzs+qVCGsdNHGyfNyroABDVw9GP4Pb12i38vncvppH2CZIPb4L2lsIFZbvx9XyjBPyObmYkSnb+YYsjs4OOUR6Aagzx6qf+X8utFoB5U84kg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682409040; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r7X86YUKsr6DaUP9RJPAougsaucvvbmX812GyuJi0kM=; b=WWjNWrVyCApAQ9XSdSan+kle/cacxvzO/WPu4UG1vf4uieZchvz1sqlqyoA3IlRz9Xx6Z+czue6gzsusjnew4Cm6hkm9O0Y5iZHUOHIWNUJeL+wCCrIAnWWb8CGmPBjcqEFBuij0qm00ZIF0+N7GYmsbZlXx1Kdrf+LIoa2tLm0= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682409040232505.2169461421897; Tue, 25 Apr 2023 00:50:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMo-0007Ny-Uk; Tue, 25 Apr 2023 03:45:39 -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 1prDMn-0007Fw-HJ for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:37 -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 1prDMl-0006lE-ML for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:37 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-85-gKkS6dKZP8yiVutB25p1Tg-1; Tue, 25 Apr 2023 03:45:33 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-2ffee43dac5so1939023f8f.2 for ; Tue, 25 Apr 2023 00:45:33 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id b9-20020adfee89000000b002f777345d21sm12391227wro.95.2023.04.25.00.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408735; 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=r7X86YUKsr6DaUP9RJPAougsaucvvbmX812GyuJi0kM=; b=gbcIxVgZWHXosipeOyL3fhF2tO+Y6QXyCa+n+3+O3rVVtVcey4daSCRoWCo5lzwSlkVQqN BavxFElXjLcNyP3iT7jeGVwMoFLFSHKQas02NLv895+3BMs6tEcUeC8mSoChZrUQLWuP3e 3Sx2OCWlMqxy8TxID+wLTYMiRng3TDY= X-MC-Unique: gKkS6dKZP8yiVutB25p1Tg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408731; x=1685000731; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r7X86YUKsr6DaUP9RJPAougsaucvvbmX812GyuJi0kM=; b=he4Z+k0wmDXb/UVLk67cRWXJmTP8vwt8zkpTLDGTWdgR3OhqC/pC2qkvWlIxhcaQSz buiPiPTgsY431LpcdQ/xMuPCa0jc7clt8E9niuxsYYlKd5uVa1o7hFPhHo6EuC+qRIVS xFbv2j9tKztrVurjKWriDrmaQbINHbrpENEq/3y6VG1eXxBPyolcrPjMoj093WjT0sR/ jYC6AQT66tbPc0f7+nonyHik7LEfFOsYTJWjjWxzHmEDhpaQ3yuP/DiQc7V8upgtM1Ao KP0MPJnkS+ZqbNbauxxg6P/jIzqG8+ZmGe2Exh+0RpNUYEea+MtH+Qa0rPldhcc1GT4G NZhw== X-Gm-Message-State: AAQBX9e5sMTfM+fu43gWS0ZIRfJfqG84E4luQiJdsVsQcCrntvrfXH9h 1L18Twa1bSYTSVMrZVZO4jhXDwBZBqGkIFi8/CA8oo8IFEgltox+PYPYy/uXHGHHFaPLX7MdPZF LmzLMu2cjdpTQ6dxKy57ApxAePjQxiFjrCvEEMLrbJpNfKS1QNXaYMu9Q8emBBm/c+E0U X-Received: by 2002:a5d:570b:0:b0:2fb:11ec:f2a1 with SMTP id a11-20020a5d570b000000b002fb11ecf2a1mr10403978wrv.20.1682408731216; Tue, 25 Apr 2023 00:45:31 -0700 (PDT) X-Google-Smtp-Source: AKy350aHPkXsfzEDL6zb1tTFCSUGxqe6I5zOFivn0m3yNrPF4oN4okBmw7vGNLOOJnYi5NERagbJIg== X-Received: by 2002:a5d:570b:0:b0:2fb:11ec:f2a1 with SMTP id a11-20020a5d570b000000b002fb11ecf2a1mr10403957wrv.20.1682408730883; Tue, 25 Apr 2023 00:45:30 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:27 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 12/31] hw/i386/amd_iommu: Move capab_offset from AMDVIState to AMDVIPCIState Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682409041879100013 From: Philippe Mathieu-Daud=C3=A9 The 'PCI capability offset' is a *PCI* notion. Since AMDVIPCIState inherits PCIDevice and hold PCI-related fields, move capab_offset from AMDVIState to AMDVIPCIState. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230313153031.86107-5-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/amd_iommu.h | 2 +- hw/i386/acpi-build.c | 2 +- hw/i386/amd_iommu.c | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index 5eccaad790..1c0cb54bd4 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -308,6 +308,7 @@ typedef struct AMDVIAddressSpace AMDVIAddressSpace; /* functions to steal PCI config space */ typedef struct AMDVIPCIState { PCIDevice dev; /* The PCI device itself */ + uint32_t capab_offset; /* capability offset pointer */ } AMDVIPCIState; =20 struct AMDVIState { @@ -315,7 +316,6 @@ struct AMDVIState { AMDVIPCIState pci; /* IOMMU PCI device */ =20 uint32_t version; - uint32_t capab_offset; /* capability offset pointer */ =20 uint64_t mmio_addr; =20 diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index a27bc33956..7f211e1f48 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2399,7 +2399,7 @@ build_amd_iommu(GArray *table_data, BIOSLinker *linke= r, const char *oem_id, object_property_get_int(OBJECT(&s->pci), "ad= dr", &error_abort), 2); /* Capability offset */ - build_append_int_noprefix(table_data, s->capab_offset, 2); + build_append_int_noprefix(table_data, s->pci.capab_offset, 2); /* IOMMU base address */ build_append_int_noprefix(table_data, s->mmio.addr, 8); /* PCI Segment Group */ diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 19f57e6318..9f6622e11f 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1516,15 +1516,15 @@ static void amdvi_init(AMDVIState *s) pci_config_set_class(s->pci.dev.config, 0x0806); =20 /* reset AMDVI specific capabilities, all r/o */ - pci_set_long(s->pci.dev.config + s->capab_offset, AMDVI_CAPAB_FEATURES= ); - pci_set_long(s->pci.dev.config + s->capab_offset + AMDVI_CAPAB_BAR_LOW, + pci_set_long(s->pci.dev.config + s->pci.capab_offset, AMDVI_CAPAB_FEAT= URES); + pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_BAR= _LOW, AMDVI_BASE_ADDR & ~(0xffff0000)); - pci_set_long(s->pci.dev.config + s->capab_offset + AMDVI_CAPAB_BAR_HIG= H, + pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_BAR= _HIGH, (AMDVI_BASE_ADDR & ~(0xffff)) >> 16); - pci_set_long(s->pci.dev.config + s->capab_offset + AMDVI_CAPAB_RANGE, + pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_RAN= GE, 0xff000000); - pci_set_long(s->pci.dev.config + s->capab_offset + AMDVI_CAPAB_MISC, 0= ); - pci_set_long(s->pci.dev.config + s->capab_offset + AMDVI_CAPAB_MISC, + pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_MIS= C, 0); + pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_MIS= C, AMDVI_MAX_PH_ADDR | AMDVI_MAX_GVA_ADDR | AMDVI_MAX_VA_ADDR); } =20 @@ -1557,7 +1557,7 @@ static void amdvi_sysbus_realize(DeviceState *dev, Er= ror **errp) if (ret < 0) { return; } - s->capab_offset =3D ret; + s->pci.capab_offset =3D ret; =20 ret =3D pci_add_capability(&s->pci.dev, PCI_CAP_ID_MSI, 0, AMDVI_CAPAB_REG_SIZE, errp); --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408975; cv=none; d=zohomail.com; s=zohoarc; b=ZafkngPJLAGxhzQk6tpcqIvUHB5QhJzxazxzSIV31SQtiHElGa21eLWfmc3DGWlGRM+QfARMa2FINRwV8/uac6DYB3nbTIRozK8mr3wsGf92MAB/QI/72Afr6PeNlYTeyM1ADIioARSBfJnkL5rhE+WeKAMWcNr/yH4219xwIZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408975; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=S/sucOaXOBUPGK9bWXP9UafBJ0BFNQr2ff/dyB9xOGE=; b=FFV/eL9wTqgm4V1b8yDCcesewlDRARC3Cs76Sjnk4ZBeU9TYCM2aVTA6ntVlFZE+So3eMRXP6Nct25d8TBJQlx2YZpNlCXkIUH3fWb6A24m5Br3M/5LNZiY+uuTUcKEgEGMiCF2VroJpPiPSqVH/iN+4RpyQ1TlOBMii7MZNCWQ= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408975878388.6855880013844; Tue, 25 Apr 2023 00:49:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMv-0007tr-0D; Tue, 25 Apr 2023 03:45:45 -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 1prDMt-0007lF-JL for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:43 -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 1prDMr-0006m0-TI for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:43 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-383-4kqG95VIPeKuTSzlg9wugQ-1; Tue, 25 Apr 2023 03:45:37 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f195c06507so51460555e9.1 for ; Tue, 25 Apr 2023 00:45:36 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id d6-20020a5d6dc6000000b002efb31d3c24sm12416494wrz.32.2023.04.25.00.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408741; 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=S/sucOaXOBUPGK9bWXP9UafBJ0BFNQr2ff/dyB9xOGE=; b=S1sq9qGx1Rx+hoIJDshriqXs/xZe0Wg4DoZvK+Hq9VuUqATbbGyhXTPFiGA/zAnttrctsr 8m9BZQGreDywPf6/NVH6FLGeqSnqJrv5GdSXyaXCgfxgcGXhj0lD0qhYm8Op7nYLdomPNa 5kPUnmQF2F9RnW/ybofEp9EIS0OdR4o= X-MC-Unique: 4kqG95VIPeKuTSzlg9wugQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408734; x=1685000734; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S/sucOaXOBUPGK9bWXP9UafBJ0BFNQr2ff/dyB9xOGE=; b=FCHqm8CVmDvHQIySMsa3QqkwZ9CMbYr5FlxjnlyXUpg9ihEIWH7ycFczG25m8llaze bHKlj9Oj7JKO5CVw96VXVgTwOhCvpEIlHxLTBa8Wg5B1Qc00jQOFDuW1vEg0AO8nkh5a I7GWwXvM78g+EpEYitbN1cMvMygD6Bt/U0bOWbHY/VkzAnwC7NLMEX1MtEjN4+JdrkuN dGKmj/Klhqpg81CsoXHNnQkc92RiWyvwWnFRRMTflLNSgvD2frWS6bV7exlDY02pxGYx YoP8pr3cmTlNze1zJcFjXBA62dwssk9xtdOPuIl2l+nAX+8k7VzJmkrnbVmThymeva8H w6sw== X-Gm-Message-State: AAQBX9exe4UeEs2FplQoLKAMl77DWWHfq8ZybxDTyEq8uFGDiLctPcuF z0WVVREI/v/ysm3qh6I/95e1T/PPH6oF/pjB0sx7ISUm+rwu/eeHxTPqX94UOjaS+s2VABgJ5ui K31UaV8jaiNFgAmSU0qCvKLlSvsm/YzBz+p82xFiNHLBI3A5Wtmj5nw3dDCJd1fwbF55Y X-Received: by 2002:adf:f604:0:b0:2cb:29eb:a35e with SMTP id t4-20020adff604000000b002cb29eba35emr14909585wrp.11.1682408734651; Tue, 25 Apr 2023 00:45:34 -0700 (PDT) X-Google-Smtp-Source: AKy350b8tuMf3vAbkBJqc5CNuCJGfV9C+0bq+UMgxdUNNyI7XH1hG5iPh4kyghW1XodlnsuXin+pug== X-Received: by 2002:adf:f604:0:b0:2cb:29eb:a35e with SMTP id t4-20020adff604000000b002cb29eba35emr14909571wrp.11.1682408734373; Tue, 25 Apr 2023 00:45:34 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:31 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 13/31] hw/i386/amd_iommu: Set PCI static/const fields via PCIDeviceClass Message-ID: <7f5a459dc8132bd15c28a0d2af1f0cf844ee19f4.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408977398100010 From: Philippe Mathieu-Daud=C3=A9 Set PCI static/const fields once in amdvi_pci_class_init. They will be propagated via DeviceClassRealize handler via pci_qdev_realize() -> do_pci_register_device() -> pci_config_set*(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230313153031.86107-6-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/amd_iommu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 9f6622e11f..8e4ce63f8e 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1511,9 +1511,7 @@ static void amdvi_init(AMDVIState *s) amdvi_set_quad(s, AMDVI_MMIO_STATUS, 0, 0x98, 0x67); =20 /* reset device ident */ - pci_config_set_vendor_id(s->pci.dev.config, PCI_VENDOR_ID_AMD); pci_config_set_prog_interface(s->pci.dev.config, 00); - pci_config_set_class(s->pci.dev.config, 0x0806); =20 /* reset AMDVI specific capabilities, all r/o */ pci_set_long(s->pci.dev.config + s->pci.capab_offset, AMDVI_CAPAB_FEAT= URES); @@ -1623,6 +1621,10 @@ static const TypeInfo amdvi_sysbus =3D { static void amdvi_pci_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); + + k->vendor_id =3D PCI_VENDOR_ID_AMD; + k->class_id =3D 0x0806; =20 set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc =3D "AMD IOMMU (AMD-Vi) DMA Remapping device"; --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682409014; cv=none; d=zohomail.com; s=zohoarc; b=ia3e71ylwT32rm6bdIKPIOPRR8o9HCyFFr2siEkHS/x75hkJ78AysiHVscApZnyq9XT3y/U9vqrXyw4MMYQW/pz9SI/7hcoiQd5FMqXn301OFdj7VPpOTQK+Yda0fpSvhHkWn8LcHgAf5FhF03+z+mkFsvcGkDJff0ukQiSOVM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682409014; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GtN4MhT1X0LAjc6r6BLfMyCLZv02rU9TJYnr4qhyY1Y=; b=QGzwFeGlQFrI+e9yvgMv9/5uWogVxZkpc3JREs3jzDEUY0qfp/uJZGrRboDSJH73oON/+lteIEkld0xny5NgmBHXSCmJdhtoYXL2bvizNQZ8rqf1YqydxtX0ZpRFct03fnQD9S6PMV4ZrIMK6R9jCeptGO4g0C6vqkUSNnJVVK8= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682409014692973.8426032281109; Tue, 25 Apr 2023 00:50:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMv-0007xd-P0; Tue, 25 Apr 2023 03:45:45 -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 1prDMu-0007pB-Fj for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDMs-0006mB-LU for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:44 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-IDs_BSXyPwu0y16buWsZng-1; Tue, 25 Apr 2023 03:45:40 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f17b8d24bbso33833635e9.2 for ; Tue, 25 Apr 2023 00:45:40 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id c21-20020a7bc855000000b003f17300c7dcsm14069071wml.48.2023.04.25.00.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408742; 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=GtN4MhT1X0LAjc6r6BLfMyCLZv02rU9TJYnr4qhyY1Y=; b=hHpf+wYPmy6wNIiGKOj+p5Jp7IN9FF1BRRj2noLO+0uW9T/FsHVP4evcFsEYG4cZwX/M2i w8LhIj64xWlj/xgK8g8ZLnqdvIN3pADVIaquyuT6Ie7fiaBpTs5FJqqotXqZ33pCzKg84y VFSNNtMTFYNtNjsDQNsmqtsVCA+fLNg= X-MC-Unique: IDs_BSXyPwu0y16buWsZng-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408738; x=1685000738; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GtN4MhT1X0LAjc6r6BLfMyCLZv02rU9TJYnr4qhyY1Y=; b=XEQDT95qum1BbF4S7yoJtqwyXFxZuyfnhVUaiZcSixDsqdV9gmO6C/zcPzwl+40bBO ATu0dS+2sBeixwyDs+qKJUOMoYl56HYA8wO2S/dW/hG6Qz+WxFyH0tWWYKJCq0VJiwxL 1C9J7tX9x6YNwNAS6PZq2EVOuLsgRIwiIN9+oga+nV744b3SUCuJr0ln0BgySdOtJJsE sJH0DzMGp6YlRT9okTt9g/L0aqrHK1MJvCA29b/d/1piRpcByvho6MtTZrn6k/kDUNQK v5BUOXPSLh9carB7FDaxeLwI5NsPCBxydRVEQ2Mr5Fym+sZyQshyR55IE5Mab9Olzfl+ 76IQ== X-Gm-Message-State: AAQBX9eykZ5NAyLVKjLZZWssBKFtA1+x51LGwXWUvfG/H+HgunLNdMyx Z7LpOQjkp7Itnd8/WgAa/CtK8rJZBcDLTv0QFj7dzHjHgLtoOVEW6gQbNRB7LVmrTWtsdQUznrO UP6RkMqG+fBerwgzOp4gazW+cPzG4Sk9JCiawiSe855sY1dosIctz9rGjk3jVdKbpOqtf X-Received: by 2002:a1c:f407:0:b0:3f0:9564:f4f6 with SMTP id z7-20020a1cf407000000b003f09564f4f6mr9551530wma.1.1682408738334; Tue, 25 Apr 2023 00:45:38 -0700 (PDT) X-Google-Smtp-Source: AKy350ZU+BT7CXRgK8q88fCP5mTsn/wZTkE98lcLy1W8drelsAz0RzXTRc7C4vilmTeke2hZ/30pgw== X-Received: by 2002:a1c:f407:0:b0:3f0:9564:f4f6 with SMTP id z7-20020a1cf407000000b003f09564f4f6mr9551509wma.1.1682408738033; Tue, 25 Apr 2023 00:45:38 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:34 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 14/31] hw/i386/amd_iommu: Factor amdvi_pci_realize out of amdvi_sysbus_realize Message-ID: <5ec7755eb7c503fc66fe44083ee5113bd5b87bd9.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682409016304100003 From: Philippe Mathieu-Daud=C3=A9 Aside the Frankenstein model of a SysBusDevice realizing a PCIDevice, QOM parents shouldn't access children internals. In this particular case, amdvi_sysbus_realize() is just open-coding TYPE_AMD_IOMMU_PCI's DeviceRealize() handler. Factor it out. Declare QOM-cast macros with OBJECT_DECLARE_SIMPLE_TYPE() so we can cast the AMDVIPCIState in amdvi_pci_realize(). Note this commit removes the single use in the repository of pci_add_capability() and msi_init() on a *realized* QDev instance. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230313153031.86107-7-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/amd_iommu.h | 5 ++-- hw/i386/amd_iommu.c | 62 ++++++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index 1c0cb54bd4..6da893ee57 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -300,16 +300,17 @@ struct irte_ga { OBJECT_DECLARE_SIMPLE_TYPE(AMDVIState, AMD_IOMMU_DEVICE) =20 #define TYPE_AMD_IOMMU_PCI "AMDVI-PCI" +OBJECT_DECLARE_SIMPLE_TYPE(AMDVIPCIState, AMD_IOMMU_PCI) =20 #define TYPE_AMD_IOMMU_MEMORY_REGION "amd-iommu-iommu-memory-region" =20 typedef struct AMDVIAddressSpace AMDVIAddressSpace; =20 /* functions to steal PCI config space */ -typedef struct AMDVIPCIState { +struct AMDVIPCIState { PCIDevice dev; /* The PCI device itself */ uint32_t capab_offset; /* capability offset pointer */ -} AMDVIPCIState; +}; =20 struct AMDVIState { X86IOMMUState iommu; /* IOMMU bus device */ diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 8e4ce63f8e..9c77304438 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1509,20 +1509,48 @@ static void amdvi_init(AMDVIState *s) amdvi_set_quad(s, AMDVI_MMIO_EXT_FEATURES, AMDVI_EXT_FEATURES, 0xffffffffffffffef, 0); amdvi_set_quad(s, AMDVI_MMIO_STATUS, 0, 0x98, 0x67); +} + +static void amdvi_pci_realize(PCIDevice *pdev, Error **errp) +{ + AMDVIPCIState *s =3D AMD_IOMMU_PCI(pdev); + int ret; + + ret =3D pci_add_capability(pdev, AMDVI_CAPAB_ID_SEC, 0, + AMDVI_CAPAB_SIZE, errp); + if (ret < 0) { + return; + } + s->capab_offset =3D ret; + + ret =3D pci_add_capability(pdev, PCI_CAP_ID_MSI, 0, + AMDVI_CAPAB_REG_SIZE, errp); + if (ret < 0) { + return; + } + ret =3D pci_add_capability(pdev, PCI_CAP_ID_HT, 0, + AMDVI_CAPAB_REG_SIZE, errp); + if (ret < 0) { + return; + } + + if (msi_init(pdev, 0, 1, true, false, errp) < 0) { + return; + } =20 /* reset device ident */ - pci_config_set_prog_interface(s->pci.dev.config, 00); + pci_config_set_prog_interface(pdev->config, 0); =20 /* reset AMDVI specific capabilities, all r/o */ - pci_set_long(s->pci.dev.config + s->pci.capab_offset, AMDVI_CAPAB_FEAT= URES); - pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_BAR= _LOW, + pci_set_long(pdev->config + s->capab_offset, AMDVI_CAPAB_FEATURES); + pci_set_long(pdev->config + s->capab_offset + AMDVI_CAPAB_BAR_LOW, AMDVI_BASE_ADDR & ~(0xffff0000)); - pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_BAR= _HIGH, + pci_set_long(pdev->config + s->capab_offset + AMDVI_CAPAB_BAR_HIGH, (AMDVI_BASE_ADDR & ~(0xffff)) >> 16); - pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_RAN= GE, + pci_set_long(pdev->config + s->capab_offset + AMDVI_CAPAB_RANGE, 0xff000000); - pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_MIS= C, 0); - pci_set_long(s->pci.dev.config + s->pci.capab_offset + AMDVI_CAPAB_MIS= C, + pci_set_long(pdev->config + s->capab_offset + AMDVI_CAPAB_MISC, 0); + pci_set_long(pdev->config + s->capab_offset + AMDVI_CAPAB_MISC, AMDVI_MAX_PH_ADDR | AMDVI_MAX_GVA_ADDR | AMDVI_MAX_VA_ADDR); } =20 @@ -1536,7 +1564,6 @@ static void amdvi_sysbus_reset(DeviceState *dev) =20 static void amdvi_sysbus_realize(DeviceState *dev, Error **errp) { - int ret =3D 0; AMDVIState *s =3D AMD_IOMMU_DEVICE(dev); MachineState *ms =3D MACHINE(qdev_get_machine()); PCMachineState *pcms =3D PC_MACHINE(ms); @@ -1550,23 +1577,6 @@ static void amdvi_sysbus_realize(DeviceState *dev, E= rror **errp) if (!qdev_realize(DEVICE(&s->pci), &bus->qbus, errp)) { return; } - ret =3D pci_add_capability(&s->pci.dev, AMDVI_CAPAB_ID_SEC, 0, - AMDVI_CAPAB_SIZE, errp); - if (ret < 0) { - return; - } - s->pci.capab_offset =3D ret; - - ret =3D pci_add_capability(&s->pci.dev, PCI_CAP_ID_MSI, 0, - AMDVI_CAPAB_REG_SIZE, errp); - if (ret < 0) { - return; - } - ret =3D pci_add_capability(&s->pci.dev, PCI_CAP_ID_HT, 0, - AMDVI_CAPAB_REG_SIZE, errp); - if (ret < 0) { - return; - } =20 /* Pseudo address space under root PCI bus. */ x86ms->ioapic_as =3D amdvi_host_dma_iommu(bus, s, AMDVI_IOAPIC_SB_DEVI= D); @@ -1578,7 +1588,6 @@ static void amdvi_sysbus_realize(DeviceState *dev, Er= ror **errp) sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->mmio); sysbus_mmio_map(SYS_BUS_DEVICE(s), 0, AMDVI_BASE_ADDR); pci_setup_iommu(bus, amdvi_host_dma_iommu, s); - msi_init(&s->pci.dev, 0, 1, true, false, errp); amdvi_init(s); } =20 @@ -1625,6 +1634,7 @@ static void amdvi_pci_class_init(ObjectClass *klass, = void *data) =20 k->vendor_id =3D PCI_VENDOR_ID_AMD; k->class_id =3D 0x0806; + k->realize =3D amdvi_pci_realize; =20 set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc =3D "AMD IOMMU (AMD-Vi) DMA Remapping device"; --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682409036; cv=none; d=zohomail.com; s=zohoarc; b=ECf8vD49qCCaR1xvMn+5/1IH28E6CbPJFPwtsLk0WfATvED8DZ9+9ifEynNyatH07g2zGVG7PILWbcpOuYo2OTZp8Enq3fStZlaI6ukalr/qTR08xqiusF9myDWku9W5KKmP9xutUf/oDwsNpFyE9tXeuuFPly8vPY2LS29HxV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682409036; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SZyALfukxzBD+7v1skx9V8CEhb/AqBg6Lg9I83bz/T8=; b=OgXoiwZ2vMU0BUqottP/QMepi7iwdRBxZfR5XsT1hEOTgqMTkL/PPcB2Rj7dNX783NztfdEgPjfmAS/6kVfmDHmi4xVmuILc/vuc6B+6ndTAJyAaTE4Ee7Yf1fpf73VRZS/3QgZ662QYScnfXbHl7TEgHGw4Iuft011avxHMaaE= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682409036327569.3026614068484; Tue, 25 Apr 2023 00:50:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDN1-0008R5-Fy; Tue, 25 Apr 2023 03:45:51 -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 1prDMz-0008Hv-Ra for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDMx-0006n9-Og for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:49 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-NR3KoDzzMKSD7HIyT0jYiw-1; Tue, 25 Apr 2023 03:45:45 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f080f9ea3eso20277965e9.1 for ; Tue, 25 Apr 2023 00:45:45 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id o10-20020a1c750a000000b003f191c9c4b0sm11060595wmc.11.2023.04.25.00.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408747; 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: in-reply-to:in-reply-to:references:references; bh=SZyALfukxzBD+7v1skx9V8CEhb/AqBg6Lg9I83bz/T8=; b=JKJvNanr5lkXd+2ahYSaBzjUNCOgTW43Aj8JLc8DpJxLq9SbNfr1uAxvXue5m1GwW/5sKO qcA+gUZhB2xVnH7EKiko6eNg7Jf4DVZx/XCISUIwhBMw/gx+E1dcH7pzF4klI0RuO+KcMe EvVZlzzVNg0mjQFMIuktVWDqbae8jV8= X-MC-Unique: NR3KoDzzMKSD7HIyT0jYiw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408743; x=1685000743; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=SZyALfukxzBD+7v1skx9V8CEhb/AqBg6Lg9I83bz/T8=; b=OjPI5Ug70/52Zda3Uhi/b2BmEnYYx9rbml5tPDg0TFjHv1Ng5j3sq/BuqYf/IP1qVw Ebej+YKlyhVLTBy5VDqWAikEW0B+vfg7Wk0XawqXbrVieU+CrIdSviTlZyD2FSKaUjuj yLHaiEbeSm8FWjYIHgruX+/9qahCFqZbylXM3g8EJjnUm83m/99xGth0uodAN6ytUdM3 zkkdk6nYJcSpvL2SVvVXVWbP369xUtTNo8s9jCye9rlqU1nxocJ479C6aej6KTDkC+BF c3kC22GZvjHHjFVMunXfE7cBtMfVxCsWKILf3bfCfyN7wQsUcVpD72e8PF2mYCaPrWe8 Hf6g== X-Gm-Message-State: AAQBX9cmXxauLL2vDyDCIVRLCxH0ogdxjnW8m/jaPew66Wnx6NUZDAjr teYIWIWMiZSLuUQIMiu9AnJxCvur/B4nJmRed/YAUD7wsoxX3XUKv70i7Cf+5eVtCO5r2M18tc0 +67gmiSXN1pSQrU5TSgOEq/3lWZaViu3SVxuVRirCZhnRC8EkDu+MKXxhOO9jLejhXdgJ X-Received: by 2002:a1c:f703:0:b0:3f1:8aaa:c20c with SMTP id v3-20020a1cf703000000b003f18aaac20cmr9254145wmh.7.1682408743053; Tue, 25 Apr 2023 00:45:43 -0700 (PDT) X-Google-Smtp-Source: AKy350ZjGTe1T/xtPuDjdz/lLIbB779Df0qnRXhmuPm9srvEx7TXY3QGG9eMUpOVKaeHaAEFO4z3/A== X-Received: by 2002:a1c:f703:0:b0:3f1:8aaa:c20c with SMTP id v3-20020a1cf703000000b003f18aaac20cmr9254105wmh.7.1682408742668; Tue, 25 Apr 2023 00:45:42 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:38 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cornelia Huck , Eduardo Habkost , Marcel Apfelbaum , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Yanan Wang , Paolo Bonzini , Richard Henderson , Laurent Vivier , Daniel Henrique Barboza , =?utf-8?Q?C=C3=A9dric?= Le Goater , David Gibson , Greg Kurz , Thomas Huth , David Hildenbrand , Ilya Leoshkevich , Halil Pasic , Christian Borntraeger , Eric Farman , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org Subject: [PULL 15/31] hw: Add compat machines for 8.1 Message-ID: <0259dd3e6ffe35145068ddc1bfb5c3ec06b33f48.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1682409037829100002 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cornelia Huck Add 8.1 machine types for arm/i440fx/m68k/q35/s390x/spapr. Signed-off-by: Cornelia Huck Message-Id: <20230314173009.152667-1-cohuck@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/boards.h | 3 +++ include/hw/i386/pc.h | 3 +++ hw/arm/virt.c | 11 +++++++++-- hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 16 +++++++++++++--- hw/i386/pc_q35.c | 14 ++++++++++++-- hw/m68k/virt.c | 11 +++++++++-- hw/ppc/spapr.c | 17 ++++++++++++++--- hw/s390x/s390-virtio-ccw.c | 14 +++++++++++++- 10 files changed, 82 insertions(+), 13 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index f840f88d54..f4117fdb9a 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -383,6 +383,9 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) =20 +extern GlobalProperty hw_compat_8_0[]; +extern const size_t hw_compat_8_0_len; + extern GlobalProperty hw_compat_7_2[]; extern const size_t hw_compat_7_2_len; =20 diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 8206d5405a..eb668e9034 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -195,6 +195,9 @@ void pc_madt_cpu_entry(int uid, const CPUArchIdList *ap= ic_ids, /* sgx.c */ void pc_machine_init_sgx_epc(PCMachineState *pcms); =20 +extern GlobalProperty pc_compat_8_0[]; +extern const size_t pc_compat_8_0_len; + extern GlobalProperty pc_compat_7_2[]; extern const size_t pc_compat_7_2_len; =20 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ac626b3bef..267fe56fae 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3232,10 +3232,17 @@ static void machvirt_machine_init(void) } type_init(machvirt_machine_init); =20 -static void virt_machine_8_0_options(MachineClass *mc) +static void virt_machine_8_1_options(MachineClass *mc) { } -DEFINE_VIRT_MACHINE_AS_LATEST(8, 0) +DEFINE_VIRT_MACHINE_AS_LATEST(8, 1) + +static void virt_machine_8_0_options(MachineClass *mc) +{ + virt_machine_8_1_options(mc); + compat_props_add(mc->compat_props, hw_compat_8_0, hw_compat_8_0_len); +} +DEFINE_VIRT_MACHINE(8, 0) =20 static void virt_machine_7_2_options(MachineClass *mc) { diff --git a/hw/core/machine.c b/hw/core/machine.c index cd13b8b0a3..2ce97a5d3b 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -39,6 +39,9 @@ #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-pci.h" =20 +GlobalProperty hw_compat_8_0[] =3D {}; +const size_t hw_compat_8_0_len =3D G_N_ELEMENTS(hw_compat_8_0); + GlobalProperty hw_compat_7_2[] =3D { { "e1000e", "migrate-timadj", "off" }, { "virtio-mem", "x-early-migration", "false" }, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 1489abf010..615e1d3d06 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -116,6 +116,9 @@ { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }= ,\ { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, =20 +GlobalProperty pc_compat_8_0[] =3D {}; +const size_t pc_compat_8_0_len =3D G_N_ELEMENTS(pc_compat_8_0); + GlobalProperty pc_compat_7_2[] =3D { { "ICH9-LPC", "noreboot", "true" }, }; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 30eedd62a3..21591dad8d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -454,21 +454,31 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); } =20 -static void pc_i440fx_8_0_machine_options(MachineClass *m) +static void pc_i440fx_8_1_machine_options(MachineClass *m) { pc_i440fx_machine_options(m); m->alias =3D "pc"; m->is_default =3D true; } =20 +DEFINE_I440FX_MACHINE(v8_1, "pc-i440fx-8.1", NULL, + pc_i440fx_8_1_machine_options); + +static void pc_i440fx_8_0_machine_options(MachineClass *m) +{ + pc_i440fx_8_1_machine_options(m); + m->alias =3D NULL; + m->is_default =3D false; + compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len); + compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len); +} + DEFINE_I440FX_MACHINE(v8_0, "pc-i440fx-8.0", NULL, pc_i440fx_8_0_machine_options); =20 static void pc_i440fx_7_2_machine_options(MachineClass *m) { pc_i440fx_8_0_machine_options(m); - m->alias =3D NULL; - m->is_default =3D false; compat_props_add(m->compat_props, hw_compat_7_2, hw_compat_7_2_len); compat_props_add(m->compat_props, pc_compat_7_2, pc_compat_7_2_len); } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 797ba347fd..f02919d92c 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -373,19 +373,29 @@ static void pc_q35_machine_options(MachineClass *m) m->max_cpus =3D 288; } =20 -static void pc_q35_8_0_machine_options(MachineClass *m) +static void pc_q35_8_1_machine_options(MachineClass *m) { pc_q35_machine_options(m); m->alias =3D "q35"; } =20 +DEFINE_Q35_MACHINE(v8_1, "pc-q35-8.1", NULL, + pc_q35_8_1_machine_options); + +static void pc_q35_8_0_machine_options(MachineClass *m) +{ + pc_q35_8_1_machine_options(m); + m->alias =3D NULL; + compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len); + compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len); +} + DEFINE_Q35_MACHINE(v8_0, "pc-q35-8.0", NULL, pc_q35_8_0_machine_options); =20 static void pc_q35_7_2_machine_options(MachineClass *m) { pc_q35_8_0_machine_options(m); - m->alias =3D NULL; compat_props_add(m->compat_props, hw_compat_7_2, hw_compat_7_2_len); compat_props_add(m->compat_props, pc_compat_7_2, pc_compat_7_2_len); } diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index 754b9bdfcc..731205b215 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -347,10 +347,17 @@ type_init(virt_machine_register_types) } \ type_init(machvirt_machine_##major##_##minor##_init); =20 -static void virt_machine_8_0_options(MachineClass *mc) +static void virt_machine_8_1_options(MachineClass *mc) { } -DEFINE_VIRT_MACHINE(8, 0, true) +DEFINE_VIRT_MACHINE(8, 1, true) + +static void virt_machine_8_0_options(MachineClass *mc) +{ + virt_machine_8_1_options(mc); + compat_props_add(mc->compat_props, hw_compat_8_0, hw_compat_8_0_len); +} +DEFINE_VIRT_MACHINE(8, 0, false) =20 static void virt_machine_7_2_options(MachineClass *mc) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4921198b9d..ddc9c7b1a1 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4735,14 +4735,25 @@ static void spapr_machine_latest_class_options(Mach= ineClass *mc) type_init(spapr_machine_register_##suffix) =20 /* - * pseries-8.0 + * pseries-8.1 */ -static void spapr_machine_8_0_class_options(MachineClass *mc) +static void spapr_machine_8_1_class_options(MachineClass *mc) { /* Defaults for the latest behaviour inherited from the base class */ } =20 -DEFINE_SPAPR_MACHINE(8_0, "8.0", true); +DEFINE_SPAPR_MACHINE(8_1, "8.1", true); + +/* + * pseries-8.0 + */ +static void spapr_machine_8_0_class_options(MachineClass *mc) +{ + spapr_machine_8_1_class_options(mc); + compat_props_add(mc->compat_props, hw_compat_8_0, hw_compat_8_0_len); +} + +DEFINE_SPAPR_MACHINE(8_0, "8.0", false); =20 /* * pseries-7.2 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 503f212a31..e6f2c62625 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -826,14 +826,26 @@ bool css_migration_enabled(void) } = \ type_init(ccw_machine_register_##suffix) =20 +static void ccw_machine_8_1_instance_options(MachineState *machine) +{ +} + +static void ccw_machine_8_1_class_options(MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE(8_1, "8.1", true); + static void ccw_machine_8_0_instance_options(MachineState *machine) { + ccw_machine_8_1_instance_options(machine); } =20 static void ccw_machine_8_0_class_options(MachineClass *mc) { + ccw_machine_8_1_class_options(mc); + compat_props_add(mc->compat_props, hw_compat_8_0, hw_compat_8_0_len); } -DEFINE_CCW_MACHINE(8_0, "8.0", true); +DEFINE_CCW_MACHINE(8_0, "8.0", false); =20 static void ccw_machine_7_2_instance_options(MachineState *machine) { --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408785; cv=none; d=zohomail.com; s=zohoarc; b=Y0P6+eRcm/wCrgKeNUjSbNhxRDCYkvLjaK1nVDeMqNAnfebeVfr2gj2kfesY/DPG7n9i0HrOeJ/qet67SBs/fJN3FFBSJhRZ/w+7J5fszvoZ6Tfvgh5SE1odiZ3tOZgLcfDeoxliNxWU3jUUyfkXprfAoXZp6aH1DoDgnOHxsCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408785; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sdqkWiEXuBbe0aMuicHVixExQ0RmC/KmdA8XIHRB1Jw=; b=l9eKZYFxM0MuwiYa6uA9qEAF44LGQzOOR1xWeb9zAIxod2dT4TYsnDpp6kAFl4aQGNq558RpFS1XZIRXJ2vAdQPbFNKtFNs7OA/3XffAde+zN+k0x41aSwT63O/iB8hKeQwXlkYp8YBUaNAAP5celO25b3VHB8KZsVnOGhGAEYk= 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 1682408785323660.4149990729887; Tue, 25 Apr 2023 00:46:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.525746.817127 (Exim 4.92) (envelope-from ) id 1prDN3-0003Xd-Qx; Tue, 25 Apr 2023 07:45:53 +0000 Received: by outflank-mailman (output) from mailman id 525746.817127; Tue, 25 Apr 2023 07:45:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1prDN3-0003XW-OD; Tue, 25 Apr 2023 07:45:53 +0000 Received: by outflank-mailman (input) for mailman id 525746; Tue, 25 Apr 2023 07:45:52 +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 1prDN2-0003XO-CW for xen-devel@lists.xenproject.org; Tue, 25 Apr 2023 07:45:52 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3228640a-e33d-11ed-b223-6b7b168915f2; Tue, 25 Apr 2023 09:45:50 +0200 (CEST) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-5FbvCDsMMVucTY83pUDLkw-1; Tue, 25 Apr 2023 03:45:47 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f250e9e090so6441655e9.0 for ; Tue, 25 Apr 2023 00:45:47 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id c21-20020a7bc855000000b003f17300c7dcsm14069408wml.48.2023.04.25.00.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:45 -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: 3228640a-e33d-11ed-b223-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408749; 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: in-reply-to:in-reply-to:references:references; bh=sdqkWiEXuBbe0aMuicHVixExQ0RmC/KmdA8XIHRB1Jw=; b=DFpss1RSe5Q3/YBqOYsnaajaQEGoVIfPIwr4u80ZPfnk/SbbxCPTvhR9SDj3Igw2a1WnCT Mny3MCBn54YJ2oYz0YRtGXIXMKnXp6DMLi76KI/TvgXHfjs5/7a2mq9MVjNyJuMsuDlh/T 5tdKoR1zd2QZ0QuMgEvNZx5fY3eIjdk= X-MC-Unique: 5FbvCDsMMVucTY83pUDLkw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408746; x=1685000746; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sdqkWiEXuBbe0aMuicHVixExQ0RmC/KmdA8XIHRB1Jw=; b=iSJGD3z+U+0uV4EVgSfI6xvXRP/WbXAvmPkcL7gDfW5RM5Cc3GO+kUgNZV5Pc0fuVF Mn+Y104FgnTGRAbbciWBomizKX93GN7CuqiatWLQCtALWNuYEF9mXVckzkEEsDwdYs/Q Zi0AirbcdCZn7W027vTK6MX/aYpi3sbV2kjLwZqatC3gyryZKhw8CDlvwbDVU0G69r8h 8+YJO+ZHqAbhN7EC2U07Q1P7GL/msRxBUtNmgMeBtqOlV0gUxtHhrs5krPFDveIPer3/ MVGP7kgZq5qtySypUeEnfAammQx2/3PZFZuwoKyEs90XddUl9g8HEFSBq4vqNY25hh+2 U/zw== X-Gm-Message-State: AAQBX9e67411ZX0ybk1qH2fdp/Nw+sBTelX4VdXWHFF/ruvVLleVfyZI MHvxlwGvUi2EqhHHhyBWqBeMrzRbyZbwn1c+tf2dYFKJ4ALe6BwwcvEKVhbhQYibTNCL0g8mwwc qMiyTH1nyWFjKN4zfpsE7oqMEFW0= X-Received: by 2002:a7b:c393:0:b0:3f1:6458:99a7 with SMTP id s19-20020a7bc393000000b003f1645899a7mr9012014wmj.38.1682408746653; Tue, 25 Apr 2023 00:45:46 -0700 (PDT) X-Google-Smtp-Source: AKy350ad4TCuWCBC+AG461cfDN1Vfgv2g5HSPeZ6e0X8sYuDXur/RoTq2vL2cKfGjWKS10+DKS3e8g== X-Received: by 2002:a7b:c393:0:b0:3f1:6458:99a7 with SMTP id s19-20020a7bc393000000b003f1645899a7mr9011994wmj.38.1682408746316; Tue, 25 Apr 2023 00:45:46 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:42 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Chuck Zmudzinski , Mark Cave-Ayland , Marcel Apfelbaum , Artyom Tarasenko , Stefano Stabellini , Anthony Perard , Paul Durrant , xen-devel@lists.xenproject.org Subject: [PULL 16/31] pci: avoid accessing slot_reserved_mask directly outside of pci.c Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1682408786436100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Chuck Zmudzinski This patch provides accessor functions as replacements for direct access to slot_reserved_mask according to the comment at the top of include/hw/pci/pci_bus.h which advises that data structures for PCIBus should not be directly accessed but instead be accessed using accessor functions in pci.h. Three accessor functions can conveniently replace all direct accesses of slot_reserved_mask. With this patch, the new accessor functions are used in hw/sparc64/sun4u.c and hw/xen/xen_pt.c and pci_bus.h is removed from the included header files of the same two files. No functional change intended. Signed-off-by: Chuck Zmudzinski Message-Id: Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Tested-by: Mark Cave-Ayland [sun4u] --- include/hw/pci/pci.h | 3 +++ hw/pci/pci.c | 15 +++++++++++++++ hw/sparc64/sun4u.c | 7 +++---- hw/xen/xen_pt.c | 7 +++---- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index d5a40cd058..935b4b91b4 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -287,6 +287,9 @@ void pci_bus_irqs(PCIBus *bus, pci_set_irq_fn set_irq, void pci_bus_map_irqs(PCIBus *bus, pci_map_irq_fn map_irq); void pci_bus_irqs_cleanup(PCIBus *bus); int pci_bus_get_irq_level(PCIBus *bus, int irq_num); +uint32_t pci_bus_get_slot_reserved_mask(PCIBus *bus); +void pci_bus_set_slot_reserved_mask(PCIBus *bus, uint32_t mask); +void pci_bus_clear_slot_reserved_mask(PCIBus *bus, uint32_t mask); /* 0 <=3D pin <=3D 3 0 =3D INTA, 1 =3D INTB, 2 =3D INTC, 3 =3D INTD */ static inline int pci_swizzle(int slot, int pin) { diff --git a/hw/pci/pci.c b/hw/pci/pci.c index def5000e7b..8a87ccc8b0 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1116,6 +1116,21 @@ static bool pci_bus_devfn_reserved(PCIBus *bus, int = devfn) return bus->slot_reserved_mask & (1UL << PCI_SLOT(devfn)); } =20 +uint32_t pci_bus_get_slot_reserved_mask(PCIBus *bus) +{ + return bus->slot_reserved_mask; +} + +void pci_bus_set_slot_reserved_mask(PCIBus *bus, uint32_t mask) +{ + bus->slot_reserved_mask |=3D mask; +} + +void pci_bus_clear_slot_reserved_mask(PCIBus *bus, uint32_t mask) +{ + bus->slot_reserved_mask &=3D ~mask; +} + /* -1 for devfn means auto assign */ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, const char *name, int devfn, diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index a25e951f9d..eae7589462 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -31,7 +31,6 @@ #include "hw/irq.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h" -#include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" #include "hw/qdev-properties.h" #include "hw/pci-host/sabre.h" @@ -608,9 +607,9 @@ static void sun4uv_init(MemoryRegion *address_space_mem, /* Only in-built Simba APBs can exist on the root bus, slot 0 on busA = is reserved (leaving no slots free after on-board devices) however slo= ts 0-3 are free on busB */ - pci_bus->slot_reserved_mask =3D 0xfffffffc; - pci_busA->slot_reserved_mask =3D 0xfffffff1; - pci_busB->slot_reserved_mask =3D 0xfffffff0; + pci_bus_set_slot_reserved_mask(pci_bus, 0xfffffffc); + pci_bus_set_slot_reserved_mask(pci_busA, 0xfffffff1); + pci_bus_set_slot_reserved_mask(pci_busB, 0xfffffff0); =20 ebus =3D pci_new_multifunction(PCI_DEVFN(1, 0), true, TYPE_EBUS); qdev_prop_set_uint64(DEVICE(ebus), "console-serial-base", diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 2d33d178ad..a540149639 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -57,7 +57,6 @@ #include =20 #include "hw/pci/pci.h" -#include "hw/pci/pci_bus.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "xen_pt.h" @@ -951,7 +950,7 @@ void xen_igd_reserve_slot(PCIBus *pci_bus) } =20 XEN_PT_LOG(0, "Reserving PCI slot 2 for IGD\n"); - pci_bus->slot_reserved_mask |=3D XEN_PCI_IGD_SLOT_MASK; + pci_bus_set_slot_reserved_mask(pci_bus, XEN_PCI_IGD_SLOT_MASK); } =20 static void xen_igd_clear_slot(DeviceState *qdev, Error **errp) @@ -971,7 +970,7 @@ static void xen_igd_clear_slot(DeviceState *qdev, Error= **errp) return; } =20 - if (!(pci_bus->slot_reserved_mask & XEN_PCI_IGD_SLOT_MASK)) { + if (!(pci_bus_get_slot_reserved_mask(pci_bus) & XEN_PCI_IGD_SLOT_MASK)= ) { xpdc->pci_qdev_realize(qdev, errp); return; } @@ -982,7 +981,7 @@ static void xen_igd_clear_slot(DeviceState *qdev, Error= **errp) s->real_device.dev =3D=3D XEN_PCI_IGD_DEV && s->real_device.func =3D=3D XEN_PCI_IGD_FN && s->real_device.vendor_id =3D=3D PCI_VENDOR_ID_INTEL) { - pci_bus->slot_reserved_mask &=3D ~XEN_PCI_IGD_SLOT_MASK; + pci_bus_clear_slot_reserved_mask(pci_bus, XEN_PCI_IGD_SLOT_MASK); XEN_PT_LOG(pci_dev, "Intel IGD found, using slot 2\n"); } xpdc->pci_qdev_realize(qdev, errp); --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408796; cv=none; d=zohomail.com; s=zohoarc; b=Htzwht+Ieut0RyuGPACQS4oiTabZBIKw8AxX0wwAzs1r6yPwhr2BshsdVmZIDalT1mlmxgHVJwVwBwYs/r33U65pz+DY+KlBjpcK4HrATCcRlguPasGjyojqN4qiIr2zU2YF6qtgIttF0UCPFfECN4eLMJdRl3q+wZ/yBK0Ywlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408796; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=blfDpFbwTXrEQIE32dbNR8aJtUL+pHsX1hk7uO4u/aw=; b=F8W6X4Ddpg86ABmnKq9hSqgbXSEIQD5rI7W3SghJ8AxgXnxDZoiJtrhjbV60/Zt+54+oDAZ6KqhyLSIptsVKCHo+euQ2+W5AmB798l+N4m47BIoQoxPp1JCXDkXiM2Mp8Pl4r6Y5pIjtRdF93ACKSjl9nJv73SVFnMc6fEaqiKI= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408796181347.8397466582147; Tue, 25 Apr 2023 00:46:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDN7-0000TY-Sf; Tue, 25 Apr 2023 03:45:58 -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 1prDN5-0000QD-NK for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:55 -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 1prDN3-0006oD-Ta for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:55 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-601-2-JVNWv4MRWDhBsvxb7Q0Q-1; Tue, 25 Apr 2023 03:45:52 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f25376e3b1so5294225e9.1 for ; Tue, 25 Apr 2023 00:45:51 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id k17-20020a5d6291000000b002c561805a4csm12455059wru.45.2023.04.25.00.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408753; 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: in-reply-to:in-reply-to:references:references; bh=blfDpFbwTXrEQIE32dbNR8aJtUL+pHsX1hk7uO4u/aw=; b=D7QmHiA4wy24irRri2+0IYoNVgIJy+Jo1mPFRCqvQrmhDk9ntiKfAoL51LaqXLkaXnQQJJ Vm6RZpUZgihQqi4mZavwR0H1Ve1NWnFc+Q4CdoMxZUVFWCt2ieoCzDmq7CnWUArVRiL2e6 GFchTBmsiyscJeTvKTK+c2AHFw8Xewc= X-MC-Unique: 2-JVNWv4MRWDhBsvxb7Q0Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408750; x=1685000750; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=blfDpFbwTXrEQIE32dbNR8aJtUL+pHsX1hk7uO4u/aw=; b=EV5i5hxVmEYx+SlmOuQMoj6pZB3PPUll5nVTCO9Q8fydhIauKvuLFUzfthGvo2LTrm 2QC7KWdW4+HC9phYY7W+Z/240pn/lkLEKtGizGcfrZV1LnOPFy48e0mwcujt75rqX4Fm eqMncYgJukvboG0I0cw1F8w3UY7zzuUuaj37FTgNg8FyBXyh72ctDYHBcLGmGKO0Fr3v hkDU1dCCXmXWNCcguelqcK0pXi2WKxqw5QltWQO2D7N05orYpuLXdnJyNVxyhQhCPxxt b7F1igmpVYFIFHhlK9AANvFxaX8ypT9a4+Aj2HEkrs1222tucEbhd7fLUCUgBDk3BLUq clrg== X-Gm-Message-State: AAQBX9eTfEjuXCX1+Y3/idxZfdvYHWbO8z01iByryCNuES1cVUId6Uf+ W9OsZaHK8X8JsEmCCsTdEgwGzZ5NTUM1Z/fhgD7TWvNkLHx/cCPt/dX3Er6TM7pazCFigxGY5qy qI2K/tJ1psTDw7GMXnHHDCzuWSVVU79P3rwyCjUMs4lNHZ74Otmlvwu87I5BPg9oy/14w X-Received: by 2002:adf:f1d1:0:b0:2ef:5d73:f6b7 with SMTP id z17-20020adff1d1000000b002ef5d73f6b7mr10956485wro.13.1682408750248; Tue, 25 Apr 2023 00:45:50 -0700 (PDT) X-Google-Smtp-Source: AKy350bA9yONv16tMDWeHyElrRQgn47L4yQfbQMmE3Z1mG3NTcFvGyzO3U5zwxXenkbT6qRzvrDe3w== X-Received: by 2002:adf:f1d1:0:b0:2ef:5d73:f6b7 with SMTP id z17-20020adff1d1000000b002ef5d73f6b7mr10956469wro.13.1682408749981; Tue, 25 Apr 2023 00:45:49 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:46 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Vladimir Sementsov-Ogievskiy , Coiby Xu , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org Subject: [PULL 17/31] vhost-user-blk-server: notify client about disk resize Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408797141100007 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Currently block_resize qmp command is simply ignored by vhost-user-blk export. So, the block-node is successfully resized, but virtio config is unchanged and guest doesn't see that disk is resized. Let's handle the resize by modifying the config and notifying the guest appropriately. After this comment, lsblk in linux guest with attached vhost-user-blk-pci device shows new size immediately after block_resize QMP command on vhost-user exported block node. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20230321201323.3695923-1-vsementsov@yandex-team.ru> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- subprojects/libvhost-user/libvhost-user.h | 2 ++ block/export/vhost-user-blk-server.c | 24 +++++++++++++++++++++++ subprojects/libvhost-user/libvhost-user.c | 10 ++++++++++ 3 files changed, 36 insertions(+) diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvho= st-user/libvhost-user.h index 8c5a2719e3..49208cceaa 100644 --- a/subprojects/libvhost-user/libvhost-user.h +++ b/subprojects/libvhost-user/libvhost-user.h @@ -585,6 +585,8 @@ bool vu_queue_empty(VuDev *dev, VuVirtq *vq); */ void vu_queue_notify(VuDev *dev, VuVirtq *vq); =20 +void vu_config_change_msg(VuDev *dev); + /** * vu_queue_notify_sync: * @dev: a VuDev context diff --git a/block/export/vhost-user-blk-server.c b/block/export/vhost-user= -blk-server.c index 3409d9e02e..e56b92f2e2 100644 --- a/block/export/vhost-user-blk-server.c +++ b/block/export/vhost-user-blk-server.c @@ -10,6 +10,7 @@ * later. See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "block/block.h" #include "subprojects/libvhost-user/libvhost-user.h" /* only for the type = definitions */ #include "standard-headers/linux/virtio_blk.h" @@ -251,6 +252,27 @@ static void vu_blk_exp_request_shutdown(BlockExport *e= xp) vhost_user_server_stop(&vexp->vu_server); } =20 +static void vu_blk_exp_resize(void *opaque) +{ + VuBlkExport *vexp =3D opaque; + BlockDriverState *bs =3D blk_bs(vexp->handler.blk); + int64_t new_size =3D bdrv_getlength(bs); + + if (new_size < 0) { + error_printf("Failed to get length of block node '%s'", + bdrv_get_node_name(bs)); + return; + } + + vexp->blkcfg.capacity =3D cpu_to_le64(new_size >> VIRTIO_BLK_SECTOR_BI= TS); + + vu_config_change_msg(&vexp->vu_server.vu_dev); +} + +static const BlockDevOps vu_blk_dev_ops =3D { + .resize_cb =3D vu_blk_exp_resize, +}; + static int vu_blk_exp_create(BlockExport *exp, BlockExportOptions *opts, Error **errp) { @@ -292,6 +314,8 @@ static int vu_blk_exp_create(BlockExport *exp, BlockExp= ortOptions *opts, blk_add_aio_context_notifier(exp->blk, blk_aio_attached, blk_aio_detac= h, vexp); =20 + blk_set_dev_ops(exp->blk, &vu_blk_dev_ops, vexp); + if (!vhost_user_server_start(&vexp->vu_server, vu_opts->addr, exp->ctx, num_queues, &vu_blk_iface, errp)) { blk_remove_aio_context_notifier(exp->blk, blk_aio_attached, diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvho= st-user/libvhost-user.c index 0200b78e8e..0abd898a52 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -2455,6 +2455,16 @@ void vu_queue_notify_sync(VuDev *dev, VuVirtq *vq) _vu_queue_notify(dev, vq, true); } =20 +void vu_config_change_msg(VuDev *dev) +{ + VhostUserMsg vmsg =3D { + .request =3D VHOST_USER_BACKEND_CONFIG_CHANGE_MSG, + .flags =3D VHOST_USER_VERSION, + }; + + vu_message_write(dev, dev->slave_fd, &vmsg); +} + static inline void vring_used_flags_set_bit(VuVirtq *vq, int mask) { --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408973; cv=none; d=zohomail.com; s=zohoarc; b=ikXLDJYgg47PpFC0dlkA83CTnTqqDsTrLxiT+LMMEW7z3sFgWCNx0Qeww//baXleWqeOq2meEFzmmDpdGXmvxnlB1HjhxE+42UwWh8NhXCxQ4og0MYVbOhvQm7Iv3xzIfDzz2eDxUCUDbhezMc/mcB55iWG80zDk+jcNyWDngcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408973; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1alCUm+k7ESdeXvrCp2Z+zu3n7fe+Oxkw/OyZwonDqs=; b=nN73meT7DyAjhXEGn8Y7QBhGUcqtBStETwIKTGW2wVHB4eCWHI+wszWZs9QoEaMkuFNuOOAwzjgAFysEPKsVu8uByOgiT+x9PGLE8MpFoQuT3XTlHzv/FOXrzeTwCr1ePkoU+zeBchs8H3P4CR/lMMugIG+EC135QGr9pZea/zM= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408973977298.000129040205; Tue, 25 Apr 2023 00:49:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDNM-0000cK-3C; Tue, 25 Apr 2023 03:46:17 -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 1prDN9-0000VQ-Cm for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:59 -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 1prDN7-0006os-Ua for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:59 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-207-s-iojnCTP-aiQ0PSTEv9hQ-1; Tue, 25 Apr 2023 03:45:56 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-301110f1756so1924159f8f.0 for ; Tue, 25 Apr 2023 00:45:56 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id c7-20020a5d4cc7000000b002fa5a73bf9bsm12410799wrt.89.2023.04.25.00.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408757; 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: in-reply-to:in-reply-to:references:references; bh=1alCUm+k7ESdeXvrCp2Z+zu3n7fe+Oxkw/OyZwonDqs=; b=XWMqgfJ3utPFjIJnT2eshZl4Kcf/YZ7vAj0UW7lIOKv0YSayOMPFakjaWqZivbLMMe5kIs YxbNNT4luAV319/Ob7T1/eQFrhw0/5dzWZXort4T3RMJVXdJgkYgtnkJOmHpSrY/gW6kV3 DxljRc+gnBYA+/Q3KueDDbYyPFzUW0k= X-MC-Unique: s-iojnCTP-aiQ0PSTEv9hQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408754; x=1685000754; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1alCUm+k7ESdeXvrCp2Z+zu3n7fe+Oxkw/OyZwonDqs=; b=j+0xEqeDT4QKpu1VIgYmZhLVccw5eVO4caNBiyHU8odSvTR5gop651NSGd9QDnyBwP UCW0+hTEH0iYcAJdpR2Oohey/ePgEjS5QV9UwGffx1YJjEGGiAZjGoUDsKMcgccn6CFP Iu4C/NUsHM0ewShONh/V2W5HuHS95ldO43M9eVVb/sLjVF10P1VbO6PNxiJhHkH4W0sN kiNUKcDhNNjNwo0MyNuDn6na4WLxX5+iwypig96vt+H3hW02M5iidZArplWtaHLvTANz HptBMf1+WU8Hwz2vyQh/VoThGugXslhU3H0j1J6OBmNghmS3TO0Qo16mZS+xqhf1Y0Pj 3FiQ== X-Gm-Message-State: AAQBX9dAOIFdECt/hZ6Bg1JdAPXYrxSYS2zjTETPlxhx57T6zCCMdgvJ ushrxL51v6LEAdIh/669cGv0BcExok9eGvd9/mYzoKhUf4OOVJY7/9qg7QB4QFV4CgbROcPUhIT KzX6xyhOCC4xrW4z7eLLi3SPgRU3btx+gHuGjaNMoEqlFOHmQ9SHVIioTKsLhY5Cb0FHe X-Received: by 2002:a5d:4611:0:b0:2f4:2f98:bf2d with SMTP id t17-20020a5d4611000000b002f42f98bf2dmr11696117wrq.37.1682408753797; Tue, 25 Apr 2023 00:45:53 -0700 (PDT) X-Google-Smtp-Source: AKy350af3YHfhj5uUR5MZKZrL1hRIgwssjjQ2eE3mPv0EoXh8QekozNoWKEo3pYIi0rXIU11zfQ4Pg== X-Received: by 2002:a5d:4611:0:b0:2f4:2f98:bf2d with SMTP id t17-20020a5d4611000000b002f42f98bf2dmr11696092wrq.37.1682408753465; Tue, 25 Apr 2023 00:45:53 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:50 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Ani Sinha , Ani Sinha , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth , Alex =?utf-8?Q?Benn=C3=A9e?= Subject: [PULL 18/31] Add my old and new work email mapping and use work email to support acpi Message-ID: <104593c3ad48f3857e9c48d9e3e7feb3566444c7.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408974367100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ani Sinha Updating mailmap to indicate ani@anisinha.ca and anisinha@redhat.com are one and the same person. Also updating my email in MAINTAINERS for all my acpi = work (reviewing patches and biosbits) to my work email. Also doing the same for bios bits test framework documentation. Signed-off-by: Ani Sinha Message-Id: <20230329040834.11973-1-anisinha@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 83c0373872..e365a7a47e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1894,7 +1894,7 @@ F: hw/pci/pcie_doe.c ACPI/SMBIOS M: Michael S. Tsirkin M: Igor Mammedov -R: Ani Sinha +R: Ani Sinha S: Supported F: include/hw/acpi/* F: include/hw/firmware/smbios.h --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408962; cv=none; d=zohomail.com; s=zohoarc; b=MRR5ADShqKFglu61owFxLEuSX+AtqsTRIag3cpLJ44XD07WnKH4JVX45Trh28vK40e40HHJhjgGbW09tClWyH2zvatAHtTCRLIkIIIdNvbdzBJXwdx5frOoM1Om/aB1fwYYxm6pWKyd91Mvr9iUiXa1KHaeME1tdPOutHqrky1A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408962; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=norJz+1M75We69bp+lSvK+ufLxrx4lDcxGwEvwpqxDw=; b=lOKB5XJCknKeeeoyrKXCEiDArQADYp9OXBdmisg/9dv0HUi7gCZo6VNb57s+YijBnafisgJ5LtYK76xOTUuB3zPBwxyOZDjEQIYob2nIQTqUhnwflC6L5zkjR82bFjhmQkA/v+g0mSYOVzXKnsNOkbb+AjqWex2OBilMBQtpXG8= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408962940411.1405415878744; Tue, 25 Apr 2023 00:49:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDNg-0001D7-36; Tue, 25 Apr 2023 03:46:32 -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 1prDNY-0000tl-RO for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDNJ-0006pt-GW for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:23 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-596-0uNaf45NMmayLrDfgm73Sw-1; Tue, 25 Apr 2023 03:46:00 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f16ef3be6eso32279955e9.3 for ; Tue, 25 Apr 2023 00:45:59 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id z18-20020adfd0d2000000b002fae7408544sm12332875wrh.108.2023.04.25.00.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408769; 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: in-reply-to:in-reply-to:references:references; bh=norJz+1M75We69bp+lSvK+ufLxrx4lDcxGwEvwpqxDw=; b=b3ypiRrfuzcUFCsAmjoBdrd4zQrmqj+GUECKdNdNxYBEvw3yyvbLAU/ZzskanCelvaQVe8 MSlCdbhFN7HWBQLh1H6Am/MVJVkso2bDfAtubQqSlSvBf09PpPD3Ip0Wikac42AfBbc4h9 7tk/5b+ywDNubTwCQyK+d0qSD1pezFc= X-MC-Unique: 0uNaf45NMmayLrDfgm73Sw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408757; x=1685000757; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=norJz+1M75We69bp+lSvK+ufLxrx4lDcxGwEvwpqxDw=; b=HLJgGtJwA2RNL8Ji+Nr/DAyapA79GSpjooPKRSQWJmejLz92V9lnSJ9thl4yQ2rQWA hea4Yy7XE0MOYO8IfceWApF+i9c+yPpnROzbvVFlbOFldIIfxUCLXgPcEKs8od61pK7q iCvNwdf52A3H2k6Rq2BiBEwFsAW89LMh17X/wq0p/l3v7tCDDaIsHJrYBzcc9qtg25rk 9HKnpFV6YdVMpXNjiO1SGJSxLpaozyQf1HS1hE9EMkV9Z+WHioh6hMyZKulUOVNVxwjG VbcOt1zM8E21QfhO8bCy+A4GMQUNXoUZkK0OSinLPVH9HUKQg7eDHGnAXjKrPN3ZsnCp 8Xnw== X-Gm-Message-State: AAQBX9c9VWVwMZqn4bsSglJYd8JcGRE25NJNZgzfVYyk/o/euftpjAiL YK5fF4BngALrZo86j8IditmtYod+lPFl0ENDdjEWzFISXdQrIsETnrgbCnoc7mDPD6CdpP3q+O3 jxAI4/QaN9xGyN+lVTAGlcvwk3QxEcLWbaspw9tOK9ZxCOIctnIN3a2/VU1f0x3DzCVIn X-Received: by 2002:adf:e651:0:b0:304:75b1:4dff with SMTP id b17-20020adfe651000000b0030475b14dffmr5349877wrn.48.1682408757551; Tue, 25 Apr 2023 00:45:57 -0700 (PDT) X-Google-Smtp-Source: AKy350Zrbbdz2gOcDg7C3bxGugJKgNkcam+uuQoo+GuxAbwUae3atoz8NU69VASvoVUBx8282mCHRw== X-Received: by 2002:adf:e651:0:b0:304:75b1:4dff with SMTP id b17-20020adfe651000000b0030475b14dffmr5349851wrn.48.1682408757222; Tue, 25 Apr 2023 00:45:57 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:53 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Ani Sinha , Igor Mammedov , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 19/31] hw/acpi: limit warning on acpi table size to pc machines older than version 2.3 Message-ID: <1af507756bae775028c27d30e602e2b9c72cd074.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1682408963349100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ani Sinha i440fx machine versions 2.3 and newer supports dynamic ram resizing. See commit a1666142db6233 ("acpi-build: make ROMs RAM blocks resi= zeable") . Currently supported all q35 machine types (versions 2.4 and newer) supports resizable RAM/ROM blocks.Therefore the warning generated when the ACPI table size exceeds a pre-defined value does not apply to those machine versions. Add a check limiting the warning message to only those machines that does n= ot support expandable ram blocks (that is, i440fx machines with version 2.2 and older). Signed-off-by: Ani Sinha Message-Id: <20230329045726.14028-1-anisinha@redhat.com> Reviewed-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/i386/pc.h | 3 +++ hw/i386/acpi-build.c | 6 ++++-- hw/i386/pc.c | 1 + hw/i386/pc_piix.c | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index eb668e9034..84935fc958 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -127,6 +127,9 @@ struct PCMachineClass { =20 /* create kvmclock device even when KVM PV features are not exposed */ bool kvmclock_create_always; + + /* resizable acpi blob compat */ + bool resizable_acpi_blob; }; =20 #define TYPE_PC_MACHINE "generic-pc-machine" diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 7f211e1f48..512162003b 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2697,7 +2697,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState= *machine) int legacy_table_size =3D ROUND_UP(tables_blob->len - aml_len + legacy_aml_len, ACPI_BUILD_ALIGN_SIZE); - if (tables_blob->len > legacy_table_size) { + if ((tables_blob->len > legacy_table_size) && + !pcmc->resizable_acpi_blob) { /* Should happen only with PCI bridges and -M pc-i440fx-2.0. = */ warn_report("ACPI table size %u exceeds %d bytes," " migration may not work", @@ -2708,7 +2709,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState= *machine) g_array_set_size(tables_blob, legacy_table_size); } else { /* Make sure we have a buffer in case we need to resize the tables= . */ - if (tables_blob->len > ACPI_BUILD_TABLE_SIZE / 2) { + if ((tables_blob->len > ACPI_BUILD_TABLE_SIZE / 2) && + !pcmc->resizable_acpi_blob) { /* As of QEMU 2.1, this fires with 160 VCPUs and 255 memory sl= ots. */ warn_report("ACPI table size %u exceeds %d bytes," " migration may not work", diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 615e1d3d06..d761c8c775 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1946,6 +1946,7 @@ static void pc_machine_class_init(ObjectClass *oc, vo= id *data) pcmc->acpi_data_size =3D 0x20000 + 0x8000; pcmc->pvh_enabled =3D true; pcmc->kvmclock_create_always =3D true; + pcmc->resizable_acpi_blob =3D true; assert(!mc->get_hotplug_handler); mc->get_hotplug_handler =3D pc_get_hotplug_handler; mc->hotplug_allowed =3D pc_hotplug_allowed; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 21591dad8d..66a849d279 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -756,6 +756,7 @@ static void pc_i440fx_2_2_machine_options(MachineClass = *m) compat_props_add(m->compat_props, hw_compat_2_2, hw_compat_2_2_len); compat_props_add(m->compat_props, pc_compat_2_2, pc_compat_2_2_len); pcmc->rsdp_in_ram =3D false; + pcmc->resizable_acpi_blob =3D false; } =20 DEFINE_I440FX_MACHINE(v2_2, "pc-i440fx-2.2", pc_compat_2_2_fn, --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408817; cv=none; d=zohomail.com; s=zohoarc; b=klI+PJB+G5ucXDz/wZs6AhM1oa9cNgGwHwnO/pNyIVzXz31dzv2ERhYCxPS5BxVmguAXvF2oiJvdCqvFJkz0JEZUi8VpIdBduftZpSFyfOpdWT9gGz9kSCD3NlV+wWlb47SBVNNcHujC6Xx9ko3nH/hnfk6thpMPxf/YlVDRFZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408817; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=U5eMnKVSQzF1LGFDPWxt41QZoo4W9acoFcy3DK/SxP8=; b=AIn/C4w4LvNV/KZx19swn6W185ePMlEvy4c4C6q6E4XMeo+4O3QOokoV7IZKKNctyVNBtNcsV0UFRYI4vT2HAxnZAF2O3D6n1l2AfMCM6+919bLAKe+hJfqD8Cz6WQQ85zGDrDeGQ0JkKy55cByvyYswEdcw2sRFBdlokjPVoIw= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408817630377.43656322600305; Tue, 25 Apr 2023 00:46:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDNg-0001H4-VD; Tue, 25 Apr 2023 03:46:33 -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 1prDNZ-0000tn-LH for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDNJ-0006pr-GQ for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:24 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-380-UvSWfqXCMfiWJnbNEh13Bg-1; Tue, 25 Apr 2023 03:46:07 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f171d201afso32387905e9.0 for ; Tue, 25 Apr 2023 00:46:07 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id z10-20020a5d654a000000b002f22c44e974sm12423331wrv.102.2023.04.25.00.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408768; 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: in-reply-to:in-reply-to:references:references; bh=U5eMnKVSQzF1LGFDPWxt41QZoo4W9acoFcy3DK/SxP8=; b=e+NUfQsFYJicDPxuRmv25XKvw/TLQBrXxCyE2s6g3FDeY7Xb2f8RXp7tK3Hbz1yKG2zVvv /J3IhoteS0Ktyew8+7wn//zyHqaN5YkQWCmPNKOP6H2gYLUg5uzEQnnIYkeTMZg38HVfKw ckhzz/wFxJavEFE2HTR5TpRXODzaiBs= X-MC-Unique: UvSWfqXCMfiWJnbNEh13Bg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408761; x=1685000761; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=U5eMnKVSQzF1LGFDPWxt41QZoo4W9acoFcy3DK/SxP8=; b=aKlL8qMeL+M1WCY7TjaTwfI44JD8Za7NSIvGom2HqUssqroqAh7/XrJ377ZZYLSiqc 4APbhyCykEz3hm6Bi1zbZWXAPgH2moX1Gtg78b33fyFBM3TrwF/7rSZqrB54TbMelt+U MNKef4KV0zIL4NpEUqW6Huf9xD4Y4LMOKU59myHEgJ4aFAObn0Yx2CI2C/ghFn0bp401 sjxf9SPwoRakq6XXGHaNzLR/Ih/6skZwP33dPK/Mx4F6QbCEo+giePqU+ozHDJAANptd QYfoYqcq2+pxZtWVK7j8GZLSelrykIBWRtR+jV9L81O1+GiEw2NGV+ZLA+Fu6YYS0v4r QHHw== X-Gm-Message-State: AAQBX9dTeSDJdwgLqJSpF+hG5jcZXWd13kojIWybZhrAYhRoYhfoMEBd 9x3UfH4bLm76vFx6V0ZQnmNKyAmmrqnH3cfgtg4lTAibJXsByoQLbcVhqTRUcnkgSGpcMpZQi+c 9j72cr3VixU4jfBOu1wRY7zpswiCHTVZ1wc6t5ZvoJZpPxbfBP9TQIAU95ei8gVHYDT36 X-Received: by 2002:adf:dc89:0:b0:2f7:faa0:3f19 with SMTP id r9-20020adfdc89000000b002f7faa03f19mr10917551wrj.28.1682408761285; Tue, 25 Apr 2023 00:46:01 -0700 (PDT) X-Google-Smtp-Source: AKy350YUbGaIQuNxRMUifDu01ZZM+dAJc4+Mf2d16ZpM/fHFudnNRWpbnmTAkK9tmqXktz2aT6BO8A== X-Received: by 2002:adf:dc89:0:b0:2f7:faa0:3f19 with SMTP id r9-20020adfdc89000000b002f7faa03f19mr10917526wrj.28.1682408760772; Tue, 25 Apr 2023 00:46:00 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:57 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Paolo Bonzini , Thomas Huth , Igor Mammedov , Ani Sinha Subject: [PULL 20/31] tests: bios-tables-test: replace memset with initializer Message-ID: <094e29a27184430d6d82ad4bea1d3311fc48297e.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1682408819436100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Coverity complains that memset() writes over a const field. Use an initializer instead, so that the const field is left to zero. Tests that have to write the const field already use an initializer for the whole struct, here I am choosing the smallest possible patch (which is not that small already). Cc: Michael S. Tsirkin Signed-off-by: Paolo Bonzini Message-Id: <20230330131109.47856-1-pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Thomas Huth --- tests/qtest/bios-tables-test.c | 123 ++++++++++++--------------------- 1 file changed, 43 insertions(+), 80 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 8733589437..464f87382e 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -438,10 +438,9 @@ static void test_acpi_asl(test_data *data) { int i; AcpiSdtTable *sdt, *exp_sdt; - test_data exp_data; + test_data exp_data =3D {}; gboolean exp_err, err, all_tables_match =3D true; =20 - memset(&exp_data, 0, sizeof(exp_data)); exp_data.tables =3D load_expected_aml(data); dump_aml_files(data, false); for (i =3D 0; i < data->tables->len; ++i) { @@ -853,12 +852,11 @@ static uint8_t base_required_struct_types[] =3D { =20 static void test_acpi_piix4_tcg(void) { - test_data data; + test_data data =3D {}; =20 /* Supplying -machine accel argument overrides the default (qtest). * This is to make guest actually run. */ - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.required_struct_types =3D base_required_struct_types; data.required_struct_types_len =3D ARRAY_SIZE(base_required_struct_typ= es); @@ -868,9 +866,8 @@ static void test_acpi_piix4_tcg(void) =20 static void test_acpi_piix4_tcg_bridge(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".bridge"; data.required_struct_types =3D base_required_struct_types; @@ -906,9 +903,8 @@ static void test_acpi_piix4_tcg_bridge(void) =20 static void test_acpi_piix4_no_root_hotplug(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".roothp"; data.required_struct_types =3D base_required_struct_types; @@ -923,9 +919,8 @@ static void test_acpi_piix4_no_root_hotplug(void) =20 static void test_acpi_piix4_no_bridge_hotplug(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".hpbridge"; data.required_struct_types =3D base_required_struct_types; @@ -940,9 +935,8 @@ static void test_acpi_piix4_no_bridge_hotplug(void) =20 static void test_acpi_piix4_no_acpi_pci_hotplug(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".hpbrroot"; data.required_struct_types =3D base_required_struct_types; @@ -962,9 +956,8 @@ static void test_acpi_piix4_no_acpi_pci_hotplug(void) =20 static void test_acpi_q35_tcg(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.required_struct_types =3D base_required_struct_types; data.required_struct_types_len =3D ARRAY_SIZE(base_required_struct_typ= es); @@ -994,9 +987,8 @@ static void test_acpi_q35_tcg_core_count2(void) =20 static void test_acpi_q35_tcg_bridge(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".bridge"; data.required_struct_types =3D base_required_struct_types; @@ -1009,9 +1001,8 @@ static void test_acpi_q35_tcg_bridge(void) =20 static void test_acpi_q35_tcg_no_acpi_hotplug(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".noacpihp"; data.required_struct_types =3D base_required_struct_types; @@ -1105,9 +1096,8 @@ static void test_acpi_q35_tcg_mmio64(void) =20 static void test_acpi_piix4_tcg_cphp(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".cphp"; test_acpi_one("-smp 2,cores=3D3,sockets=3D2,maxcpus=3D6" @@ -1121,9 +1111,8 @@ static void test_acpi_piix4_tcg_cphp(void) =20 static void test_acpi_q35_tcg_cphp(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".cphp"; test_acpi_one(" -smp 2,cores=3D3,sockets=3D2,maxcpus=3D6" @@ -1141,9 +1130,8 @@ static uint8_t ipmi_required_struct_types[] =3D { =20 static void test_acpi_q35_tcg_ipmi(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".ipmibt"; data.required_struct_types =3D ipmi_required_struct_types; @@ -1156,9 +1144,8 @@ static void test_acpi_q35_tcg_ipmi(void) =20 static void test_acpi_q35_tcg_smbus_ipmi(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".ipmismbus"; data.required_struct_types =3D ipmi_required_struct_types; @@ -1171,12 +1158,11 @@ static void test_acpi_q35_tcg_smbus_ipmi(void) =20 static void test_acpi_piix4_tcg_ipmi(void) { - test_data data; + test_data data =3D {}; =20 /* Supplying -machine accel argument overrides the default (qtest). * This is to make guest actually run. */ - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".ipmikcs"; data.required_struct_types =3D ipmi_required_struct_types; @@ -1189,9 +1175,8 @@ static void test_acpi_piix4_tcg_ipmi(void) =20 static void test_acpi_q35_tcg_memhp(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".memhp"; test_acpi_one(" -m 128,slots=3D3,maxmem=3D1G" @@ -1205,9 +1190,8 @@ static void test_acpi_q35_tcg_memhp(void) =20 static void test_acpi_piix4_tcg_memhp(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".memhp"; test_acpi_one(" -m 128,slots=3D3,maxmem=3D1G" @@ -1221,9 +1205,8 @@ static void test_acpi_piix4_tcg_memhp(void) =20 static void test_acpi_piix4_tcg_nosmm(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".nosmm"; test_acpi_one("-machine smm=3Doff", &data); @@ -1232,9 +1215,8 @@ static void test_acpi_piix4_tcg_nosmm(void) =20 static void test_acpi_piix4_tcg_smm_compat(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".smm-compat"; test_acpi_one("-global PIIX4_PM.smm-compat=3Don", &data); @@ -1243,9 +1225,8 @@ static void test_acpi_piix4_tcg_smm_compat(void) =20 static void test_acpi_piix4_tcg_smm_compat_nosmm(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".smm-compat-nosmm"; test_acpi_one("-global PIIX4_PM.smm-compat=3Don -machine smm=3Doff", &= data); @@ -1254,9 +1235,8 @@ static void test_acpi_piix4_tcg_smm_compat_nosmm(void) =20 static void test_acpi_piix4_tcg_nohpet(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.machine_param =3D ",hpet=3Doff"; data.variant =3D ".nohpet"; @@ -1266,9 +1246,8 @@ static void test_acpi_piix4_tcg_nohpet(void) =20 static void test_acpi_q35_tcg_numamem(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".numamem"; test_acpi_one(" -object memory-backend-ram,id=3Dram0,size=3D128M" @@ -1278,9 +1257,8 @@ static void test_acpi_q35_tcg_numamem(void) =20 static void test_acpi_q35_kvm_xapic(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".xapic"; test_acpi_one(" -object memory-backend-ram,id=3Dram0,size=3D128M" @@ -1291,9 +1269,8 @@ static void test_acpi_q35_kvm_xapic(void) =20 static void test_acpi_q35_tcg_nosmm(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".nosmm"; test_acpi_one("-machine smm=3Doff", &data); @@ -1302,9 +1279,8 @@ static void test_acpi_q35_tcg_nosmm(void) =20 static void test_acpi_q35_tcg_smm_compat(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".smm-compat"; test_acpi_one("-global ICH9-LPC.smm-compat=3Don", &data); @@ -1313,9 +1289,8 @@ static void test_acpi_q35_tcg_smm_compat(void) =20 static void test_acpi_q35_tcg_smm_compat_nosmm(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".smm-compat-nosmm"; test_acpi_one("-global ICH9-LPC.smm-compat=3Don -machine smm=3Doff", &= data); @@ -1324,9 +1299,8 @@ static void test_acpi_q35_tcg_smm_compat_nosmm(void) =20 static void test_acpi_q35_tcg_nohpet(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.machine_param =3D ",hpet=3Doff"; data.variant =3D ".nohpet"; @@ -1336,9 +1310,8 @@ static void test_acpi_q35_tcg_nohpet(void) =20 static void test_acpi_q35_kvm_dmar(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".dmar"; test_acpi_one("-machine kernel-irqchip=3Dsplit -accel kvm" @@ -1348,9 +1321,8 @@ static void test_acpi_q35_kvm_dmar(void) =20 static void test_acpi_q35_tcg_ivrs(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".ivrs"; data.tcg_only =3D true, @@ -1360,9 +1332,8 @@ static void test_acpi_q35_tcg_ivrs(void) =20 static void test_acpi_piix4_tcg_numamem(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.variant =3D ".numamem"; test_acpi_one(" -object memory-backend-ram,id=3Dram0,size=3D128M" @@ -1379,7 +1350,7 @@ static void test_acpi_tcg_tpm(const char *machine, co= nst char *tpm_if, machine, tpm_if); char *tmp_path =3D g_dir_make_tmp(tmp_dir_name, NULL); TPMTestState test; - test_data data; + test_data data =3D {}; GThread *thread; const char *suffix =3D tpm_version =3D=3D TPM_VERSION_2_0 ? "tpm2" : "= tpm12"; char *args, *variant =3D g_strdup_printf(".%s.%s", tpm_if, suffix); @@ -1399,7 +1370,6 @@ static void test_acpi_tcg_tpm(const char *machine, co= nst char *tpm_if, thread =3D g_thread_new(NULL, tpm_emu_ctrl_thread, &test); tpm_emu_test_wait_cond(&test); =20 - memset(&data, 0, sizeof(data)); data.machine =3D machine; data.variant =3D variant; =20 @@ -1434,9 +1404,8 @@ static void test_acpi_q35_tcg_tpm12_tis(void) =20 static void test_acpi_tcg_dimm_pxm(const char *machine) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D machine; data.variant =3D ".dimmpxm"; test_acpi_one(" -machine nvdimm=3Don,nvdimm-persistence=3Dcpu" @@ -1504,7 +1473,6 @@ static void test_acpi_virt_tcg_memhp(void) =20 static void test_acpi_microvm_prepare(test_data *data) { - memset(data, 0, sizeof(*data)); data->machine =3D "microvm"; data->required_struct_types =3D NULL; /* no smbios */ data->required_struct_types_len =3D 0; @@ -1513,7 +1481,7 @@ static void test_acpi_microvm_prepare(test_data *data) =20 static void test_acpi_microvm_tcg(void) { - test_data data; + test_data data =3D {}; =20 test_acpi_microvm_prepare(&data); test_acpi_one(" -machine microvm,acpi=3Don,ioapic2=3Doff,rtc=3Doff", @@ -1523,7 +1491,7 @@ static void test_acpi_microvm_tcg(void) =20 static void test_acpi_microvm_usb_tcg(void) { - test_data data; + test_data data =3D {}; =20 test_acpi_microvm_prepare(&data); data.variant =3D ".usb"; @@ -1534,7 +1502,7 @@ static void test_acpi_microvm_usb_tcg(void) =20 static void test_acpi_microvm_rtc_tcg(void) { - test_data data; + test_data data =3D {}; =20 test_acpi_microvm_prepare(&data); data.variant =3D ".rtc"; @@ -1545,7 +1513,7 @@ static void test_acpi_microvm_rtc_tcg(void) =20 static void test_acpi_microvm_pcie_tcg(void) { - test_data data; + test_data data =3D {}; =20 test_acpi_microvm_prepare(&data); data.variant =3D ".pcie"; @@ -1557,7 +1525,7 @@ static void test_acpi_microvm_pcie_tcg(void) =20 static void test_acpi_microvm_ioapic2_tcg(void) { - test_data data; + test_data data =3D {}; =20 test_acpi_microvm_prepare(&data); data.variant =3D ".ioapic2"; @@ -1622,9 +1590,8 @@ static void test_acpi_virt_tcg_pxb(void) =20 static void test_acpi_tcg_acpi_hmat(const char *machine) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D machine; data.variant =3D ".acpihmat"; test_acpi_one(" -machine hmat=3Don" @@ -1721,9 +1688,8 @@ static void test_acpi_virt_tcg_acpi_hmat(void) =20 static void test_acpi_q35_tcg_acpi_hmat_noinitiator(void) { - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.variant =3D ".acpihmat-noinitiator"; test_acpi_one(" -machine hmat=3Don" @@ -1772,9 +1738,8 @@ static void test_acpi_erst(const char *machine) { gchar *tmp_path =3D g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); gchar *params; - test_data data; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D machine; data.variant =3D ".acpierst"; params =3D g_strdup_printf( @@ -1802,7 +1767,7 @@ static void test_acpi_microvm_acpi_erst(void) { gchar *tmp_path =3D g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); gchar *params; - test_data data; + test_data data =3D {}; =20 test_acpi_microvm_prepare(&data); data.variant =3D ".pcie"; @@ -2003,10 +1968,9 @@ static void test_oem_fields(test_data *data) =20 static void test_acpi_piix4_oem_fields(void) { - test_data data; char *args; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_PC; data.required_struct_types =3D base_required_struct_types; data.required_struct_types_len =3D ARRAY_SIZE(base_required_struct_typ= es); @@ -2022,10 +1986,9 @@ static void test_acpi_piix4_oem_fields(void) =20 static void test_acpi_q35_oem_fields(void) { - test_data data; char *args; + test_data data =3D {}; =20 - memset(&data, 0, sizeof(data)); data.machine =3D MACHINE_Q35; data.required_struct_types =3D base_required_struct_types; data.required_struct_types_len =3D ARRAY_SIZE(base_required_struct_typ= es); @@ -2041,7 +2004,7 @@ static void test_acpi_q35_oem_fields(void) =20 static void test_acpi_microvm_oem_fields(void) { - test_data data; + test_data data =3D {}; char *args; =20 test_acpi_microvm_prepare(&data); --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682409030; cv=none; d=zohomail.com; s=zohoarc; b=EcAlUGFJ8r0HNbPNTn5lRG1xhS9kN8+6wDRRyNczYEfjRfAjm55pd/rUUs9fEzaEyn2jLAWRjXdHihXacUdDMTcQb7AKVrd7jNWL2902eGE/P55UYQm1lDyZUlDjyXnP5tQmyrRnGoM2mjsn1bgg3DbZyx5jm6pUcI1gNDckT4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682409030; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RQ3CXFb4EAO35V6poQk6L8RCvBgf3V6gIrpzx+cWSv8=; b=TRoyWYJvOxlH0xqvoS1hbUK5nelm8XfVhUmVgLwwQKVf4Gh9QHxJCbkj3GFu9W2y/P4164jUC/HM293HJZcMlxoxweSlByL0KsVyLFHoONWUv2YczVQKUlQwTKUx64VzMOYHWHN29By0v11hbQ2u3YFY43nI4WFgEDi6HbzaMDE= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682409030112630.1946500429215; Tue, 25 Apr 2023 00:50:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDNo-0001Rv-19; Tue, 25 Apr 2023 03:46:44 -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 1prDNd-0000xO-Uu for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:30 -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 1prDNO-0006q9-78 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:27 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-365-YEQomauVMD6Bphb1uE-C4w-1; Tue, 25 Apr 2023 03:46:11 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f250e9e090so6443055e9.0 for ; Tue, 25 Apr 2023 00:46:11 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id e22-20020a5d5956000000b003012030a0c6sm12451911wri.18.2023.04.25.00.46.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408772; 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=RQ3CXFb4EAO35V6poQk6L8RCvBgf3V6gIrpzx+cWSv8=; b=gssg/ThThpn6LnCFhtXpezJHYIFBYWLzolSv5aFrTKpKvuHub5D/lIe+/Rjdg1troXAlgd Y5E2puTeFg96wAMZeqP+JvTXLhOQheZl8FlwUp3E6fuUKxVLX91yoh1AhuVkofoQFVtEet YYNBhAGVlg6sQ9CfT3AnLdP5ISJKeKY= X-MC-Unique: YEQomauVMD6Bphb1uE-C4w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408768; x=1685000768; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RQ3CXFb4EAO35V6poQk6L8RCvBgf3V6gIrpzx+cWSv8=; b=aYZL+1E8iX4RY0HFAVDHUKghV4sL/8pVuxLIntbww15cRmAuX4Gg9rp0jo5Z7Gx8Wo vCe5IDrZFza1Tpqsvb8ROQCMcT6xyqokBuTkJ2KJ4wd8nle7vV5MjF/OxVqcVrN+DUsF Pq83vV8MNEjms1LTj0UUayqSd4hwYkMyT1w1WDwz4S5VDkhuZDlLZAkhgMvndduyLcgz DuubtjRMUaVbp9AIrXZ9pX6iw3FYuie00Ndrdjync+3nw000VbLeZuZ/X/DSt5wVuP2j oCawsOxkmhz3C7e0JCAo7u/3ofNtoR4Wf9gvNMFEW9w4DL7AnXDi2lz3Hb2ciFLjAU21 HABg== X-Gm-Message-State: AAQBX9fIpSAVj3860HW2nRvZrwOef4ZRl6O724lh4cZ1ckEKlnFkaWkx /y//F1IAqzbv/mfsf6Sab3FUdgFkHyAKOyy9CbowZ0dacBEnPVu8Bp3PxRYxqP0JeNzcFBeCCWm 1RuslHXqXCL0dISIniyYDqIETKm8kxe8yRrv2NhTQfOKUIfcS+rSKVFfNg02/+VmQzkWr X-Received: by 2002:a05:600c:3657:b0:3f1:72ec:400d with SMTP id y23-20020a05600c365700b003f172ec400dmr9117390wmq.33.1682408768790; Tue, 25 Apr 2023 00:46:08 -0700 (PDT) X-Google-Smtp-Source: AKy350YOrxBRrr3rWfQUmHPeRanvl7QF0auam70BidQVCy+CTE+iV9JM8YgSK6gEuU9byKLuWu9hfg== X-Received: by 2002:a05:600c:3657:b0:3f1:72ec:400d with SMTP id y23-20020a05600c365700b003f172ec400dmr9117361wmq.33.1682408768366; Tue, 25 Apr 2023 00:46:08 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:00 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Jason Wang , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth , Alex =?utf-8?Q?Benn=C3=A9e?= Subject: [PULL 21/31] MAINTAINERS: Add =?utf-8?Q?Eu?= =?utf-8?Q?genio_P=C3=A9rez?= as vhost-shadow-virtqueue reviewer Message-ID: <2b6fc0b859a1b8a5bc2a48c56e8cb595748b7c3f.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 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: 1682409030923100001 From: Eugenio P=C3=A9rez I'd like to be notified on SVQ patches and review them. Signed-off-by: Eugenio P=C3=A9rez Message-Id: <20230331150410.2627214-1-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- MAINTAINERS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e365a7a47e..5e2d4b2c2c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2075,6 +2075,10 @@ F: backends/vhost-user.c F: include/sysemu/vhost-user-backend.h F: subprojects/libvhost-user/ =20 +vhost-shadow-virtqueue +R: Eugenio P=C3=A9rez +F: hw/virtio/vhost-shadow-virtqueue.* + virtio M: Michael S. Tsirkin S: Supported --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408963; cv=none; d=zohomail.com; s=zohoarc; b=iAwWcUaj6w9BCOG+O2HHAPHuR/rWJD9y4bHoukiru/xIg/ztawklB6EPO1SVTJ4LDTM+HkGibCBSqyXKDLFDCQOBmAoL9nJYA5KNH0z6ByiRJN1gec3UHwlhlfMUicE65nuqZ15OyTerqDrTpT9kKEtkGXTLMUU4uPcvlD3ie7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408963; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Pa00TmI+JP+HfRG/j3rVJD6r3nOHqgZI9IlJQtfidvc=; b=VOnQ5XRvyly127JFf39pp1dfTIgg9T3kog5ytdEhWRZ+ibTcOlmlPsCysIrLF5NM3S9tBuDU3rMAUc8OrD18FFS+pNI2kquJVNEnWm8ch7aurmBT2cM9ivy8lAyNmuawwNmgRsbfSqB+WTADOUQ9cMayF6dybiAOeVEIpApK8kU= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408963407976.3251065812057; Tue, 25 Apr 2023 00:49:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDOW-0002og-4o; Tue, 25 Apr 2023 03:47:24 -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 1prDNl-0001kT-SB for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:39 -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 1prDNR-0006qW-Hh for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:37 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-511-UgICCn_5M_SI7VNQdBdQtQ-1; Tue, 25 Apr 2023 03:46:15 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f080f46fb1so20311955e9.0 for ; Tue, 25 Apr 2023 00:46:15 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id b4-20020a05600010c400b002e45f6ffe63sm12477818wrx.26.2023.04.25.00.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408776; 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: in-reply-to:in-reply-to:references:references; bh=Pa00TmI+JP+HfRG/j3rVJD6r3nOHqgZI9IlJQtfidvc=; b=YJTVohtbH9cfmtKgfI5G5mApOKdTDnDRB99fHjTFLEPrQeBc/qQLiJkwdhxHHefdK8g377 sOERuqRdxG2pnOYVZZ4BQqxYLdUM8fTZNzO+wKKHxJNt6dEiM+E7Vlo1Zovkn/FiJeyd0j POYbtsfyajhiCSwC3nWapYafmOetFvg= X-MC-Unique: UgICCn_5M_SI7VNQdBdQtQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408773; x=1685000773; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Pa00TmI+JP+HfRG/j3rVJD6r3nOHqgZI9IlJQtfidvc=; b=Gloa/tHFg2pd5gPKWQ0Xahf5gnPlLrMtmIJLZCqLSDOQ4rHTvvI6+KA15XXEM0Vs4X UZDrQorYyFIP1viTU2lAGDbfIH6vMmf3hatRgRtXXJWI02ynyjxENNLJW5GcR2HDUAov HPnQnGd0vjyqMx/GovhvxllwlkpKYfpRJ+U/iWAGnVv9dn+NhX9BDQoZ4rNRpzzBzY3i bnwjoRV516IEYQ9xyHW7LIClKLeT8NvKkfkIEeSbV/2UWubA0ou1NU7XGW/aKQnFubNh JguglfrRq+9PXpNv6Yw6JbWuzPLier9AYWwZxpeR/q6iCfGo0KDrE5zCysvAPXlo/6wQ sWzw== X-Gm-Message-State: AAQBX9c9kec+uJMggk2CbWkEK2IR5G1sRU3K9YuuOLckoKVGTJOPq9J0 XWyZj+vvTMYX/P4OVpfY7BXPYUqUSJ/5R+TfZhvoIrMMaUmLJdP/X0XpU7p63mGWGCSZvN+9CyT 8SK8e1lPWovGun7A6XjCDJt+2C6H8bQScE8HBLfHhMytgNxZ0JQ9oC2xpdeVujNpaPLVN X-Received: by 2002:a5d:4f8e:0:b0:2fb:2567:bc1 with SMTP id d14-20020a5d4f8e000000b002fb25670bc1mr11525794wru.8.1682408772908; Tue, 25 Apr 2023 00:46:12 -0700 (PDT) X-Google-Smtp-Source: AKy350ZdYebbVmCRgM7XKBsIPRqtaf2Bdr7fOWmrilAKbfwF6ZoHuykbNqZhwAyG+y2T5ZLImAIqSQ== X-Received: by 2002:a5d:4f8e:0:b0:2fb:2567:bc1 with SMTP id d14-20020a5d4f8e000000b002fb25670bc1mr11525777wru.8.1682408772626; Tue, 25 Apr 2023 00:46:12 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:08 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Stefan Weil , Jonathan Cameron , Ben Widawsky Subject: [PULL 22/31] docs/cxl: Fix sentence Message-ID: <8a9ede6f511c5a028e1c1fc949a97ff30c36bebe.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1682408964810100023 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefan Weil Signed-off-by: Stefan Weil Message-Id: <20230409201828.1159568-1-sw@weilnetz.de> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- docs/system/devices/cxl.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/system/devices/cxl.rst b/docs/system/devices/cxl.rst index f25783a4ec..4c38223069 100644 --- a/docs/system/devices/cxl.rst +++ b/docs/system/devices/cxl.rst @@ -111,7 +111,7 @@ Interfaces provided include: =20 CXL Root Ports (CXL RP) ~~~~~~~~~~~~~~~~~~~~~~~ -A CXL Root Port servers te same purpose as a PCIe Root Port. +A CXL Root Port serves the same purpose as a PCIe Root Port. There are a number of CXL specific Designated Vendor Specific Extended Capabilities (DVSEC) in PCIe Configuration Space and associated component register access via PCI bars. --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682409038; cv=none; d=zohomail.com; s=zohoarc; b=MAI7BP7snL4Vjke9Tl9GRRItxTixTi1LN0ibq5s0osLmVrtbvOKjKiJrfGFdv5y/f9/+Ijwi5QYJF/BLShrb2xInJmsckVpf5ViJToGgHFT+knEUAAF/kY3GWRy2LWLlZeCn8c2WbnrX4Drr4AnUowFffol+a41HkGWyQFwhvZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682409038; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g+LmbV+KcWhotCY4TFXNF71hZn8TnJdbAxdQ6GLDJM0=; b=BK+eJ7Oe1vgk2pOcw0sTYG0b5ayspzK5H+vsF7xDL5bT9hSVMefa2ZCMz1Rkv+OfpXae4gtgyGHf6+5c+hf3kwKJWuC9PRJodOx0igtDWNIm/BUu+O5+e/pSU9AMEjEBjxwVEwkeMqhFdo/rE+AL0RQ2DhKWcfC1z1l5enMfDEs= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682409038089545.7313505165571; Tue, 25 Apr 2023 00:50:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDO1-0001tc-EW; Tue, 25 Apr 2023 03:46: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 1prDNc-0000tu-Bn for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDNY-0006r7-JB for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:27 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-QMjxjaV0PFq5qjVXrhxEog-1; Tue, 25 Apr 2023 03:46:22 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f18b63229bso51543525e9.0 for ; Tue, 25 Apr 2023 00:46:22 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id o2-20020a5d58c2000000b002fe522117fdsm12452357wrf.36.2023.04.25.00.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408783; 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: in-reply-to:in-reply-to:references:references; bh=g+LmbV+KcWhotCY4TFXNF71hZn8TnJdbAxdQ6GLDJM0=; b=Tdfo0vuGXarHx1Swd/Wx1pOdNNJrFM0mG+eFuqecTMcOfwNsfI/0L338rMfogTVAnt4CKI 9yloJ6wN8bICgbuwbB+btgF8xtpKUhokbVImGLXmIm8aFjmHJ0CnL8VuZfn/JdDikf16DT +X9LGy/MeMbLka/zWRQbUW29bal3r84= X-MC-Unique: QMjxjaV0PFq5qjVXrhxEog-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408776; x=1685000776; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=g+LmbV+KcWhotCY4TFXNF71hZn8TnJdbAxdQ6GLDJM0=; b=i23isKLx7B+tCKAT9ZiccEEV+omBMGFwBDFaaXf3YZ58ZO+4ujwxD86BhEonhHwxG+ G7mKDq7Esbw2ZZ6jzgyr+rJQ5RZi3aCZz7AWg0jVDVBD2dYUQ+94Fsp5rm1VlP4TkOLL TuZr0pnU6SFfbKeo1hqC1RUVKo27KMaxIf20RD6YFdheKJ7/yx/5wH93/AFfTKU+A7TU E4zWMr2PEO2AMJlpFtN32e1QzTzI8vfZN4juwyToZ+TjnSMcSHURsrKTH4Qs6OAiveY4 zx1gzTAbvF3gjC5LEo77w6oPpN7lCjTOAEOjWh74InG8piSSplpVQY7giFi0rR7codFf VpTg== X-Gm-Message-State: AAQBX9ehxS7gjbTqL+hLlh/FYZyfTRTgeGYmtjfo9SiCona2RnVgJg+D izQSO/mNIGgoykulM5WplWloCxtqytK3HApowOiY2g2wYXqcznXRRJvPZu3IIDWU40wo4b9ssKH wEF3u0i7gUsq+calv8fSoatsFLROGwaiaz40J4mTbSuItSb4O6Agzomo9djRCyIn/F2Sg X-Received: by 2002:adf:f10e:0:b0:2ff:3605:e1e9 with SMTP id r14-20020adff10e000000b002ff3605e1e9mr11631025wro.17.1682408776672; Tue, 25 Apr 2023 00:46:16 -0700 (PDT) X-Google-Smtp-Source: AKy350b3GS+jHf+uZdTqE7EQqYAIWnobZ8r6SKeSlADspyez1uDF9NY0dwOx9gj5CZgT6SRaCYyDlA== X-Received: by 2002:adf:f10e:0:b0:2ff:3605:e1e9 with SMTP id r14-20020adff10e000000b002ff3605e1e9mr11630998wro.17.1682408776387; Tue, 25 Apr 2023 00:46:16 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:12 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jason Wang , Peter Xu , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 23/31] intel_iommu: refine iotlb hash calculation Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682409038827100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Wang Commit 1b2b12376c8 ("intel-iommu: PASID support") takes PASID into account when calculating iotlb hash like: static guint vtd_iotlb_hash(gconstpointer v) { const struct vtd_iotlb_key *key =3D v; return key->gfn | ((key->sid) << VTD_IOTLB_SID_SHIFT) | (key->level) << VTD_IOTLB_LVL_SHIFT | (key->pasid) << VTD_IOTLB_PASID_SHIFT; } This turns out to be problematic since: - the shift will lose bits if not converting to uint64_t - level should be off by one in order to fit into 2 bits - VTD_IOTLB_PASID_SHIFT is 30 but PASID is 20 bits which will waste some bits - the hash result is uint64_t so we will lose bits when converting to guint So this patch fixes them by - converting the keys into uint64_t before doing the shift - off level by one to make it fit into two bits - change the sid, lvl and pasid shift to 26, 42 and 44 in order to take the full width of uint64_t - perform an XOR to the top 32bit with the bottom 32bit for the final result to fit guint Fixes: Coverity CID 1508100 Fixes: 1b2b12376c8 ("intel-iommu: PASID support") Signed-off-by: Jason Wang Message-Id: <20230412073510.7158-1-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Peter Xu --- hw/i386/intel_iommu_internal.h | 6 +++--- hw/i386/intel_iommu.c | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index f090e61e11..2e61eec2f5 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -114,9 +114,9 @@ VTD_INTERRUPT_ADDR_FIRST + 1) =20 /* The shift of source_id in the key of IOTLB hash table */ -#define VTD_IOTLB_SID_SHIFT 20 -#define VTD_IOTLB_LVL_SHIFT 28 -#define VTD_IOTLB_PASID_SHIFT 30 +#define VTD_IOTLB_SID_SHIFT 26 +#define VTD_IOTLB_LVL_SHIFT 42 +#define VTD_IOTLB_PASID_SHIFT 44 #define VTD_IOTLB_MAX_SIZE 1024 /* Max size of the hash table = */ =20 /* IOTLB_REG */ diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index a62896759c..94d52f4205 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -64,8 +64,8 @@ struct vtd_as_key { struct vtd_iotlb_key { uint64_t gfn; uint32_t pasid; - uint32_t level; uint16_t sid; + uint8_t level; }; =20 static void vtd_address_space_refresh_all(IntelIOMMUState *s); @@ -221,10 +221,11 @@ static gboolean vtd_iotlb_equal(gconstpointer v1, gco= nstpointer v2) static guint vtd_iotlb_hash(gconstpointer v) { const struct vtd_iotlb_key *key =3D v; + uint64_t hash64 =3D key->gfn | ((uint64_t)(key->sid) << VTD_IOTLB_SID_= SHIFT) | + (uint64_t)(key->level - 1) << VTD_IOTLB_LVL_SHIFT | + (uint64_t)(key->pasid) << VTD_IOTLB_PASID_SHIFT; =20 - return key->gfn | ((key->sid) << VTD_IOTLB_SID_SHIFT) | - (key->level) << VTD_IOTLB_LVL_SHIFT | - (key->pasid) << VTD_IOTLB_PASID_SHIFT; + return (guint)((hash64 >> 32) ^ (hash64 & 0xffffffffU)); } =20 static gboolean vtd_as_equal(gconstpointer v1, gconstpointer v2) --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682409912; cv=none; d=zohomail.com; s=zohoarc; b=VCWY/6jny4tGpTwZsdxfv2egewq93H1iiuk6m51RJ6+DCA2PIlxDwIDbkJGumoLIDhpuSmulNOb3gvmSDEh1KH9CUNBRdbKbJyEl/eyG+TnyYd6juz4GmADFi/l7MJaQM35mTMIp7CXhduDz+7oI1oTbjt44cPwo1nXRELaN8hY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682409912; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zdUptC3OUS5/gVIT/clyQf+DzMu7cp2cXJXaS2I+boY=; b=U6yjos0DyyKYBk9ZQAPWsB1IjZUS6+PKDS5JVrMLOFKl+zi5kpqFi2MdiXLdCDWR42e6cSLJgowP84mJU5wk/IprnrSsaCU/2jwM044CJ6k+Otejgqf2g9Se5GlPbf5Kt0wIYtH1JojY+byY0JCrLYjCfQ0iUfsSOsuW0GfLXvQ= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682409912958601.4122982990768; Tue, 25 Apr 2023 01:05:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDf6-00038J-7D; Tue, 25 Apr 2023 04:04:32 -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 1prDf5-000388-47 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 04:04:31 -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 1prDf3-0001QJ-Ge for qemu-devel@nongnu.org; Tue, 25 Apr 2023 04:04:30 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-131-tA_7pyCeN4CSl2g0ojB5dQ-1; Tue, 25 Apr 2023 04:04:26 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f191fc08b7so15869265e9.0 for ; Tue, 25 Apr 2023 01:04:26 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id p17-20020a056000019100b002fda1b12a0bsm12579122wrx.2.2023.04.25.01.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 01:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682409868; 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: in-reply-to:in-reply-to:references:references; bh=zdUptC3OUS5/gVIT/clyQf+DzMu7cp2cXJXaS2I+boY=; b=TtXmVV8xwazcNIphRqZGhtv75xj6R/0R1A3bkIBrEvlop4vuEQce04gwXZ1jYH6/DXYuBo fsF3yuIES81U2SHznGwfJz7fhdVANnPDezfDLUyqeUU9aWLCBl0OLXxwj2JQMty93VzK6T ATOFszaEfe40GqUhfr9Y9uNWAXqXxoQ= X-MC-Unique: tA_7pyCeN4CSl2g0ojB5dQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682409865; x=1685001865; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zdUptC3OUS5/gVIT/clyQf+DzMu7cp2cXJXaS2I+boY=; b=HPj+5Vgc7y/ay3GBE7wS6RLiLshZ17qeqbkTiw4h1obvHsq/eWR5ZtHtb7fVXw+kf0 YmZfqiDLcsHRgUCGPPaDrt0Jxvex1ix6skSHXB7YxJj+1moeD3wq6rvkZ3MRs/7CWAxQ k4Hjdvu8s26TPU+BbAr7bjj0QAGBi15Ge8/phWdprbaQDH29riCsDp3ZPWmF28bBXY+F WMX+KRQQlgVaB1tRni3R0F1yzF7P+N3uKoKeyeeLyshYfhXVs+AGXMUDz06yiO1ET2Io OPbYO7h0dU8l4wYxGD6wjOtjtrg2EHJufR7qH5kOGOeGCOdywW/DSOiMQ0o9TKWuYFbA DdYA== X-Gm-Message-State: AAQBX9fMQ4141E0mm78dnPeLxb5hjILmX7Y35Xat5LPlZfFui+2gUHKX AOC3eIN1+AT1nYNlpIEfSHld9D/wD8B4keRfZZExDx5R30/O+GFH/pmuuxxlMb1Qw58sK0mPW7v kzyZVdRv3aVEwGHMTVCJBWVwoiPsteHHtmyRPfxoC/s5itKoGLCJd2Q0StbiFbYCQ39v7 X-Received: by 2002:a5d:6d4d:0:b0:2ef:c0cf:c72b with SMTP id k13-20020a5d6d4d000000b002efc0cfc72bmr11584816wri.29.1682409865361; Tue, 25 Apr 2023 01:04:25 -0700 (PDT) X-Google-Smtp-Source: AKy350YY0Sbf24aCoaZiHiR4zrg68icFRkbS6074lX1IIbB0wNH9Z/7YPCW5HdnyAlPVufLUaUkj/A== X-Received: by 2002:a5d:6d4d:0:b0:2ef:c0cf:c72b with SMTP id k13-20020a5d6d4d000000b002efc0cfc72bmr11584795wri.29.1682409864997; Tue, 25 Apr 2023 01:04:24 -0700 (PDT) Date: Tue, 25 Apr 2023 04:04:22 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Akihiko Odaki , Marcel Apfelbaum Subject: [PULL 24/31] docs: Remove obsolete descriptions of SR-IOV support Message-ID: <2a3f8b333b6efbc0ccaacb318fb9c9d53f25bcfd.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682409914968100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki The documentation used to say there is no device implemented with SR-IOV, but igb and nvme support SR-IOV today. Signed-off-by: Akihiko Odaki Message-Id: <20230414090441.23156-1-akihiko.odaki@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- docs/pcie_sriov.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/pcie_sriov.txt b/docs/pcie_sriov.txt index 11158dbf88..7eff7f2703 100644 --- a/docs/pcie_sriov.txt +++ b/docs/pcie_sriov.txt @@ -9,10 +9,7 @@ virtual functions (VFs) for the main purpose of eliminatin= g software overhead in I/O from virtual machines. =20 QEMU now implements the basic common functionality to enable an emulated d= evice -to support SR/IOV. Yet no fully implemented devices exists in QEMU, but a -proof-of-concept hack of the Intel igb can be found here: - -git://github.com/knuto/qemu.git sriov_patches_v5 +to support SR/IOV. =20 Implementation =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408964; cv=none; d=zohomail.com; s=zohoarc; b=oAbll7LEVNJUy2H7AuwEqNbjIjNXmI6lID1c6NzJQ7lk20VyemC0CwK55Wps7CJWvrAz8eLXZPxf51UwHiqvPTLEHHyjA/muLPVE0/MQAYEj+lYqANnQYSnaeK4saVjDc5AQdqIql7BZzx5eSHWEsyCurzuTKHku8ZJMIsZhPnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408964; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HdiQFYvQ7qjd5XHe+MOZ4snXbsF1M5K1kc94Srzr2lU=; b=Y64fPgYESeVKNSi6vO+nrIfFXg63InfbbbZNHE1o3nIJxCwzbS6UwM+wDgnL6/ay89eWwDC2h+dCgYau+YRXXpGLeNpfLcypcpOZ1BzODjiXLn1nNcXlQVrE3omTdH4AYTn7Iu3Snnqy+msjHu1PGhXZujIDImsM6xwjE068vqA= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408964235950.2068772859404; Tue, 25 Apr 2023 00:49:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDOT-0002O7-8x; Tue, 25 Apr 2023 03:47:21 -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 1prDNf-000115-0h for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDNd-0006rl-Dy for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:30 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-362-_kZn5AyRNdmYuGOqJvbcAw-1; Tue, 25 Apr 2023 03:46:26 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f065208a64so31227295e9.3 for ; Tue, 25 Apr 2023 00:46:26 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id iz14-20020a05600c554e00b003f175954e71sm17567293wmb.32.2023.04.25.00.46.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408787; 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: in-reply-to:in-reply-to:references:references; bh=HdiQFYvQ7qjd5XHe+MOZ4snXbsF1M5K1kc94Srzr2lU=; b=QpfzXhun1q2COhjxXVnc6zE8iJN5Xu6HaVupRcQCRhfM+v1/b/e22WXeWWIg2/3GznmxIM HlBJNG3vU8xrrB2/5BvkhnvTVX5h9tjfeDvTaHLgdWLJ/SON/cEPWVmvKnqC4oW//3A02f WWsTPxIhU3iP9Q4MuImn9Pcp+GgJIZQ= X-MC-Unique: _kZn5AyRNdmYuGOqJvbcAw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408784; x=1685000784; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HdiQFYvQ7qjd5XHe+MOZ4snXbsF1M5K1kc94Srzr2lU=; b=QizEtDREDANTtIQYrt0QMAY3VyOWZpd0UwMafc2LcPUO1M3GPYr/VNX8+G46WLSeiw gfEXQ2g7BCJcBt9LiCNEwDm9KpRGqCfK5HAwU71fYkbSp9fD7RgFPgD3KghgCxtFpoil Igz3XPQ10Gnp2bh5L9c34dLNe9dMSYKLv6gdWfzDrfJRjTbS0eIr/iwmQ+1utt26jA4j ty3eHul4wrzH5mOcD9SSs6xZXxP8BprvMWU+TfuiptGT2Ygg5HLIT3DpSgZOj3jH5AjL 5OqB6KSMQpkyeIExmjiU97AqQWecrXD6RAvt4Q0U2HFXbdtPZ0Etcy4gCvG1Fv1bkFlj Cz6g== X-Gm-Message-State: AC+VfDwZeBr+2Zqtd4z9LA98yyNrbB/fuXa3pz1l8YDLeOF0B5fYO3Cu pAiazKOL9dxUJ567QPR6JsGgvAbgF7B0gKY61CApj/KNMcdcG6WGtv3SAILe1REbvkppSo0IR6z +cJezC+bpMOTVpm22NgDj1swndtE4B+usmQF7Wn5Q7bTn8+Ccge5MU7hlqndsAEdAR3Ae X-Received: by 2002:a1c:f613:0:b0:3f2:5a60:d629 with SMTP id w19-20020a1cf613000000b003f25a60d629mr255223wmc.24.1682408784612; Tue, 25 Apr 2023 00:46:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7YIvE3oaWLi3SHpFicGyrxoGUU/yz5Hce5XkFNhQHz76NTkvNjopWL4uYl8qshmuYxTE/f6A== X-Received: by 2002:a1c:f613:0:b0:3f2:5a60:d629 with SMTP id w19-20020a1cf613000000b003f25a60d629mr255201wmc.24.1682408784292; Tue, 25 Apr 2023 00:46:24 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:21 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Viresh Kumar Subject: [PULL 25/31] virtio: i2c: Check notifier helpers for VIRTIO_CONFIG_IRQ_IDX Message-ID: <91208dd297f2686b778210ffda49acbfe36bd3b6.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408964530100020 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Viresh Kumar Since the driver doesn't support interrupts, we must return early when index is set to VIRTIO_CONFIG_IRQ_IDX. Fixes: 544f0278afca ("virtio: introduce macro VIRTIO_CONFIG_IRQ_IDX") Signed-off-by: Viresh Kumar Message-Id: Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user-i2c.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hw/virtio/vhost-user-i2c.c b/hw/virtio/vhost-user-i2c.c index 60eaf0d95b..4eef3f0633 100644 --- a/hw/virtio/vhost-user-i2c.c +++ b/hw/virtio/vhost-user-i2c.c @@ -128,6 +128,14 @@ static void vu_i2c_guest_notifier_mask(VirtIODevice *v= dev, int idx, bool mask) { VHostUserI2C *i2c =3D VHOST_USER_I2C(vdev); =20 + /* + * We don't support interrupts, return early if index is set to + * VIRTIO_CONFIG_IRQ_IDX. + */ + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return; + } + vhost_virtqueue_mask(&i2c->vhost_dev, vdev, idx, mask); } =20 @@ -135,6 +143,14 @@ static bool vu_i2c_guest_notifier_pending(VirtIODevice= *vdev, int idx) { VHostUserI2C *i2c =3D VHOST_USER_I2C(vdev); =20 + /* + * We don't support interrupts, return early if index is set to + * VIRTIO_CONFIG_IRQ_IDX. + */ + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return false; + } + return vhost_virtqueue_pending(&i2c->vhost_dev, idx); } =20 --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408987; cv=none; d=zohomail.com; s=zohoarc; b=COx/kcMUDu9CkurClin2AEEdhFKBWf49Dz5Ctm2Yn+SQFIetfyYs1+HnvLJPxUQOv/4wK2mfXY3xCulVdiFLcn0kxr3YtVZgkkZltNgpS/SaKb3AMnVMhNNIiL/0QXgceyJWrb7GPLMHxSUXCu/SzVtPbslgj3nM588laJbUgcs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408987; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NMtY4B3CUEsIScWMVfi1qUKQMVTCD7QWE7ao8AyIg/g=; b=gRHzOz51ASXVMfH8mdhp4LF71A4fOX0jstNfpuHi088A05AvE5DDMFZZDK8ZAST9714k2pkvKe6Q7DKfTFTMH20Sr0C+5/k/3k5R/wv079OnAmbmLwcgtrDPcomkr5XHXSXnOiyUaNGu8hMEV4fN/c+dMxpvB8/kK8RxrwQYiJU= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408987442381.0895051470412; Tue, 25 Apr 2023 00:49:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDPb-0004GE-VV; Tue, 25 Apr 2023 03:48:32 -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 1prDNi-0001UF-Ao for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDNg-0006sN-IZ for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:34 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-622-akDCFo1INkC9DXCl9U8zfQ-1; Tue, 25 Apr 2023 03:46:29 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f16fa91923so29673805e9.2 for ; Tue, 25 Apr 2023 00:46:29 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id m9-20020a7bce09000000b003f049a42689sm14143446wmc.25.2023.04.25.00.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408791; 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: in-reply-to:in-reply-to:references:references; bh=NMtY4B3CUEsIScWMVfi1qUKQMVTCD7QWE7ao8AyIg/g=; b=MtabJynQeZcp7aBEeW1vwUTQC2QVANm+drdNb5PNG6U/fr0qcyBqznWXUxCfA3gG9lCVEi +vO0pTtyGSv4o687HXKeva6XFsiMK9HqND3pPLqR/zSMvf4ZkxTq/r50TdgSJ9449bg0Hn h/7+Luqqb7LDhm0rTQZ2yEO6RgZnPC8= X-MC-Unique: akDCFo1INkC9DXCl9U8zfQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408787; x=1685000787; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NMtY4B3CUEsIScWMVfi1qUKQMVTCD7QWE7ao8AyIg/g=; b=cGfUCiSbilTQ2m9ZNbIDAjk8FpC53oUaG1zWM+2oN1QzDy2end0SNBKC1XNTgqGeEi OszMPljZ/jiQD2dmsfrXn9vk5kY3CITHb6RAA876Hrf08FRfvijPgoIRUKR2kV/MzWEw 8KPu6XLQCSJHlwHlHJ85BanoeZF5A8So0i/BeCwKJdrgpurz0Q032Le58Ophj/VpHh2x 9/3P7OTH/QbLr8MAtJvdoG9I1tCSch0KI/yulph3XMswl8Mu57pRo/ZnXPAOZuYZHcJM ZY992KReaDIWhdDH+/H03CITL1JgGn2kZBD4W2/94VStjkFXR9GDFxQsgMpqjhpaWe3A zzAw== X-Gm-Message-State: AAQBX9fHsDHI5upz84HLIISgCMr4QTfFTNjjsy94XxGy/SXq9449622G sniCaKWbGj4CToPCD5J3iQRw5y+CowT6ctq4xCR0KTJAyazY44MdA1kmaYbMt9yglMKYN04RH/X osRh2ac/P8Z8ZHlJJ5QhkKxuxRvmsrT3rBZsfQ+rzYjdCmw/3unOrZ+W0Qbm6/d6vIKYF X-Received: by 2002:a7b:cd02:0:b0:3ef:d8c6:4bc0 with SMTP id f2-20020a7bcd02000000b003efd8c64bc0mr8958821wmj.40.1682408787649; Tue, 25 Apr 2023 00:46:27 -0700 (PDT) X-Google-Smtp-Source: AKy350bcSWukGm9Uxkg8qn6h5+di1XidClB4gYFQPKftFtL8mLEwZ7iHa9AnensvD2YeRNPbZnRAag== X-Received: by 2002:a7b:cd02:0:b0:3ef:d8c6:4bc0 with SMTP id f2-20020a7bcd02000000b003efd8c64bc0mr8958801wmj.40.1682408787271; Tue, 25 Apr 2023 00:46:27 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:24 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , mst@redhat.com, anisinha@redhat.com, jusual@redhat.com Subject: [PULL 26/31] acpi: pcihp: allow repeating hot-unplug requests Message-ID: <0f689cf5ada4d5df5ab95c7f7aa9fc221afa855d.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408988420100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Igor Mammedov with Q35 using ACPI PCI hotplug by default, user's request to unplug device is ignored when it's issued before guest OS has been booted. And any additional attempt to request device hot-unplug afterwards results in following error: "Device XYZ is already in the process of unplug" arguably it can be considered as a regression introduced by [2], before which it was possible to issue unplug request multiple times. Accept new uplug requests after timeout (1ms). This brings ACPI PCI hotplug on par with native PCIe unplug behavior [1] and allows user to repeat unplug requests at propper times. Set expire timeout to arbitrary 1msec so user won't be able to flood guest with SCI interrupts by calling device_del in tight loop. PS: ACPI spec doesn't mandate what OSPM can do with GPEx.status bits set before it's booted =3D> it's impl. depended. Status bits may be retained (I tested with one Windows version) or cleared (Linux since 2.6 kernel times) during guest's ACPI subsystem initialization. Clearing status bits (though not wrong per se) hides the unplug event from guest, and it's upto user to repeat device_del later when guest is able to handle unplug requests. 1) 18416c62e3 ("pcie: expire pending delete") 2) Fixes: cce8944cc9ef ("qdev-monitor: Forbid repeated device_del") Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann CC: mst@redhat.com CC: anisinha@redhat.com CC: jusual@redhat.com CC: kraxel@redhat.com Message-Id: <20230418090449.2155757-1-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Ani Sinha --- hw/acpi/pcihp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index dcfb779a7a..cdd6f775a1 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -357,6 +357,16 @@ void acpi_pcihp_device_unplug_request_cb(HotplugHandle= r *hotplug_dev, * acpi_pcihp_eject_slot() when the operation is completed. */ pdev->qdev.pending_deleted_event =3D true; + /* if unplug was requested before OSPM is initialized, + * linux kernel will clear GPE0.sts[] bits during boot, which effectiv= ely + * hides unplug event. And than followup qmp_device_del() calls remain + * blocked by above flag permanently. + * Unblock qmp_device_del() by setting expire limit, so user can + * repeat unplug request later when OSPM has been booted. + */ + pdev->qdev.pending_deleted_expires_ms =3D + qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL); /* 1 msec */ + s->acpi_pcihp_pci_status[bsel].down |=3D (1U << slot); acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS); } --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408972; cv=none; d=zohomail.com; s=zohoarc; b=SuMWEfJWXTXsDrOcgc9+pA818S9leJpKxxl291YO1DK8eknSYXcE33XF/zXDRr58/yBDTtKXncPuGqMeoqWfo9JbA4XB9bUGGralajjDIdPCClv96vx5GzWIo+lAsPOyyuv38KxS/FqOUDYs2/WCYPFiFGLNu2adPviaU5dQK/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408972; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ENB/ftYh8f6TIyn1LHdOpb4fofLhwW3Aa4TSW+e9pK0=; b=Ou7ml3d6E1/gVkbxMgCxBVPekbmLHHT2xjHqRzdjcu08ptL2Ke+j73IREBwtJmtt5rLraP2zoJAUAGF05uyzgKdc5QhQh+wGyno0VGVxesyj4ANi+cE+OVYQb+5ZV8yXszCrKu9LICIdMdG3uFBUfcY28Tj8g6H717zmrWmFo1I= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408972161469.49445355390515; Tue, 25 Apr 2023 00:49:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDOV-0002cT-6z; Tue, 25 Apr 2023 03:47:23 -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 1prDNk-0001ja-H5 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:39 -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 1prDNi-0006sW-3r for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:35 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-435-_P61B52jNHefddncIO9SiA-1; Tue, 25 Apr 2023 03:46:32 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3f173bd0fc9so29624095e9.3 for ; Tue, 25 Apr 2023 00:46:31 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id k6-20020a5d5246000000b002e71156b0fcsm12524587wrc.6.2023.04.25.00.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408793; 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: in-reply-to:in-reply-to:references:references; bh=ENB/ftYh8f6TIyn1LHdOpb4fofLhwW3Aa4TSW+e9pK0=; b=c9l+g8QCBGmhA/awuR4tkVM+L1yY61vXh8u9sLfKVeIEn7iZL7theA3ZKThbko7HGdwqFY 1cU851xdt90Awy4TgItBRMgU/card+qDwY9Z9+ldTSBxVf3MV3DWtZ6r7JUi3mKLOOyRnJ ouUV/0j3Xz3PygfKv0IxGC5/WfcpyPA= X-MC-Unique: _P61B52jNHefddncIO9SiA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408790; x=1685000790; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ENB/ftYh8f6TIyn1LHdOpb4fofLhwW3Aa4TSW+e9pK0=; b=jjg3rgNRtAHS4cKcbt5wR7EwACdBiru7RJXVxToCscAS7BYpezgocEAtNzOT/MEpMd JzPhCja2HHSzHBvn+pLddAesD7dvNrK9ER/m8L80TYkGkV2sI7bwJpYIvBfjr4EI/c+3 ntbI8wfoLfgC8+/MXYqQzUJfC/t6OvF3o0TQVuHKHpwhLlvJrxSqJRF4KeICGkHkwZDX 4VbfM7hvnl0XpSzJrEEIZTUp7gFKhIz/JWLsFirKZ4QixOjLLmUKW+3vQSqcyUoIhgM1 ekcOhaIZLvixSVeqirP8ADsP/QR+7M7JEIA5QQGtxSplAxYh8huH+uItDh3D1hebHdyC Ir6A== X-Gm-Message-State: AAQBX9fqXgKUBwuoGPLRgAWINBMfsIRG+53BhvHitDM0p4DvY2TPcrRj cRSCQ/Gv13hkedSQMWr7WnChssqCpIQdwYkHavCJOWPqSZ4R14NIRjbMDP3qTyAT9vZISvYip6G q94Od9Q73V9ADaKJcZuhnyACpF0e6pwK+2vdE9gbOCBD5FwF5Zvs72gk+cHxiB7twahjU X-Received: by 2002:a5d:6b04:0:b0:2f6:121a:c1d0 with SMTP id v4-20020a5d6b04000000b002f6121ac1d0mr11403745wrw.19.1682408790474; Tue, 25 Apr 2023 00:46:30 -0700 (PDT) X-Google-Smtp-Source: AKy350b9oMWpcaOo9YS0u2xc5QZ9xJjUc/hUU7fOHMT4xr6ajAIw2XlK4SrOYqsuDHm7agZ9vwhQdA== X-Received: by 2002:a5d:6b04:0:b0:2f6:121a:c1d0 with SMTP id v4-20020a5d6b04000000b002f6121ac1d0mr11403733wrw.19.1682408790086; Tue, 25 Apr 2023 00:46:30 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:27 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Marcel Apfelbaum Subject: [PULL 27/31] docs/specs/pci-ids: Convert from txt to rST Message-ID: <0c0e21d1c1e2dde4f7437bcd5c53127013cc25f7.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408972375100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Peter Maydell Convert the pci-ids document from plain text to reStructuredText. I opted to use definition-lists here because rST tables are super-clunky, and actually formatting these as tables didn't seem necessary. Signed-off-by: Peter Maydell Message-Id: <20230420160334.1048224-2-peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- docs/specs/pci-ids.txt | 70 ------------------------------ docs/specs/index.rst | 1 + docs/specs/pci-ids.rst | 98 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 70 deletions(-) delete mode 100644 docs/specs/pci-ids.txt create mode 100644 docs/specs/pci-ids.rst diff --git a/docs/specs/pci-ids.txt b/docs/specs/pci-ids.txt deleted file mode 100644 index e463c4cb3a..0000000000 --- a/docs/specs/pci-ids.txt +++ /dev/null @@ -1,70 +0,0 @@ - -PCI IDs for qemu -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -Red Hat, Inc. donates a part of its device ID range to qemu, to be used for -virtual devices. The vendor IDs are 1af4 (formerly Qumranet ID) and 1b36. - -Contact Gerd Hoffmann to get a device ID assigned -for your devices. - -1af4 vendor ID --------------- - -The 1000 -> 10ff device ID range is used as follows for virtio-pci devices. -Note that this allocation separate from the virtio device IDs, which are -maintained as part of the virtio specification. - -1af4:1000 network device (legacy) -1af4:1001 block device (legacy) -1af4:1002 balloon device (legacy) -1af4:1003 console device (legacy) -1af4:1004 SCSI host bus adapter device (legacy) -1af4:1005 entropy generator device (legacy) -1af4:1009 9p filesystem device (legacy) -1af4:1012 vsock device (bug compatibility) - -1af4:1040 Start of ID range for modern virtio devices. The PCI device - to ID is calculated from the virtio device ID by adding the -1af4:10ef 0x1040 offset. The virtio IDs are defined in the virtio - specification. The Linux kernel has a header file with - defines for all virtio IDs (linux/virtio_ids.h), qemu has a - copy in include/standard-headers/. - -1af4:10f0 Available for experimental usage without registration. Must get - to official ID when the code leaves the test lab (i.e. when seeking -1af4:10ff upstream merge or shipping a distro/product) to avoid conflicts. - -1af4:1100 Used as PCI Subsystem ID for existing hardware devices emulated - by qemu. - -1af4:1110 ivshmem device (shared memory, docs/specs/ivshmem-spec.txt) - -All other device IDs are reserved. - -1b36 vendor ID --------------- - -The 0000 -> 00ff device ID range is used as follows for QEMU-specific -PCI devices (other than virtio): - -1b36:0001 PCI-PCI bridge -1b36:0002 PCI serial port (16550A) adapter (docs/specs/pci-serial.txt) -1b36:0003 PCI Dual-port 16550A adapter (docs/specs/pci-serial.txt) -1b36:0004 PCI Quad-port 16550A adapter (docs/specs/pci-serial.txt) -1b36:0005 PCI test device (docs/specs/pci-testdev.txt) -1b36:0006 PCI Rocker Ethernet switch device -1b36:0007 PCI SD Card Host Controller Interface (SDHCI) -1b36:0008 PCIe host bridge -1b36:0009 PCI Expander Bridge (-device pxb) -1b36:000a PCI-PCI bridge (multiseat) -1b36:000b PCIe Expander Bridge (-device pxb-pcie) -1b36:000d PCI xhci usb host adapter -1b36:000f mdpy (mdev sample device), linux/samples/vfio-mdev/mdpy.c -1b36:0010 PCIe NVMe device (-device nvme) -1b36:0011 PCI PVPanic device (-device pvpanic-pci) -1b36:0012 PCI ACPI ERST device (-device acpi-erst) - -All these devices are documented in docs/specs. - -The 0100 device ID is used for the QXL video card device. diff --git a/docs/specs/index.rst b/docs/specs/index.rst index a58d9311cb..8aa0fcb77a 100644 --- a/docs/specs/index.rst +++ b/docs/specs/index.rst @@ -8,6 +8,7 @@ guest hardware that is specific to QEMU. .. toctree:: :maxdepth: 2 =20 + pci-ids ppc-xive ppc-spapr-xive ppc-spapr-numa diff --git a/docs/specs/pci-ids.rst b/docs/specs/pci-ids.rst new file mode 100644 index 0000000000..e1cf022006 --- /dev/null +++ b/docs/specs/pci-ids.rst @@ -0,0 +1,98 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +PCI IDs for QEMU +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Red Hat, Inc. donates a part of its device ID range to QEMU, to be used for +virtual devices. The vendor IDs are 1af4 (formerly Qumranet ID) and 1b36. + +Contact Gerd Hoffmann to get a device ID assigned +for your devices. + +1af4 vendor ID +-------------- + +The 1000 -> 10ff device ID range is used as follows for virtio-pci devices. +Note that this allocation is separate from the virtio device IDs, which are +maintained as part of the virtio specification. + +1af4:1000 + network device (legacy) +1af4:1001 + block device (legacy) +1af4:1002 + balloon device (legacy) +1af4:1003 + console device (legacy) +1af4:1004 + SCSI host bus adapter device (legacy) +1af4:1005 + entropy generator device (legacy) +1af4:1009 + 9p filesystem device (legacy) +1af4:1012 + vsock device (bug compatibility) + +1af4:1040 to 1af4:10ef + ID range for modern virtio devices. The PCI device + ID is calculated from the virtio device ID by adding the + 0x1040 offset. The virtio IDs are defined in the virtio + specification. The Linux kernel has a header file with + defines for all virtio IDs (``linux/virtio_ids.h``); QEMU has a + copy in ``include/standard-headers/``. + +1af4:10f0 to 1a4f:10ff + Available for experimental usage without registration. Must get + official ID when the code leaves the test lab (i.e. when seeking + upstream merge or shipping a distro/product) to avoid conflicts. + +1af4:1100 + Used as PCI Subsystem ID for existing hardware devices emulated + by QEMU. + +1af4:1110 + ivshmem device (shared memory, ``docs/specs/ivshmem-spec.txt``) + +All other device IDs are reserved. + +1b36 vendor ID +-------------- + +The 0000 -> 00ff device ID range is used as follows for QEMU-specific +PCI devices (other than virtio): + +1b36:0001 + PCI-PCI bridge +1b36:0002 + PCI serial port (16550A) adapter (``docs/specs/pci-serial.txt``) +1b36:0003 + PCI Dual-port 16550A adapter (``docs/specs/pci-serial.txt``) +1b36:0004 + PCI Quad-port 16550A adapter (``docs/specs/pci-serial.txt``) +1b36:0005 + PCI test device (``docs/specs/pci-testdev.txt``) +1b36:0006 + PCI Rocker Ethernet switch device +1b36:0007 + PCI SD Card Host Controller Interface (SDHCI) +1b36:0008 + PCIe host bridge +1b36:0009 + PCI Expander Bridge (-device pxb) +1b36:000a + PCI-PCI bridge (multiseat) +1b36:000b + PCIe Expander Bridge (-device pxb-pcie) +1b36:000d + PCI xhci usb host adapter +1b36:000f + mdpy (mdev sample device), ``linux/samples/vfio-mdev/mdpy.c`` +1b36:0010 + PCIe NVMe device (``-device nvme``) +1b36:0011 + PCI PVPanic device (``-device pvpanic-pci``) +1b36:0012 + PCI ACPI ERST device (``-device acpi-erst``) + +All these devices are documented in :doc:`index`. + +The 0100 device ID is used for the QXL video card device. --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408986; cv=none; d=zohomail.com; s=zohoarc; b=oKmwENwwKkgGJUECUw/8zkDuEtPh2ZTjyhO0hckjbm8M3eiq+7c+Kn1hfEbeavzDMxaNqhZfHSztvZaP+TP14U/cMAXliOEr9MiZh3rqppeMjT+OMGvBqsTwWGhDpC4IAsxpIlHKM9kLBe5XyLuYVTaAhSHrxGc/uwAQapPL6NU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408986; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3YJvIXB4JXgLc+BchY3FYURGQPfXfUe8KWU9L0uhwmc=; b=hNOmq5XAeiWgFAoMJghyd8AX00rmFnoFhsZ25j0jtIxJv/zyMlBluQ5YV+It4enpnXy2BSHKSHXeEOsSCdvCO50QJuGvHhZLPj7Uy4hpM9dczqhbdLHLS4WaVJBfNf9HdjfS8NtjWgPmgvIo1k3ggGvh/vK4Toqx1ZWyalsynbs= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408986728487.66992381672367; Tue, 25 Apr 2023 00:49:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDOb-0003Gv-Ps; Tue, 25 Apr 2023 03:47:29 -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 1prDNo-0001q2-Dz for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDNm-0006uM-DM for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:40 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-546-bA3gZ2u-OA656rjU5pP5Gw-1; Tue, 25 Apr 2023 03:46:35 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-2f92bd71f32so1710361f8f.2 for ; Tue, 25 Apr 2023 00:46:35 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id h18-20020a5d6892000000b002f9bfac5baesm12482772wru.47.2023.04.25.00.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408796; 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=3YJvIXB4JXgLc+BchY3FYURGQPfXfUe8KWU9L0uhwmc=; b=Fq6/QE1t5HgKkTThka1VbgDl3XkGONZjw81O1a4/26tvLOhCCApKTXnYsWU/lrq/u146hp mYtZvWqpFXu6sCCnrWhx3bq4bQmtYaEpSUGmBxeVWqT2sy3ZFFPMkfpbSCDfi6sOYb+sBm KqThojAEhkE+nVif8kQrifxAPlhoHGs= X-MC-Unique: bA3gZ2u-OA656rjU5pP5Gw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408793; x=1685000793; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3YJvIXB4JXgLc+BchY3FYURGQPfXfUe8KWU9L0uhwmc=; b=kY68X+miE8V9n/maGaCzSenrrUOz3jiAyJ+jChCWDY2cJZqrcaqXxBQKcadJXA4d6u BySPJ5lfOAK9eYn2apAaRBe/n5177noWSGqOnikKZ4k07IkaVIoWUg1mk/RwrWxXsewN L+N7nzjsaPxOeDOZ8Wj7kARh/rSNqt+sNyPM8m+15QBnMk7Z0Qa4NfA6ElJJgCR/y4vF FsuAnLNymDBY+tquZcWIXyxFdwQ2PZqghQFCwZX5JzBoB5Xa4F/SJWRhFStoxoTNb51C up5q9+Wi6rZXbgJkG+cMMtBUspbfRImj+aJoUwptKmGn6H2TOC5nbSXw3tDjxFrT77e0 119A== X-Gm-Message-State: AAQBX9fIuBLOuryQtXGNAlLJA+/b9dKxeWyotVYfMTH1kMAcsOJIDq6F +YgeTVkar07kXeAnj/bv6TsZF8Xjh+ZGECmt0wXJFeWLIK7b33/l2VbQVnM6BExQBM9vmvxEx3I tedFZ7fhSXGR25zvu+V2quv1uS/7Z/UHyIdvboiCtMQt+RlzExXw9fJZo0zorhcM+0+LE X-Received: by 2002:adf:ec46:0:b0:2ce:9fb8:b560 with SMTP id w6-20020adfec46000000b002ce9fb8b560mr11849196wrn.8.1682408793264; Tue, 25 Apr 2023 00:46:33 -0700 (PDT) X-Google-Smtp-Source: AKy350bpT1X4oxRSwMToIgC2x2pjYw/LIlQzmVNGpxxai/wdVS8/GgwXLW7dSjfQKc0lOKEtYEcXkQ== X-Received: by 2002:adf:ec46:0:b0:2ce:9fb8:b560 with SMTP id w6-20020adfec46000000b002ce9fb8b560mr11849172wrn.8.1682408792937; Tue, 25 Apr 2023 00:46:32 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:30 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Paolo Bonzini , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Subject: [PULL 28/31] docs/specs: Convert pci-serial.txt to rst Message-ID: <3669b594d88930f9e5d7c83e038d7d9ca5a75378.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408988678100007 From: Peter Maydell Convert pci-serial.txt to reStructuredText. This includes some wordsmithing, and the correction of the docs to note that the Windows inf file includes 2x and 4x support (as it has done since commit dc9528fdf9f61 in 2014). Signed-off-by: Peter Maydell Message-Id: <20230420160334.1048224-3-peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- docs/specs/pci-serial.txt | 34 ---------------------------------- hw/char/serial-pci-multi.c | 2 +- hw/char/serial-pci.c | 2 +- docs/specs/index.rst | 1 + docs/specs/pci-ids.rst | 6 +++--- docs/specs/pci-serial.rst | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 43 insertions(+), 39 deletions(-) delete mode 100644 docs/specs/pci-serial.txt create mode 100644 docs/specs/pci-serial.rst diff --git a/docs/specs/pci-serial.txt b/docs/specs/pci-serial.txt deleted file mode 100644 index 66c761f2b4..0000000000 --- a/docs/specs/pci-serial.txt +++ /dev/null @@ -1,34 +0,0 @@ - -QEMU pci serial devices -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -There is one single-port variant and two muliport-variants. Linux -guests out-of-the box with all cards. There is a Windows inf file -(docs/qemupciserial.inf) to setup the single-port card in Windows -guests. - - -single-port card ----------------- - -Name: pci-serial -PCI ID: 1b36:0002 - -PCI Region 0: - IO bar, 8 bytes long, with the 16550 uart mapped to it. - Interrupt is wired to pin A. - - -multiport cards ---------------- - -Name: pci-serial-2x -PCI ID: 1b36:0003 - -Name: pci-serial-4x -PCI ID: 1b36:0004 - -PCI Region 0: - IO bar, with two/four 16550 uart mapped after each other. - The first is at offset 0, second at offset 8, ... - Interrupt is wired to pin A. diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c index f18b8dcce5..5d65c534cb 100644 --- a/hw/char/serial-pci-multi.c +++ b/hw/char/serial-pci-multi.c @@ -25,7 +25,7 @@ * THE SOFTWARE. */ =20 -/* see docs/specs/pci-serial.txt */ +/* see docs/specs/pci-serial.rst */ =20 #include "qemu/osdep.h" #include "qapi/error.h" diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index 801b769aba..087da3059a 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -23,7 +23,7 @@ * THE SOFTWARE. */ =20 -/* see docs/specs/pci-serial.txt */ +/* see docs/specs/pci-serial.rst */ =20 #include "qemu/osdep.h" #include "qapi/error.h" diff --git a/docs/specs/index.rst b/docs/specs/index.rst index 8aa0fcb77a..dfa136073c 100644 --- a/docs/specs/index.rst +++ b/docs/specs/index.rst @@ -9,6 +9,7 @@ guest hardware that is specific to QEMU. :maxdepth: 2 =20 pci-ids + pci-serial ppc-xive ppc-spapr-xive ppc-spapr-numa diff --git a/docs/specs/pci-ids.rst b/docs/specs/pci-ids.rst index e1cf022006..7bc7168fb6 100644 --- a/docs/specs/pci-ids.rst +++ b/docs/specs/pci-ids.rst @@ -63,11 +63,11 @@ PCI devices (other than virtio): 1b36:0001 PCI-PCI bridge 1b36:0002 - PCI serial port (16550A) adapter (``docs/specs/pci-serial.txt``) + PCI serial port (16550A) adapter (:doc:`pci-serial`) 1b36:0003 - PCI Dual-port 16550A adapter (``docs/specs/pci-serial.txt``) + PCI Dual-port 16550A adapter (:doc:`pci-serial`) 1b36:0004 - PCI Quad-port 16550A adapter (``docs/specs/pci-serial.txt``) + PCI Quad-port 16550A adapter (:doc:`pci-serial`) 1b36:0005 PCI test device (``docs/specs/pci-testdev.txt``) 1b36:0006 diff --git a/docs/specs/pci-serial.rst b/docs/specs/pci-serial.rst new file mode 100644 index 0000000000..8d916a3669 --- /dev/null +++ b/docs/specs/pci-serial.rst @@ -0,0 +1,37 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +QEMU PCI serial devices +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +QEMU implements some PCI serial devices which are simple PCI +wrappers around one or more 16550 UARTs. + +There is one single-port variant and two multiport-variants. Linux +guests work out-of-the box with all cards. There is a Windows inf file +(``docs/qemupciserial.inf``) to set up the cards in Windows guests. + + +Single-port card +---------------- + +Name: + ``pci-serial`` +PCI ID: + 1b36:0002 +PCI Region 0: + IO bar, 8 bytes long, with the 16550 UART mapped to it. +Interrupt: + Wired to pin A. + + +Multiport cards +--------------- + +Name: + ``pci-serial-2x``, ``pci-serial-4x`` +PCI ID: + 1b36:0003 (``-2x``) and 1b36:0004 (``-4x``) +PCI Region 0: + IO bar, with two or four 16550 UARTs mapped after each other. + The first is at offset 0, the second at offset 8, and so on. +Interrupt: + Wired to pin A. --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408962; cv=none; d=zohomail.com; s=zohoarc; b=E+pe9yxiAnFCHiDz43Tn7kuqdECpKYfaG6BKVD50FJL25X4gG+euwxnidqMOaqxbk3U9OEsisIzeLgY5f0S2ziKveJj6HTPQEY0xJr/OR+Mr6RieZzgjTLQy9WNBGfxA7aNsWo+lwpYEZxSQ5f2oKxsuIX6dyHvsATsXc9lw+Pg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408962; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=i/SAGLle76FTyq9rNigXzvwryqMTCWn4q7DLUw9suUA=; b=A5th+k4ynZfm8UgPByBfT8axGu6gBn3ziyOwad60HWN10NlIM8FYZwso7GjXNH1c+RYHRsaFGU7hIyCCi2EDNwCn2/ntowzUYp4DnaeWY7XiW9mO5rwfWEzIIWjdWskvmrbF3VWgqL7tht++VJPGiESqt9JApnGj+WI5uf22fB8= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408962356330.4495569939893; Tue, 25 Apr 2023 00:49:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDOT-0002QP-Px; Tue, 25 Apr 2023 03:47:21 -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 1prDNp-0001rK-J8 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:45 -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 1prDNn-0006uh-Ot for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:41 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-65-UsLekdiqNlamJXyQIex0VA-1; Tue, 25 Apr 2023 03:46:37 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-2f40f52c604so3040329f8f.0 for ; Tue, 25 Apr 2023 00:46:37 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id t15-20020adfe10f000000b00304832cd960sm2553024wrz.10.2023.04.25.00.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408799; 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: in-reply-to:in-reply-to:references:references; bh=i/SAGLle76FTyq9rNigXzvwryqMTCWn4q7DLUw9suUA=; b=RXfV/maPE4Iebf0W3yQitf03adiW87jDkSu2kYDMtSzTYC6wQNvGrYeBxKHdnr0dk0i8iU tcXyS2pvS1YpE5neI8eX3NU3snmmXZAAHDKRCnXx4RCrI3NsTQT7ocKVgfEXDW1t+oKFvj QdoYwMp4p2+pLKYT/SheWwOoUrUIb44= X-MC-Unique: UsLekdiqNlamJXyQIex0VA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408796; x=1685000796; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=i/SAGLle76FTyq9rNigXzvwryqMTCWn4q7DLUw9suUA=; b=HeEMf1pVoZ34sAwwcYNgtjPQbuAKG2jTN2/0dFAsZCDTfYEL2kD0yl9g0GDo7xSgQZ PsTzLHLDuVJZeP+SvcjJUnknzzun3jWN4bgb1gIaTjg1Z8zVQfuqiMi+Th3VWtiNVQmJ J2VhZ66n6FGc0b7+CUEsggPYtviKwDV8c8lazYFuZvFHZ5tLt9wCjIm/LvKmetYtEr0p emVaB8nmI3SgwnkEy1qlZvyTPwSBMV70tFU2ccGrcOwanRp48GHVTuBVFh1q/4dHUy8Z EsZKTrQZFIZhx8QjRg8w2NFdRPYy84Y3xecSwmKazqOwK/U+iFdI0KkNT4FCqlAXtppn XHtQ== X-Gm-Message-State: AAQBX9d/SnUZG5ZBC33tDGB0JgHaQu4OUQC0Ah0b9hSe4hYVda1VlrBx blFHSU0IPC/7BX9mJidhoChNTAV788H7qJVSHSJbYqQ9yiV4WSqmKn0lkVPB9CLjbLGlHBJOSww Yjfz0Yfj7PhSLIfZypdAnJaxtuDU//Mj1+34zLdfB3IHTWq0EfSNke12rEP1CoJNVrea5 X-Received: by 2002:adf:e391:0:b0:2dc:cad4:87b9 with SMTP id e17-20020adfe391000000b002dccad487b9mr11635790wrm.68.1682408795926; Tue, 25 Apr 2023 00:46:35 -0700 (PDT) X-Google-Smtp-Source: AKy350a/AZ3b/+/GVycJPvbobZAzZE2pZ3zo0jwqaHP+OzEDrlP5xsjGBiBr8Cg1xaQXfSBQVbze2A== X-Received: by 2002:adf:e391:0:b0:2dc:cad4:87b9 with SMTP id e17-20020adfe391000000b002dccad487b9mr11635773wrm.68.1682408795606; Tue, 25 Apr 2023 00:46:35 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:33 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Marcel Apfelbaum Subject: [PULL 29/31] docs/specs: Convert pci-testdev.txt to rst Message-ID: <4d58309388003837f8eba72c5643722060a5656a.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408964282100014 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Peter Maydell Convert pci-testdev.txt to reStructuredText. Includes some minor wordsmithing. Signed-off-by: Peter Maydell Message-Id: <20230420160334.1048224-4-peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- docs/specs/pci-testdev.txt | 31 ------------------------------ docs/specs/index.rst | 1 + docs/specs/pci-ids.rst | 2 +- docs/specs/pci-testdev.rst | 39 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 32 deletions(-) delete mode 100644 docs/specs/pci-testdev.txt create mode 100644 docs/specs/pci-testdev.rst diff --git a/docs/specs/pci-testdev.txt b/docs/specs/pci-testdev.txt deleted file mode 100644 index 4280a1e73c..0000000000 --- a/docs/specs/pci-testdev.txt +++ /dev/null @@ -1,31 +0,0 @@ -pci-test is a device used for testing low level IO - -device implements up to three BARs: BAR0, BAR1 and BAR2. -Each of BAR 0+1 can be memory or IO. Guests must detect -BAR types and act accordingly. - -BAR 0+1 size is up to 4K bytes each. -BAR 0+1 starts with the following header: - -typedef struct PCITestDevHdr { - uint8_t test; <- write-only, starts a given test number - uint8_t width_type; <- read-only, type and width of access for a given= test. - 1,2,4 for byte,word or long write. - any other value if test not supported on this B= AR - uint8_t pad0[2]; - uint32_t offset; <- read-only, offset in this BAR for a given test - uint32_t data; <- read-only, data to use for a given test - uint32_t count; <- for debugging. number of writes detected. - uint8_t name[]; <- for debugging. 0-terminated ASCII string. -} PCITestDevHdr; - -All registers are little endian. - -device is expected to always implement tests 0 to N on each BAR, and to ad= d new -tests with higher numbers. In this way a guest can scan test numbers unti= l it -detects an access type that it does not support on this BAR, then stop. - -BAR2 is a 64bit memory bar, without backing storage. It is disabled -by default and can be enabled using the membar=3D property. This -can be used to test whether guests handle pci bars of a specific -(possibly quite large) size correctly. diff --git a/docs/specs/index.rst b/docs/specs/index.rst index dfa136073c..e58be38c41 100644 --- a/docs/specs/index.rst +++ b/docs/specs/index.rst @@ -10,6 +10,7 @@ guest hardware that is specific to QEMU. =20 pci-ids pci-serial + pci-testdev ppc-xive ppc-spapr-xive ppc-spapr-numa diff --git a/docs/specs/pci-ids.rst b/docs/specs/pci-ids.rst index 7bc7168fb6..e302bea484 100644 --- a/docs/specs/pci-ids.rst +++ b/docs/specs/pci-ids.rst @@ -69,7 +69,7 @@ PCI devices (other than virtio): 1b36:0004 PCI Quad-port 16550A adapter (:doc:`pci-serial`) 1b36:0005 - PCI test device (``docs/specs/pci-testdev.txt``) + PCI test device (:doc:`pci-testdev`) 1b36:0006 PCI Rocker Ethernet switch device 1b36:0007 diff --git a/docs/specs/pci-testdev.rst b/docs/specs/pci-testdev.rst new file mode 100644 index 0000000000..4b6d36543b --- /dev/null +++ b/docs/specs/pci-testdev.rst @@ -0,0 +1,39 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +QEMU PCI test device +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +``pci-testdev`` is a device used for testing low level IO. + +The device implements up to three BARs: BAR0, BAR1 and BAR2. +Each of BAR 0+1 can be memory or IO. Guests must detect +BAR types and act accordingly. + +BAR 0+1 size is up to 4K bytes each. +BAR 0+1 starts with the following header: + +.. code-block:: c + + typedef struct PCITestDevHdr { + uint8_t test; /* write-only, starts a given test number */ + uint8_t width_type; /* + * read-only, type and width of access for a gi= ven test. + * 1,2,4 for byte,word or long write. + * any other value if test not supported on thi= s BAR + */ + uint8_t pad0[2]; + uint32_t offset; /* read-only, offset in this BAR for a given te= st */ + uint32_t data; /* read-only, data to use for a given test */ + uint32_t count; /* for debugging. number of writes detected. */ + uint8_t name[]; /* for debugging. 0-terminated ASCII string. */ + } PCITestDevHdr; + +All registers are little endian. + +The device is expected to always implement tests 0 to N on each BAR, and t= o add new +tests with higher numbers. In this way a guest can scan test numbers unti= l it +detects an access type that it does not support on this BAR, then stop. + +BAR2 is a 64bit memory BAR, without backing storage. It is disabled +by default and can be enabled using the ``membar=3D`` property. This +can be used to test whether guests handle PCI BARs of a specific +(possibly quite large) size correctly. --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682408992; cv=none; d=zohomail.com; s=zohoarc; b=Qe952Tl2vKHeaOQk82C4zeu5PFYXFflVI2MGQRIo+752Fvl35/Lix4H4r9Ftt3mzAmNiMaTWGHE4vWRVjqeMV7rGAbAeCbLAdHnWKAqH9CYkgD4zqJvyQ9U3Crz1YFCJAVYy7ANDGwhMDa3Mb3dPFu+SDOM+Z6rDW4jf41RaQ80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682408992; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t5kHDje6YgQKSvtsxfGVGWWdW2z/lTLpCHStMSMZnP4=; b=ex5raMm/5bo7dZHK4v2Wn/COoID6GR7e5Ep3RNVJMMiEg4P7k//wREB8ShBp1wZbIznMGQQd61aw60pOwL8HSj2OM/2B8m8dRDZ04El7yID/25NzH/ewoBgZUlmWAi+VOdU5MW+k2NjnMFluBwi6JKfz6yg/OjtaPbcfg50AKds= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682408991947442.84723827683445; Tue, 25 Apr 2023 00:49:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDOY-0003BC-EN; Tue, 25 Apr 2023 03:47:26 -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 1prDNt-0001t8-3r for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDNr-0006vB-Hd for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:44 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-Omf0556RNxab6dHMLT8h8g-1; Tue, 25 Apr 2023 03:46:40 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f173bd0fc9so29624915e9.3 for ; Tue, 25 Apr 2023 00:46:40 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id q9-20020a1ce909000000b003f177c3672dsm17269229wmc.29.2023.04.25.00.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408802; 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: in-reply-to:in-reply-to:references:references; bh=t5kHDje6YgQKSvtsxfGVGWWdW2z/lTLpCHStMSMZnP4=; b=BbwXB0lGOsbJ6TFsOfcmFh5VwBBoMZHKbk4ijEVnlwk9HngFLhAiX9vv22XnLcWi2XNJFs hZyWAXzDBZIGhSnF3JUZ5IApOPzypOJEQflt6mQktykLxwl7MwosuMaI0gjEcQVGZOxIlh 9DDSVbHnQ3UV0kaKnR83g7HxbPnZWG4= X-MC-Unique: Omf0556RNxab6dHMLT8h8g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408799; x=1685000799; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=t5kHDje6YgQKSvtsxfGVGWWdW2z/lTLpCHStMSMZnP4=; b=j+AVK0lof03QSDn1GLx/tHKkLUIeaOWPFaUgoWttzG9PJmeNf4G0AWnBIuTwc9qhGw kvkurMo2ReCu5Nj8SEff5/UV127HcXWQskIxidUteKdctR9LubyAN7FwEBqFSQOGrKXH DyWPU5nugAPcN6yfw/jVypO7vYsjnOJii6kMiBhXT1mdmcwc7eTVwx+7mjKg7wPDShhx c0dZPmcufvvtq9/vx4kfS0HL1sKZVz9xhJVRJuG4BKVlMcSLnxhQ6pYX+S9pCf6SblL1 /754MRcMWpXmHrpgQ3j6/LX6PH4mttP/nlQpTXSAtyif+nRxJogdJKEBYFE6lye2z2qY OdFw== X-Gm-Message-State: AAQBX9d5RNBIaCKWcM4H3LkFzL2ugR0iyA3cCIMFhc0QmRiuwceuVUWR qMbxuRlV0Zf4QhpjZSboXgfJAwk5gDDKYAmTkjuvgRJDKS6FK81B/LA0iQ8Xj7PeoFt3uegiEuo 6sv/Ka+5HUFcx7PFfKr704SzyN9tln0xQz4b8qDxl3txymVdJFwXl8T+e2bz/k6yY6NpG X-Received: by 2002:a1c:7c04:0:b0:3f2:51e7:f1f4 with SMTP id x4-20020a1c7c04000000b003f251e7f1f4mr3051556wmc.10.1682408799183; Tue, 25 Apr 2023 00:46:39 -0700 (PDT) X-Google-Smtp-Source: AKy350ZjOyy7WH+KkvyiDuKlNKtQFulBFZkNtznsh1G3DdvCWHBLI75YKQ8pTcEYIbtPMmB9N5vftA== X-Received: by 2002:a1c:7c04:0:b0:3f2:51e7:f1f4 with SMTP id x4-20020a1c7c04000000b003f251e7f1f4mr3051534wmc.10.1682408798887; Tue, 25 Apr 2023 00:46:38 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:35 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Thomas Huth , qemu-stable@nongnu.org, Marcel Apfelbaum Subject: [PULL 30/31] hw/pci-bridge: pci_expander_bridge fix type in pxb_cxl_dev_reset() Message-ID: <9136f661c7277777a2f85a7e98438f4fe6472fdc.1682408661.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682408994213100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jonathan Cameron Reproduce issue with configure --enable-qom-cast-debug ... qemu-system-x86_64 -display none -machine q35,cxl=3Don -device pxb-cxl,bus= =3Dpcie.0 hw/pci-bridge/pci_expander_bridge.c:54:PXB_DEV: Object 0x5570e0b1ada0 is = not an instance of type pxb Aborted The type conversion results in the right state structure, but PXB_DEV is not a parent of PXB_CXL_DEV hence the error. Rather than directly cleaning up the inheritance, this is the minimal fix which will be followed by the cleanup. Fixes: 154070eaf6 ("hw/pxb-cxl: Support passthrough HDM Decoders unless ove= rridden") Reported-by: Peter Maydell Signed-off-by: Jonathan Cameron Message-Id: <20230420142750.6950-2-Jonathan.Cameron@huawei.com> Reviewed-by: Thomas Huth Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/pci-bridge/pci_expander_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index ead33f0c05..a78327b5f2 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -311,7 +311,7 @@ static void pxb_cxl_dev_reset(DeviceState *dev) * The CXL specification allows for host bridges with no HDM decoders * if they only have a single root port. */ - if (!PXB_DEV(dev)->hdm_for_passthrough) { + if (!PXB_CXL_DEV(dev)->hdm_for_passthrough) { dsp_count =3D pcie_count_ds_ports(hb->bus); } /* Initial reset will have 0 dsp so wait until > 0 */ --=20 MST From nobody Fri Nov 1 00:04:15 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682409042; cv=none; d=zohomail.com; s=zohoarc; b=TkhYKO0HwEyv4z5BizhyLe6+jCw90RLqyJfCHCxbGIbLcpFUAkw/dUnjVIuRI++p2WQtNfRxcwOBc5vizML7VPAYFVylaiP5xJT2Y8BBGNBUekEU5KT18OIRUXScL0c0Ww/F3oYRKNnxAzoFxo0PY+txgPE9r8obLSSNQgWvug8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682409042; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h/kHw1Czuudqd7AtavZ32mV+qPmla6m9ig97FaNqQrg=; b=iT6Du6ytIJlahOL2TyiQZOPdpqhatlCUiUSliYXNFzPNYngkKixTDTAFjkc+It5IQfA5IVdm5CPSL1zQ/c2t76AIgYYP1TnMMmD7NxWB4wcdTSRdnEnWcLaGhCpy7CrTkYqjRh3mEcOiDcXViz5e8PrAVep87/hHe+2bJ2aDsyM= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168240904218469.90271366796344; Tue, 25 Apr 2023 00:50:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDOX-0002t6-JD; Tue, 25 Apr 2023 03:47:25 -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 1prDNw-0001vE-UD for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDNt-0006vV-No for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:46:48 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-474-g-WlJl0FN-CJgvuYvxskfw-1; Tue, 25 Apr 2023 03:46:43 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f175a24fd1so29730325e9.1 for ; Tue, 25 Apr 2023 00:46:43 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id q17-20020a1cf311000000b003eeb1d6a470sm14135645wmq.13.2023.04.25.00.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408805; 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: in-reply-to:in-reply-to:references:references; bh=h/kHw1Czuudqd7AtavZ32mV+qPmla6m9ig97FaNqQrg=; b=Yd30ZWZ0vatGdeg7ZWY7N70EgKjeqAmcDQFnIdf1EuSE2ajoIqSXL3HSbtZ/DEYpoa8Iun S91olpL9rzmW/pp7mw1GdDdzGwCEwoHifLvNVHOl3S/ewZjbPDijcDB0UdCccPWwucW0Ua 39WNoESXmXMwNWOzVEmfVcbMCaVg46Q= X-MC-Unique: g-WlJl0FN-CJgvuYvxskfw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408802; x=1685000802; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=h/kHw1Czuudqd7AtavZ32mV+qPmla6m9ig97FaNqQrg=; b=fyrthlyUpNxOxlc49oxlVcN9dTTx/Tqwu4xyAHz8/kqtLtq8JxDrMTu+ebqwIka+WR K9Pu7prycouIl+TTu7MTQDHyl7MCv4TENAGfrUY+e3LwwklBFuLbFz+ZKgcJKxBfqS9u jGDsDDK9w0FvMW/VqETdHtg8wN5Fv6vhbbCCecFAjWmMJkCQ2LYSbm9JAtlAIeKsE9vO P/BDksCWet3YSjTZr63mv7bzdmDWfqKNZYz50heCiHvk8dzrzjJqOAWwB0PE0BQYtEJD +csY+MyBbQgQqibFP+BNafzMishzpgKS3ZCsmQZ0XEnrNLRimPTDQozEH/4oKjaIPSXj jwCg== X-Gm-Message-State: AAQBX9ctVEoRklcpHH+wVmy7P22hSR5d91z9lAaXLv7JinYUOjUaRMM3 36MFg3KBJUaPn8sZd0iy74n/zWkO/bk3cdSX2fRXobVnTht8ZM+kbdbr0aGtWZMjkipvL5BSWH5 x3R9eU8t9ZFragVFLrF2nxEmsLtaGEV4EFZXDJ1VfXfXOIelGXM7ewdnbh/I2zB7QT3yn X-Received: by 2002:a7b:c045:0:b0:3f1:662a:93c4 with SMTP id u5-20020a7bc045000000b003f1662a93c4mr10023190wmc.36.1682408802264; Tue, 25 Apr 2023 00:46:42 -0700 (PDT) X-Google-Smtp-Source: AKy350bkLGZpX1jQd7EVFiamYn7kQX4eG/R1ArGCYmp+D37yhYE5NE/QkRBKjwqeTZdx6GsmmRraLQ== X-Received: by 2002:a7b:c045:0:b0:3f1:662a:93c4 with SMTP id u5-20020a7bc045000000b003f1662a93c4mr10023159wmc.36.1682408801826; Tue, 25 Apr 2023 00:46:41 -0700 (PDT) Date: Tue, 25 Apr 2023 03:46:39 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Thomas Huth , Igor Mammedov , Ani Sinha , Fan Ni , Marcel Apfelbaum Subject: [PULL 31/31] hw/pci-bridge: Make PCIe and CXL PXB Devices inherit from TYPE_PXB_DEV Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1682409042829100015 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jonathan Cameron Previously, PXB_CXL_DEVICE, PXB_PCIE_DEVICE and PXB_DEVICE all have PCI_DEVICE as their direct parent but share a common state struct PXBDev. convert_to_pxb() is used to get the PXBDev instance from which ever of these types it is called on. This patch switches to an explicit hierarchy based on shared functionality. To allow use of OBJECT_DECLARE_SIMPLE_TYPE() whilst minimizing code changes, all types are renamed to have the postfix _DEV rather than _DEVICE. The new heirarchy has PXB_CXL_DEV with parent PXB_PCIE_DEV which in turn has parent PXB_DEV which continues to have parent PCI_DEVICE. This allows simple use of PXB_DEV() etc rather than a custom function + removal of duplicated properties and moving the CXL specific elements out of struct PXBDev. Signed-off-by: Jonathan Cameron Message-Id: <20230420142750.6950-3-Jonathan.Cameron@huawei.com> Reviewed-by: Thomas Huth Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/cxl/cxl.h | 4 +- include/hw/pci/pci_bridge.h | 30 ++++++++++----- hw/acpi/cxl.c | 11 +++--- hw/cxl/cxl-host.c | 4 +- hw/pci-bridge/pci_expander_bridge.c | 59 ++++++++++------------------- 5 files changed, 50 insertions(+), 58 deletions(-) diff --git a/include/hw/cxl/cxl.h b/include/hw/cxl/cxl.h index b2cffbb364..c453983e83 100644 --- a/include/hw/cxl/cxl.h +++ b/include/hw/cxl/cxl.h @@ -23,12 +23,12 @@ =20 #define CXL_WINDOW_MAX 10 =20 -typedef struct PXBDev PXBDev; +typedef struct PXBCXLDev PXBCXLDev; =20 typedef struct CXLFixedWindow { uint64_t size; char **targets; - PXBDev *target_hbs[8]; + PXBCXLDev *target_hbs[8]; uint8_t num_targets; uint8_t enc_int_ways; uint8_t enc_int_gran; diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h index 1677176b2a..01670e9e65 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -84,7 +84,7 @@ struct PCIBridge { #define PCI_BRIDGE_DEV_PROP_SHPC "shpc" typedef struct CXLHost CXLHost; =20 -struct PXBDev { +typedef struct PXBDev { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -92,15 +92,27 @@ struct PXBDev { uint8_t bus_nr; uint16_t numa_node; bool bypass_iommu; - bool hdm_for_passthrough; - struct cxl_dev { - CXLHost *cxl_host_bridge; /* Pointer to a CXLHost */ - } cxl; -}; +} PXBDev; =20 -#define TYPE_PXB_CXL_DEVICE "pxb-cxl" -DECLARE_INSTANCE_CHECKER(PXBDev, PXB_CXL_DEV, - TYPE_PXB_CXL_DEVICE) +typedef struct PXBPCIEDev { + /*< private >*/ + PXBDev parent_obj; +} PXBPCIEDev; + +#define TYPE_PXB_DEV "pxb" +OBJECT_DECLARE_SIMPLE_TYPE(PXBDev, PXB_DEV) + +typedef struct PXBCXLDev { + /*< private >*/ + PXBPCIEDev parent_obj; + /*< public >*/ + + bool hdm_for_passthrough; + CXLHost *cxl_host_bridge; /* Pointer to a CXLHost */ +} PXBCXLDev; + +#define TYPE_PXB_CXL_DEV "pxb-cxl" +OBJECT_DECLARE_SIMPLE_TYPE(PXBCXLDev, PXB_CXL_DEV) =20 int pci_bridge_ssvid_init(PCIDevice *dev, uint8_t offset, uint16_t svid, uint16_t ssid, diff --git a/hw/acpi/cxl.c b/hw/acpi/cxl.c index 2bf8c07993..92b46bc932 100644 --- a/hw/acpi/cxl.c +++ b/hw/acpi/cxl.c @@ -30,9 +30,10 @@ #include "qapi/error.h" #include "qemu/uuid.h" =20 -static void cedt_build_chbs(GArray *table_data, PXBDev *cxl) +static void cedt_build_chbs(GArray *table_data, PXBCXLDev *cxl) { - SysBusDevice *sbd =3D SYS_BUS_DEVICE(cxl->cxl.cxl_host_bridge); + PXBDev *pxb =3D PXB_DEV(cxl); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(cxl->cxl_host_bridge); struct MemoryRegion *mr =3D sbd->mmio[0].memory; =20 /* Type */ @@ -45,7 +46,7 @@ static void cedt_build_chbs(GArray *table_data, PXBDev *c= xl) build_append_int_noprefix(table_data, 32, 2); =20 /* UID - currently equal to bus number */ - build_append_int_noprefix(table_data, cxl->bus_nr, 4); + build_append_int_noprefix(table_data, pxb->bus_nr, 4); =20 /* Version */ build_append_int_noprefix(table_data, 1, 4); @@ -112,7 +113,7 @@ static void cedt_build_cfmws(GArray *table_data, CXLSta= te *cxls) /* Host Bridge List (list of UIDs - currently bus_nr) */ for (i =3D 0; i < fw->num_targets; i++) { g_assert(fw->target_hbs[i]); - build_append_int_noprefix(table_data, fw->target_hbs[i]->bus_n= r, 4); + build_append_int_noprefix(table_data, PXB_DEV(fw->target_hbs[i= ])->bus_nr, 4); } } } @@ -121,7 +122,7 @@ static int cxl_foreach_pxb_hb(Object *obj, void *opaque) { Aml *cedt =3D opaque; =20 - if (object_dynamic_cast(obj, TYPE_PXB_CXL_DEVICE)) { + if (object_dynamic_cast(obj, TYPE_PXB_CXL_DEV)) { cedt_build_chbs(cedt->buf, PXB_CXL_DEV(obj)); } =20 diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 6e923ceeaf..034c7805b3 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -84,7 +84,7 @@ void cxl_fmws_link_targets(CXLState *cxl_state, Error **e= rrp) bool ambig; =20 o =3D object_resolve_path_type(fw->targets[i], - TYPE_PXB_CXL_DEVICE, + TYPE_PXB_CXL_DEV, &ambig); if (!o) { error_setg(errp, "Could not resolve CXLFM target %s", @@ -141,7 +141,7 @@ static PCIDevice *cxl_cfmws_find_device(CXLFixedWindow = *fw, hwaddr addr) addr +=3D fw->base; =20 rb_index =3D (addr / cxl_decode_ig(fw->enc_int_gran)) % fw->num_target= s; - hb =3D PCI_HOST_BRIDGE(fw->target_hbs[rb_index]->cxl.cxl_host_bridge); + hb =3D PCI_HOST_BRIDGE(fw->target_hbs[rb_index]->cxl_host_bridge); if (!hb || !hb->bus || !pci_bus_is_cxl(hb->bus)) { return NULL; } diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index a78327b5f2..613857b601 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -50,24 +50,8 @@ struct PXBBus { char bus_path[8]; }; =20 -#define TYPE_PXB_DEVICE "pxb" -DECLARE_INSTANCE_CHECKER(PXBDev, PXB_DEV, - TYPE_PXB_DEVICE) - -#define TYPE_PXB_PCIE_DEVICE "pxb-pcie" -DECLARE_INSTANCE_CHECKER(PXBDev, PXB_PCIE_DEV, - TYPE_PXB_PCIE_DEVICE) - -static PXBDev *convert_to_pxb(PCIDevice *dev) -{ - /* A CXL PXB's parent bus is PCIe, so the normal check won't work */ - if (object_dynamic_cast(OBJECT(dev), TYPE_PXB_CXL_DEVICE)) { - return PXB_CXL_DEV(dev); - } - - return pci_bus_is_express(pci_get_bus(dev)) - ? PXB_PCIE_DEV(dev) : PXB_DEV(dev); -} +#define TYPE_PXB_PCIE_DEV "pxb-pcie" +OBJECT_DECLARE_SIMPLE_TYPE(PXBPCIEDev, PXB_PCIE_DEV) =20 static GList *pxb_dev_list; =20 @@ -89,14 +73,14 @@ bool cxl_get_hb_passthrough(PCIHostState *hb) =20 static int pxb_bus_num(PCIBus *bus) { - PXBDev *pxb =3D convert_to_pxb(bus->parent_dev); + PXBDev *pxb =3D PXB_DEV(bus->parent_dev); =20 return pxb->bus_nr; } =20 static uint16_t pxb_bus_numa_node(PCIBus *bus) { - PXBDev *pxb =3D convert_to_pxb(bus->parent_dev); + PXBDev *pxb =3D PXB_DEV(bus->parent_dev); =20 return pxb->numa_node; } @@ -154,7 +138,7 @@ static char *pxb_host_ofw_unit_address(const SysBusDevi= ce *dev) =20 pxb_host =3D PCI_HOST_BRIDGE(dev); pxb_bus =3D pxb_host->bus; - pxb_dev =3D convert_to_pxb(pxb_bus->parent_dev); + pxb_dev =3D PXB_DEV(pxb_bus->parent_dev); position =3D g_list_index(pxb_dev_list, pxb_dev); assert(position >=3D 0); =20 @@ -212,8 +196,8 @@ static void pxb_cxl_realize(DeviceState *dev, Error **e= rrp) */ void pxb_cxl_hook_up_registers(CXLState *cxl_state, PCIBus *bus, Error **e= rrp) { - PXBDev *pxb =3D PXB_CXL_DEV(pci_bridge_get_device(bus)); - CXLHost *cxl =3D pxb->cxl.cxl_host_bridge; + PXBCXLDev *pxb =3D PXB_CXL_DEV(pci_bridge_get_device(bus)); + CXLHost *cxl =3D pxb->cxl_host_bridge; CXLComponentState *cxl_cstate =3D &cxl->cxl_cstate; struct MemoryRegion *mr =3D &cxl_cstate->crb.component_registers; hwaddr offset; @@ -299,7 +283,7 @@ static int pxb_map_irq_fn(PCIDevice *pci_dev, int pin) =20 static void pxb_cxl_dev_reset(DeviceState *dev) { - CXLHost *cxl =3D PXB_CXL_DEV(dev)->cxl.cxl_host_bridge; + CXLHost *cxl =3D PXB_CXL_DEV(dev)->cxl_host_bridge; CXLComponentState *cxl_cstate =3D &cxl->cxl_cstate; PCIHostState *hb =3D PCI_HOST_BRIDGE(cxl); uint32_t *reg_state =3D cxl_cstate->crb.cache_mem_registers; @@ -337,7 +321,7 @@ static gint pxb_compare(gconstpointer a, gconstpointer = b) static void pxb_dev_realize_common(PCIDevice *dev, enum BusType type, Error **errp) { - PXBDev *pxb =3D convert_to_pxb(dev); + PXBDev *pxb =3D PXB_DEV(dev); DeviceState *ds, *bds =3D NULL; PCIBus *bus; const char *dev_name =3D NULL; @@ -365,7 +349,7 @@ static void pxb_dev_realize_common(PCIDevice *dev, enum= BusType type, } else if (type =3D=3D CXL) { bus =3D pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_CXL= _BUS); bus->flags |=3D PCI_BUS_CXL; - PXB_CXL_DEV(dev)->cxl.cxl_host_bridge =3D PXB_CXL_HOST(ds); + PXB_CXL_DEV(dev)->cxl_host_bridge =3D PXB_CXL_HOST(ds); } else { bus =3D pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_P= XB_BUS); bds =3D qdev_new("pci-bridge"); @@ -418,7 +402,7 @@ static void pxb_dev_realize(PCIDevice *dev, Error **err= p) =20 static void pxb_dev_exitfn(PCIDevice *pci_dev) { - PXBDev *pxb =3D convert_to_pxb(pci_dev); + PXBDev *pxb =3D PXB_DEV(pci_dev); =20 pxb_dev_list =3D g_list_remove(pxb_dev_list, pxb); } @@ -449,7 +433,7 @@ static void pxb_dev_class_init(ObjectClass *klass, void= *data) } =20 static const TypeInfo pxb_dev_info =3D { - .name =3D TYPE_PXB_DEVICE, + .name =3D TYPE_PXB_DEV, .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PXBDev), .class_init =3D pxb_dev_class_init, @@ -481,15 +465,14 @@ static void pxb_pcie_dev_class_init(ObjectClass *klas= s, void *data) k->class_id =3D PCI_CLASS_BRIDGE_HOST; =20 dc->desc =3D "PCI Express Expander Bridge"; - device_class_set_props(dc, pxb_dev_properties); dc->hotpluggable =3D false; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); } =20 static const TypeInfo pxb_pcie_dev_info =3D { - .name =3D TYPE_PXB_PCIE_DEVICE, - .parent =3D TYPE_PCI_DEVICE, - .instance_size =3D sizeof(PXBDev), + .name =3D TYPE_PXB_PCIE_DEV, + .parent =3D TYPE_PXB_DEV, + .instance_size =3D sizeof(PXBPCIEDev), .class_init =3D pxb_pcie_dev_class_init, .interfaces =3D (InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, @@ -510,11 +493,7 @@ static void pxb_cxl_dev_realize(PCIDevice *dev, Error = **errp) } =20 static Property pxb_cxl_dev_properties[] =3D { - /* Note: 0 is not a legal PXB bus number. */ - DEFINE_PROP_UINT8("bus_nr", PXBDev, bus_nr, 0), - DEFINE_PROP_UINT16("numa_node", PXBDev, numa_node, NUMA_NODE_UNASSIGNE= D), - DEFINE_PROP_BOOL("bypass_iommu", PXBDev, bypass_iommu, false), - DEFINE_PROP_BOOL("hdm_for_passthrough", PXBDev, hdm_for_passthrough, f= alse), + DEFINE_PROP_BOOL("hdm_for_passthrough", PXBCXLDev, hdm_for_passthrough= , false), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -540,9 +519,9 @@ static void pxb_cxl_dev_class_init(ObjectClass *klass, = void *data) } =20 static const TypeInfo pxb_cxl_dev_info =3D { - .name =3D TYPE_PXB_CXL_DEVICE, - .parent =3D TYPE_PCI_DEVICE, - .instance_size =3D sizeof(PXBDev), + .name =3D TYPE_PXB_CXL_DEV, + .parent =3D TYPE_PXB_PCIE_DEV, + .instance_size =3D sizeof(PXBCXLDev), .class_init =3D pxb_cxl_dev_class_init, .interfaces =3D (InterfaceInfo[]){ --=20 MST