From nobody Wed May 15 07:51:38 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=1672910809; cv=none; d=zohomail.com; s=zohoarc; b=gc73K0sev8Q4hUX9FUMEk8r9vALMwWXmux9jUt2SK3sHfesAVJT7s8e7zUhQxY0/JvrFbOBMr+PzHkO8h8LRzJ1s+okYvVt5fcOl8dZ4GBc/NiNEI68uAW470PZkkS5qMFtpHTITE5itbWnbRTvBmCr9lFN8Or1Ja1DMIKI5c14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910809; 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=aiK7Orr6ur5e67j0AHms6zyenXMrQvCI9Jun2X6gj8E=; b=f8GogcgmpvW6F7D0xRcqG55ZfWvTGTXJxBZQku8LFgJZ2Jk/yWFWbtwszWvOlWv6MwLyM+lRpL4WhtGhjlcxSc+qjY6UARhhIB2p5u53ePCzVAial2N+mKtLonKVA2Blz59YsADXE/x2AkJIkBOsXLp6EZz5qVUNjO3Z/csHe18= 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 1672910809165742.4958513059964; Thu, 5 Jan 2023 01:26:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKT-0001LF-LV; Thu, 05 Jan 2023 04:14:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKS-0001Ks-Tz for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:28 -0500 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 1pDMKR-0006l9-BR for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:28 -0500 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_128_GCM_SHA256) id us-mta-182-ZO3vVVpWNyW-cchINdt2Vg-1; Thu, 05 Jan 2023 04:14:25 -0500 Received: by mail-wr1-f71.google.com with SMTP id s3-20020adf9783000000b002ab389f64c1so531589wrb.22 for ; Thu, 05 Jan 2023 01:14:24 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id l24-20020a1ced18000000b003d99da8d30asm1602848wmh.46.2023.01.05.01.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910066; 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=aiK7Orr6ur5e67j0AHms6zyenXMrQvCI9Jun2X6gj8E=; b=K7nflXfOMVI+ZRU253JOX+4XehPyRoFi0Dfqsut3yoOw/xipDIh/kWmIi8riodMKPdiGKz RYdzoynuPn5rqinOvWldnyjQoTU2Twa1Ei57Dh5eB70dVU3bc1cXngTBCtOsfjB9m4JhY7 jSkTdf3xMQ0sz0boJxFT/DHg5lwsl9A= X-MC-Unique: ZO3vVVpWNyW-cchINdt2Vg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=aiK7Orr6ur5e67j0AHms6zyenXMrQvCI9Jun2X6gj8E=; b=VSfv5LntYrWa9ybtIEB8pdK2BFA0S//hjaa8j06+/6WRPCdYZjiscAYkOi7HZcPHjG ajySymrU7aZpit/lWgnipNqb+bAqBYVpRItKxmG3Zf3MywqaZxsCB+rJRKEx7lMCR8Jy xeYAuXmGQTh5zRREV1gDs1epTZRZARqUJ/YWwweZXz1oUpsiMkEI/ayTWCrCjoI1ZRhK hopuKDbBnoVyo1EknTBqu86Ngh3AU9r522SgpIv9FR5AezBqT0NFG9HHgWDnVO5QBGX+ 2k2xaUdc3ugN7Ci8LwTVGglPxHgexYnH0OK5B1mu9janqZb2ut+lDgYoH4L20s3jLdDB fVLA== X-Gm-Message-State: AFqh2kqD6RQtNxI7QS7fr0l/NOM8EP+ymHpoSfOwQy+/+ZgeEnO/HjqF hp6gV9lF8GvKvbQnYn6rvg/tYKu1aeyVGLl/K5kiALAXsVXtjl4y/HRQDSBACooyBondI+yepbX nrz0TOaZ91IDO05wocxBgrl5OULDKcH1jX6ZE1vlhbxQMNUDdjLJLZbF2thqi X-Received: by 2002:a05:600c:4255:b0:3d2:282a:e1f5 with SMTP id r21-20020a05600c425500b003d2282ae1f5mr34615519wmm.30.1672910063344; Thu, 05 Jan 2023 01:14:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXtkIxUzO7g1tyk9iSWIutpVfrDeeZVdycHLAk+7q2TgtJXlitB/HTDBRuRtV1joXCjElkCTZw== X-Received: by 2002:a05:600c:4255:b0:3d2:282a:e1f5 with SMTP id r21-20020a05600c425500b003d2282ae1f5mr34615498wmm.30.1672910062957; Thu, 05 Jan 2023 01:14:22 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:20 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Jason Wang Subject: [PULL 01/51] virtio_net: Modify virtio_net_get_config to early return Message-ID: <20230105091310.263867-2-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910810932100003 From: Eugenio P=C3=A9rez Next patches introduce more code on vhost-vdpa branch, with already have too much indentation. Signed-off-by: Eugenio P=C3=A9rez Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Acked-by: Jason Wang Message-Id: <20221221115015.1400889-2-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/net/virtio-net.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 9cbdfa5547..b30038d130 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -168,20 +168,22 @@ static void virtio_net_get_config(VirtIODevice *vdev,= uint8_t *config) if (nc->peer && nc->peer->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_VD= PA) { ret =3D vhost_net_get_config(get_vhost_net(nc->peer), (uint8_t *)&= netcfg, n->config_size); - if (ret !=3D -1) { - /* - * Some NIC/kernel combinations present 0 as the mac address. = As - * that is not a legal address, try to proceed with the - * address from the QEMU command line in the hope that the - * address has been configured correctly elsewhere - just not - * reported by the device. - */ - if (memcmp(&netcfg.mac, &zero, sizeof(zero)) =3D=3D 0) { - info_report("Zero hardware mac address detected. Ignoring.= "); - memcpy(netcfg.mac, n->mac, ETH_ALEN); - } - memcpy(config, &netcfg, n->config_size); + if (ret =3D=3D -1) { + return; } + + /* + * Some NIC/kernel combinations present 0 as the mac address. As = that + * is not a legal address, try to proceed with the address from the + * QEMU command line in the hope that the address has been configu= red + * correctly elsewhere - just not reported by the device. + */ + if (memcmp(&netcfg.mac, &zero, sizeof(zero)) =3D=3D 0) { + info_report("Zero hardware mac address detected. Ignoring."); + memcpy(netcfg.mac, n->mac, ETH_ALEN); + } + + memcpy(config, &netcfg, n->config_size); } } =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672910087; cv=none; d=zohomail.com; s=zohoarc; b=i0T0rkAKoCI1Tful1Zzkt4FmaQdajbtP+ybZbROOL+rEKc0iqIpNunun1dcdnM2BNPjqGSt2iNdcWCSxrIWBZPEbSEQHHqpD3iIkGw2Shue7iCEYq/gO/7tux1ayikdOjxU3lY2cY+5izKi/vNmN7wXLWtH2fdOfkfXd8M916ck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910087; 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=lRRvIgKN38K8nw+7jCTXmfyKQPQYxZVIReBQhF7dhhU=; b=RVsq72G9bhwl7l79MLHUpq2AYs5luIFEIQOZ5OLQI/kS8SQ+JD1NtkfyIqA6rsvLSpCX36caMj1i9S2z548whjpcuVD5qocfPLg27GyMikfFmfxwKg3sBiR2U5Am/IhGyk/obv6ASYjE8xdxUsh76OJgKAYBaeQPX17lxP1NCBE= 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 1672910087742954.074625166592; Thu, 5 Jan 2023 01:14:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKX-0001Lh-4A; Thu, 05 Jan 2023 04:14:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKV-0001LY-Ag for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:31 -0500 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 1pDMKT-0006ll-ST for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:31 -0500 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_128_GCM_SHA256) id us-mta-306-3gW-T0TGOVOFxfhA6D0EFg-1; Thu, 05 Jan 2023 04:14:27 -0500 Received: by mail-wr1-f71.google.com with SMTP id n13-20020adfc60d000000b0029bdfcf52eeso1710790wrg.8 for ; Thu, 05 Jan 2023 01:14:27 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id r126-20020a1c2b84000000b003d35c845cbbsm1632027wmr.21.2023.01.05.01.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910069; 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=lRRvIgKN38K8nw+7jCTXmfyKQPQYxZVIReBQhF7dhhU=; b=bOCQX54oS/kKy6jbObluOu39h+SmtAzLZ+WoFxGD1iBk9tRP4YLXF/mWV9cE10byfAaXhk PaZJJNc6f1XhdifVumgRF10WEVg7TfFaNcEjt8iCN+b/CRr0WYRVlngmogvd2jHlot2DUe Qp5ADzqS21Nd8l6osoLUcL2NEBwQG10= X-MC-Unique: 3gW-T0TGOVOFxfhA6D0EFg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=lRRvIgKN38K8nw+7jCTXmfyKQPQYxZVIReBQhF7dhhU=; b=3GCWYvgYLX5sL78chAZejhCEH1LDCsc83X1wkQO+cNE3o5KM1wVKcaRxr7RX9h1XWf 2qumqg9v5aIBelon0ds63ioiBHj+uwvElljA0WIOJ68GUMGlw2i3EWrJ+S/eu1bcZYP3 XTTXxW/RdkDeKJBjo8juI5u2eBto6Zd+EcsRDf6z/hUOhCUC2EUF2ioxzSt+81KQMA9+ q0mKr3DX3FYDYhPhUW5U6S4ZVJ49v/kBtQrCvnKQAofh4PWPslTGwk4l226qE62YP2vs A7/UA1hP7gWyIvf3ktiNuk6Mpco6NaiKn3L1r/CxfL46qr6hCwqrkx0BPseG96aGJ+0i thKQ== X-Gm-Message-State: AFqh2krruPJQaSdWPd/K8fd5PKjh+D7YKs1o4kGAiGlbYnCOZQu89Hrv lesSkG8IZrc7JzRzMGkL5AMk6YOD6H1OR3eW2DMMranjrvmsUEeYzCzRxoRLCUXyGtb0Tj/ohiB 9L1K+9Xlb7iUP35dGaL/5GGdt80H2yO1EkoPTGVWOOj7RTNARJkPdXd6OUoM5 X-Received: by 2002:a05:600c:5113:b0:3d3:5c21:dd99 with SMTP id o19-20020a05600c511300b003d35c21dd99mr35134917wms.18.1672910066246; Thu, 05 Jan 2023 01:14:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXv80jdKk1f4Gw4M7n+xr+3wysb+3OHc2s5mJRGPXJcoTOv1/SefTkqkP6Wp+235Oq0KNqtWRg== X-Received: by 2002:a05:600c:5113:b0:3d3:5c21:dd99 with SMTP id o19-20020a05600c511300b003d35c21dd99mr35134900wms.18.1672910065987; Thu, 05 Jan 2023 01:14:25 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:23 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Jason Wang Subject: [PULL 02/51] virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model has it Message-ID: <20230105091310.263867-3-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910088970100001 From: Eugenio P=C3=A9rez Status part of the emulated feature. It will follow device model, so we must copy it as long as NIC device model has it set. Signed-off-by: Eugenio P=C3=A9rez Message-Id: <20221221115015.1400889-3-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- hw/net/virtio-net.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index b30038d130..122eac25ee 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -183,6 +183,8 @@ static void virtio_net_get_config(VirtIODevice *vdev, u= int8_t *config) memcpy(netcfg.mac, n->mac, ETH_ALEN); } =20 + netcfg.status |=3D virtio_tswap16(vdev, + n->status & VIRTIO_NET_S_ANNOUNCE); memcpy(config, &netcfg, n->config_size); } } --=20 MST From nobody Wed May 15 07:51:38 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=1672910166; cv=none; d=zohomail.com; s=zohoarc; b=IleC3lsj4FBk0U7iJUHgQWUIg0L06R88FjAZWBwmLawg9+pf08jZztJJDbVCfJAjqADOTP7jqtp0kEsyx6y+EGjxYGNDbAvW450KsdSdVA26qR77CiZFbUI/749oy6b7adW6OSZVtIYfFCsvD0jWXHDzjlKbf9WWGCcdAq9RnVE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910166; 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=5qEglmRXYJZKZpYP6BpBMT10QEx12Bn66mMNUx3KI+Y=; b=ng5T1y6fVP34x6Gq7wT3R+S8nalwIyn4m5vgyT557zb1Q2kIYxCrdUwuQ1ZqnxKnORiZtOA3IC7D2Oh66nUi8uyu+AC41Wylh+ta0T677y7uBUYQSBeju0FqyQEmeJsmFL2YF+rphKe9wfoq6Cmj7fUYkgU8G8Ili1EvqoqFbM8= 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 1672910166705939.8056528144399; Thu, 5 Jan 2023 01:16:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKZ-0001MQ-OZ; Thu, 05 Jan 2023 04:14:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKX-0001M2-V1 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:33 -0500 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 1pDMKW-0006lw-Fz for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:33 -0500 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_128_GCM_SHA256) id us-mta-537-C76dSZMEOjOE9XM731BFTQ-1; Thu, 05 Jan 2023 04:14:30 -0500 Received: by mail-wm1-f69.google.com with SMTP id f20-20020a7bc8d4000000b003d1cda5bd6fso260357wml.9 for ; Thu, 05 Jan 2023 01:14:30 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id bj11-20020a0560001e0b00b002a6f329203esm3297506wrb.61.2023.01.05.01.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910071; 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=5qEglmRXYJZKZpYP6BpBMT10QEx12Bn66mMNUx3KI+Y=; b=EvXSNt7PSsULQZmgFSXanhA7yHsSYEHKOBs35kKFWdSKaogibmazhKVXxQ/SlJdbHjk8VV WIoHiU/A2vGYRSvzjq1Jrkt6jEqkjwSLhVNDw6qJbIxX477YL8Z37NuNz5vvverRWSZFSk C84PV5//xBmRZqys4MA07UwGwYx73j8= X-MC-Unique: C76dSZMEOjOE9XM731BFTQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=5qEglmRXYJZKZpYP6BpBMT10QEx12Bn66mMNUx3KI+Y=; b=DIUc2wLXDRyzxAqlqTdjfjcJyJMVwKm/vsK8g3B/XB/PeYKV/hb5WtAWEQ90uthe/p Te7bIOKtUjK5EAwif+vc/jUnEj+Pa5HsH6EouzvBXNMtrtggVaTffJf858emn+Xvd/5a P/RLgct6ft9SZD9QzTj6Pd5eMpysjPQ1vYMKTyDjfCz2neqOcHSNBKb2gnvahZA3h7fG ziF9r3akwG1tmJ4UV/8YBPIbLixNd2xACksJ3L/NxAFrS0vkcCLpTkiFD/ebBNGKVCze +y837EJvc/gCEaVdAHG/UAXfMK+LpoHj1tVbK81nFTxpPYQJ4O7N1Q49V5oMvoNDEx04 miqw== X-Gm-Message-State: AFqh2kpcNDQgdRdhIDEjhGkgL+C6ushnLNpdgmu7nIVA7m46kUiy7vOH qgwDCmFkEEYIxxfb7MwYfgRVsLe/p6FNR/7TdqJpLD9wtvs8sU8MZV/C9k+9ltZqGNU4RJISnfs GSPPgCg1C2XFrSI24SX9zX8CPXuX3dglRkZoAQAWXJnq/s98ppgE3lDnj5Zv0 X-Received: by 2002:adf:fb05:0:b0:242:15d6:1a75 with SMTP id c5-20020adffb05000000b0024215d61a75mr27081918wrr.66.1672910068935; Thu, 05 Jan 2023 01:14:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXupo89gEx4OcPu/WA/HPQww6EX1yZeRd+biJHtScuRmeP9nkIPncX2FNoiPA6pK/mKNv1+2PA== X-Received: by 2002:adf:fb05:0:b0:242:15d6:1a75 with SMTP id c5-20020adffb05000000b0024215d61a75mr27081905wrr.66.1672910068692; Thu, 05 Jan 2023 01:14:28 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:26 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Jason Wang Subject: [PULL 03/51] vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in vhost_vdpa_net_handle_ctrl_avail Message-ID: <20230105091310.263867-4-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910167249100003 From: Eugenio P=C3=A9rez Since this capability is emulated by qemu shadowed CVQ cannot forward it to the device. Process all that command within qemu. Signed-off-by: Eugenio P=C3=A9rez Message-Id: <20221221115015.1400889-4-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- net/vhost-vdpa.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index d36664f33a..41de76376f 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -616,9 +616,18 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShado= wVirtqueue *svq, out.iov_len =3D iov_to_buf(elem->out_sg, elem->out_num, 0, s->cvq_cmd_out_buffer, vhost_vdpa_net_cvq_cmd_len()); - dev_written =3D vhost_vdpa_net_cvq_add(s, out.iov_len, sizeof(status)); - if (unlikely(dev_written < 0)) { - goto out; + if (*(uint8_t *)s->cvq_cmd_out_buffer =3D=3D VIRTIO_NET_CTRL_ANNOUNCE)= { + /* + * Guest announce capability is emulated by qemu, so don't forward= to + * the device. + */ + dev_written =3D sizeof(status); + *s->status =3D VIRTIO_NET_OK; + } else { + dev_written =3D vhost_vdpa_net_cvq_add(s, out.iov_len, sizeof(stat= us)); + if (unlikely(dev_written < 0)) { + goto out; + } } =20 if (unlikely(dev_written < sizeof(status))) { --=20 MST From nobody Wed May 15 07:51:38 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=1672910372; cv=none; d=zohomail.com; s=zohoarc; b=Ye6Cjw0GdRocpEz0GFa1eyNqOXa5Fmr5BnchqE152FhlHMbr3pVCDn18mtvYO7Geftyk3/Q123tMWanRXwB8trgjzAy70dCE8nDu7VaLM8dHKEYbl59sQE1wrK3AZ6mmCGNe9cNH7ivGnoVO9QrvAkvksPBcYuQVvGBg6EezOOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910372; 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=5A6GMov9PCeTxrjjQKoWBQC/93nLNMLXzF/LrE6+NE8=; b=LaI45YUG8nKn79S3YmgVoPSKmxOxz2W69cdbPZYTJS92qmEp0rmKJvZT4PeXIO7TYBhqctxhGEE5iVadUoDulLWdCVyYlwn9YR1iP7JRHFJtkv7eJpo+wvLvuN0WjbsJiXsUPIAfM0okLrhwLsM5N13U6pnJ7V2yjn6g5kPyfwI= 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 1672910372551412.7783460577101; Thu, 5 Jan 2023 01:19:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKd-0001OD-IB; Thu, 05 Jan 2023 04:14:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKb-0001O0-1a for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:37 -0500 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 1pDMKZ-0006mK-MB for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:36 -0500 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_128_GCM_SHA256) id us-mta-591-7pA_mUgpNWO05C7rOzv0Dw-1; Thu, 05 Jan 2023 04:14:33 -0500 Received: by mail-wm1-f69.google.com with SMTP id a6-20020a05600c224600b003d1f3ed49adso261390wmm.4 for ; Thu, 05 Jan 2023 01:14:33 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id h9-20020adffd49000000b00242209dd1ffsm35925584wrs.41.2023.01.05.01.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910074; 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=5A6GMov9PCeTxrjjQKoWBQC/93nLNMLXzF/LrE6+NE8=; b=Wp3oDU2SeoNSaFyt0Nf1UtaDZhW5yKwNtpeYD16d7RVCivL9WWAGsKSzu5obGJE2Jjf7Ya exDDwxjqQ5MGuHZqE5sfaODhk7LHzflaS8S0gfjifVyfpwQk+YPoh6Hp9QXmgxi12Rnpse hISOvhmQrBhLxYwaDYlDH+kgPT9jMsE= X-MC-Unique: 7pA_mUgpNWO05C7rOzv0Dw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=5A6GMov9PCeTxrjjQKoWBQC/93nLNMLXzF/LrE6+NE8=; b=sjuvluAZPFOhPkGjlCtBMrsuAChny7EwiUmCTbIzf7xZW1AovHedM4MNE1tkGKVHJZ LPxY2FGBBNElfkNqDBjLvSG0pmVq0i/zb/fPOk+s0htF3MRe5gxocBy/CSR52HO1Eymf HV14vO7VxILkE6g/DzlTpud1mNQsbU8+S19wCpldwugRWPS55eqEG5nYGyTQLxYpzhZL RRAYhPrcwqjZRJ2zDk2DQgx67KKPbF0q1k+/+Zwjy/FUgN8Dsa2iYJ/LNIDtTea2tAQl hsZOfWWSHPO+iGokU/zEuSNYbOcEO4fDY7fwhwGwQG3X+7sHeIzOwB1dNeiFQAdtfEJf /FnQ== X-Gm-Message-State: AFqh2kojW7NdvdNDdDXu0CCY6C6/qwXgJyki4qdUX3BMDDxMbWAjC9+I djDmgOmMJp3xx9VnRK5sqf9fQb2rfNHqmTDiQMxwBQWPAzU87DIYN2dGgAR+HG6nTm1+7DAJkPT H7WZkGC6meBXWxKB9yr5HqbSWyKmWh5R+SCqsz3bN/vNfWW8EP8HRf9aw/MWG X-Received: by 2002:a05:6000:1d84:b0:273:6845:68ef with SMTP id bk4-20020a0560001d8400b00273684568efmr25895606wrb.60.1672910071998; Thu, 05 Jan 2023 01:14:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8F9q8wU7Q1J9NyeJ0tEcDUiShqqyxnHbzyYHSH7n+ZnE2qd8ADfqIR28UMUglNgHVKPSxHQ== X-Received: by 2002:a05:6000:1d84:b0:273:6845:68ef with SMTP id bk4-20020a0560001d8400b00273684568efmr25895590wrb.60.1672910071666; Thu, 05 Jan 2023 01:14:31 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:28 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Jason Wang Subject: [PULL 04/51] vdpa: do not handle VIRTIO_NET_F_GUEST_ANNOUNCE in vhost-vdpa Message-ID: <20230105091310.263867-5-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910374231100003 From: Eugenio P=C3=A9rez So qemu emulates it even in case the device does not support it. Signed-off-by: Eugenio P=C3=A9rez Acked-by: Jason Wang Message-Id: <20221221115015.1400889-5-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 41de76376f..b0c6109230 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -74,7 +74,6 @@ const int vdpa_feature_bits[] =3D { VIRTIO_F_RING_RESET, VIRTIO_NET_F_RSS, VIRTIO_NET_F_HASH_REPORT, - VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_STATUS, VHOST_INVALID_FEATURE_BIT }; --=20 MST From nobody Wed May 15 07:51:38 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=1672911693; cv=none; d=zohomail.com; s=zohoarc; b=Te9ygMLmx6JHjoQdyOVC3afcmpIA2d7Xya/DA560UQzF0BJdKfSBZfvm6v9K7tPly8ktAt8OSVQtobx2GYJkd8pH8Guq4Nrg16b0+3jJzkk9CIGy1sUggBLAWUODe72jv6LRgcixZYvymJZfPGvzOHX9sbPls4d2sDqw1h8D7wY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911693; 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=ce2QpQ0ot58HD8RqdypL8PMLuYh1tuAM9+EGw8rDsGg=; b=dDPx9m7FjcAOK7SqLtjFhMq2mIjk0pFcpSA4ieyhfjF1/62qXdH8Z6Bv8jbKKeyhkeUHQd+cWLEBFvV6itU8F43H9K568zDRxfxweMRLcBYsYpjUoLwsGRmVPYLG57m1GYWWsvvnbQIVPOjl/iPeHFP7z0dQbmakFEfiXI3UY5M= 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 1672911693639916.7327314551333; Thu, 5 Jan 2023 01:41:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKf-0001Op-9W; Thu, 05 Jan 2023 04:14:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKe-0001OU-63 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:40 -0500 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 1pDMKc-0006mU-I3 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:39 -0500 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_128_GCM_SHA256) id us-mta-358-I3BRlLHCNiC4zVrC4yiuQQ-1; Thu, 05 Jan 2023 04:14:36 -0500 Received: by mail-wm1-f72.google.com with SMTP id k20-20020a05600c1c9400b003d9717c8b11so17468855wms.7 for ; Thu, 05 Jan 2023 01:14:36 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id l14-20020a05600c4f0e00b003d96c811d6dsm1763035wmq.30.2023.01.05.01.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910077; 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=ce2QpQ0ot58HD8RqdypL8PMLuYh1tuAM9+EGw8rDsGg=; b=eGZcLCs9N0jNqIdG81P6Eh2zpsfyguGXKWJrMe59M8njewtKFMg1ObsPEsp3tyFdV3WLjP sQPr58jzQ9l5mLGn8rlBcvw6fcQXOoXZdLjy0RGVLUxoxtx4oNiR/nPHGH6jVpbpyMfktB uSRHpVoqh7ann86QRGiT15KUGcUcO5k= X-MC-Unique: I3BRlLHCNiC4zVrC4yiuQQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ce2QpQ0ot58HD8RqdypL8PMLuYh1tuAM9+EGw8rDsGg=; b=h+J++TtYa5gKKeZko2lxwo+dWYNKIjvahIY/No94nk9Dl0DQsAE8tiG1ixGTWhpQMG RlBJK1JO5odh6nM+SevdNDJFBFOgn3T32JeczX6voXIMPG943LH1EuMMRVDbVkhJwKz6 4T7WuQx+sw63bPcUvdH8w7UfoOT4HzTYSZAS8CqpOuOM6lG0XLKX+ZBWN5qxVqV6MUz/ LDUQtoMzqV/67yHxA5pi1sl3gkv0PSZlflzrbLXSUBO2VxuehWBr8AgtEo0sS8HE0JXH uwwbqyXFqw7WNF05Y9Wvc9ZXwWFNJAk/g+zOLXc/LIeFMKd+GfJ32AH59SE78NOiijlB w8Mw== X-Gm-Message-State: AFqh2koZ+LsRH/PAt5oSvqpECvAy4wjpOMXFXMgFHtnFYl8GsnNUObsY 8JPkOYQh5P5Q9SAAAy8aB4rueLeSXRXLRLcaw3WFTUc81ZZaPZ86+TEVDpp+HIMFJm+c/WW/s9o CZUOpv45fc3RlegDstCYh2SGJP84p9Me6ClFC0C4UoizlQ3IZ3AzroKQ3QtGO X-Received: by 2002:a1c:4b06:0:b0:3cf:5e42:de64 with SMTP id y6-20020a1c4b06000000b003cf5e42de64mr39365673wma.39.1672910075013; Thu, 05 Jan 2023 01:14:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXsoeqhKJws3IaVERiLZhhMjVDZrK/5kL0oHc2/MX32dJNeMiRP/6gitBOVz/YkZFzy9i6Loag== X-Received: by 2002:a1c:4b06:0:b0:3cf:5e42:de64 with SMTP id y6-20020a1c4b06000000b003cf5e42de64mr39365654wma.39.1672910074750; Thu, 05 Jan 2023 01:14:34 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:31 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Igor Mammedov , Ani Sinha Subject: [PULL 05/51] hw/acpi/Kconfig: Rename ACPI_X86_ICH to ACPI_ICH9 Message-ID: <20230105091310.263867-6-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911694045100001 From: Bernhard Beschow Although the ICH9 ACPI controller may currently be tied to x86 it doesn't have to. Furthermore, the source files this configuration switch manages contain a '9', so this name fits more. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20221216130355.41667-2-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/Kconfig | 2 +- hw/acpi/meson.build | 2 +- hw/i2c/meson.build | 2 +- hw/isa/Kconfig | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index 3703aca212..14694c75b4 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -13,7 +13,7 @@ config ACPI_X86 select ACPI_PCIHP select ACPI_ERST =20 -config ACPI_X86_ICH +config ACPI_ICH9 bool select ACPI_X86 =20 diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index 2ed29ae94c..30054a8cdc 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -22,7 +22,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('pi= ix4.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-s= tub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VIOT', if_true: files('viot.c')) -acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'ich9_tc= o.c')) +acpi_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('ich9.c', 'ich9_tco.c= ')) acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files= ('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) diff --git a/hw/i2c/meson.build b/hw/i2c/meson.build index d3df273251..6e7340aaac 100644 --- a/hw/i2c/meson.build +++ b/hw/i2c/meson.build @@ -2,7 +2,7 @@ i2c_ss =3D ss.source_set() i2c_ss.add(when: 'CONFIG_I2C', if_true: files('core.c')) i2c_ss.add(when: 'CONFIG_SMBUS', if_true: files('smbus_slave.c', 'smbus_ma= ster.c')) i2c_ss.add(when: 'CONFIG_ACPI_SMBUS', if_true: files('pm_smbus.c')) -i2c_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('smbus_ich9.c')) +i2c_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('smbus_ich9.c')) i2c_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_i2c.c')) i2c_ss.add(when: 'CONFIG_BITBANG_I2C', if_true: files('bitbang_i2c.c')) i2c_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_i2c.c')) diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig index 18b5c6bf3f..01f330d941 100644 --- a/hw/isa/Kconfig +++ b/hw/isa/Kconfig @@ -78,4 +78,4 @@ config LPC_ICH9 select I8257 select ISA_BUS select ACPI_SMBUS - select ACPI_X86_ICH + select ACPI_ICH9 --=20 MST From nobody Wed May 15 07:51:38 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=1672910119; cv=none; d=zohomail.com; s=zohoarc; b=lwhxLHYuf00659Bc+K8V9bPlAmjcmc/8XsatesvfKvmqOWMfs10Qrr19L6kFw7xW7osp8sWpcXrSQJ36rDnDb+nZzAIJhW5K0qeODlBvgzKkPEEl/Ei2PYSf5sB7aWrVHM+b50MsOWiPoa0KTjTLKvx9Gy6XcAdzLZSWfYSj1Eo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910119; 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=vmpETAMTNVqO7akbx0McCgslyb/NoOOWfwMRfsMMuSQ=; b=K2XyMw5Rr2BIw6y2h9Nv/TXOyQHNNNz3MehY1PGZvFwXo9+EBHZVIVe7B6nLmdL08B6N1ewRoxZsSt+UiRM60DM4K+U4nFCe39AKWuVxSvdwVYp8CB2ujwEIP4HnyfJTkkBoXC41xY32W84MuxAbdBGRyaS/8Ab0BVP3Q04nlYk= 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 1672910119952821.9722815411365; Thu, 5 Jan 2023 01:15:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKk-0001Pn-6b; Thu, 05 Jan 2023 04:14:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKh-0001PJ-0S for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:43 -0500 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 1pDMKf-0006mh-J4 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:42 -0500 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_128_GCM_SHA256) id us-mta-206-vduMYLmoMGKeVYE2mkCLCg-1; Thu, 05 Jan 2023 04:14:39 -0500 Received: by mail-wr1-f69.google.com with SMTP id o14-20020adfa10e000000b002631c56fe26so4629762wro.1 for ; Thu, 05 Jan 2023 01:14:39 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id iv14-20020a05600c548e00b003b47b80cec3sm1851768wmb.42.2023.01.05.01.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910081; 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=vmpETAMTNVqO7akbx0McCgslyb/NoOOWfwMRfsMMuSQ=; b=OWNGOtC/5QRphxZbxjsIH6qkt5iq6b8lGEpAhqgGw5fg9HuwUEM+g0hitKpQTCPAgm9nXs jrwgms/RbQR1VO1PuGB2hvMdBmQC9LYlkjCQ3htdIxffm4MvbFKezS4dNqBCHv4sEWNWZI krl2VTyUGIwJnKGNO5hC9ovPfaY8tlo= X-MC-Unique: vduMYLmoMGKeVYE2mkCLCg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=vmpETAMTNVqO7akbx0McCgslyb/NoOOWfwMRfsMMuSQ=; b=fe07+MYxo571k6TZmWIl79r+7/Yzph6Cc3ctaJCqwZU+yixn3GSvELgStDh0U0qoKW VaixVmfU/LMCx5LLK7ha3A7zahciMS4jukQw2Qvy9ddNLQ4YCTaWvuCrrn6DkscSoTny 0JuS7cHX9nn7wrZ4U2zwXL/dNBglI9jyuCB2JkEB6XCiqprzV83ze0ospFS5LrmDaEmm rKDnXKcSjbpjkGb1TMk+O3jeQTBD5yTwhKWpKl1FaufoEt9/OR9Fg6KPYz/QetgpxedV ko/k18i+AzFcNBOqSmYN1QkuII5DEFvb9D21/HKLjCXyXBQv9SXiodbXlh4YYk+reVO8 5oZQ== X-Gm-Message-State: AFqh2kod4N9p0erduSc83rc201/CfPDKfVQIKiPONCOv7l9YQPR97Ra9 F96VUO2o1faUn1qwIgTdAfKsn+IikOgIUtMn7XiSa8pnLFuiwKxxOreOFmJ0SD4tT6xYc5bThSK gPF9B1KmlPisLEVcSNXWHc4uHUCajYnjs6kPsaCuT6YVzVrJKomIBtdt1RQoi X-Received: by 2002:a05:600c:a51:b0:3cf:6f4d:c259 with SMTP id c17-20020a05600c0a5100b003cf6f4dc259mr34782021wmq.39.1672910078309; Thu, 05 Jan 2023 01:14:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXu45giiXLSQ/T98EPekjAZzH77sc+7w0KLs7+BuA0b7lnV0+Xi+RQHsN7Dur+rAApFyRCygfg== X-Received: by 2002:a05:600c:a51:b0:3cf:6f4d:c259 with SMTP id c17-20020a05600c0a5100b003cf6f4dc259mr34782002wmq.39.1672910078034; Thu, 05 Jan 2023 01:14:38 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:35 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Igor Mammedov , Ani Sinha Subject: [PULL 06/51] hw/acpi/Kconfig: Add missing dependencies to ACPI_ICH9 Message-ID: <20230105091310.263867-7-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910120961100001 From: Bernhard Beschow ich9_lpc_realize() uses apm_init() and ich9_smbus_realize() uses pm_smbus_init(), so both APM and ACPI_SMBUS are provided by the device models managed by ACPI_ICH9. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20221216130355.41667-3-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/Kconfig | 2 ++ hw/isa/Kconfig | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index 14694c75b4..704cbc6236 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -15,7 +15,9 @@ config ACPI_X86 =20 config ACPI_ICH9 bool + select ACPI_SMBUS select ACPI_X86 + select APM =20 config ACPI_CPU_HOTPLUG bool diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig index 01f330d941..0a6a04947c 100644 --- a/hw/isa/Kconfig +++ b/hw/isa/Kconfig @@ -77,5 +77,4 @@ config LPC_ICH9 # for ICH9. select I8257 select ISA_BUS - select ACPI_SMBUS select ACPI_ICH9 --=20 MST From nobody Wed May 15 07:51:38 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=1672911498; cv=none; d=zohomail.com; s=zohoarc; b=Fs/eNgZxYqWLBzTOWj97MqOQbs0WkrZmTx8S+AQjBmoKP3VGVzBRO+L6f0/xbY5CsGCWpbx9KUma2XC9koHr2paRTzvWPrXOpcixTZPbuP0iuWpLR4oxuAV2q0cI3jWfmUrANtq9Y5O4AbE08BjTgS1jw+LLI9J8pVQR7n0ukjI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911498; 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=rxn3sdtuOgGivwWWqmONun4vbY1V0V2nvJUpVR/FeeM=; b=Cp0g4jpqX3r93LPF+eZTEFJx0irDLxdm2c7QXyXhlcRz+/kSz2FMTDibp7+sbjTbFRJYGWbvhMh1DGpDHWgWz/i9Jj1Y1PRQDtL1SmwEke0tRnSHTvTce26wNkptudmtRO19/60c6dl5228rFd//qD/V3uGt1/fAYhMT+EOKAj0= 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 1672911498292832.1027862555195; Thu, 5 Jan 2023 01:38:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKq-0001TZ-W8; Thu, 05 Jan 2023 04:14:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKn-0001TA-Kr for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:49 -0500 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 1pDMKm-0006nJ-8A for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:49 -0500 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_128_GCM_SHA256) id us-mta-29-aEpVX3A4M8iswgXjObzffg-1; Thu, 05 Jan 2023 04:14:45 -0500 Received: by mail-wm1-f69.google.com with SMTP id r15-20020a05600c35cf00b003d9a14517b2so734192wmq.2 for ; Thu, 05 Jan 2023 01:14:45 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id u21-20020a7bc055000000b003d9aa76dc6asm2050196wmc.0.2023.01.05.01.14.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910087; 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=rxn3sdtuOgGivwWWqmONun4vbY1V0V2nvJUpVR/FeeM=; b=QZ6bGXpS7RNMFUelPO2ySIjsY6IbLO0HpX6UbQCbNjCVpVKwGAZsBAoR5/u/EqJ9iVicNG 37GQ6uz3xPRWJ5wt1YxvzNrh9zkR0EW5y6dOU036aoNwpa5lvFsWcSyUoPbVbcfhJrtjfZ QK8umBx2Hv1AULWFp6a2/bkfaq8LxFk= X-MC-Unique: aEpVX3A4M8iswgXjObzffg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=rxn3sdtuOgGivwWWqmONun4vbY1V0V2nvJUpVR/FeeM=; b=7Zcl7+Vr5eJIT6VAVcfpXpyp60r/RrhhRdcO6ufzdgD1ETuIUzZJRhUE8e5ug/RwpM ojuG+3LYHDII6aHxpdPsncSAU68mOpB6+S2Tzc3N4jcaLwHWAJNAqg4YXSCNAU3/deVC z0OrtczBDVPZ/UBLAzFd0RhZwUKVzchxs2YtpOFLaqh2QOyBYfymSP3H77TazQmrCskP oxLOtlBhbtYs7HZLcg3Ks/+2M3j2iYv89wzuy0aU+06x5fZuJ3ZOApEEKu6Rq46VCoVw sx2G2WiGq0bZqEHgM8Fj3M34HBcP/9C24l6XnvRcB10AIiHmO7EQRWGJRdpCKEXw72F2 Jp2w== X-Gm-Message-State: AFqh2kroV9UX0SkV8tlmGgN9KcERerRnnt3U/fGMs9Zq09nT8Xmh2XXK +0Ij0NRqWQs39YCBYiGHXE2khwH69gINXlDYJfqftsCuiwm1cNGjP9gD7oFOLpocRR0DUO5RsgH G9/3fdJMAVnqS0+eaz//BvKotPkVKfsbIuvihn/wEDtgQVYr7zlxKlEU16gc6 X-Received: by 2002:a05:600c:34d0:b0:3d6:b691:b80d with SMTP id d16-20020a05600c34d000b003d6b691b80dmr35378809wmq.21.1672910081734; Thu, 05 Jan 2023 01:14:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXuT7G0HHejAoa1d/VRwnsGw1sXv8znIT8Poed4rrW/14nZdB7igu8zVSFb7HgwQhgEmzpIcRQ== X-Received: by 2002:a05:600c:34d0:b0:3d6:b691:b80d with SMTP id d16-20020a05600c34d000b003d6b691b80dmr35378786wmq.21.1672910081411; Thu, 05 Jan 2023 01:14:41 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:38 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , BALATON Zoltan , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 07/51] hw/acpi/Kconfig: Do not needlessly build TYPE_PIIX4_PM in non-PC/Malta machines Message-ID: <20230105091310.263867-8-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911500612100007 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bernhard Beschow TYPE_PIIX4_PM is only used in machines where PIIX chipsets are used which is currently PC and Malta. There is no point building it for the other ACPI_X86 machines. Note that this also removes unneeded ACPI_PIIX4 from PEGASOS2. Signed-off-by: Bernhard Beschow Message-Id: <20221216130355.41667-4-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: BALATON Zoltan --- hw/acpi/Kconfig | 1 - hw/i386/Kconfig | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index 704cbc6236..b7006e18c8 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -9,7 +9,6 @@ config ACPI_X86 select ACPI_CPU_HOTPLUG select ACPI_MEMORY_HOTPLUG select ACPI_HMAT - select ACPI_PIIX4 select ACPI_PCIHP select ACPI_ERST =20 diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index d22ac4a4b9..3a92566701 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -69,6 +69,7 @@ config I440FX imply E1000_PCI imply VMPORT imply VMMOUSE + select ACPI_PIIX4 select PC_PCI select PC_ACPI select ACPI_SMBUS --=20 MST From nobody Wed May 15 07:51:38 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=1672911972; cv=none; d=zohomail.com; s=zohoarc; b=eICsCmOxpFxnXeIpSGB4QUlKr4eDEwGF1l2t75a2ctVTdI2tybzujdMXcVr7dAIYw57B/e5izngtyP/Orx3YpcbYBWuPUR33moXNJskhfl/EYHlIaU7We6/GehgDZ44UA/9Y09A52OeAsJK4ouLUi1I1rbPFiUnnqFvB+6vsvnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911972; 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=Pur9/YaviOiAK2NOYFsJiuuRu4TcG+CvN2Bn3YgLiWc=; b=HPVBjNuOyBEXXtTq3mIVzLkpuhHY9V7s726d2OCfuzNFHfqnsJdwHgjqKGMQsH6n3ATca5er70QuCgcQLpr6nJ08d0WvXYk2JAkSmVMDX5wXgJBomUR7RhfEgBhE1tUA0Q6QTghuGdMkBAmqWGYQsQdYLxcRSFHYl6OY4Zp0+QQ= 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 167291197252144.87464764018455; Thu, 5 Jan 2023 01:46:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKr-0001Tb-0r; Thu, 05 Jan 2023 04:14:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKo-0001TL-Nf for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:50 -0500 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 1pDMKn-0006nN-1K for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:50 -0500 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_128_GCM_SHA256) id us-mta-131-aSm_b1dsPvazAGnVbFg6zg-1; Thu, 05 Jan 2023 04:14:47 -0500 Received: by mail-wr1-f70.google.com with SMTP id o14-20020adfa10e000000b002631c56fe26so4629847wro.1 for ; Thu, 05 Jan 2023 01:14:47 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id i18-20020a5d5232000000b0028e55b44a99sm17914364wra.17.2023.01.05.01.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910088; 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=Pur9/YaviOiAK2NOYFsJiuuRu4TcG+CvN2Bn3YgLiWc=; b=NZx3NmetbsbEWfbmlqXuOW6jEzxj7PXqnHPTPW3RIKHTDivowXXAnnQ43E2cQU2GosIRXq 5Mq1bj5dm1JZjviOrmOMbp/1sAqxUUv9aiDLi3vqP3+echSOVL4SwLNk60Gu9fhsyFvKMG BhUQZA96Wk7VdaHsab/tn8gD7y0GNnw= X-MC-Unique: aSm_b1dsPvazAGnVbFg6zg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Pur9/YaviOiAK2NOYFsJiuuRu4TcG+CvN2Bn3YgLiWc=; b=nNd7MgGINHUKNA0Ithl3hOMDM6rjTMMY23lttcsareEi3Qw4jHRVJYrajd3uHtqAgj ThCpcs4AUhXg70BZf8TSU9J3xzB4X4SN9rPArIPSGWkIaR4QhGhedbAG8QXMWPNgenh5 LSWiQC20Uy3IC70vX7HRXHsfgcPVVp8+g+NEsuudc3hjB8tCaSkjHhnXxBmJkrdUSQwp Uv9yslv+iKaohgNCTNdhCD/260ISfRvTgfrL6d4h/EJ2MSUAqiKtgWe5BzEMdOtW7T4y Y1oAHjawaevsFBmYHRgPyHgl/yVryd4bvkbn7KhStxcErv7hXpgSOA8VCIvOqbEiwXKg Z34g== X-Gm-Message-State: AFqh2kqL+5CUunNpziWDs5FqdK9d3ZhyGA5zqr4I8oKbE5PvZ9Gc1euy OKKnL+akCGpBHejYu8udvjvgxIRLHEwJJpe34FOlPCdbXTiAf1SXVFDCM8TzZ2roLHWAzbFXqFC RYHw2jq97q1mnabp8kXH1bhX7jZz0h1fSC940J8IPDOH9JMFWLuisM3wmCQ64 X-Received: by 2002:a05:6000:181:b0:276:c52a:e3a0 with SMTP id p1-20020a056000018100b00276c52ae3a0mr23292804wrx.65.1672910085673; Thu, 05 Jan 2023 01:14:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXshoCntFj9TOQTrofKRal0Juq7qj3a7R1f9inNj8SguvXMGOJPSNDzIN9NGqbBIPgBFSOa61w== X-Received: by 2002:a05:6000:181:b0:276:c52a:e3a0 with SMTP id p1-20020a056000018100b00276c52ae3a0mr23292788wrx.65.1672910085438; Thu, 05 Jan 2023 01:14:45 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:41 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Igor Mammedov , Ani Sinha Subject: [PULL 08/51] hw/acpi/Kconfig: Add missing dependencies to ACPI_PIIX4 Message-ID: <20230105091310.263867-9-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911973613100001 From: Bernhard Beschow piix4_pm_realize() uses apm_init() and pm_smbus_init(), so both APM and ACPI_SMBUS are provided by the device model managed by ACPI_PIIX4. The ACPIREGS are also provided by ACPI_PIIX4, so needs to select ACPI. Signed-off-by: Bernhard Beschow Message-Id: <20221216130355.41667-5-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index b7006e18c8..1f7803fdab 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -31,7 +31,9 @@ config ACPI_NVDIMM =20 config ACPI_PIIX4 bool - depends on ACPI + select ACPI + select ACPI_SMBUS + select APM =20 config ACPI_PCIHP bool --=20 MST From nobody Wed May 15 07:51:38 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=1672910335; cv=none; d=zohomail.com; s=zohoarc; b=Nau++EYpAyHk42YgwhiXFeipLYpTystv/o1vGcwGrsjQfTUln4R+lAkI8KW2vzsKeE5m1Y/D/ipIMB913c+2IBhYduz/CDLKwqqpwHGwLqxwkuWl783Hkg/LugpZuzpoQlG2WaEw4uQM2MnzAPRj088xOyr+6I6+zht6NiTrpuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910335; 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=m3TFYG5jtPJxj2AAF57n0Xvz2wJnns/YSUt6EOuT54c=; b=PJR68ZZSRJZqay4U0qdcntxKN/URnaYKI1u4PK37YvdzAbsyAMuM2dVGtNztVKhzXAcd7oHJL+H4oohXZvfM7uJ81oVne6ASJlQF3VdNlXsiNSGY5bLpQix4iIAepcqE8vAtHD2DGxJJY1nUQtgxDXg41HwTKZu48aHcoMi7+bk= 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 1672910335414769.7486823258175; Thu, 5 Jan 2023 01:18:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKv-0001V3-CU; Thu, 05 Jan 2023 04:14:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKr-0001Tx-7R for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:53 -0500 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 1pDMKp-0006ox-S2 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:52 -0500 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_128_GCM_SHA256) id us-mta-70-bEYMC0wMP1qdfPs_hFgqmQ-1; Thu, 05 Jan 2023 04:14:50 -0500 Received: by mail-wr1-f72.google.com with SMTP id d28-20020adfa35c000000b00293b14c3868so2067766wrb.10 for ; Thu, 05 Jan 2023 01:14:50 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id l15-20020a5d410f000000b002683695bf97sm36186611wrp.58.2023.01.05.01.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910091; 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=m3TFYG5jtPJxj2AAF57n0Xvz2wJnns/YSUt6EOuT54c=; b=ImUCspHhOGfbO6FnQYGRqil2wEgccLNamZ170tZsgfxegLXHCUAs08bylSGdtwEy06wFUu 12hdtGJ2suYFoqbpWWGLXQEatHOu+jbPfIwgfG+9X4l5OwEFlEpiE2kR1Q2i3RnFnLWOaQ Uuxwed97K5YVApEfUYcq8C9kExb4N60= X-MC-Unique: bEYMC0wMP1qdfPs_hFgqmQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=m3TFYG5jtPJxj2AAF57n0Xvz2wJnns/YSUt6EOuT54c=; b=tfxU5eB2berrWNhGoi7YmwCF1CBPyJLeeFWL2QDs+mz5MwflsC2dSgEIL0fmW/8tQg 9sBTF8075zlPPGMabxv1pviWvsyn8ww8e85Q379hkYogYKYPv9WrktgyaxWbr72LoovH jrwRR+HLYFLApEBGbwSLIqJieKQp9KikZjk+YQ6G/74YWJJqczlNluqHN2r/8nQaszlW YMljhTCH+M+JNkvnFyRqA6jmy31Rsd1ne8xysLPLt0RMmhe7tiuA6gpTwtj0seie7Khj N/fUa/ZKm6+m2jt3LLm1c+wxZnUAIGtmnRbMlzv567AlrdnldQ0m5o6jIwCdR+1PJeUk CWaQ== X-Gm-Message-State: AFqh2kp+L4iHI14A1BHv9/bzGTEqpFrjvNnjqo/AGbBu0bLy3xAk8MZi 9tgtTQxsRKSR2u3l7XTRNK0Vnx2PiJLpRR4EcNEsjnp73REbBiSzUkZYk15h+suyKt/wuP6fY64 sMQ7etApPdsRd1ExJtmad3AWHg8u3QXyw/K1osxcvpWPeci8qcQftnL+MxgKq X-Received: by 2002:adf:eecf:0:b0:242:14f5:7a96 with SMTP id a15-20020adfeecf000000b0024214f57a96mr32587140wrp.47.1672910088832; Thu, 05 Jan 2023 01:14:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXvefxch3bc5FFDMITaRo4gIulnMM58JUW2SKduJhvmVgHTt8yIxsU30cCTs5NCIXJgA6lGBRQ== X-Received: by 2002:adf:eecf:0:b0:242:14f5:7a96 with SMTP id a15-20020adfeecf000000b0024214f57a96mr32587126wrp.47.1672910088573; Thu, 05 Jan 2023 01:14:48 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:45 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , BALATON Zoltan , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza Subject: [PULL 09/51] hw/isa/Kconfig: Add missing dependency to VT82C686 Message-ID: <20230105091310.263867-10-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910336076100003 From: Bernhard Beschow The ACPIREGS are provided by TYPE_VIA_PM, so needs to select ACPI. Signed-off-by: Bernhard Beschow Message-Id: <20221216130355.41667-6-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/isa/Kconfig b/hw/isa/Kconfig index 0a6a04947c..0156a66889 100644 --- a/hw/isa/Kconfig +++ b/hw/isa/Kconfig @@ -52,6 +52,7 @@ config PIIX4 config VT82C686 bool select ISA_SUPERIO + select ACPI select ACPI_SMBUS select SERIAL_ISA select FDC_ISA --=20 MST From nobody Wed May 15 07:51:38 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=1672910115; cv=none; d=zohomail.com; s=zohoarc; b=EoT2PiZLNGF9QYW0VD8+H2W02qYlN+1kHA2kNsCho5gOhscWIJJLevUhxrVeclQWgm/KSCGOnHVHngFXfTn2cQBF4YMFOciGTY3YROqp6laoDgwLsOYZib/XpvQYhOOlNqJRAgqzuOE0BgCmSuYZP4d8+UIGZ/LPZSAC7qbODwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910115; 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=s35k0RneRD6JhyeM2uQz3SiG5naDndGylOIMBCANsXw=; b=GKoSx6Z3WueMs2XZ15BdLfwj47IXS/8tNZ/PXzOqwvDiui2m63nQQma4EGegLt+7yN5Sk7J8zEiQPEtq/mYZMtNpJgjhDynpJO0VnA4fuS1tsJz93O7zUFr/bvOGIw/awnMfMy728Ygb97ollgiOkXa9LIyyVqgmPG4gJUPzI00= 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 167291011554148.44367561199783; Thu, 5 Jan 2023 01:15:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKy-0001W7-Pw; Thu, 05 Jan 2023 04:15:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKw-0001VO-Ia for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:58 -0500 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 1pDMKv-0006pH-5F for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:14:58 -0500 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_128_GCM_SHA256) id us-mta-76-OEo0vmCBN0uURlHvrNXGRA-1; Thu, 05 Jan 2023 04:14:55 -0500 Received: by mail-wr1-f72.google.com with SMTP id o14-20020adfa10e000000b002631c56fe26so4629929wro.1 for ; Thu, 05 Jan 2023 01:14:55 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id f2-20020adfdb42000000b00241d544c9b1sm22750863wrj.90.2023.01.05.01.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910096; 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=s35k0RneRD6JhyeM2uQz3SiG5naDndGylOIMBCANsXw=; b=HmfMrzjDRiC3x92FeMXlkFWP7Ig6Ah7qiI5n2AD6dwwDopOPnZ6ocLrgQI8sggyh/sWXVW h3tRj4JoxGpd4XRyv/NRef4vyd4ylc5fezRzefZ+KRXU9vO0NW2ZahC6wPkh9R1wEgFz7W /ymha8WuBtz6WqX43ybZXT8Hl5bllbI= X-MC-Unique: OEo0vmCBN0uURlHvrNXGRA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=s35k0RneRD6JhyeM2uQz3SiG5naDndGylOIMBCANsXw=; b=gcZ2Pfs4g6ewPqo6t2MAZInC0oMHXo0Yu283VeqimEotEoHNa5aZFNtPtFex3W8AF9 YVElfUgdVtCWXB7dQFHwuPlP92prMp8alfAufmUbNaUvkyYvXX7hlYlqEvZEq4noEP1u hjzZ9HNNUVt6mIJV34zyWvEqX6gcxkUXG1U2+nRzX7EM+QtjwyjoPvlonXUeRqQkY2OT Xh7RCUta6nCEnVrdlA6Yus4LLX6o8lnaB/xpxbP21mWt9dPO66CvVP5aBQxC2Q/DKHwd CY+G7vtpBSkZYJPq5MFWTG1n+33COSa1bU+v7d4kLyT9Aa4/TGr5ku/3Ey6tRPnAUfTI R56A== X-Gm-Message-State: AFqh2kqcd3oJRkFVxm+e50xMwqqDebj6jDPVva7Xav5bQDQ/JOZh89yi 2mAbKTqpjnc1iWx6E4HdqbEDm75DUKq7EwoxOMLQHi+/FgMX2SqKN3YV5B22gTRoUw8gwJ75oIe YOAZS9zhRms2rNHs+7wcet69wvQxHFk2tY8nXRSH6TS7UKVgkFkS8YL5ZTBA3 X-Received: by 2002:a5d:6b04:0:b0:24f:11cc:86b7 with SMTP id v4-20020a5d6b04000000b0024f11cc86b7mr28275479wrw.41.1672910091929; Thu, 05 Jan 2023 01:14:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXsVqVxYPJXj3Z5wV1XMFz55PBSA9iKtHH8JFay/+cAHm7IsxD3rMsr5QeInaMYCFeJez/TZPw== X-Received: by 2002:a5d:6b04:0:b0:24f:11cc:86b7 with SMTP id v4-20020a5d6b04000000b0024f11cc86b7mr28275460wrw.41.1672910091601; Thu, 05 Jan 2023 01:14:51 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:48 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Jiaxun Yang Subject: [PULL 10/51] i386, mips: Resolve redundant ACPI and APM dependencies Message-ID: <20230105091310.263867-11-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910116952100003 From: Bernhard Beschow Now that all ACPI controllers select the ACPI and APM dependencies themselves, these explicit dependencies became redundant. Remove them. Signed-off-by: Bernhard Beschow Message-Id: <20221216130355.41667-7-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- configs/devices/mips-softmmu/common.mak | 3 --- hw/i386/Kconfig | 2 -- 2 files changed, 5 deletions(-) diff --git a/configs/devices/mips-softmmu/common.mak b/configs/devices/mips= -softmmu/common.mak index 416161f833..88aff94625 100644 --- a/configs/devices/mips-softmmu/common.mak +++ b/configs/devices/mips-softmmu/common.mak @@ -17,9 +17,7 @@ CONFIG_I8254=3Dy CONFIG_PCSPK=3Dy CONFIG_PCKBD=3Dy CONFIG_FDC=3Dy -CONFIG_ACPI=3Dy CONFIG_ACPI_PIIX4=3Dy -CONFIG_APM=3Dy CONFIG_I8257=3Dy CONFIG_PIIX4=3Dy CONFIG_IDE_ISA=3Dy @@ -32,6 +30,5 @@ CONFIG_MIPS_ITU=3Dy CONFIG_MALTA=3Dy CONFIG_PCNET_PCI=3Dy CONFIG_MIPSSIM=3Dy -CONFIG_ACPI_SMBUS=3Dy CONFIG_SMBUS_EEPROM=3Dy CONFIG_TEST_DEVICES=3Dy diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 3a92566701..c4fb5b49bd 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -51,7 +51,6 @@ config PC_PCI bool select APIC select IOAPIC - select APM select PC =20 config PC_ACPI @@ -72,7 +71,6 @@ config I440FX select ACPI_PIIX4 select PC_PCI select PC_ACPI - select ACPI_SMBUS select PCI_I440FX select PIIX3 select IDE_PIIX --=20 MST From nobody Wed May 15 07:51:38 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=1672911371; cv=none; d=zohomail.com; s=zohoarc; b=IzX7MM5xahvt/O+sCR1PZIcmwZXfsl0Fmv7w6KKZ5BBwlYMfVwwwNc2HdXwceOnobUaNPjUeg2IzyWNDQFvZ+AEqK++Yhrkf5pGmeb/hm4Nhj+cSZH6Cg21xHE9dnZXKRmIyQmeEBIsxJfK3j4g6UYW4qAoTFp81KI6YxGsDMK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911371; 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=K0/Q4t5SUp0QHFh8qqqSqfRchZLYMl7Pm+UebNin4VI=; b=mDkT9Rqx0AuX2Djl66gwxYWSnaIeu7C7dDuXZWg1QLtlVqQwmJidYgS9EQP4/7/jn9ZCsreCcsV84xzsOWV9nQU5Kpsvg3zPR3pn2+FNPWdhr5qjO4in0pCrIgL+NV0Ofp91IVsApm5RP28XUBpnRrn2Rfru6X/uqtjkBBz2zNo= 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 1672911370870318.90340147865106; Thu, 5 Jan 2023 01:36:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMKz-0001Wa-Ai; Thu, 05 Jan 2023 04:15:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMKy-0001Vp-9Y for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:00 -0500 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 1pDMKw-0006pe-VE for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:00 -0500 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_128_GCM_SHA256) id us-mta-505-RnvW-fpyOqSNnnPjqm66Qw-1; Thu, 05 Jan 2023 04:14:57 -0500 Received: by mail-wm1-f71.google.com with SMTP id c23-20020a7bc857000000b003d97c8d4935so15189502wml.8 for ; Thu, 05 Jan 2023 01:14:57 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id i17-20020a05600c355100b003d99fad7511sm1906391wmq.22.2023.01.05.01.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910098; 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=K0/Q4t5SUp0QHFh8qqqSqfRchZLYMl7Pm+UebNin4VI=; b=L02M3m2l0huiMGaKuGPkP0m9blfeuOFw47RQOssFcWPk7pe1khkDNOhPFi1/iOhRAgGik5 tRbwq1VrkyMwAqhBrQaBCIByYOXUnorYd8tVAwLEsQRgaSS3k77aNIPlCcULH+a88h2uJk HXsbUJXEIYAk9xhqP2fYbAzag1RjtSQ= X-MC-Unique: RnvW-fpyOqSNnnPjqm66Qw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=K0/Q4t5SUp0QHFh8qqqSqfRchZLYMl7Pm+UebNin4VI=; b=PxmE2yo/viMgWXCaB4UFAcIu4EY4TynsXgV+9rtbPBEnI3WNMH8iWBAT+eb5/i7Is6 tDr440hNWFD8dffuhBq2w9UEbcfmWxJNfiUCneJXcIKhA45L+qRcStjWepBvGDQPTEji MFj0eu9dcKa7LXq2IMF4rToxGPUPE9zK6cIUFoWGQznhMVkzMe/vBZwYLjFEX5/T2Crg irInnOjoizfi3AqmyzOad7qYYpPy5533CVu3N+OuURNKIl9McLtSzqf4RJAyrm6zcfVJ +gJ+u0DvN80kRP20mZUJbzja2adGTQryd4cQHPt1D6OPYt5p0FsBj9pBDMBv0YxpB1cV 7BJg== X-Gm-Message-State: AFqh2kqp1xujIj9JvscmmcCZSDTnL+b5pyjDuCEy24IXUMsWqtTZwNgO 8EIt5nyeze9/BH6JuADed9ZOrkf+j5vTYTPYeGjKYWnu7d8fHavcNcho5neCEZ+vxDRoO6roIaH IR25EYeEKol29V6QovNqJp1Zvvsql5g9X3ySccGmiyota9MRRWkL6+zJ69wKY X-Received: by 2002:a05:600c:35ca:b0:3d1:f2de:195a with SMTP id r10-20020a05600c35ca00b003d1f2de195amr39012044wmq.32.1672910095676; Thu, 05 Jan 2023 01:14:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXul1Hs2LUd3yPHMp7cIleHkBXXTOT1tbgmV3PDCBXuwhUNCK/vLOaFCYrjfMO2FgDGNsrPfew== X-Received: by 2002:a05:600c:35ca:b0:3d1:f2de:195a with SMTP id r10-20020a05600c35ca00b003d1f2de195amr39012027wmq.32.1672910095412; Thu, 05 Jan 2023 01:14:55 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:52 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , BALATON Zoltan , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza , Bin Meng Subject: [PULL 11/51] hw/ppc/Kconfig: Remove unused dependencies from PEGASOS2 Message-ID: <20230105091310.263867-12-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911371910100001 From: Bernhard Beschow Removes the following dependencies from ppc-softmmu: - CONFIG_ACPI_CPU_HOTPLUG - CONFIG_ACPI_CXL - CONFIG_ACPI_HMAT - CONFIG_ACPI_MEMORY_HOTPLUG - CONFIG_ACPI_NVDIMM - CONFIG_ACPI_PCIHP - CONFIG_ACPI_X86 - CONFIG_MEM_DEVICE Signed-off-by: Bernhard Beschow Message-Id: <20221216130355.41667-8-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 72a311edcb..c898021b5f 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -76,8 +76,6 @@ config PEGASOS2 select VT82C686 select SMBUS_EEPROM select VOF -# This should come with VT82C686 - select ACPI_X86 =20 config PREP bool --=20 MST From nobody Wed May 15 07:51:38 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=1672910175; cv=none; d=zohomail.com; s=zohoarc; b=GTlIG5hiz01Np4hYf0mc0ITWg8WrTdReKCDMvTc/1457hDpGbuuPtbn50nUJSzSH+CgYpGF00X28KyY8iWmqMUEcN9FWubGiKxpRZ7aY8hEDk0h1ww4ODBZob7gG/KmmIcLMPBFX8qTdly3ACLKgIypR1hYwXMzvtnqFu/VrAFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910175; 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=hhzPSfS8UKaxweeDnvuPzNZ/m8zZG2cgk4Ut2Omo5ps=; b=C9JhMeFXeKDduZntGEeiHpFZWOJua/jnnLl7r+1Dm6N7Hbe+PikJFq56z6DcJu3N5tODmPQqBqI4pUBHVmmSwaEV17Spr1uNtMx1Tg9PuPDCxFTumxz3PAEQWRRhL7oZX8tzh7DnSSybA7opF6PQDMLAZbFBJPLqmqDEhbnGR3g= 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 16729101753492.6762181756510017; Thu, 5 Jan 2023 01:16:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDML3-0001gG-Vh; Thu, 05 Jan 2023 04:15:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDML2-0001bv-Kz for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:04 -0500 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 1pDML0-0006qE-MA for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:03 -0500 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_128_GCM_SHA256) id us-mta-125-0JhCCEuCPB-7C2CWx3OM6A-1; Thu, 05 Jan 2023 04:15:01 -0500 Received: by mail-wm1-f71.google.com with SMTP id fm17-20020a05600c0c1100b003d96f0a7f2eso725570wmb.6 for ; Thu, 05 Jan 2023 01:15:00 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id x26-20020a1c7c1a000000b003d9d23ab449sm1638984wmc.29.2023.01.05.01.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910102; 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=hhzPSfS8UKaxweeDnvuPzNZ/m8zZG2cgk4Ut2Omo5ps=; b=fKh2/lvqfKQmOg6jItmq3Ba8dGZK5yJhW7np9GWnPeVlSGrMWnQa0qLOMWhdpBTeai6aaq mm/k+K+IkkkktBi9a8jQYxLT8o1xKuFdfhhbcEb6JdfqxwPRdg2t7GFNFFwKW5vh8WLy8W /gO0EsxGmxtwnPhhGzmSglUl/2MGEcg= X-MC-Unique: 0JhCCEuCPB-7C2CWx3OM6A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=hhzPSfS8UKaxweeDnvuPzNZ/m8zZG2cgk4Ut2Omo5ps=; b=zY6Mc3eFJj8Es1nSVv4w1KQ8gtzvjxN1OKFaEwASUIav+E2FZGpjkh2YClfiVx12C4 DReHzkhR7btwc6CG2WusLY3lJ9yG+LAUyipqPSghF7pzugrsSRV9E7XyiKPSgcREtI3Q CQR7iHGf7S3BJK74jJ79binAfHhRtodyfS12OHUcxLQRshGWhSnbtlC+2Rv55rIXzM3J kYC0K+Jo5MDoWcoLDP6J1nBBKZ/Mxda13HO2VKwHLEwgIET3iEVCdY4Sg3eqyPLxSge4 zlhTPxiOdn6ycxN+rssY2O+zGlcy5ryYkWNQhVCuQiPb34ZXaQRw8HDwBOllFoP8MG9P JcdQ== X-Gm-Message-State: AFqh2krEzuaL1qi6LCeKYBc/HLO35ZUkNc3Vgz8Oi3jVhzl/lQZ7lUKs Bz2l8op8Vobl8OkG5AesST3AXVotILTe++ZECjmcv9N2MWeCyAW7vOyVt1EhiIqD1mRaXAbNTtu uVeOcdStu+A5SPyeh6dSaV4gEXmQbuWf9A0e9aGwJRsoOuxiSTu+IPKCwfNor X-Received: by 2002:a05:600c:22cc:b0:3d1:bd81:b1b1 with SMTP id 12-20020a05600c22cc00b003d1bd81b1b1mr34719155wmg.18.1672910098863; Thu, 05 Jan 2023 01:14:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXuBcQUInVC2kqqvsZQd03U5O48+3rVNf4cij4IFCtWz+o6eGvKHniwmiN7PtSop00Z5HJ6pYg== X-Received: by 2002:a05:600c:22cc:b0:3d1:bd81:b1b1 with SMTP id 12-20020a05600c22cc00b003d1bd81b1b1mr34719142wmg.18.1672910098597; Thu, 05 Jan 2023 01:14:58 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:55 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Hyman =?utf-8?B?SHVhbmco6buE5YuHKQ==?= , Guoyi Tu , Jason Wang Subject: [PULL 12/51] vhost-user: Refactor vhost acked features saving Message-ID: <20230105091310.263867-13-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910177256100003 From: Hyman Huang(=E9=BB=84=E5=8B=87) Abstract vhost acked features saving into vhost_user_save_acked_features, export it as util function. Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) Signed-off-by: Guoyi Tu Message-Id: <50dc9b09b0635e3052551efcc1046c2a85332fcb.1671627406.git.huangy= 81@chinatelecom.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/net/vhost-user.h | 1 + net/vhost-user.c | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/net/vhost-user.h b/include/net/vhost-user.h index 5bcd8a6285..35bf619709 100644 --- a/include/net/vhost-user.h +++ b/include/net/vhost-user.h @@ -14,5 +14,6 @@ struct vhost_net; struct vhost_net *vhost_user_get_vhost_net(NetClientState *nc); uint64_t vhost_user_get_acked_features(NetClientState *nc); +void vhost_user_save_acked_features(NetClientState *nc); =20 #endif /* VHOST_USER_H */ diff --git a/net/vhost-user.c b/net/vhost-user.c index 3a6b90da86..f5cb095d5c 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -45,10 +45,23 @@ uint64_t vhost_user_get_acked_features(NetClientState *= nc) return s->acked_features; } =20 -static void vhost_user_stop(int queues, NetClientState *ncs[]) +void vhost_user_save_acked_features(NetClientState *nc) { NetVhostUserState *s; + + s =3D DO_UPCAST(NetVhostUserState, nc, nc); + if (s->vhost_net) { + uint64_t features =3D vhost_net_get_acked_features(s->vhost_net); + if (features) { + s->acked_features =3D features; + } + } +} + +static void vhost_user_stop(int queues, NetClientState *ncs[]) +{ int i; + NetVhostUserState *s; =20 for (i =3D 0; i < queues; i++) { assert(ncs[i]->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_USER); @@ -56,11 +69,7 @@ static void vhost_user_stop(int queues, NetClientState *= ncs[]) s =3D DO_UPCAST(NetVhostUserState, nc, ncs[i]); =20 if (s->vhost_net) { - /* save acked features */ - uint64_t features =3D vhost_net_get_acked_features(s->vhost_ne= t); - if (features) { - s->acked_features =3D features; - } + vhost_user_save_acked_features(ncs[i]); vhost_net_cleanup(s->vhost_net); } } --=20 MST From nobody Wed May 15 07:51:38 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=1672911963; cv=none; d=zohomail.com; s=zohoarc; b=DVMFNkKf9R2KweZEHEt36PnghjLIs8Fys6OR/nFsEFHDo6/LIpFqjrpuxB21A/3VwXZHamTk2xVFv4LejNKWyF2PtUQ1Yg/hgHZRdFJ1SiDeOk5XMtCS19bAXsG2F4iBsiGTt4LtGjRa3yIJ1rJPLRegBPxWrJIO9+dUUCzLwT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911963; 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=V/vfyslWt4MlbRW5heOudUWcHHqot7dn827hRuGuvKI=; b=RUHA3jPpjZiThaHpsFAFdsYyA0K9vvAxzhByEu7Y80AFNSE2lkZsoKKJnYUgzBieg18HxsqDfdKXct4jTLoVoHYj/+tXhjqzrmC1GmwDh6HsJw8aTflt2M/uwCOQd4TuUEqra7TaXeC1eby1piqDtum2sio3AO2xvvZJARUaWgE= 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 1672911963351857.6616951705787; Thu, 5 Jan 2023 01:46:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDML7-0001mH-V4; Thu, 05 Jan 2023 04:15:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDML6-0001iK-37 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:08 -0500 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 1pDML4-00070y-DB for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:07 -0500 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_128_GCM_SHA256) id us-mta-473-dKrBA6tOPceXr9J3ypN1TA-1; Thu, 05 Jan 2023 04:15:04 -0500 Received: by mail-wr1-f71.google.com with SMTP id e3-20020adfa443000000b00296b280432dso1939100wra.19 for ; Thu, 05 Jan 2023 01:15:04 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id m10-20020a5d624a000000b002706244dc0dsm35652186wrv.31.2023.01.05.01.15.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V/vfyslWt4MlbRW5heOudUWcHHqot7dn827hRuGuvKI=; b=LktetUZdqmoTlYPVtuTBi6bXFIUwQqhltuqbvDfyN2v3DjiI+SccJQuNhf9D/cmTmp6lE9 fUPbpSJSKDsmYprMKyqKcby1kAft+BQq6NiGpR11O+QBvec2ihGczDtcSSTD2Zt4f9kbC/ vR8ZpkVgAdzCNkATl5duEV0NsIQlwoE= X-MC-Unique: dKrBA6tOPceXr9J3ypN1TA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=V/vfyslWt4MlbRW5heOudUWcHHqot7dn827hRuGuvKI=; b=mMcrQJh1a9CJ65ho1zT1PNtodFcg45W4X+VN1wlhp60HhC95ehO9jdFZqn9uUWJq4b +8JCgrGO3V1qryaYG2tv1f9pP/IenY+BIzM4MeFnM2YQ7wTYzJT8mnjJS2VuMqk0q5Ok qVh1fU8uSpzLUnYDev2sdBXcKxeIYLYAu2P8dAJBa8TmcgL5E6s5oge5bSPKyeYqa8iD aWwHH4dKbjoXhjDeC8yiFXvOK8il+rniAJ3kUBLyHQjo8DezW+mWevXKNsfcp6pm4yb2 UhK88QmCevr2xQT4kq7CEJXZ4o43gmumL3j+OSB+omsfZx0oc90nWjBCVoX5SljGlUxq TsXQ== X-Gm-Message-State: AFqh2kpxe5smyfTuJ1BK4jcoUn82OEqh7JQ1NXcC5Kr3jPPSd8WtIDrd WhNul0mC5mUxxWi164426QnxvUTr7kxxRgfG01eelgl2iBEbtb8HcosQAl1crDDaCaxshiZ6zUw 8o2KFnR0AIIfSEoQu+sgfhzpGzG3dlt/uu0C37lywYdsXjHZEAcprf6lJ7LV6 X-Received: by 2002:a05:600c:3589:b0:3d0:6c60:b4d1 with SMTP id p9-20020a05600c358900b003d06c60b4d1mr43499790wmq.6.1672910102480; Thu, 05 Jan 2023 01:15:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXsZ09rSyLQYn/uTencYd5z/k0QjOs+175IcfbgMcG+jESMuxRdpmYntV80xHL1vGf4TCCzpmg== X-Received: by 2002:a05:600c:3589:b0:3d0:6c60:b4d1 with SMTP id p9-20020a05600c358900b003d06c60b4d1mr43499770wmq.6.1672910102181; Thu, 05 Jan 2023 01:15:02 -0800 (PST) Date: Thu, 5 Jan 2023 04:14:58 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Hyman =?utf-8?B?SHVhbmco6buE5YuHKQ==?= , Guoyi Tu , Jason Wang Subject: [PULL 13/51] vhost-user: Refactor the chr_closed_bh Message-ID: <20230105091310.263867-14-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911965381100001 From: Hyman Huang(=E9=BB=84=E5=8B=87) Use vhost_user_save_acked_features to implemente acked features saving. Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) Signed-off-by: Guoyi Tu Message-Id: <6699ee88687b62fb8152fe021e576cd2f468d7ca.1671627406.git.huangy= 81@chinatelecom.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-user.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index f5cb095d5c..5993e4afca 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -260,11 +260,7 @@ static void chr_closed_bh(void *opaque) s =3D DO_UPCAST(NetVhostUserState, nc, ncs[0]); =20 for (i =3D queues -1; i >=3D 0; i--) { - s =3D DO_UPCAST(NetVhostUserState, nc, ncs[i]); - - if (s->vhost_net) { - s->acked_features =3D vhost_net_get_acked_features(s->vhost_ne= t); - } + vhost_user_save_acked_features(ncs[i]); } =20 qmp_set_link(name, false, &err); --=20 MST From nobody Wed May 15 07:51:38 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=1672912144; cv=none; d=zohomail.com; s=zohoarc; b=FofggUn/PDPmev91Gzf6wpGXv5S9+4UcY7sD3enUaJxwJckWoQ8kjqyW0+PJuvfcMDUKhTLfbsssLVyY9XkIDO3gOWTimue36Vv8m4Z15loOE15Hic79Vetw8q0q2pUXt8Qz4SUOrgMy5mObrtaOV2INelri6k754x5BE1lQfEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672912144; 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=eN1yqTd4dHMXJ+HTH4aU//xomIGR26HS+IfKzCf9oxk=; b=L1LlQH6fBFjzpozEuY+ELNHExyYPXtkxgW6iJRpuwsdmZkWzIWDuP61mVTQ7AbgV/2YYDkL2cimCX5+hJKL3t0vqKE7XrQ7eX8ggKycTuY3ldm1kedgcMZxZeLYdA0T6uMqFAcCaF8VKBT2U45WOey2VISM8QcMBs1TsX9mpJ0Q= 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 16729121442231008.470998150052; Thu, 5 Jan 2023 01:49:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLA-0001mh-3L; Thu, 05 Jan 2023 04:15:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDML8-0001mX-MI for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:10 -0500 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 1pDML7-00071N-0M for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:10 -0500 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_128_GCM_SHA256) id us-mta-55-2eBfqXVWMka35tE-RvyABA-1; Thu, 05 Jan 2023 04:15:07 -0500 Received: by mail-wr1-f71.google.com with SMTP id u15-20020adfa18f000000b002b129dc55bfso174888wru.11 for ; Thu, 05 Jan 2023 01:15:06 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id n14-20020a05600c3b8e00b003b49bd61b19sm1845253wms.15.2023.01.05.01.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910108; 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=eN1yqTd4dHMXJ+HTH4aU//xomIGR26HS+IfKzCf9oxk=; b=MsiAFZ/A2K1MbtE33o2+6IGmNKLL8LSKYMKubzEraue/MfBWHqsb54pQ+1OYD/YL/CaShq VtZa/yvvYUorHD+Pq32L13XP34xBrs8D3FUuSC4I5eb3FbCbwaPjHBjzJFkhUzPcEKVqjK OYubP+HVWV1lBVrG5XtdhbKtC2JVb24= X-MC-Unique: 2eBfqXVWMka35tE-RvyABA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=eN1yqTd4dHMXJ+HTH4aU//xomIGR26HS+IfKzCf9oxk=; b=cOlwYyBFs6yTa/dO3/MFIj9RkA/dV6HR4JwjcuyHKtv5qef/gvhFcs8ubKXkFIieUm WINKcMELUgqKXgZ9ZlOA/mk2BwhHjYuFOj6S/yRPH9AmhmLBkGUYZPUpdHS0BTgUT98o kYik5YCxe88R5xKcF1eG775vBL0b+wr5o+iWX1hIbll2udDq1TKBDjYjnt4xaif8IaW9 HjxyjY4Lv4EooykEDz+QYiBsxW0laBZ9n1twr4ZWZK+3539HN7N1W1+K816Ewl1IA5Rb RTt2RB/n1an+fRgopnVmRooAq/cBqybRzWn/QsUCYJn8y1IybWK6quKXQHc+/HOIShcV Ok/Q== X-Gm-Message-State: AFqh2kqTLTGyA/L35CiAEoQI/GIBnd8NpFWXkPiybpoNWl2y9etD4Hyj 72OpbzriqcjOWXnpqUFlq+ThPKiPqhkCoFtuS0hXNeiE72Ypz0JvjulH3oL2v60QLn1vZ2pQQqi FBrkrk8bv7zrH0XM3zQubqYc1AyY13Vxg+0sLQ9qPQKCm8ankJrN3bTGZe17E X-Received: by 2002:a05:600c:3acc:b0:3d9:a145:91a with SMTP id d12-20020a05600c3acc00b003d9a145091amr14730690wms.28.1672910105461; Thu, 05 Jan 2023 01:15:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXuCVvbZ2xPqVMxoKk6pvxhLXIysQdOFXtDZBcmxs+C84dGVhQWlOhGboVBvcLd7Iq8Q5oB7sQ== X-Received: by 2002:a05:600c:3acc:b0:3d9:a145:91a with SMTP id d12-20020a05600c3acc00b003d9a145091amr14730667wms.28.1672910105130; Thu, 05 Jan 2023 01:15:05 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:02 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Hyman =?utf-8?B?SHVhbmco6buE5YuHKQ==?= , Guoyi Tu , Liuxiangdong , Jason Wang Subject: [PULL 14/51] vhost-user: Fix the virtio features negotiation flaw Message-ID: <20230105091310.263867-15-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672912144756100002 From: Hyman Huang(=E9=BB=84=E5=8B=87) This patch aims to fix unexpected negotiation features for vhost-user netdev interface. When openvswitch reconnect Qemu after an unexpected disconnection and Qemu therefore start the vhost_dev, acked_features field in vhost_dev is initialized with value fetched from acked_features field in NetVhostUserState, which should be up-to-date at that moment but Qemu could not make it actually during the time window of virtio features negotiation. So we save the acked_features right after being configured by guest virtio driver so it can be used to restore acked_features field in vhost_dev correctly. Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) Signed-off-by: Guoyi Tu Signed-off-by: Liuxiangdong Message-Id: Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/net/vhost_net.h | 2 ++ hw/net/vhost_net-stub.c | 5 +++++ hw/net/vhost_net.c | 9 +++++++++ hw/net/virtio-net.c | 6 ++++++ 4 files changed, 22 insertions(+) diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h index 40b9a40074..dfb13756cd 100644 --- a/include/net/vhost_net.h +++ b/include/net/vhost_net.h @@ -52,4 +52,6 @@ void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetCli= entState *nc, int vq_index); int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc, int vq_index); + +void vhost_net_save_acked_features(NetClientState *nc); #endif diff --git a/hw/net/vhost_net-stub.c b/hw/net/vhost_net-stub.c index 9f7daae99c..66ed5f0b98 100644 --- a/hw/net/vhost_net-stub.c +++ b/hw/net/vhost_net-stub.c @@ -113,3 +113,8 @@ int vhost_net_virtqueue_restart(VirtIODevice *vdev, Net= ClientState *nc, { return 0; } + +void vhost_net_save_acked_features(NetClientState *nc) +{ + +} diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 043058ff43..984b130e8f 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -144,6 +144,15 @@ uint64_t vhost_net_get_acked_features(VHostNetState *n= et) return net->dev.acked_features; } =20 +void vhost_net_save_acked_features(NetClientState *nc) +{ +#ifdef CONFIG_VHOST_NET_USER + if (nc->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_USER) { + vhost_user_save_acked_features(nc); + } +#endif +} + static int vhost_net_get_fd(NetClientState *backend) { switch (backend->info->type) { diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 122eac25ee..b342d66160 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -984,6 +984,12 @@ static void virtio_net_set_features(VirtIODevice *vdev= , uint64_t features) continue; } vhost_net_ack_features(get_vhost_net(nc->peer), features); + + /* + * keep acked_features in NetVhostUserState up-to-date so it + * can't miss any features configured by guest virtio driver. + */ + vhost_net_save_acked_features(nc->peer); } =20 if (virtio_has_feature(features, VIRTIO_NET_F_CTRL_VLAN)) { --=20 MST From nobody Wed May 15 07:51:38 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=1672911830; cv=none; d=zohomail.com; s=zohoarc; b=D0i8d8GuGYD5JRxB1g0FEzicfqrCHTd3sxaJxwR4hpL8repxF9bXjX3jRaz/vkAVHbYRmpQpRkrKgWnbYvJpLwMnHKRNrQCT45PHwHYb/wvxWoUeb93qbAlu4dsVKmF7mFBCQSZ74YEVt6CCB4Z3nw0z0s+oG6eXdCQ6L5d1OK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911830; 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=JfZmU89DZylsMPxnHgpyHtp8Ce4+lUJ+AKt/F8kA8Qw=; b=HYVADVFH2vZ4mJkhJNhTaezTnjS0N35qjYKJXqLBhUH0/f7DLMY5ASD4jt6xk4nHXFvjV7SaPQOhGy9QI7dL0URyXZrJONlVc2vtDDVtdrfCREvKGHroYq93LOmWwo9orhbatUJ7DQY9Qxgtl0IngJC+2tD3oSBrfnrmb+lERc8= 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 167291183051951.574913601966614; Thu, 5 Jan 2023 01:43:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLf-0002JJ-WE; Thu, 05 Jan 2023 04:15:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLK-00025B-Ca for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:23 -0500 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 1pDMLI-00073M-Fs for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:22 -0500 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_128_GCM_SHA256) id us-mta-664-xQ-Ct3wiPc2iab5idkEvyw-1; Thu, 05 Jan 2023 04:15:10 -0500 Received: by mail-wm1-f70.google.com with SMTP id c66-20020a1c3545000000b003d355c13229so750363wma.0 for ; Thu, 05 Jan 2023 01:15:10 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id k41-20020a05600c1ca900b003d974076f13sm1967760wms.3.2023.01.05.01.15.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910120; 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=JfZmU89DZylsMPxnHgpyHtp8Ce4+lUJ+AKt/F8kA8Qw=; b=auqAK1pT2P9L69ofOnxySeE2VAzV/M7zo8Go6U7LKUyOuc+H5yDKNXozl/WEGN6EeyL64l mDBrrjpuxPfFTQhZ3swtBeB7fJ4nNxCNtstTa/AdpyZRGmrPB045UXX27AVZ7a+7AXkFMN ac8QgsVBDNaPqucsGqUV5AwDJQv14oY= X-MC-Unique: xQ-Ct3wiPc2iab5idkEvyw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JfZmU89DZylsMPxnHgpyHtp8Ce4+lUJ+AKt/F8kA8Qw=; b=sApO9gDmafBGo54lxGyEk6Quw6pDn0XFfi/OZPSKMrHA64+d9O/6Ah8fZyG3NBvM3q /2XoHUYKgnkz7qy5eBXnELuGvW2jLJ7zaOBRg+OXftZRIBP/2c/APH8uCQ2QlgcPnEWT cIDBYcfL2fFepNDA72Px6jJG0MfZSFodw5qApsbJ7wvyfUEUDV0cHskfZpr+zryFgeXq 6jwM/LsnfaL5hNmupyU4pT4y0hFyzQwqzlBg5OcCdA0FVmhYpdE4QpYtv1YcRRRomQ0D 5zJ7v/xx1F3hI2UssaEabPhcjWEL3Q8ku02TDTjBOor5V4e8oLe5K2Za/SJAK5w6sUto hLVQ== X-Gm-Message-State: AFqh2ko3LdEG3bbYJuFEZ6MYnr3Qv9eYQFvV5rVVZ59u84RJl5PuTlBk 9M6friXSWQzpICyd44yvWSv+L9cOe5VTr5y7d6EterV1CF7OrLohlRtbDjX5BYdHM6EO9QSGzc1 0DlSLV/f7z8qiSqK4NG+XxLatUN8LsSr93sc8LfeBu1Od7WmwwFSMQ+N4g3CI X-Received: by 2002:a05:600c:35c8:b0:3cf:85f7:bbc4 with SMTP id r8-20020a05600c35c800b003cf85f7bbc4mr36398884wmq.2.1672910109300; Thu, 05 Jan 2023 01:15:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXs3lz1yLPvv7ypvAIQcBMHQ1eaWkR8S4Kp+WUfd6OVHPp55KFbzTyce0f/f9Yo8O7KzdwYgWw== X-Received: by 2002:a05:600c:35c8:b0:3cf:85f7:bbc4 with SMTP id r8-20020a05600c35c800b003cf85f7bbc4mr36398855wmq.2.1672910108997; Thu, 05 Jan 2023 01:15:08 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:05 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Gerd Hoffmann , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Alex =?utf-8?Q?Benn=C3=A9e?= , Viresh Kumar , "Gonglei (Arei)" , virtio-fs@redhat.com Subject: [PULL 15/51] virtio: introduce macro VIRTIO_CONFIG_IRQ_IDX Message-ID: <20230105091310.263867-16-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911832543100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu To support configure interrupt for vhost-vdpa Introduce VIRTIO_CONFIG_IRQ_IDX -1 as configure interrupt's queue index, Then we can reuse the functions guest_notifier_mask and guest_notifier_pend= ing. Add the check of queue index in these drivers, if the driver does not suppo= rt configure interrupt, the function will just return Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-2-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio.h | 3 +++ hw/display/vhost-user-gpu.c | 18 ++++++++++++++++++ hw/net/virtio-net.c | 22 ++++++++++++++++++++-- hw/virtio/vhost-user-fs.c | 18 ++++++++++++++++++ hw/virtio/vhost-user-gpio.c | 10 ++++++++++ hw/virtio/vhost-vsock-common.c | 18 ++++++++++++++++++ hw/virtio/virtio-crypto.c | 18 ++++++++++++++++++ 7 files changed, 105 insertions(+), 2 deletions(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 24561e933a..8266d240cc 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -79,6 +79,9 @@ typedef struct VirtQueueElement =20 #define VIRTIO_NO_VECTOR 0xffff =20 +/* special index value used internally for config irqs */ +#define VIRTIO_CONFIG_IRQ_IDX -1 + #define TYPE_VIRTIO_DEVICE "virtio-device" OBJECT_DECLARE_TYPE(VirtIODevice, VirtioDeviceClass, VIRTIO_DEVICE) =20 diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c index 19c0e20103..4380a5e672 100644 --- a/hw/display/vhost-user-gpu.c +++ b/hw/display/vhost-user-gpu.c @@ -486,6 +486,15 @@ vhost_user_gpu_guest_notifier_pending(VirtIODevice *vd= ev, int idx) { VhostUserGPU *g =3D VHOST_USER_GPU(vdev); =20 + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return false; + } return vhost_virtqueue_pending(&g->vhost->dev, idx); } =20 @@ -494,6 +503,15 @@ vhost_user_gpu_guest_notifier_mask(VirtIODevice *vdev,= int idx, bool mask) { VhostUserGPU *g =3D VHOST_USER_GPU(vdev); =20 + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return; + } vhost_virtqueue_mask(&g->vhost->dev, vdev, idx, mask); } =20 diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index b342d66160..0bfe454c23 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3325,6 +3325,15 @@ static bool virtio_net_guest_notifier_pending(VirtIO= Device *vdev, int idx) } else { nc =3D qemu_get_subqueue(n->nic, vq2q(idx)); } + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return false + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return false; + } return vhost_net_virtqueue_pending(get_vhost_net(nc->peer), idx); } =20 @@ -3348,8 +3357,17 @@ static void virtio_net_guest_notifier_mask(VirtIODev= ice *vdev, int idx, } else { nc =3D qemu_get_subqueue(n->nic, vq2q(idx)); } - vhost_net_virtqueue_mask(get_vhost_net(nc->peer), - vdev, idx, mask); + /* + *Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return; + } + + vhost_net_virtqueue_mask(get_vhost_net(nc->peer), vdev, idx, mask); } =20 static void virtio_net_set_config_size(VirtIONet *n, uint64_t host_feature= s) diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c index d97b179e6f..f5049735ac 100644 --- a/hw/virtio/vhost-user-fs.c +++ b/hw/virtio/vhost-user-fs.c @@ -159,6 +159,15 @@ static void vuf_guest_notifier_mask(VirtIODevice *vdev= , int idx, { VHostUserFS *fs =3D VHOST_USER_FS(vdev); =20 + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return; + } vhost_virtqueue_mask(&fs->vhost_dev, vdev, idx, mask); } =20 @@ -166,6 +175,15 @@ static bool vuf_guest_notifier_pending(VirtIODevice *v= dev, int idx) { VHostUserFS *fs =3D VHOST_USER_FS(vdev); =20 + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return false; + } return vhost_virtqueue_pending(&fs->vhost_dev, idx); } =20 diff --git a/hw/virtio/vhost-user-gpio.c b/hw/virtio/vhost-user-gpio.c index b7b82a1099..fe3da32c74 100644 --- a/hw/virtio/vhost-user-gpio.c +++ b/hw/virtio/vhost-user-gpio.c @@ -191,6 +191,16 @@ static void vu_gpio_guest_notifier_mask(VirtIODevice *= vdev, int idx, bool mask) { VHostUserGPIO *gpio =3D VHOST_USER_GPIO(vdev); =20 + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return; + } + vhost_virtqueue_mask(&gpio->vhost_dev, vdev, idx, mask); } =20 diff --git a/hw/virtio/vhost-vsock-common.c b/hw/virtio/vhost-vsock-common.c index d21c72b401..d2b5519d5a 100644 --- a/hw/virtio/vhost-vsock-common.c +++ b/hw/virtio/vhost-vsock-common.c @@ -127,6 +127,15 @@ static void vhost_vsock_common_guest_notifier_mask(Vir= tIODevice *vdev, int idx, { VHostVSockCommon *vvc =3D VHOST_VSOCK_COMMON(vdev); =20 + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return; + } vhost_virtqueue_mask(&vvc->vhost_dev, vdev, idx, mask); } =20 @@ -135,6 +144,15 @@ static bool vhost_vsock_common_guest_notifier_pending(= VirtIODevice *vdev, { VHostVSockCommon *vvc =3D VHOST_VSOCK_COMMON(vdev); =20 + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return false; + } return vhost_virtqueue_pending(&vvc->vhost_dev, idx); } =20 diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 97da74e719..516425e26a 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -1182,6 +1182,15 @@ static void virtio_crypto_guest_notifier_mask(VirtIO= Device *vdev, int idx, =20 assert(vcrypto->vhost_started); =20 + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return; + } cryptodev_vhost_virtqueue_mask(vdev, queue, idx, mask); } =20 @@ -1192,6 +1201,15 @@ static bool virtio_crypto_guest_notifier_pending(Vir= tIODevice *vdev, int idx) =20 assert(vcrypto->vhost_started); =20 + /* + * Add the check for configure interrupt, Use VIRTIO_CONFIG_IRQ_IDX -1 + * as the Marco of configure interrupt's IDX, If this driver does not + * support, the function will return + */ + + if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return false; + } return cryptodev_vhost_virtqueue_pending(vdev, queue, idx); } =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672912187; cv=none; d=zohomail.com; s=zohoarc; b=aEizTIOEOiT5irG/rLUjSXXLp5RoBo+Y24tCwFSbFos+nNvoAHDqfqtG5K5DmzxUlZZeiuFIP9Q2kL9ytRJ9aoKeg60lEOAmPcLf9jkusBJ+QZ0Zg9IKkIcYGnNMhzP6tCQczn7CLRhh3yN8RtNBBDrOeNgmsgUh1HtnzIdJLUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672912187; 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=O2GwQBuahYwxjT54S9wdqHj2Luqz03rRQU/6Y8Iaipw=; b=lCYSUEYXsL8fiBXPKuKQRutgSJojzIoEhEhUDb59lMzpyEWBHEmG5qKDJG/Qn3lhRtSBK5TXhluk4bDA9fs7OUrUcn0IPlxa4DyvYOEl/oZlaUErzfkAoTGjnyC25H1/7IaB7wRAZQENdXGQY4gsOgFqkbq08d6FWxpF841YgBg= 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 1672912187823552.4982727862488; Thu, 5 Jan 2023 01:49:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLK-00024w-Qv; Thu, 05 Jan 2023 04:15:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLG-0001zy-1m for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:18 -0500 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 1pDMLD-00072c-Nm for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:17 -0500 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_128_GCM_SHA256) id us-mta-121-xV0oGCdPP8aNKkpsqIgUrw-1; Thu, 05 Jan 2023 04:15:13 -0500 Received: by mail-wm1-f71.google.com with SMTP id n18-20020a05600c4f9200b003d993e08485so12117579wmq.2 for ; Thu, 05 Jan 2023 01:15:13 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id q15-20020adff78f000000b00291f1a5ced6sm15197919wrp.53.2023.01.05.01.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910115; 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=O2GwQBuahYwxjT54S9wdqHj2Luqz03rRQU/6Y8Iaipw=; b=MNumE0PZb+3NSIaV88y3a0USfWDqESz7Sc+4Q63nuPYCEVh4Ahtx/v5tkI645ESQ2JX7w8 5wxvyZmqxgOm/uQzRMaEM5OTGzLRJCMY9+tX1yBsY1Ti19RV5eCa0lg6yeI99ej0Uddaq+ mLAwaHhA6HvpF2iqqEKlFnMog76adMg= X-MC-Unique: xV0oGCdPP8aNKkpsqIgUrw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=O2GwQBuahYwxjT54S9wdqHj2Luqz03rRQU/6Y8Iaipw=; b=UE9Jqg0zKRYzD1X5e0IpklcpCUYX87iDqhC6q1U/Fo6Dz0H0VsU63TqGVP9nZ7hj1H LYoWCZUBbYsnq3J/id1F4EWP3NK0a+p3ZifrU1TFSM9m4NVB1w9QwhWTVMv9Ip5/KNjH 3dPDESUZFjsBVolezj/dhD6SVsFf6cGffGmg0lb+Y9wdKnqjPpFETac1xJ6SCyipR6o1 rVE8sfHBj8C75D0Ujo+kTTux5cKg6CH6YxaialMfx4e4M1zLtmrt3P2rnfL4Qy9CNpwq SgTxCtakcovZfSoEQqwcBE3PiQ6fcPIRPOfq1P1xitoFjx+rVyl0Y3JHc6oiDof7tIlF dm4A== X-Gm-Message-State: AFqh2kr2gbb+Q63fX7rdQN2DJHidKp0hUCXT/AWx/GUcYzhqyEaC2XCy lUXNTEzlZj79gDBy98lzxavBqnLaVfnsrsYA7fKhWduzmpDSVP/BQ/N5xtSPhjKIOIF6eBOVRi9 r8byE5WIhH+M+5BJuubEEn7Jyg3MLqghAoizlamp4SW7F0rvLWc1GDL3BHz3R X-Received: by 2002:a05:600c:4e46:b0:3d2:3761:b717 with SMTP id e6-20020a05600c4e4600b003d23761b717mr35612495wmq.37.1672910112127; Thu, 05 Jan 2023 01:15:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXskknJhNACdFJMD1LX79LNXWxJjGRsrbEV2ATvjHwT6gCysptDcJAtKpGsXJi3XrLwpUSzmOw== X-Received: by 2002:a05:600c:4e46:b0:3d2:3761:b717 with SMTP id e6-20020a05600c4e4600b003d23761b717mr35612476wmq.37.1672910111782; Thu, 05 Jan 2023 01:15:11 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:09 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang Subject: [PULL 16/51] virtio-pci: decouple notifier from interrupt process Message-ID: <20230105091310.263867-17-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672912188760100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu To reuse the notifier process. We add the virtio_pci_get_notifier to get the notifier and vector. The INPUT for this function is IDX, The OUTPUT is the notifier and the vector Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-3-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 88 +++++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 70639300aa..68d04928db 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -813,29 +813,41 @@ static void kvm_virtio_pci_vq_vector_release(VirtIOPC= IProxy *proxy, } =20 static int kvm_virtio_pci_irqfd_use(VirtIOPCIProxy *proxy, - unsigned int queue_no, + EventNotifier *n, unsigned int vector) { VirtIOIRQFD *irqfd =3D &proxy->vector_irqfd[vector]; - VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); - VirtQueue *vq =3D virtio_get_queue(vdev, queue_no); - EventNotifier *n =3D virtio_queue_get_guest_notifier(vq); return kvm_irqchip_add_irqfd_notifier_gsi(kvm_state, n, NULL, irqfd->v= irq); } =20 static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy, - unsigned int queue_no, + EventNotifier *n , unsigned int vector) { - VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); - VirtQueue *vq =3D virtio_get_queue(vdev, queue_no); - EventNotifier *n =3D virtio_queue_get_guest_notifier(vq); VirtIOIRQFD *irqfd =3D &proxy->vector_irqfd[vector]; int ret; =20 ret =3D kvm_irqchip_remove_irqfd_notifier_gsi(kvm_state, n, irqfd->vir= q); assert(ret =3D=3D 0); } +static int virtio_pci_get_notifier(VirtIOPCIProxy *proxy, int queue_no, + EventNotifier **n, unsigned int *vec= tor) +{ + VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); + VirtQueue *vq; + + if (queue_no =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + return -1; + } else { + if (!virtio_queue_get_num(vdev, queue_no)) { + return -1; + } + *vector =3D virtio_queue_vector(vdev, queue_no); + vq =3D virtio_get_queue(vdev, queue_no); + *n =3D virtio_queue_get_guest_notifier(vq); + } + return 0; +} =20 static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs) { @@ -844,12 +856,15 @@ static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *= proxy, int nvqs) VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); unsigned int vector; int ret, queue_no; - + EventNotifier *n; for (queue_no =3D 0; queue_no < nvqs; queue_no++) { if (!virtio_queue_get_num(vdev, queue_no)) { break; } - vector =3D virtio_queue_vector(vdev, queue_no); + ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); + if (ret < 0) { + break; + } if (vector >=3D msix_nr_vectors_allocated(dev)) { continue; } @@ -861,7 +876,7 @@ static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *pr= oxy, int nvqs) * Otherwise, delay until unmasked in the frontend. */ if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =3D kvm_virtio_pci_irqfd_use(proxy, queue_no, vector); + ret =3D kvm_virtio_pci_irqfd_use(proxy, n, vector); if (ret < 0) { kvm_virtio_pci_vq_vector_release(proxy, vector); goto undo; @@ -877,7 +892,11 @@ undo: continue; } if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - kvm_virtio_pci_irqfd_release(proxy, queue_no, vector); + ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); + if (ret < 0) { + break; + } + kvm_virtio_pci_irqfd_release(proxy, n, vector); } kvm_virtio_pci_vq_vector_release(proxy, vector); } @@ -891,12 +910,16 @@ static void kvm_virtio_pci_vector_release(VirtIOPCIPr= oxy *proxy, int nvqs) unsigned int vector; int queue_no; VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); - + EventNotifier *n; + int ret ; for (queue_no =3D 0; queue_no < nvqs; queue_no++) { if (!virtio_queue_get_num(vdev, queue_no)) { break; } - vector =3D virtio_queue_vector(vdev, queue_no); + ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); + if (ret < 0) { + break; + } if (vector >=3D msix_nr_vectors_allocated(dev)) { continue; } @@ -904,21 +927,20 @@ static void kvm_virtio_pci_vector_release(VirtIOPCIPr= oxy *proxy, int nvqs) * Otherwise, it was cleaned when masked in the frontend. */ if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - kvm_virtio_pci_irqfd_release(proxy, queue_no, vector); + kvm_virtio_pci_irqfd_release(proxy, n, vector); } kvm_virtio_pci_vq_vector_release(proxy, vector); } } =20 -static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy, +static int virtio_pci_one_vector_unmask(VirtIOPCIProxy *proxy, unsigned int queue_no, unsigned int vector, - MSIMessage msg) + MSIMessage msg, + EventNotifier *n) { VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); - VirtQueue *vq =3D virtio_get_queue(vdev, queue_no); - EventNotifier *n =3D virtio_queue_get_guest_notifier(vq); VirtIOIRQFD *irqfd; int ret =3D 0; =20 @@ -945,14 +967,15 @@ static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy= *proxy, event_notifier_set(n); } } else { - ret =3D kvm_virtio_pci_irqfd_use(proxy, queue_no, vector); + ret =3D kvm_virtio_pci_irqfd_use(proxy, n, vector); } return ret; } =20 -static void virtio_pci_vq_vector_mask(VirtIOPCIProxy *proxy, +static void virtio_pci_one_vector_mask(VirtIOPCIProxy *proxy, unsigned int queue_no, - unsigned int vector) + unsigned int vector, + EventNotifier *n) { VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); @@ -963,7 +986,7 @@ static void virtio_pci_vq_vector_mask(VirtIOPCIProxy *p= roxy, if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { k->guest_notifier_mask(vdev, queue_no, true); } else { - kvm_virtio_pci_irqfd_release(proxy, queue_no, vector); + kvm_virtio_pci_irqfd_release(proxy, n, vector); } } =20 @@ -973,6 +996,7 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, uns= igned vector, VirtIOPCIProxy *proxy =3D container_of(dev, VirtIOPCIProxy, pci_dev); VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtQueue *vq =3D virtio_vector_first_queue(vdev, vector); + EventNotifier *n; int ret, index, unmasked =3D 0; =20 while (vq) { @@ -981,7 +1005,8 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, un= signed vector, break; } if (index < proxy->nvqs_with_notifiers) { - ret =3D virtio_pci_vq_vector_unmask(proxy, index, vector, msg); + n =3D virtio_queue_get_guest_notifier(vq); + ret =3D virtio_pci_one_vector_unmask(proxy, index, vector, msg= , n); if (ret < 0) { goto undo; } @@ -997,7 +1022,8 @@ undo: while (vq && unmasked >=3D 0) { index =3D virtio_get_queue_index(vq); if (index < proxy->nvqs_with_notifiers) { - virtio_pci_vq_vector_mask(proxy, index, vector); + n =3D virtio_queue_get_guest_notifier(vq); + virtio_pci_one_vector_mask(proxy, index, vector, n); --unmasked; } vq =3D virtio_vector_next_queue(vq); @@ -1010,15 +1036,17 @@ static void virtio_pci_vector_mask(PCIDevice *dev, = unsigned vector) VirtIOPCIProxy *proxy =3D container_of(dev, VirtIOPCIProxy, pci_dev); VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtQueue *vq =3D virtio_vector_first_queue(vdev, vector); + EventNotifier *n; int index; =20 while (vq) { index =3D virtio_get_queue_index(vq); + n =3D virtio_queue_get_guest_notifier(vq); if (!virtio_queue_get_num(vdev, index)) { break; } if (index < proxy->nvqs_with_notifiers) { - virtio_pci_vq_vector_mask(proxy, index, vector); + virtio_pci_one_vector_mask(proxy, index, vector, n); } vq =3D virtio_vector_next_queue(vq); } @@ -1034,19 +1062,17 @@ static void virtio_pci_vector_poll(PCIDevice *dev, int queue_no; unsigned int vector; EventNotifier *notifier; - VirtQueue *vq; + int ret; =20 for (queue_no =3D 0; queue_no < proxy->nvqs_with_notifiers; queue_no++= ) { - if (!virtio_queue_get_num(vdev, queue_no)) { + ret =3D virtio_pci_get_notifier(proxy, queue_no, ¬ifier, &vecto= r); + if (ret < 0) { break; } - vector =3D virtio_queue_vector(vdev, queue_no); if (vector < vector_start || vector >=3D vector_end || !msix_is_masked(dev, vector)) { continue; } - vq =3D virtio_get_queue(vdev, queue_no); - notifier =3D virtio_queue_get_guest_notifier(vq); if (k->guest_notifier_pending) { if (k->guest_notifier_pending(vdev, queue_no)) { msix_set_pending(dev, vector); --=20 MST From nobody Wed May 15 07:51:38 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=1672910230; cv=none; d=zohomail.com; s=zohoarc; b=kvWvFeBngqbi9mEFsbAhG2mDc7RKRhI8CrcWJ20/Gatj5MwJktnq9DaV6TZ/iCcORezslgv7Jp4xP22eb21gGw8vMzSrbf7/nC7HDa9Y+Vf3rZ8qWw3jLI6x4ehGWHCJ+srxxitkWiAHsdqolmMS/2S748wJ1fY0h4ESZ28ytF0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910230; 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=7Yz1VejxA6ihgawm49ftmHrbes/XNuA7XNkefEH+3v8=; b=dmR261O7T6lKTR8qqUNGQWzc+aBmXqZJDWAyzpjnMdRYcU/KIOvQPVHwaEJ7hSzOK91T7VEMYssxfC3fkOiQGxo4URKS9HRdatFcwDLDiBNIG8EAOR/pkC48i9357jttSxDbBdtbeKV3VufaH1SGjmWeDAmqLaruTvMAYCjzrlA= 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 1672910230677669.1791719721663; Thu, 5 Jan 2023 01:17:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLL-00025j-Up; Thu, 05 Jan 2023 04:15:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLI-00023s-07 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:20 -0500 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 1pDMLG-00072v-7S for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:19 -0500 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_128_GCM_SHA256) id us-mta-38-EgEUyPQnP52c829DVa-M3g-1; Thu, 05 Jan 2023 04:15:16 -0500 Received: by mail-wr1-f69.google.com with SMTP id g18-20020adfa492000000b0027174820fdbso4531013wrb.4 for ; Thu, 05 Jan 2023 01:15:16 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id m6-20020a05600c4f4600b003d995a704fdsm1827514wmq.33.2023.01.05.01.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910117; 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=7Yz1VejxA6ihgawm49ftmHrbes/XNuA7XNkefEH+3v8=; b=P+vSnRII64qfOdGedkg86Koc1hFWEPNMmXiMHdyaRBdLtLa9PU7Dpe4GO8i8uRCO7Uk63u xupYgwV4o72QlR09fTcomowYxsmxStAh2jGmDed3cUoYIIyipdApbZOrIjkc2+Sj5NgSSu cHF4pSgAOpnY7pFvgzS6HlITo25orGg= X-MC-Unique: EgEUyPQnP52c829DVa-M3g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7Yz1VejxA6ihgawm49ftmHrbes/XNuA7XNkefEH+3v8=; b=6XRv6iBIYx35+LeviA1VLAtQnkh1X16mCDqs7zG2Mb1baNUCk3Gi5pSn5xwffFZtEQ k/6qz02vpXjIqIdqixWW2hmPF7ogaCavDxw0JNhEtlkCIB6Luov9Qa6bl0+nRZK8b9ZI VIIljcDV38n/kSgbBOB8LH1UqFXI2izRVMOT/fwRd6Jk48bmqjDuaKGpI0kGGqnv7y4V MHXKQMXt26ZyTxDydm8unTtJdHWO6JoUounZCOxE/QoWU97Wll4d/mMx2tt9VRicYSzP GMM51c1EPzmbu//I3Z/x8uvOpfIjG2YSgK8xnw4Qjt8fh4GC18ib0w9ZJE30a8MK8VZD oWXw== X-Gm-Message-State: AFqh2kpkmxjkvtfZfyakixARRy54S44Ip0mh51Z6ookec1ryAuu2iSTE nQNubS58l4gN8Oq266fD4ZiXzd29EzlrWS6NIqdIOkZs7VlIkW5yWX0J4J4znwdg/uj7AKoId32 fLnQf6FaiS0EEBsBwVw0mxkC5f5pkX2la/MPQjy4e+JTZuZklkjBKupdPhbnV X-Received: by 2002:a05:600c:22c4:b0:3cf:8ed7:712d with SMTP id 4-20020a05600c22c400b003cf8ed7712dmr39783470wmg.14.1672910114873; Thu, 05 Jan 2023 01:15:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXvwc7VlhQSaf7Dq/FSJyvQVcC2kD0EdI4xHR5R2Hxv6GHhQQ1BTEzCqkzfQBIK/UpRWZLGfcw== X-Received: by 2002:a05:600c:22c4:b0:3cf:8ed7:712d with SMTP id 4-20020a05600c22c400b003cf8ed7712dmr39783452wmg.14.1672910114587; Thu, 05 Jan 2023 01:15:14 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:12 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang Subject: [PULL 17/51] virtio-pci: decouple the single vector from the interrupt process Message-ID: <20230105091310.263867-18-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910231423100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu To reuse the interrupt process in configure interrupt Need to decouple the single vector from the interrupt process. We add new function kvm_virtio_pci_vector_use_one and _release_one. These functions are used for the single vector, the whole process will finish in the loop with vq number. Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-4-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 131 +++++++++++++++++++++++------------------ 1 file changed, 73 insertions(+), 58 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 68d04928db..d7e29b1cdc 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -784,7 +784,6 @@ static uint32_t virtio_read_config(PCIDevice *pci_dev, } =20 static int kvm_virtio_pci_vq_vector_use(VirtIOPCIProxy *proxy, - unsigned int queue_no, unsigned int vector) { VirtIOIRQFD *irqfd =3D &proxy->vector_irqfd[vector]; @@ -849,87 +848,103 @@ static int virtio_pci_get_notifier(VirtIOPCIProxy *p= roxy, int queue_no, return 0; } =20 -static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs) +static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy *proxy, int queue_= no) { + unsigned int vector; + int ret; + EventNotifier *n; PCIDevice *dev =3D &proxy->pci_dev; VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); - unsigned int vector; - int ret, queue_no; - EventNotifier *n; - for (queue_no =3D 0; queue_no < nvqs; queue_no++) { - if (!virtio_queue_get_num(vdev, queue_no)) { - break; - } - ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); - if (ret < 0) { - break; - } - if (vector >=3D msix_nr_vectors_allocated(dev)) { - continue; - } - ret =3D kvm_virtio_pci_vq_vector_use(proxy, queue_no, vector); + + ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); + if (ret < 0) { + return ret; + } + if (vector >=3D msix_nr_vectors_allocated(dev)) { + return 0; + } + ret =3D kvm_virtio_pci_vq_vector_use(proxy, vector); + if (ret < 0) { + goto undo; + } + /* + * If guest supports masking, set up irqfd now. + * Otherwise, delay until unmasked in the frontend. + */ + if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { + ret =3D kvm_virtio_pci_irqfd_use(proxy, n, vector); if (ret < 0) { + kvm_virtio_pci_vq_vector_release(proxy, vector); goto undo; } - /* If guest supports masking, set up irqfd now. - * Otherwise, delay until unmasked in the frontend. - */ - if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =3D kvm_virtio_pci_irqfd_use(proxy, n, vector); - if (ret < 0) { - kvm_virtio_pci_vq_vector_release(proxy, vector); - goto undo; - } - } } - return 0; =20 + return 0; undo: - while (--queue_no >=3D 0) { - vector =3D virtio_queue_vector(vdev, queue_no); - if (vector >=3D msix_nr_vectors_allocated(dev)) { - continue; + + vector =3D virtio_queue_vector(vdev, queue_no); + if (vector >=3D msix_nr_vectors_allocated(dev)) { + return ret; + } + if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { + ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); + if (ret < 0) { + return ret; } - if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); - if (ret < 0) { - break; - } - kvm_virtio_pci_irqfd_release(proxy, n, vector); + kvm_virtio_pci_irqfd_release(proxy, n, vector); + } + return ret; +} +static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs) +{ + int queue_no; + int ret =3D 0; + VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); + + for (queue_no =3D 0; queue_no < nvqs; queue_no++) { + if (!virtio_queue_get_num(vdev, queue_no)) { + return -1; } - kvm_virtio_pci_vq_vector_release(proxy, vector); + ret =3D kvm_virtio_pci_vector_use_one(proxy, queue_no); } return ret; } =20 -static void kvm_virtio_pci_vector_release(VirtIOPCIProxy *proxy, int nvqs) + +static void kvm_virtio_pci_vector_release_one(VirtIOPCIProxy *proxy, + int queue_no) { - PCIDevice *dev =3D &proxy->pci_dev; VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); unsigned int vector; - int queue_no; - VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); EventNotifier *n; - int ret ; + int ret; + VirtioDeviceClass *k =3D VIRTIO_DEVICE_GET_CLASS(vdev); + PCIDevice *dev =3D &proxy->pci_dev; + + ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); + if (ret < 0) { + return; + } + if (vector >=3D msix_nr_vectors_allocated(dev)) { + return; + } + if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { + kvm_virtio_pci_irqfd_release(proxy, n, vector); + } + kvm_virtio_pci_vq_vector_release(proxy, vector); +} + +static void kvm_virtio_pci_vector_release(VirtIOPCIProxy *proxy, int nvqs) +{ + int queue_no; + VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); + for (queue_no =3D 0; queue_no < nvqs; queue_no++) { if (!virtio_queue_get_num(vdev, queue_no)) { break; } - ret =3D virtio_pci_get_notifier(proxy, queue_no, &n, &vector); - if (ret < 0) { - break; - } - if (vector >=3D msix_nr_vectors_allocated(dev)) { - continue; - } - /* If guest supports masking, clean up irqfd now. - * Otherwise, it was cleaned when masked in the frontend. - */ - if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) { - kvm_virtio_pci_irqfd_release(proxy, n, vector); - } - kvm_virtio_pci_vq_vector_release(proxy, vector); + kvm_virtio_pci_vector_release_one(proxy, queue_no); } } =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672911592; cv=none; d=zohomail.com; s=zohoarc; b=P0oUqK4tV1vfL7DRfa6ol07n+2v14ulT8vZZ/GrxLimAyLEgAdcPcnviRRGGpXt30+5x9Ybc66/rTmiZzPTw3oJaEx+YflLGdJpD0PaGbo6hN0U+gjlgHrduSNakqjENkt0qdVAt4m0ISlONTzaVzw4TRgHJxdoz2uHLD9D5ViE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911592; 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=TW26SpRLvo3EQOgqHPmT0jppiI/VcZdoEpjPo9AUTRY=; b=QwfoaPHopIMRba5wkSVmesFoHtKuy9O9uMX/qN3rMJnli9PcNGy0DtIRLTC5Fe1G8ERcFFeGXw3n7zOAdge7P30c5yemCDzYIQrvyCfFc7JFcRQ3Hrgq00I1bzYCocqHoELZTSZotKpSEw/D6Q93Z0t02JuDgPoB+8I6/JkxieQ= 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 1672911592292318.9828553447936; Thu, 5 Jan 2023 01:39:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLY-0002IQ-6D; Thu, 05 Jan 2023 04:15:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLL-00025Q-7d for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:23 -0500 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 1pDMLI-00073Q-QP for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:23 -0500 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_128_GCM_SHA256) id us-mta-617-Vt1q-27eO2qqeYInMVKUpg-1; Thu, 05 Jan 2023 04:15:19 -0500 Received: by mail-wm1-f72.google.com with SMTP id f20-20020a7bc8d4000000b003d1cda5bd6fso260769wml.9 for ; Thu, 05 Jan 2023 01:15:18 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id cc15-20020a5d5c0f000000b00298d87b6309sm11250041wrb.78.2023.01.05.01.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910120; 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=TW26SpRLvo3EQOgqHPmT0jppiI/VcZdoEpjPo9AUTRY=; b=K0zaoB9mw5mG0pPKF0u5Hy4rWzh1/S6NWrnqs0qQfJzZwMes+gakrSFKv7Qxrms5OO7P7r HoSNrHpWyjo/TlMDECE4Hgay3jEGU1g3VAVr2dpMqmOIOUagcyjICrhfj+DyN+qrRsph5u 2J8UIxKH2iWIH/4TGDQmDFPTHEeqyaY= X-MC-Unique: Vt1q-27eO2qqeYInMVKUpg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=TW26SpRLvo3EQOgqHPmT0jppiI/VcZdoEpjPo9AUTRY=; b=BTmyxZF/rPHAX3rWE7l34SqhJk7BFrLHmf2zZvW85hl71CYKQS2KGNhVYbfUn3VVaf WALJDPgNnyv3uROAvGaVStl9lsW+FHqMD/Czc7zvwVBA8CsYlZ+391LekYz1EvqTqvSq iaXVtQFsWnmBK1yM5UEja9kHRYgibA8wMjEWKmIP677XAIkvLPbzB1vcK14qit9uGCrU PyPxH4pgSmGSF44zbBTMHUMPHg0gxQmSk1OqgknS968zvsx3GNRQ3lilDLSFBSIiDmen kZnWZoTzKt0fvJ7asxLnv5UagyPANGRUhGDJaWHjGistzibxDW+b+SV78tUhgdg807zw 5p7A== X-Gm-Message-State: AFqh2kpPNNYeBUM06DlVPVySWdT0jWopYq1NpZJJnvMB6wlmi5psJRVt RXVUUPb7UHbS7WPaLnxhAvJfyBQaZV89NOdx02Q/+tbFZGIqVzCn8cG2OF+SrqPvRtsCrfiVTAw Fmw7GELUkzsfeKTIyhG76Vp0HT+luhg/qWl5yJMjH9iJj6iHqeMehjfRRj8pl X-Received: by 2002:a05:600c:35ca:b0:3d1:f2de:195a with SMTP id r10-20020a05600c35ca00b003d1f2de195amr39012979wmq.32.1672910117633; Thu, 05 Jan 2023 01:15:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXtAt8LRuVRwOi3CZqOk/GVrJfLtKQpjF44hZjsz5JkcrRI1cgTmlmiV0dYM7NiIRHpqBFCq0A== X-Received: by 2002:a05:600c:35ca:b0:3d1:f2de:195a with SMTP id r10-20020a05600c35ca00b003d1f2de195amr39012968wmq.32.1672910117436; Thu, 05 Jan 2023 01:15:17 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:14 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang Subject: [PULL 18/51] vhost: introduce new VhostOps vhost_set_config_call Message-ID: <20230105091310.263867-19-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911593231100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu This patch introduces new VhostOps vhost_set_config_call. This function allows the qemu to set the config event fd to kernel driver. Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-5-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost-backend.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-ba= ckend.h index eab46d7f0b..c5ab49051e 100644 --- a/include/hw/virtio/vhost-backend.h +++ b/include/hw/virtio/vhost-backend.h @@ -128,6 +128,8 @@ typedef int (*vhost_get_device_id_op)(struct vhost_dev = *dev, uint32_t *dev_id); =20 typedef bool (*vhost_force_iommu_op)(struct vhost_dev *dev); =20 +typedef int (*vhost_set_config_call_op)(struct vhost_dev *dev, + int fd); typedef struct VhostOps { VhostBackendType backend_type; vhost_backend_init vhost_backend_init; @@ -174,6 +176,7 @@ typedef struct VhostOps { vhost_vq_get_addr_op vhost_vq_get_addr; vhost_get_device_id_op vhost_get_device_id; vhost_force_iommu_op vhost_force_iommu; + vhost_set_config_call_op vhost_set_config_call; } VhostOps; =20 int vhost_backend_update_device_iotlb(struct vhost_dev *dev, --=20 MST From nobody Wed May 15 07:51:38 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=1672911850; cv=none; d=zohomail.com; s=zohoarc; b=oCQP6mO6FGxzMWwad0qRWKUq5unV9YXXeJgXIv1Ft9xXt5holqReXJrySZKm5ROFa0ddbjaFk2P6S9wC9jNcp+ePQIYsUuT74al0W76LhKaRhlg/lt5EgytxA0RfvVX7ctQkzJgWpy1/iKaGTvRuAm/ZuyQuUpJpJlrpgI0b2ro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911850; 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=tUK5dfADqIwjkAFG0/90Q4aE1+3jpwQ7FcSG0ql53l0=; b=Z9JYblRpX5Kjl2/UZigkK0ZaFLFu9AZR+GaEk93qZpBnpymS8OQBSe6nQRxc5qVttLfw961Vq5AUbOuxTZ08xaAPz5iA1eynCYzZsgkv6xjvoI/2gntBGKaf1WpYl1nuQAu+Ij3TwC3DzEsRS48k8h0l6mp28PXAFVgHI76trKc= 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 1672911850537364.02132994501153; Thu, 5 Jan 2023 01:44:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLh-0002Qu-2c; Thu, 05 Jan 2023 04:15:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLN-00026I-QF for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:26 -0500 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 1pDMLM-00074h-6Z for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:25 -0500 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_128_GCM_SHA256) id us-mta-500-zJ7TQdIoMku0yesG46p3CA-1; Thu, 05 Jan 2023 04:15:22 -0500 Received: by mail-wr1-f69.google.com with SMTP id u15-20020adfa18f000000b002b129dc55bfso175101wru.11 for ; Thu, 05 Jan 2023 01:15:22 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c358c00b003d237d60318sm1912166wmq.2.2023.01.05.01.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910123; 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=tUK5dfADqIwjkAFG0/90Q4aE1+3jpwQ7FcSG0ql53l0=; b=M8e5/UV8tgztm7okElZiHHWnGnB5rlowyaW6khuOfqO/IkBwbgPRN6QogKjDyCG1T67/Yv cfrIMQN/MlnhuOQGQt09tKty3+Xirbxjdkx/LBJPGFnR4YJtCaILA4ltAB43H89nohSJAy YwgMC/9czWMXYLf7e5W2I5pmdtYkWY0= X-MC-Unique: zJ7TQdIoMku0yesG46p3CA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=tUK5dfADqIwjkAFG0/90Q4aE1+3jpwQ7FcSG0ql53l0=; b=uooBy/vkJ3hjJFxbxKRcRxmX/D2yzdAE1H9i4QtAIK2yMgXei85yEhQe292NkmRT2D 9stNelV1lxXKM2R3tQuRr8rPxCzuHQddYyoyZ8cwVSpAuKwy+GgQyo+ofsoEaKa9c43S BxdCXHEL2JuIEPCDpXRvJLERHEs9GKylP/1zSN3WS9OTLaXhhdqcY6tpdTX9rdgfei57 q3q1+OLIGBTsa2TvUf07D7PuV0n7j9JtRaLx9Rp8oipUEeo1oHev+UB2Sj0AO5x2ESvm LYTpziHMsd3nYU+0LcTNvjJfyUuzJvwdkK9IDNYwEEoq8/XGkseXg8JjD6cO2nBRgx5H leqg== X-Gm-Message-State: AFqh2koT+9TLvn3P4ZCPzrUQytFmQceh390T6n8oB5bZABEVh904eYUh BetDraLbpbf2hRDBcQ0lu9+wDXckHmQMKSuT8ZI6ysfx0dTeW9DWFxXtg7mm8aXKX3Py7bjWIae ueBgB4NAlzZ7zlloaKQs4ynpbxkFifqKecAL6KCvRpn4HBWjegBjwcC9hmjiC X-Received: by 2002:a05:600c:1d1d:b0:3cf:81af:8b73 with SMTP id l29-20020a05600c1d1d00b003cf81af8b73mr35476252wms.23.1672910120945; Thu, 05 Jan 2023 01:15:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXu9ta0IrK6Dbx+rER/w8G7MkzUcCoJa9Wa7pbGELuCThbz0iU4XL3B4NXmkTaB1AX4V8qU1Pg== X-Received: by 2002:a05:600c:1d1d:b0:3cf:81af:8b73 with SMTP id l29-20020a05600c1d1d00b003cf81af8b73mr35476238wms.23.1672910120703; Thu, 05 Jan 2023 01:15:20 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:17 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang Subject: [PULL 19/51] vhost-vdpa: add support for config interrupt Message-ID: <20230105091310.263867-20-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911852618100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu Add new call back function in vhost-vdpa, The function vhost_set_config_call can set the event fd to kernel. This function will be called in the vhost_dev_start and vhost_dev_stop Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-6-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-vdpa.c | 8 ++++++++ hw/virtio/trace-events | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index fd0c33b0e1..fcb1e96316 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -716,6 +716,13 @@ static int vhost_vdpa_set_vring_ready(struct vhost_dev= *dev) return 0; } =20 +static int vhost_vdpa_set_config_call(struct vhost_dev *dev, + int fd) +{ + trace_vhost_vdpa_set_config_call(dev, fd); + return vhost_vdpa_call(dev, VHOST_VDPA_SET_CONFIG_CALL, &fd); +} + static void vhost_vdpa_dump_config(struct vhost_dev *dev, const uint8_t *c= onfig, uint32_t config_len) { @@ -1298,4 +1305,5 @@ const VhostOps vdpa_ops =3D { .vhost_get_device_id =3D vhost_vdpa_get_device_id, .vhost_vq_get_addr =3D vhost_vdpa_vq_get_addr, .vhost_force_iommu =3D vhost_vdpa_force_iommu, + .vhost_set_config_call =3D vhost_vdpa_set_config_call, }; diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events index 96da58a41f..a87c5f39a2 100644 --- a/hw/virtio/trace-events +++ b/hw/virtio/trace-events @@ -62,6 +62,7 @@ vhost_vdpa_get_features(void *dev, uint64_t features) "de= v: %p features: 0x%"PRI vhost_vdpa_set_owner(void *dev) "dev: %p" vhost_vdpa_vq_get_addr(void *dev, void *vq, uint64_t desc_user_addr, uint6= 4_t avail_user_addr, uint64_t used_user_addr) "dev: %p vq: %p desc_user_add= r: 0x%"PRIx64" avail_user_addr: 0x%"PRIx64" used_user_addr: 0x%"PRIx64 vhost_vdpa_get_iova_range(void *dev, uint64_t first, uint64_t last) "dev: = %p first: 0x%"PRIx64" last: 0x%"PRIx64 +vhost_vdpa_set_config_call(void *dev, int fd)"dev: %p fd: %d" =20 # virtio.c virtqueue_alloc_element(void *elem, size_t sz, unsigned in_num, unsigned o= ut_num) "elem %p size %zd in_num %u out_num %u" --=20 MST From nobody Wed May 15 07:51:38 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=1672912005; cv=none; d=zohomail.com; s=zohoarc; b=herEBJ3P4Av3djDrsS4FH5UqiSSvPG54Wbm9kJSIyXvqv5zI22F25wu6msKb+Av5d0RdBt2prkNSWBqRKzjmR+VVY970OAkqEhyzQ5JOhhZ0oK9b2+aL4y4feL4jA7/cTFv2TJF/pK0jjc/P+MFr/CNQPmwKssWBlJzsbTeu+mk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672912005; 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=SX8qIklmUF8EkSd2KYgJ3YK4hBq7RqmE4YSjRP8TIv4=; b=TwDT5Mk6f39OMOv8/Kbml1pNYjOS0IOwlGtUGcYWVR+upixRN6nq6AvcfybnaEqhl0siY+1Ya6wFzu3kYbq/lhAFI8VZtPF2mo9KC6CHoDW+zA7dmg1PnDp3mzZ6xYbZflHud4/Q9bx+hN+Wy0YfV81z0PoRCE+ExDchSeWuPx4= 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 1672912005404210.88915146661725; Thu, 5 Jan 2023 01:46:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLi-0002Th-5t; Thu, 05 Jan 2023 04:15:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLU-0002Ep-19 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:35 -0500 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 1pDMLS-000770-7W for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:31 -0500 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_128_GCM_SHA256) id us-mta-440-9_8BSvILPHeA0qA-_sTlgg-1; Thu, 05 Jan 2023 04:15:25 -0500 Received: by mail-wr1-f71.google.com with SMTP id h24-20020adfaa98000000b0028abfe5b8d9so2511932wrc.2 for ; Thu, 05 Jan 2023 01:15:25 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id v16-20020a05600c445000b003c6c3fb3cf6sm1859332wmn.18.2023.01.05.01.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910129; 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=SX8qIklmUF8EkSd2KYgJ3YK4hBq7RqmE4YSjRP8TIv4=; b=IndNBwkOysQbeQRrRjAj6RKqSh92OMcnWYLHmJgHlLo4bxqTbseBprmUMqRquY3rUlebb1 LWsScSWigloCAZKOH6V7o6cpHKHWLcIoPAiW9kXAk63cepFy1QLcbHG8SWd5PbPM+tzlp/ BkrKk6GAyUghf1wWAyKqYwXC1WWWzH4= X-MC-Unique: 9_8BSvILPHeA0qA-_sTlgg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=SX8qIklmUF8EkSd2KYgJ3YK4hBq7RqmE4YSjRP8TIv4=; b=5fDlxUNXtEnAXnSi61xfE9NOGWfE8MVr9uf16NK30KW/N6fGmVhp3eZ1ePutmvP3qT EGnSQRx7QRJiBuRqpa+Knj3lX/LUzev5tsmW39FhsbZNuYHmdhqO1M8G0RMPabFMGxi2 nkzhCiWFJW33RQVk9rgX7epN5Zv3bgOaRuFfDnLvMi28EQJJrO4uPCpNeNhMEfRZHolL gGxjJUCXESEcTsIFZaBQJVZO92plPfqIuVsPijn3/YikkgQp0rXBzot2qrqlCR/nCeEA 0f48aaAC1cA/RhVuO0MrrwRR+4eLOiVCYE7KL70/9byBCPqFz00WOJB4oI3cVYHTgnFk o5IQ== X-Gm-Message-State: AFqh2kpCamTnOrvDbWjmhShwTIa74v4y1RhbqIypHInLWxZfMa5oziva 6gp4gGkpfRcSu6Kswwt4DopXKa8dNmNlnmRqNwsiuL+UE1IdtjfLLZ5YXinTcGMEdsyQsveSlbE nAhBWBKdGVt9h1Spq1Z0CQpiaE4fWsVhgVG1WnSG4tAyEzgokHL1sxawtSW1g X-Received: by 2002:a05:600c:228b:b0:3d2:37a4:222a with SMTP id 11-20020a05600c228b00b003d237a4222amr39944708wmf.38.1672910124057; Thu, 05 Jan 2023 01:15:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXv12ExmkV9igizXC+4HjCmRUocW3oBP2k3nmfgS0R0P6KseNxy5vOPDuLfygDiR7Gam/AgMyw== X-Received: by 2002:a05:600c:228b:b0:3d2:37a4:222a with SMTP id 11-20020a05600c228b00b003d237a4222amr39944689wmf.38.1672910123688; Thu, 05 Jan 2023 01:15:23 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:20 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang Subject: [PULL 20/51] virtio: add support for configure interrupt Message-ID: <20230105091310.263867-21-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672912005709100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu Add the functions to support the configure interrupt in virtio The function virtio_config_guest_notifier_read will notify the guest if there is an configure interrupt. The function virtio_config_set_guest_notifier_fd_handler is to set the fd hander for the notifier Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-7-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio.h | 4 ++++ hw/virtio/virtio.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 8266d240cc..4219968fd8 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -155,6 +155,7 @@ struct VirtIODevice AddressSpace *dma_as; QLIST_HEAD(, VirtQueue) *vector_queues; QTAILQ_ENTRY(VirtIODevice) next; + EventNotifier config_notifier; }; =20 struct VirtioDeviceClass { @@ -377,6 +378,9 @@ void virtio_queue_aio_attach_host_notifier_no_poll(Virt= Queue *vq, AioContext *ct void virtio_queue_aio_detach_host_notifier(VirtQueue *vq, AioContext *ctx); VirtQueue *virtio_vector_first_queue(VirtIODevice *vdev, uint16_t vector); VirtQueue *virtio_vector_next_queue(VirtQueue *vq); +EventNotifier *virtio_config_get_guest_notifier(VirtIODevice *vdev); +void virtio_config_set_guest_notifier_fd_handler(VirtIODevice *vdev, + bool assign, bool with_ir= qfd); =20 static inline void virtio_add_feature(uint64_t *features, unsigned int fbi= t) { diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 289eb71045..6ff797e1cf 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3417,7 +3417,14 @@ static void virtio_queue_guest_notifier_read(EventNo= tifier *n) virtio_irq(vq); } } +static void virtio_config_guest_notifier_read(EventNotifier *n) +{ + VirtIODevice *vdev =3D container_of(n, VirtIODevice, config_notifier); =20 + if (event_notifier_test_and_clear(n)) { + virtio_notify_config(vdev); + } +} void virtio_queue_set_guest_notifier_fd_handler(VirtQueue *vq, bool assign, bool with_irqfd) { @@ -3434,6 +3441,23 @@ void virtio_queue_set_guest_notifier_fd_handler(Virt= Queue *vq, bool assign, } } =20 +void virtio_config_set_guest_notifier_fd_handler(VirtIODevice *vdev, + bool assign, bool with_ir= qfd) +{ + EventNotifier *n; + n =3D &vdev->config_notifier; + if (assign && !with_irqfd) { + event_notifier_set_handler(n, virtio_config_guest_notifier_read); + } else { + event_notifier_set_handler(n, NULL); + } + if (!assign) { + /* Test and clear notifier before closing it,*/ + /* in case poll callback didn't have time to run. */ + virtio_config_guest_notifier_read(n); + } +} + EventNotifier *virtio_queue_get_guest_notifier(VirtQueue *vq) { return &vq->guest_notifier; @@ -3514,6 +3538,11 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQu= eue *vq) return &vq->host_notifier; } =20 +EventNotifier *virtio_config_get_guest_notifier(VirtIODevice *vdev) +{ + return &vdev->config_notifier; +} + void virtio_queue_set_host_notifier_enabled(VirtQueue *vq, bool enabled) { vq->host_notifier_enabled =3D enabled; --=20 MST From nobody Wed May 15 07:51:38 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=1672911491; cv=none; d=zohomail.com; s=zohoarc; b=W2SouXw4SzaP8HjCam6TGtB/QS+4tv35Vu//rjyMSXBuukFvEEeEc+vlelKq9/y6dRLxzlKkyWtultYXDGDUaKjZ9MtAARrCjMiG+ZO7dKm31JO1t3p84QJ2vbtXz+Xihv4QYeGXZKk7mV087hpl3+zN9OIOj+gG5MUmt39d65I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911491; 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=+xcXVTlPeptVuSlj1Zo7g+4j3dPj3ynx76m4Fa2ITrk=; b=SGYooIR6TjHt72O0ZfMRWmIv7ModkyGQJnis7gF+sz9Y4HypYjg4MMVC5U9FhQxpKS5Dd2H0akIaqqnC/c6BShZnNPnTGiSNoqtjWa0wFzyP3JumcbpFaYE23QEUY3vYTqoik8s15uoOcgLJzKyzth1AubGRtMj+Tu+O82batZw= 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 1672911491429290.7151535773826; Thu, 5 Jan 2023 01:38:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLg-0002Qg-Rq; Thu, 05 Jan 2023 04:15:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLT-0002EK-TK for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:34 -0500 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 1pDMLR-00076n-U3 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:31 -0500 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_128_GCM_SHA256) id us-mta-80-7AgBp5IOMRSYZ6-CGrnNoQ-1; Thu, 05 Jan 2023 04:15:28 -0500 Received: by mail-wm1-f70.google.com with SMTP id k20-20020a05600c1c9400b003d9717c8b11so17469792wms.7 for ; Thu, 05 Jan 2023 01:15:28 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id o9-20020a05600c510900b003c6f8d30e40sm1857080wms.31.2023.01.05.01.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910129; 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=+xcXVTlPeptVuSlj1Zo7g+4j3dPj3ynx76m4Fa2ITrk=; b=dOCwKsgKyH3UEkSSVyhj+3BBbzw+Hg13PADeUpgRxs9p5o2KTL4WdqXZAnaiLv700gYWG/ zREpC9uO5c2UioAEeLq3+EYMuBMlTeFs/sr/cUgoLhCxa/E1YBnxZu+BeptMmR8vtoVXyz JbVEh4iDlp149fqcLdQLm/dITG79c6k= X-MC-Unique: 7AgBp5IOMRSYZ6-CGrnNoQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=+xcXVTlPeptVuSlj1Zo7g+4j3dPj3ynx76m4Fa2ITrk=; b=E2AP8dOCUXtJTKVBxiB8js/T6SJZDbZP/YMOu/sOM1d3Zi0YSMoF2UDy/mswglWdLR +bNryUGh4bgcjZ+ZK/L8g4aZyzSvxUNWQfgtsfXY9E/Z6J8A794xb2pizBbhg/0ep9cg 2bWnm4mxA41cTY1pYhdNNSk4YImyccD6X5LAiUTLWqDf8aufDtMhcqV0F4uZp8U8RUFe e4rG2Bv8ErHeLI9sK4ej/nGmKdUnjaAL7Ks+dxiTJH70Ln+q6XW36gak+VY4yjdIUP9w mCAMfKuQDiEG58eS+t0zdFu8dpb5MgVbYgqrl8nvgsENl4MYATAFDMYaYjwtd3wK5XUp NMRw== X-Gm-Message-State: AFqh2kpTXM18pbJn6tLGZGIvqrqw7eh+o5glTVSk8QSvMistYrWVQAyL rnOXZeua/bKcuEFYkovvb9BciagKV33PZDnpDZQCRB+VCyOckl3CnGUD++iLiiUgP+apeDimqWz O9U3g7IwV2GOxSb4f4h9L6uEqVfDKyKLKfThGrBHPjpdI7ycLyPcG47NDntdn X-Received: by 2002:a05:600c:1911:b0:3d9:8635:a916 with SMTP id j17-20020a05600c191100b003d98635a916mr30162095wmq.9.1672910126733; Thu, 05 Jan 2023 01:15:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXvdevg0tfB91G+b6HdmKDjwT9Rleaj7VWZ7cag8pRKP+6sqr4L9YYFZgOn4VPtG1Jo5H6gBGg== X-Received: by 2002:a05:600c:1911:b0:3d9:8635:a916 with SMTP id j17-20020a05600c191100b003d98635a916mr30162081wmq.9.1672910126447; Thu, 05 Jan 2023 01:15:26 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:24 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang Subject: [PULL 21/51] vhost: add support for configure interrupt Message-ID: <20230105091310.263867-22-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911492467100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu Add functions to support configure interrupt. The configure interrupt process will start in vhost_dev_start and stop in vhost_dev_stop. Also add the functions to support vhost_config_pending and vhost_config_mask. Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-8-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost.h | 4 ++ hw/virtio/vhost.c | 78 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index 1cafa0d776..a52f273347 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -33,6 +33,7 @@ struct vhost_virtqueue { unsigned used_size; EventNotifier masked_notifier; EventNotifier error_notifier; + EventNotifier masked_config_notifier; struct vhost_dev *dev; }; =20 @@ -41,6 +42,7 @@ typedef unsigned long vhost_log_chunk_t; #define VHOST_LOG_BITS (8 * sizeof(vhost_log_chunk_t)) #define VHOST_LOG_CHUNK (VHOST_LOG_PAGE * VHOST_LOG_BITS) #define VHOST_INVALID_FEATURE_BIT (0xff) +#define VHOST_QUEUE_NUM_CONFIG_INR 0 =20 struct vhost_log { unsigned long long size; @@ -187,6 +189,8 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, = VirtIODevice *vdev); * Disable direct notifications to vhost device. */ void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vde= v); +bool vhost_config_pending(struct vhost_dev *hdev); +void vhost_config_mask(struct vhost_dev *hdev, VirtIODevice *vdev, bool ma= sk); =20 /** * vhost_dev_is_started() - report status of vhost device diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index fdcd1a8fdf..2c566dc539 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1640,7 +1640,68 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev, Vi= rtIODevice *vdev, int n, file.index =3D hdev->vhost_ops->vhost_get_vq_index(hdev, n); r =3D hdev->vhost_ops->vhost_set_vring_call(hdev, &file); if (r < 0) { - VHOST_OPS_DEBUG(r, "vhost_set_vring_call failed"); + error_report("vhost_set_vring_call failed %d", -r); + } +} + +bool vhost_config_pending(struct vhost_dev *hdev) +{ + assert(hdev->vhost_ops); + if ((hdev->started =3D=3D false) || + (hdev->vhost_ops->vhost_set_config_call =3D=3D NULL)) { + return false; + } + + EventNotifier *notifier =3D + &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier; + return event_notifier_test_and_clear(notifier); +} + +void vhost_config_mask(struct vhost_dev *hdev, VirtIODevice *vdev, bool ma= sk) +{ + int fd; + int r; + EventNotifier *notifier =3D + &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier; + EventNotifier *config_notifier =3D &vdev->config_notifier; + assert(hdev->vhost_ops); + + if ((hdev->started =3D=3D false) || + (hdev->vhost_ops->vhost_set_config_call =3D=3D NULL)) { + return; + } + if (mask) { + assert(vdev->use_guest_notifier_mask); + fd =3D event_notifier_get_fd(notifier); + } else { + fd =3D event_notifier_get_fd(config_notifier); + } + r =3D hdev->vhost_ops->vhost_set_config_call(hdev, fd); + if (r < 0) { + error_report("vhost_set_config_call failed %d", -r); + } +} + +static void vhost_stop_config_intr(struct vhost_dev *dev) +{ + int fd =3D -1; + assert(dev->vhost_ops); + if (dev->vhost_ops->vhost_set_config_call) { + dev->vhost_ops->vhost_set_config_call(dev, fd); + } +} + +static void vhost_start_config_intr(struct vhost_dev *dev) +{ + int r; + + assert(dev->vhost_ops); + int fd =3D event_notifier_get_fd(&dev->vdev->config_notifier); + if (dev->vhost_ops->vhost_set_config_call) { + r =3D dev->vhost_ops->vhost_set_config_call(dev, fd); + if (!r) { + event_notifier_set(&dev->vdev->config_notifier); + } } } =20 @@ -1880,6 +1941,16 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODe= vice *vdev, bool vrings) } } =20 + r =3D event_notifier_init( + &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier, 0); + if (r < 0) { + return r; + } + event_notifier_test_and_clear( + &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier); + if (!vdev->use_guest_notifier_mask) { + vhost_config_mask(hdev, vdev, true); + } if (hdev->log_enabled) { uint64_t log_base; =20 @@ -1918,6 +1989,7 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODev= ice *vdev, bool vrings) vhost_device_iotlb_miss(hdev, vq->used_phys, true); } } + vhost_start_config_intr(hdev); return 0; fail_start: if (vrings) { @@ -1947,6 +2019,9 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODev= ice *vdev, bool vrings) =20 /* should only be called after backend is connected */ assert(hdev->vhost_ops); + event_notifier_test_and_clear( + &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier); + event_notifier_test_and_clear(&vdev->config_notifier); =20 trace_vhost_dev_stop(hdev, vdev->name, vrings); =20 @@ -1969,6 +2044,7 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODev= ice *vdev, bool vrings) } memory_listener_unregister(&hdev->iommu_listener); } + vhost_stop_config_intr(hdev); vhost_log_put(hdev, true); hdev->started =3D false; vdev->vhost_started =3D false; --=20 MST From nobody Wed May 15 07:51:38 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=1672911817; cv=none; d=zohomail.com; s=zohoarc; b=IhFhiQ0vO3gps7DKqKxOVq0+q7Kq5MyoQnulG9a5gedHVliK0HrOPvdvMYe7iQNj9Pn7x08mqnuO4NaWM0GdSkui8B8m+qmEtL4wT/n1RAson0U5iwNYe8r1oJV1iJ56W7f52AMwYRpKopwQiDl5DEfXUUxeA7HMbYSRjPk8PRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911817; 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=Ti5mHEuUeGoPKkCa8ZRTnHusVq2zl8pzj2H8pELjLkI=; b=dB4DeDFy1eyO4zdK3ipr9PvTWp1sMrPsPO19WGehFu7J2lCwdvl8V0rpx/n1B4ixChmow5shAFW/DA2uA1nCODzySY/0IpcbyI26FpWOz0hXQLhmnRWcEBexgSgaF/KQeYMi5awlk1hBzr0DtX74BB9HmPSaY3AGUHj0duCoqPc= 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 1672911817849702.9149122422559; Thu, 5 Jan 2023 01:43:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLj-0002Vh-Lt; Thu, 05 Jan 2023 04:15:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLe-0002PC-Tx for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:43 -0500 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 1pDMLc-0007At-Pe for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:42 -0500 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_128_GCM_SHA256) id us-mta-27-uzIwfN3eMKSZ1R_ISXspTw-1; Thu, 05 Jan 2023 04:15:31 -0500 Received: by mail-wm1-f70.google.com with SMTP id m38-20020a05600c3b2600b003d23f8c6ebdso1263171wms.0 for ; Thu, 05 Jan 2023 01:15:31 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id n14-20020a5d484e000000b00242814c2cf0sm36160386wrs.4.2023.01.05.01.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910140; 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=Ti5mHEuUeGoPKkCa8ZRTnHusVq2zl8pzj2H8pELjLkI=; b=Ry/NbDrDRXOVSWrSR6WpfGfIt4xHXfkeUtiq1vcf/OqI1qr/qOUIydUgFna1IToexYu19v uxXcYzWX5pT7dj15V5lw8mf6Dt9bZKWsvVhLxk+LVort5MvnRvAfyEQwSEOM1PIEVNGDFF j2ksJDwo7tVk53B0z6VEdVlk2dKWKYg= X-MC-Unique: uzIwfN3eMKSZ1R_ISXspTw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Ti5mHEuUeGoPKkCa8ZRTnHusVq2zl8pzj2H8pELjLkI=; b=QnTYBkljV//2EtbYjvax9bl5YXpWWNt2SFA8+/BRrnPXyFS8W6Pr4HdSCQoch9paeT BsxBtZLFTLTcWQZwhOk88CbRkDkonBEl2JAXpymnSGXp2X04AjVyI+gIYzEb/UGISYx7 tTpuFHosmMxrFCJ1A51QHg0LTPGBJjfKmzAT7+UW0RoKv2hmcYvUDqiO+dXI3WgeRMj8 ZHAURsyFIGGxwCoBobT9sYnKuds/wHtP+LB0ZhamPrCOX6EbKmCzOruHswZnfdV+tCtU XU6gINl7rNYscuepWBZH/6cwS4xoPoj3jGvg53bNSVatWX+dVjfeKgXC1EmfKmPfgsIe vxMg== X-Gm-Message-State: AFqh2koQuDbiZecV33tTvRvVhdSDF/95jDpnjKvjVB5erQo0OBVCBsx4 5Mw9v7De0LnBaIabBx0wSijk6aTGB9oitRAPHfS4XQiXMcYqgEaYeJXIpMERJ7NE3lLfg3rStWP 5hXEalfGC/jq/M6FiLBVlqzc+fOvw4CrW4QSeepULY389Tehxl3UgzYzFBWT6 X-Received: by 2002:a5d:4387:0:b0:26f:2fb:7f88 with SMTP id i7-20020a5d4387000000b0026f02fb7f88mr32129229wrq.33.1672910129882; Thu, 05 Jan 2023 01:15:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXu20t7vrACMrJxqZF0qjCNGfKc8h3Fnr5Zt0FjnbG5hk3X3U7v9Qgp25osNIrtUif2hPcX0Kw== X-Received: by 2002:a5d:4387:0:b0:26f:2fb:7f88 with SMTP id i7-20020a5d4387000000b0026f02fb7f88mr32129202wrq.33.1672910129470; Thu, 05 Jan 2023 01:15:29 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:26 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang Subject: [PULL 22/51] virtio-net: add support for configure interrupt Message-ID: <20230105091310.263867-23-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911818423100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu Add functions to support configure interrupt in virtio_net Add the functions to support vhost_net_config_pending and vhost_net_config_mask. Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-9-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/net/vhost_net.h | 2 ++ hw/net/vhost_net-stub.c | 9 +++++++++ hw/net/vhost_net.c | 9 +++++++++ hw/net/virtio-net.c | 4 ++-- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h index dfb13756cd..c37aba35e6 100644 --- a/include/net/vhost_net.h +++ b/include/net/vhost_net.h @@ -39,6 +39,8 @@ int vhost_net_set_config(struct vhost_net *net, const uin= t8_t *data, bool vhost_net_virtqueue_pending(VHostNetState *net, int n); void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev, int idx, bool mask); +bool vhost_net_config_pending(VHostNetState *net); +void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mas= k); int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr); VHostNetState *get_vhost_net(NetClientState *nc); =20 diff --git a/hw/net/vhost_net-stub.c b/hw/net/vhost_net-stub.c index 66ed5f0b98..72df6d757e 100644 --- a/hw/net/vhost_net-stub.c +++ b/hw/net/vhost_net-stub.c @@ -82,6 +82,15 @@ void vhost_net_virtqueue_mask(VHostNetState *net, VirtIO= Device *dev, { } =20 +bool vhost_net_config_pending(VHostNetState *net) +{ + return false; +} + +void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mas= k) +{ +} + int vhost_net_notify_migration_done(struct vhost_net *net, char* mac_addr) { return -1; diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 984b130e8f..c4eecc6f36 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -487,6 +487,15 @@ void vhost_net_virtqueue_mask(VHostNetState *net, Virt= IODevice *dev, vhost_virtqueue_mask(&net->dev, dev, idx, mask); } =20 +bool vhost_net_config_pending(VHostNetState *net) +{ + return vhost_config_pending(&net->dev); +} + +void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mas= k) +{ + vhost_config_mask(&net->dev, dev, mask); +} VHostNetState *get_vhost_net(NetClientState *nc) { VHostNetState *vhost_net =3D 0; diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 0bfe454c23..f191e3037f 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3332,7 +3332,7 @@ static bool virtio_net_guest_notifier_pending(VirtIOD= evice *vdev, int idx) */ =20 if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return false; + return vhost_net_config_pending(get_vhost_net(nc->peer)); } return vhost_net_virtqueue_pending(get_vhost_net(nc->peer), idx); } @@ -3364,9 +3364,9 @@ static void virtio_net_guest_notifier_mask(VirtIODevi= ce *vdev, int idx, */ =20 if (idx =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + vhost_net_config_mask(get_vhost_net(nc->peer), vdev, mask); return; } - vhost_net_virtqueue_mask(get_vhost_net(nc->peer), vdev, idx, mask); } =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672911938; cv=none; d=zohomail.com; s=zohoarc; b=aWa9Alu8SAItUmLvm2SUOsLbX92Ra9+u3QK5d68rjLkMR/S7zb277SQmh39NJbelqTSnEpM84h+LiPvlAL2DbC9YcSHQPfKgvUgBkCwFn8XoYRZwW3LtvJS9rzGSl/BWfdBlIe+MnbuobKeIE/fcJ7zzLfsw9PfmKsv1458cv/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911938; 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=GGklUbfsYOTwoJJjI6gv9XOzUxb3ETCwK876oF/HvWU=; b=Mc/0nkpY/BZeavXwTeSr+eUUsGA1TXY6oK0zozqgzOjpAEnN5W4jtyNEWn7eyWq5c0ZGzjpDjtRDL2bbPGD1W39M8SztPsR4higzT2JS52nF88TeG8PmqaPDxTZC+kpWT1ZoZi21BZvfHSotMM5URfkvJUzB84HM4BEEo1JA8Hk= 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 1672911938617984.3451169748602; Thu, 5 Jan 2023 01:45:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLi-0002Tp-7q; Thu, 05 Jan 2023 04:15:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLZ-0002MR-Oq for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:43 -0500 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 1pDMLY-0007AL-85 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:37 -0500 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_128_GCM_SHA256) id us-mta-435-HB0skVhXNNyPb3MHPQ51vw-1; Thu, 05 Jan 2023 04:15:34 -0500 Received: by mail-wm1-f72.google.com with SMTP id r15-20020a05600c35cf00b003d9a14517b2so735025wmq.2 for ; Thu, 05 Jan 2023 01:15:34 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id u13-20020a5d468d000000b00275970a85f4sm33881121wrq.74.2023.01.05.01.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910135; 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=GGklUbfsYOTwoJJjI6gv9XOzUxb3ETCwK876oF/HvWU=; b=Zk/vhR4h+5hgXaSCYF5Eu6ctFLfOxW4+O6yst5yt+PyDkgUr7MuNZLjdP/JxiHZLp7UQJq RjRLTtaqM+zDN97J9ZAxXFX/jwnqAFN8FsEUXclGOvhNwk6FeZ+3HKynx3KYK8ikDRACG0 k10RLpk14ID14o34QnbzeFxz2VcCeWg= X-MC-Unique: HB0skVhXNNyPb3MHPQ51vw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=GGklUbfsYOTwoJJjI6gv9XOzUxb3ETCwK876oF/HvWU=; b=W6fKjYzbahjMt8c76EaRyD8hKiorgwmH4im0xMIDvMgtUXwfgLevHJ38kqG4HDVuLu BOnTxMVX8oiPWk4ZtTpjRzuicB7Bs0F/VoQCqkEYGdPDVI0TRN1eXpqOo1fQvhCvCKfB MoBebw68qnSpbORtnGbYkU4pcux/+paa5cUFJ5EkZtEh+cxt4h2rugrGbmAAfqWD+COv K5NDIfdRMwzaRUJNt36jAArQDrZTG45EQ9r/5kr3OfzNWhg6Vc3pL0Vsr+pATIllKBg/ haBQds5UJZJtDa3DHh0dT3FZRbB/Q3WAWWwtjJKu4ZhMlefCdW2FNVnRr2QZIuM40IFc KhmQ== X-Gm-Message-State: AFqh2kpkogKaAgUxDetLG4JBGuy8KQ+7ayWs6Vo6tjggwkNfoTtgXvYf x60Dz0vjZsyy2AcFi4LgxPcEX+Yv3ayzlOacs6gf0KR34RhIRC1d4OnOBRaGqdRfepbNTgZKO3n XKQ9Ntpog+laiRB4Jq1VF3umLRuVd6/oZuIsIPxIOAZyuzAv8bN4MPTBpDTe1 X-Received: by 2002:a5d:544a:0:b0:290:7dfa:9582 with SMTP id w10-20020a5d544a000000b002907dfa9582mr12592322wrv.22.1672910132705; Thu, 05 Jan 2023 01:15:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtyBw6XKQaoaUCY0yIltTgHxMGvTTR7MShgJdasrqv7snz50nRyN8FxK+Yq8tP3zOSUcM6jAA== X-Received: by 2002:a5d:544a:0:b0:290:7dfa:9582 with SMTP id w10-20020a5d544a000000b002907dfa9582mr12592307wrv.22.1672910132440; Thu, 05 Jan 2023 01:15:32 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:29 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang Subject: [PULL 23/51] virtio-mmio: add support for configure interrupt Message-ID: <20230105091310.263867-24-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911939356100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu Add configure interrupt support in virtio-mmio bus. add function to set configure guest notifier. Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-10-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-mmio.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index d240efef97..103260ec15 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -670,7 +670,30 @@ static int virtio_mmio_set_guest_notifier(DeviceState = *d, int n, bool assign, =20 return 0; } +static int virtio_mmio_set_config_guest_notifier(DeviceState *d, bool assi= gn, + bool with_irqfd) +{ + VirtIOMMIOProxy *proxy =3D VIRTIO_MMIO(d); + VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); + VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(vdev); + EventNotifier *notifier =3D virtio_config_get_guest_notifier(vdev); + int r =3D 0; =20 + if (assign) { + r =3D event_notifier_init(notifier, 0); + if (r < 0) { + return r; + } + virtio_config_set_guest_notifier_fd_handler(vdev, assign, with_irq= fd); + } else { + virtio_config_set_guest_notifier_fd_handler(vdev, assign, with_irq= fd); + event_notifier_cleanup(notifier); + } + if (vdc->guest_notifier_mask && vdev->use_guest_notifier_mask) { + vdc->guest_notifier_mask(vdev, VIRTIO_CONFIG_IRQ_IDX, !assign); + } + return r; +} static int virtio_mmio_set_guest_notifiers(DeviceState *d, int nvqs, bool assign) { @@ -692,6 +715,10 @@ static int virtio_mmio_set_guest_notifiers(DeviceState= *d, int nvqs, goto assign_error; } } + r =3D virtio_mmio_set_config_guest_notifier(d, assign, with_irqfd); + if (r < 0) { + goto assign_error; + } =20 return 0; =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672910750; cv=none; d=zohomail.com; s=zohoarc; b=TQPOPjNIL6+jMmw2190qMMORsuEYCOCaERhCnEQANyw2KniNYM1XH651F0dFn4IfjG8y+MoRSDTVXiZ+so2Ki1z63gUABEBrrhVhAUHnUBlt5fKbqI3v3qTlp4nXHwvTb0bFVNE/IiIiABpvrIQvv/Pc8IqyoSLEiaQxjxlgB1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910750; 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=/S4TuIzJ/MKxBFVR2orv4UpJ7fiW7dgwfl0+WMjr3gw=; b=BHT4aj6Zh+frrVBIrEHGTAy3t5ONZAjUVaDSHPvqJP1/ZunhdgP0ZvdkOweW5hmPfD6R+XZgqr2JqQHoWQ485w1Fd2v5GMEq806hsZ55mW7PcpcCAFYFtREbKTaNCAYcb2fxi5CmwmR3i7zz8WcLfzPZRI0QpbYdixtI6xxCfZU= 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 1672910750033811.8447796746261; Thu, 5 Jan 2023 01:25:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLk-0002Xf-NI; Thu, 05 Jan 2023 04:15:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLi-0002UA-95 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:46 -0500 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 1pDMLg-0007BH-94 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:46 -0500 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_128_GCM_SHA256) id us-mta-240-KzVL1gr8Pu-vaE2hJqCbEA-1; Thu, 05 Jan 2023 04:15:37 -0500 Received: by mail-wr1-f70.google.com with SMTP id i26-20020adfaada000000b0027c76c49445so3497637wrc.13 for ; Thu, 05 Jan 2023 01:15:36 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id g19-20020a05600c4ed300b003d978f8f255sm2371521wmq.27.2023.01.05.01.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910143; 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=/S4TuIzJ/MKxBFVR2orv4UpJ7fiW7dgwfl0+WMjr3gw=; b=X0Y23E/6Y4vVWqJYFhrQxkaJ7Bs7SkuRgT1FJOvxsci480j83gDijN2IovQdISgAj+pEJk XneZ2mzMi8EFKNGRrRYhK6fvDUeZWYyhkn5GI3j+BQUe/5mzCX9vbkldQCELOkQOlzSSMM OjOzqe0EH4VutAbhMRj6e5xrYOoi0iQ= X-MC-Unique: KzVL1gr8Pu-vaE2hJqCbEA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=/S4TuIzJ/MKxBFVR2orv4UpJ7fiW7dgwfl0+WMjr3gw=; b=AyAi+FZ+qTu5pZcX5JNAqA6VJmNRmX4oXEepqBHegKAgi1p8100h3L/DOEuzTZQ6Ed qBU32nGEtEuXtz3sYxDWlghjgxWWkhPeOrvIo/BsLAO54oEfslN5sM23fq90Rcmp3FHJ dsncbS5c3257E+LyHrV0D7/Vthbtlyr1sswTnygQTif4z3LeXbMC634mlaPJQN4cis7w cu7BKewrd+hNDnjYO7CaBhS9qQcKV833MiqHyUtkcPEJNeTfYcp6qPXF/OMG1NmKB4Nj E6om/t+lln7+Mif/jdzEzLxe5VSOjntldEK2tf2YZKISuPnsLrOpb0nZHcVKlE8pXRwy aYyQ== X-Gm-Message-State: AFqh2kqP5n3niVOeZGl38gtdZTrNeEPZ8loxidQni1vgGTffkPeNt/uo ASKoR7V/9pauLdBPr7eM9Gl6W91A3N2IrymrqaFu6gejwQvgEqeQAlfbKkzL0OE2hg7L+pzqrfG j+ROngPG30zIsPqca7XTihwgUCKpf4QoyIpOnFP7oTBSleSOrB0oXhjiDpVOU X-Received: by 2002:a05:600c:35ca:b0:3d1:f2de:195a with SMTP id r10-20020a05600c35ca00b003d1f2de195amr39013739wmq.32.1672910135412; Thu, 05 Jan 2023 01:15:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXvJdPA1qnYjsFivGVnItjVNrjcJorC78eqawMMXyvUBpWU+mVg70bjyOWCZqZ2Vs0s565GvuQ== X-Received: by 2002:a05:600c:35ca:b0:3d1:f2de:195a with SMTP id r10-20020a05600c35ca00b003d1f2de195amr39013719wmq.32.1672910135087; Thu, 05 Jan 2023 01:15:35 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:32 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Cindy Lu , Jason Wang Subject: [PULL 24/51] virtio-pci: add support for configure interrupt Message-ID: <20230105091310.263867-25-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910750668100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu Add process to handle the configure interrupt, The function's logic is the same with vq interrupt.Add extra process to check the configure interrupt Signed-off-by: Cindy Lu Message-Id: <20221222070451.936503-11-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-pci.h | 4 +- hw/virtio/virtio-pci.c | 118 +++++++++++++++++++++++++++------ 2 files changed, 102 insertions(+), 20 deletions(-) diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h index 24fba1604b..ab2051b64b 100644 --- a/include/hw/virtio/virtio-pci.h +++ b/include/hw/virtio/virtio-pci.h @@ -261,5 +261,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTyp= eInfo *t); * @fixed_queues. */ unsigned virtio_pci_optimal_num_queues(unsigned fixed_queues); - +void virtio_pci_set_guest_notifier_fd_handler(VirtIODevice *vdev, VirtQueu= e *vq, + int n, bool assign, + bool with_irqfd); #endif diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index d7e29b1cdc..7bc60fcf94 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -836,7 +836,8 @@ static int virtio_pci_get_notifier(VirtIOPCIProxy *prox= y, int queue_no, VirtQueue *vq; =20 if (queue_no =3D=3D VIRTIO_CONFIG_IRQ_IDX) { - return -1; + *n =3D virtio_config_get_guest_notifier(vdev); + *vector =3D vdev->config_vector; } else { if (!virtio_queue_get_num(vdev, queue_no)) { return -1; @@ -896,7 +897,7 @@ undo: } return ret; } -static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs) +static int kvm_virtio_pci_vector_vq_use(VirtIOPCIProxy *proxy, int nvqs) { int queue_no; int ret =3D 0; @@ -911,6 +912,10 @@ static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *p= roxy, int nvqs) return ret; } =20 +static int kvm_virtio_pci_vector_config_use(VirtIOPCIProxy *proxy) +{ + return kvm_virtio_pci_vector_use_one(proxy, VIRTIO_CONFIG_IRQ_IDX); +} =20 static void kvm_virtio_pci_vector_release_one(VirtIOPCIProxy *proxy, int queue_no) @@ -935,7 +940,7 @@ static void kvm_virtio_pci_vector_release_one(VirtIOPCI= Proxy *proxy, kvm_virtio_pci_vq_vector_release(proxy, vector); } =20 -static void kvm_virtio_pci_vector_release(VirtIOPCIProxy *proxy, int nvqs) +static void kvm_virtio_pci_vector_vq_release(VirtIOPCIProxy *proxy, int nv= qs) { int queue_no; VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); @@ -948,6 +953,11 @@ static void kvm_virtio_pci_vector_release(VirtIOPCIPro= xy *proxy, int nvqs) } } =20 +static void kvm_virtio_pci_vector_config_release(VirtIOPCIProxy *proxy) +{ + kvm_virtio_pci_vector_release_one(proxy, VIRTIO_CONFIG_IRQ_IDX); +} + static int virtio_pci_one_vector_unmask(VirtIOPCIProxy *proxy, unsigned int queue_no, unsigned int vector, @@ -1029,9 +1039,19 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, = unsigned vector, } vq =3D virtio_vector_next_queue(vq); } - + /* unmask config intr */ + if (vector =3D=3D vdev->config_vector) { + n =3D virtio_config_get_guest_notifier(vdev); + ret =3D virtio_pci_one_vector_unmask(proxy, VIRTIO_CONFIG_IRQ_IDX,= vector, + msg, n); + if (ret < 0) { + goto undo_config; + } + } return 0; - +undo_config: + n =3D virtio_config_get_guest_notifier(vdev); + virtio_pci_one_vector_mask(proxy, VIRTIO_CONFIG_IRQ_IDX, vector, n); undo: vq =3D virtio_vector_first_queue(vdev, vector); while (vq && unmasked >=3D 0) { @@ -1065,6 +1085,11 @@ static void virtio_pci_vector_mask(PCIDevice *dev, u= nsigned vector) } vq =3D virtio_vector_next_queue(vq); } + + if (vector =3D=3D vdev->config_vector) { + n =3D virtio_config_get_guest_notifier(vdev); + virtio_pci_one_vector_mask(proxy, VIRTIO_CONFIG_IRQ_IDX, vector, n= ); + } } =20 static void virtio_pci_vector_poll(PCIDevice *dev, @@ -1096,6 +1121,34 @@ static void virtio_pci_vector_poll(PCIDevice *dev, msix_set_pending(dev, vector); } } + /* poll the config intr */ + ret =3D virtio_pci_get_notifier(proxy, VIRTIO_CONFIG_IRQ_IDX, ¬ifie= r, + &vector); + if (ret < 0) { + return; + } + if (vector < vector_start || vector >=3D vector_end || + !msix_is_masked(dev, vector)) { + return; + } + if (k->guest_notifier_pending) { + if (k->guest_notifier_pending(vdev, VIRTIO_CONFIG_IRQ_IDX)) { + msix_set_pending(dev, vector); + } + } else if (event_notifier_test_and_clear(notifier)) { + msix_set_pending(dev, vector); + } +} + +void virtio_pci_set_guest_notifier_fd_handler(VirtIODevice *vdev, VirtQueu= e *vq, + int n, bool assign, + bool with_irqfd) +{ + if (n =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + virtio_config_set_guest_notifier_fd_handler(vdev, assign, with_irq= fd); + } else { + virtio_queue_set_guest_notifier_fd_handler(vq, assign, with_irqfd); + } } =20 static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assig= n, @@ -1104,17 +1157,25 @@ static int virtio_pci_set_guest_notifier(DeviceStat= e *d, int n, bool assign, VirtIOPCIProxy *proxy =3D to_virtio_pci_proxy(d); VirtIODevice *vdev =3D virtio_bus_get_device(&proxy->bus); VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(vdev); - VirtQueue *vq =3D virtio_get_queue(vdev, n); - EventNotifier *notifier =3D virtio_queue_get_guest_notifier(vq); + VirtQueue *vq =3D NULL; + EventNotifier *notifier =3D NULL; + + if (n =3D=3D VIRTIO_CONFIG_IRQ_IDX) { + notifier =3D virtio_config_get_guest_notifier(vdev); + } else { + vq =3D virtio_get_queue(vdev, n); + notifier =3D virtio_queue_get_guest_notifier(vq); + } =20 if (assign) { int r =3D event_notifier_init(notifier, 0); if (r < 0) { return r; } - virtio_queue_set_guest_notifier_fd_handler(vq, true, with_irqfd); + virtio_pci_set_guest_notifier_fd_handler(vdev, vq, n, true, with_i= rqfd); } else { - virtio_queue_set_guest_notifier_fd_handler(vq, false, with_irqfd); + virtio_pci_set_guest_notifier_fd_handler(vdev, vq, n, false, + with_irqfd); event_notifier_cleanup(notifier); } =20 @@ -1157,10 +1218,13 @@ static int virtio_pci_set_guest_notifiers(DeviceSta= te *d, int nvqs, bool assign) proxy->nvqs_with_notifiers =3D nvqs; =20 /* Must unset vector notifier while guest notifier is still assigned */ - if ((proxy->vector_irqfd || k->guest_notifier_mask) && !assign) { + if ((proxy->vector_irqfd || + (vdev->use_guest_notifier_mask && k->guest_notifier_mask)) && + !assign) { msix_unset_vector_notifiers(&proxy->pci_dev); if (proxy->vector_irqfd) { - kvm_virtio_pci_vector_release(proxy, nvqs); + kvm_virtio_pci_vector_vq_release(proxy, nvqs); + kvm_virtio_pci_vector_config_release(proxy); g_free(proxy->vector_irqfd); proxy->vector_irqfd =3D NULL; } @@ -1176,20 +1240,30 @@ static int virtio_pci_set_guest_notifiers(DeviceSta= te *d, int nvqs, bool assign) goto assign_error; } } - + r =3D virtio_pci_set_guest_notifier(d, VIRTIO_CONFIG_IRQ_IDX, assign, + with_irqfd); + if (r < 0) { + goto config_assign_error; + } /* Must set vector notifier after guest notifier has been assigned */ - if ((with_irqfd || k->guest_notifier_mask) && assign) { + if ((with_irqfd || + (vdev->use_guest_notifier_mask && k->guest_notifier_mask)) && + assign) { if (with_irqfd) { proxy->vector_irqfd =3D g_malloc0(sizeof(*proxy->vector_irqfd) * msix_nr_vectors_allocated(&proxy->pci_dev)); - r =3D kvm_virtio_pci_vector_use(proxy, nvqs); + r =3D kvm_virtio_pci_vector_vq_use(proxy, nvqs); if (r < 0) { - goto assign_error; + goto config_assign_error; + } + r =3D kvm_virtio_pci_vector_config_use(proxy); + if (r < 0) { + goto config_error; } } - r =3D msix_set_vector_notifiers(&proxy->pci_dev, - virtio_pci_vector_unmask, + + r =3D msix_set_vector_notifiers(&proxy->pci_dev, virtio_pci_vector= _unmask, virtio_pci_vector_mask, virtio_pci_vector_poll); if (r < 0) { @@ -1202,9 +1276,15 @@ static int virtio_pci_set_guest_notifiers(DeviceStat= e *d, int nvqs, bool assign) notifiers_error: if (with_irqfd) { assert(assign); - kvm_virtio_pci_vector_release(proxy, nvqs); + kvm_virtio_pci_vector_vq_release(proxy, nvqs); } - +config_error: + if (with_irqfd) { + kvm_virtio_pci_vector_config_release(proxy); + } +config_assign_error: + virtio_pci_set_guest_notifier(d, VIRTIO_CONFIG_IRQ_IDX, !assign, + with_irqfd); assign_error: /* We get here on assignment failure. Recover by undoing for VQs 0 .. = n. */ assert(assign); --=20 MST From nobody Wed May 15 07:51:38 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=1672910722; cv=none; d=zohomail.com; s=zohoarc; b=ccaECZLxU1DFhnNHmxJ2c5rjqRzucoFu5Nq6CEYCkU5SwiViQFGZ2/MvGVbnzgJssIj2FLVDik/AumDK9IgSbQKBkasjOyQh7Ilu+Tq+t24XtouWYmuUVkOYxWKHsLSh/kQYS/uyFFienn6e+7gQ5yAQYkQBVm3Bial+LxNEXYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910722; 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=gyeI9n00srHT95Wf05HcVdwfoBiIPp7caNy4o1qIx1E=; b=Lypt3GsC+2P9UetWsEs8MWcNWhjDzZq3W/F/h4+gBiEP89Jyhz2NU0tSzsVJI4VmhJmUxVMy8BGRbJXEqo3BlTJ2OMctn1kb8dHmM2KbX0qD3gDsNUD+B/ZA4mCMkCQssy0sU5MHBFjM9UNqnp95DIoHB0XfuMuX2/BP/vy0yNg= 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 1672910722201600.3603807736891; Thu, 5 Jan 2023 01:25:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLo-0002cg-FF; Thu, 05 Jan 2023 04:15:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLf-0002PP-Eq for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:43 -0500 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 1pDMLd-0007Ax-Ut for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:43 -0500 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_128_GCM_SHA256) id us-mta-246-NzLio1BAMIqyk9l9lA8vtA-1; Thu, 05 Jan 2023 04:15:39 -0500 Received: by mail-wr1-f69.google.com with SMTP id o14-20020adfa10e000000b002631c56fe26so4630492wro.1 for ; Thu, 05 Jan 2023 01:15:39 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id v16-20020a05600c445000b003c6c3fb3cf6sm1860155wmn.18.2023.01.05.01.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910141; 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=gyeI9n00srHT95Wf05HcVdwfoBiIPp7caNy4o1qIx1E=; b=CNlSQq/rwIm+sbeB+8c0d6bprV9b6sf9AeBJa4ptyd38QizEC5NnY6m+eTY+GUyrImDown +Xb4xqGShTz4b5OVEmbT1iBfQ1vlmEtC8gjRxf76h/TVvUDT6cfEgL/Ueos49vjwbLkPO4 9rYGc3Yy5JG3XVCYDLKKKo8Pxt5l/K8= X-MC-Unique: NzLio1BAMIqyk9l9lA8vtA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=gyeI9n00srHT95Wf05HcVdwfoBiIPp7caNy4o1qIx1E=; b=0PWtCBvRPC3ehh5TI30sE/XlcBuXlOde98+F5Zov/RBtd5I97gDpbPcLc7mA9Hp5M9 4Cvp+nSgBLUuLYnkxdgSEbdI8KL9W3GR5mhprYAtvRMtV4dpyb6jJglfNQGDe5Xby0h6 Eh1yhPCKmwHB4HUOXlfpNfkbUzFMBCZxvSiBf0+MG1QbvcUZFkyebz1M3TLBCan8GNum vOsG4oIt/B4DRuB3+BstD22HwXxaOXmIFsCmU/hQP4HRVuR2iw6M3EFPDSvU/JUFHX3e kk5EoVM5N73xoWoKRNk80clrbdw5EhXS5miuHDnUE8ibbEa8T9foCTPzIKS6/wraXCD5 lHrw== X-Gm-Message-State: AFqh2kpou8dCSntvUd3vhUQ8muWNZ+uHJVCbwxO7h4+00efAbBsec7e7 CSZe0xI1vhXc3NGobbmP07K9rBHl6dRaH2osrgbTOgAS28OrWbspouGM18NFg9u8oNkmjYOVUAF JNakqMI1fVit5RwbS3R9ljt3Ip6DiinoHV35l9JQ0/LSY/SQX5vrtw/iYT/rT X-Received: by 2002:a05:600c:4f55:b0:3cf:7197:e67c with SMTP id m21-20020a05600c4f5500b003cf7197e67cmr34440618wmq.25.1672910138227; Thu, 05 Jan 2023 01:15:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtTPQ88rC3LTzG01sihXMH6Qdx7o82vc5OyRFC0PJqRfx3hpEIBJ3rpnJk1YYxD7T5uAsqORA== X-Received: by 2002:a05:600c:4f55:b0:3cf:7197:e67c with SMTP id m21-20020a05600c4f5500b003cf7197e67cmr34440605wmq.25.1672910137952; Thu, 05 Jan 2023 01:15:37 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:35 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: [PULL 25/51] hw/virtio: Rename virtio_device_find() -> qmp_find_virtio_device() Message-ID: <20230105091310.263867-26-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910722737100001 From: Philippe Mathieu-Daud=C3=A9 To emphasize this function is QMP related, rename it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20221222080005.27616-2-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 6ff797e1cf..e08443e3bf 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3855,7 +3855,7 @@ VirtioInfoList *qmp_x_query_virtio(Error **errp) return list; } =20 -static VirtIODevice *virtio_device_find(const char *path) +static VirtIODevice *qmp_find_virtio_device(const char *path) { VirtIODevice *vdev; =20 @@ -3896,7 +3896,7 @@ VirtioStatus *qmp_x_query_virtio_status(const char *p= ath, Error **errp) VirtIODevice *vdev; VirtioStatus *status; =20 - vdev =3D virtio_device_find(path); + vdev =3D qmp_find_virtio_device(path); if (vdev =3D=3D NULL) { error_setg(errp, "Path %s is not a VirtIODevice", path); return NULL; @@ -3972,7 +3972,7 @@ VirtVhostQueueStatus *qmp_x_query_virtio_vhost_queue_= status(const char *path, VirtIODevice *vdev; VirtVhostQueueStatus *status; =20 - vdev =3D virtio_device_find(path); + vdev =3D qmp_find_virtio_device(path); if (vdev =3D=3D NULL) { error_setg(errp, "Path %s is not a VirtIODevice", path); return NULL; @@ -4016,7 +4016,7 @@ VirtQueueStatus *qmp_x_query_virtio_queue_status(cons= t char *path, VirtIODevice *vdev; VirtQueueStatus *status; =20 - vdev =3D virtio_device_find(path); + vdev =3D qmp_find_virtio_device(path); if (vdev =3D=3D NULL) { error_setg(errp, "Path %s is not a VirtIODevice", path); return NULL; @@ -4109,7 +4109,7 @@ VirtioQueueElement *qmp_x_query_virtio_queue_element(= const char *path, VirtQueue *vq; VirtioQueueElement *element =3D NULL; =20 - vdev =3D virtio_device_find(path); + vdev =3D qmp_find_virtio_device(path); if (vdev =3D=3D NULL) { error_setg(errp, "Path %s is not a VirtIO device", path); return NULL; --=20 MST From nobody Wed May 15 07:51:38 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=1672910228; cv=none; d=zohomail.com; s=zohoarc; b=ArUUX5SpXeB31OMMjVSzWyL/SbsHV9Ck74jgLAG5Y7DUJPlCkvrDsWTeO+ciaEvgDI0oUK8RWmWMXwZ1XcRat9iEWN0yVZJ9h7ZcMXvvvxpDzLTxPMYrPAGXtYeLE7aJev7HwkEwh8g0hz4zh6SymzGY/QTk0SMyAv7eN/Gao3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910228; 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=8rdjip+25b1dwiqpkqVWxqDvIT7eKP5F+F/OwUaW8Q0=; b=FuO7yC6EdOUtzNjYu49ZKGmAE+rGfDYVpeN3yBZzugXxtE6vcA4JPzigwGEfMcHmfPFfFeMGKgVW+SLs3yCO2VXNye0IhS0A6CLFjOLfLFze2DRhEtkaSZTyJltAqjP4aEtWEptbvkEZ6QSuMOLON8+4oUuu6zQuTpnUTTfJREU= 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 1672910228342876.6441011246767; Thu, 5 Jan 2023 01:17:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMLp-0002eM-B6; Thu, 05 Jan 2023 04:15:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLk-0002Wt-6r for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:48 -0500 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 1pDMLg-0007BT-SY for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:47 -0500 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_128_GCM_SHA256) id us-mta-170-te4Zt1DOPReUXqlICbzfOw-1; Thu, 05 Jan 2023 04:15:43 -0500 Received: by mail-wr1-f71.google.com with SMTP id g18-20020adfa492000000b0027174820fdbso4531335wrb.4 for ; Thu, 05 Jan 2023 01:15:42 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id g19-20020a05600c4ed300b003d978f8f255sm2371959wmq.27.2023.01.05.01.15.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910144; 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=8rdjip+25b1dwiqpkqVWxqDvIT7eKP5F+F/OwUaW8Q0=; b=O7veVVb437OnACdA0auaR1aDEI0cPvzGfexs4/cx+mPlpnAEFb1nxEkPsJGH8x10eIonDN +G4zhebAMDKDasX+IJZwSorEfZ/cKyL/wSpSlrkEDhfxKwBMcJHF/TvXVEoy1W1ZOBcKk0 NfuSSrf1IrThPZwFLCC1vNKThAr9HOQ= X-MC-Unique: te4Zt1DOPReUXqlICbzfOw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=8rdjip+25b1dwiqpkqVWxqDvIT7eKP5F+F/OwUaW8Q0=; b=njH5K6+9ymZjq2lSxWNCL3h5Dvd3Ni5PuAdyZYo1ArraBE6tt1wqRAChudokzJCQdP PR2ZsIgAhf5x5LaA5xTN7rcYRWyuHsQ5fF9oBUIc+3jH3Q27Gx5V6SuzAaGcOOFjdUQr Xp9TT4urqcj4uKrNi9n17vKsKvxoIOsoXGsSe/dkqSqpiZbCMTWeHDtTVLVktA2WzcZJ 9PJtWmwdgha3Mi1Qj9eolIdL4u/l3s7OR4qxPVtVO3fhPT9SOpd34ApJmLQJxVyDgVhN P+4hwNTmKp/DO932C7J68ewZuCT0X7gqkVp40DiFGzY8jZphyUnc+rbk/62Wuudzcp+w l4ow== X-Gm-Message-State: AFqh2krou5a6pOrK7rD5ySZ+gX+4+YxMioTBrIcqk03fwBqvDzzBncPy KHBTPK6apxFjKAgc0j+pmzADShr2a+rjeXfqcZ8neK7WZ2Ml7pggsfpuEcZBVjucMKHIqgep8Bp l141ycTIsjJMZXJV6lVbo1d9iHDAdWioobX6TDTO50hQ76a8gXp7/tyh2bfBR X-Received: by 2002:a05:600c:1ca5:b0:3d1:d746:7bca with SMTP id k37-20020a05600c1ca500b003d1d7467bcamr36003033wms.4.1672910141291; Thu, 05 Jan 2023 01:15:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvctaPvdiF1skO622aNTjIsQA8k9BhYPEj1U7Dyp8YL8oo3f+CqS6l3pdZ0Pi4TqVSTUvdEbA== X-Received: by 2002:a05:600c:1ca5:b0:3d1:d746:7bca with SMTP id k37-20020a05600c1ca500b003d1d7467bcamr36003012wms.4.1672910140932; Thu, 05 Jan 2023 01:15:40 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:38 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Jonah Palmer Subject: [PULL 26/51] hw/virtio: Extract QMP QOM-specific functions to virtio-qmp.c Message-ID: <20230105091310.263867-27-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910229712100001 From: Philippe Mathieu-Daud=C3=A9 virtio.c is big enough, extract more QMP related code to virtio-qmp.c. To do so, expose qmp_find_virtio_device() and declar virtio_list in the internal virtio-qmp.h header. Note we have to leave qmp_x_query_virtio_queue_status() and qmp_x_query_virtio_queue_element(), because they access VirtQueue internal fields, and VirtQueue is only declared within virtio.c. Suggested-by: Jonah Palmer Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20221222080005.27616-3-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-qmp.h | 9 ++ hw/virtio/virtio-qmp.c | 192 ++++++++++++++++++++++++++++++++++++++++- hw/virtio/virtio.c | 191 +--------------------------------------- 3 files changed, 201 insertions(+), 191 deletions(-) diff --git a/hw/virtio/virtio-qmp.h b/hw/virtio/virtio-qmp.h index 075fc27030..59681082e5 100644 --- a/hw/virtio/virtio-qmp.h +++ b/hw/virtio/virtio-qmp.h @@ -12,7 +12,16 @@ #define HW_VIRTIO_QMP_H =20 #include "qapi/qapi-types-virtio.h" +#include "hw/virtio/virtio.h" =20 +#include "qemu/queue.h" + +typedef QTAILQ_HEAD(QmpVirtIODeviceList, VirtIODevice) QmpVirtIODeviceList; + +/* QAPI list of realized VirtIODevices */ +extern QmpVirtIODeviceList virtio_list; + +VirtIODevice *qmp_find_virtio_device(const char *path); VirtioDeviceStatus *qmp_decode_status(uint8_t bitmap); VhostDeviceProtocols *qmp_decode_protocols(uint64_t bitmap); VirtioDeviceFeatures *qmp_decode_features(uint16_t device_id, uint64_t bit= map); diff --git a/hw/virtio/virtio-qmp.c b/hw/virtio/virtio-qmp.c index 8e7282658f..e4d4bece2d 100644 --- a/hw/virtio/virtio-qmp.c +++ b/hw/virtio/virtio-qmp.c @@ -10,9 +10,14 @@ */ =20 #include "qemu/osdep.h" -#include "hw/virtio/virtio.h" #include "virtio-qmp.h" =20 +#include "qapi/error.h" +#include "qapi/qapi-commands-virtio.h" +#include "qapi/qapi-commands-qom.h" +#include "qapi/qmp/qobject.h" +#include "qapi/qmp/qjson.h" + #include "standard-headers/linux/virtio_ids.h" #include "standard-headers/linux/vhost_types.h" #include "standard-headers/linux/virtio_blk.h" @@ -657,3 +662,188 @@ VirtioDeviceFeatures *qmp_decode_features(uint16_t de= vice_id, uint64_t bitmap) =20 return features; } + +VirtioInfoList *qmp_x_query_virtio(Error **errp) +{ + VirtioInfoList *list =3D NULL; + VirtioInfoList *node; + VirtIODevice *vdev; + + QTAILQ_FOREACH(vdev, &virtio_list, next) { + DeviceState *dev =3D DEVICE(vdev); + Error *err =3D NULL; + QObject *obj =3D qmp_qom_get(dev->canonical_path, "realized", &err= ); + + if (err =3D=3D NULL) { + GString *is_realized =3D qobject_to_json_pretty(obj, true); + /* virtio device is NOT realized, remove it from list */ + if (!strncmp(is_realized->str, "false", 4)) { + QTAILQ_REMOVE(&virtio_list, vdev, next); + } else { + node =3D g_new0(VirtioInfoList, 1); + node->value =3D g_new(VirtioInfo, 1); + node->value->path =3D g_strdup(dev->canonical_path); + node->value->name =3D g_strdup(vdev->name); + QAPI_LIST_PREPEND(list, node->value); + } + g_string_free(is_realized, true); + } + qobject_unref(obj); + } + + return list; +} + +VirtIODevice *qmp_find_virtio_device(const char *path) +{ + VirtIODevice *vdev; + + QTAILQ_FOREACH(vdev, &virtio_list, next) { + DeviceState *dev =3D DEVICE(vdev); + + if (strcmp(dev->canonical_path, path) !=3D 0) { + continue; + } + + Error *err =3D NULL; + QObject *obj =3D qmp_qom_get(dev->canonical_path, "realized", &err= ); + if (err =3D=3D NULL) { + GString *is_realized =3D qobject_to_json_pretty(obj, true); + /* virtio device is NOT realized, remove it from list */ + if (!strncmp(is_realized->str, "false", 4)) { + g_string_free(is_realized, true); + qobject_unref(obj); + QTAILQ_REMOVE(&virtio_list, vdev, next); + return NULL; + } + g_string_free(is_realized, true); + } else { + /* virtio device doesn't exist in QOM tree */ + QTAILQ_REMOVE(&virtio_list, vdev, next); + qobject_unref(obj); + return NULL; + } + /* device exists in QOM tree & is realized */ + qobject_unref(obj); + return vdev; + } + return NULL; +} + +VirtioStatus *qmp_x_query_virtio_status(const char *path, Error **errp) +{ + VirtIODevice *vdev; + VirtioStatus *status; + + vdev =3D qmp_find_virtio_device(path); + if (vdev =3D=3D NULL) { + error_setg(errp, "Path %s is not a VirtIODevice", path); + return NULL; + } + + status =3D g_new0(VirtioStatus, 1); + status->name =3D g_strdup(vdev->name); + status->device_id =3D vdev->device_id; + status->vhost_started =3D vdev->vhost_started; + status->guest_features =3D qmp_decode_features(vdev->device_id, + vdev->guest_features); + status->host_features =3D qmp_decode_features(vdev->device_id, + vdev->host_features); + status->backend_features =3D qmp_decode_features(vdev->device_id, + vdev->backend_features); + + switch (vdev->device_endian) { + case VIRTIO_DEVICE_ENDIAN_LITTLE: + status->device_endian =3D g_strdup("little"); + break; + case VIRTIO_DEVICE_ENDIAN_BIG: + status->device_endian =3D g_strdup("big"); + break; + default: + status->device_endian =3D g_strdup("unknown"); + break; + } + + status->num_vqs =3D virtio_get_num_queues(vdev); + status->status =3D qmp_decode_status(vdev->status); + status->isr =3D vdev->isr; + status->queue_sel =3D vdev->queue_sel; + status->vm_running =3D vdev->vm_running; + status->broken =3D vdev->broken; + status->disabled =3D vdev->disabled; + status->use_started =3D vdev->use_started; + status->started =3D vdev->started; + status->start_on_kick =3D vdev->start_on_kick; + status->disable_legacy_check =3D vdev->disable_legacy_check; + status->bus_name =3D g_strdup(vdev->bus_name); + status->use_guest_notifier_mask =3D vdev->use_guest_notifier_mask; + + if (vdev->vhost_started) { + VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(vdev); + struct vhost_dev *hdev =3D vdc->get_vhost(vdev); + + status->vhost_dev =3D g_new0(VhostStatus, 1); + status->vhost_dev->n_mem_sections =3D hdev->n_mem_sections; + status->vhost_dev->n_tmp_sections =3D hdev->n_tmp_sections; + status->vhost_dev->nvqs =3D hdev->nvqs; + status->vhost_dev->vq_index =3D hdev->vq_index; + status->vhost_dev->features =3D + qmp_decode_features(vdev->device_id, hdev->features); + status->vhost_dev->acked_features =3D + qmp_decode_features(vdev->device_id, hdev->acked_features); + status->vhost_dev->backend_features =3D + qmp_decode_features(vdev->device_id, hdev->backend_features); + status->vhost_dev->protocol_features =3D + qmp_decode_protocols(hdev->protocol_features); + status->vhost_dev->max_queues =3D hdev->max_queues; + status->vhost_dev->backend_cap =3D hdev->backend_cap; + status->vhost_dev->log_enabled =3D hdev->log_enabled; + status->vhost_dev->log_size =3D hdev->log_size; + } + + return status; +} + +VirtVhostQueueStatus *qmp_x_query_virtio_vhost_queue_status(const char *pa= th, + uint16_t queue, + Error **errp) +{ + VirtIODevice *vdev; + VirtVhostQueueStatus *status; + + vdev =3D qmp_find_virtio_device(path); + if (vdev =3D=3D NULL) { + error_setg(errp, "Path %s is not a VirtIODevice", path); + return NULL; + } + + if (!vdev->vhost_started) { + error_setg(errp, "Error: vhost device has not started yet"); + return NULL; + } + + VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(vdev); + struct vhost_dev *hdev =3D vdc->get_vhost(vdev); + + if (queue < hdev->vq_index || queue >=3D hdev->vq_index + hdev->nvqs) { + error_setg(errp, "Invalid vhost virtqueue number %d", queue); + return NULL; + } + + status =3D g_new0(VirtVhostQueueStatus, 1); + status->name =3D g_strdup(vdev->name); + status->kick =3D hdev->vqs[queue].kick; + status->call =3D hdev->vqs[queue].call; + status->desc =3D (uintptr_t)hdev->vqs[queue].desc; + status->avail =3D (uintptr_t)hdev->vqs[queue].avail; + status->used =3D (uintptr_t)hdev->vqs[queue].used; + status->num =3D hdev->vqs[queue].num; + status->desc_phys =3D hdev->vqs[queue].desc_phys; + status->desc_size =3D hdev->vqs[queue].desc_size; + status->avail_phys =3D hdev->vqs[queue].avail_phys; + status->avail_size =3D hdev->vqs[queue].avail_size; + status->used_phys =3D hdev->vqs[queue].used_phys; + status->used_size =3D hdev->vqs[queue].used_size; + + return status; +} diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index e08443e3bf..02a49d9fa1 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -13,10 +13,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qmp/qdict.h" #include "qapi/qapi-commands-virtio.h" -#include "qapi/qapi-commands-qom.h" -#include "qapi/qmp/qjson.h" #include "trace.h" #include "qemu/error-report.h" #include "qemu/log.h" @@ -47,8 +44,7 @@ #include "standard-headers/linux/virtio_mem.h" #include "standard-headers/linux/virtio_vsock.h" =20 -/* QAPI list of realized VirtIODevices */ -static QTAILQ_HEAD(, VirtIODevice) virtio_list; +QmpVirtIODeviceList virtio_list; =20 /* * Maximum size of virtio device config space @@ -3824,191 +3820,6 @@ bool virtio_device_ioeventfd_enabled(VirtIODevice *= vdev) return virtio_bus_ioeventfd_enabled(vbus); } =20 -VirtioInfoList *qmp_x_query_virtio(Error **errp) -{ - VirtioInfoList *list =3D NULL; - VirtioInfoList *node; - VirtIODevice *vdev; - - QTAILQ_FOREACH(vdev, &virtio_list, next) { - DeviceState *dev =3D DEVICE(vdev); - Error *err =3D NULL; - QObject *obj =3D qmp_qom_get(dev->canonical_path, "realized", &err= ); - - if (err =3D=3D NULL) { - GString *is_realized =3D qobject_to_json_pretty(obj, true); - /* virtio device is NOT realized, remove it from list */ - if (!strncmp(is_realized->str, "false", 4)) { - QTAILQ_REMOVE(&virtio_list, vdev, next); - } else { - node =3D g_new0(VirtioInfoList, 1); - node->value =3D g_new(VirtioInfo, 1); - node->value->path =3D g_strdup(dev->canonical_path); - node->value->name =3D g_strdup(vdev->name); - QAPI_LIST_PREPEND(list, node->value); - } - g_string_free(is_realized, true); - } - qobject_unref(obj); - } - - return list; -} - -static VirtIODevice *qmp_find_virtio_device(const char *path) -{ - VirtIODevice *vdev; - - QTAILQ_FOREACH(vdev, &virtio_list, next) { - DeviceState *dev =3D DEVICE(vdev); - - if (strcmp(dev->canonical_path, path) !=3D 0) { - continue; - } - - Error *err =3D NULL; - QObject *obj =3D qmp_qom_get(dev->canonical_path, "realized", &err= ); - if (err =3D=3D NULL) { - GString *is_realized =3D qobject_to_json_pretty(obj, true); - /* virtio device is NOT realized, remove it from list */ - if (!strncmp(is_realized->str, "false", 4)) { - g_string_free(is_realized, true); - qobject_unref(obj); - QTAILQ_REMOVE(&virtio_list, vdev, next); - return NULL; - } - g_string_free(is_realized, true); - } else { - /* virtio device doesn't exist in QOM tree */ - QTAILQ_REMOVE(&virtio_list, vdev, next); - qobject_unref(obj); - return NULL; - } - /* device exists in QOM tree & is realized */ - qobject_unref(obj); - return vdev; - } - return NULL; -} - -VirtioStatus *qmp_x_query_virtio_status(const char *path, Error **errp) -{ - VirtIODevice *vdev; - VirtioStatus *status; - - vdev =3D qmp_find_virtio_device(path); - if (vdev =3D=3D NULL) { - error_setg(errp, "Path %s is not a VirtIODevice", path); - return NULL; - } - - status =3D g_new0(VirtioStatus, 1); - status->name =3D g_strdup(vdev->name); - status->device_id =3D vdev->device_id; - status->vhost_started =3D vdev->vhost_started; - status->guest_features =3D qmp_decode_features(vdev->device_id, - vdev->guest_features); - status->host_features =3D qmp_decode_features(vdev->device_id, - vdev->host_features); - status->backend_features =3D qmp_decode_features(vdev->device_id, - vdev->backend_features); - - switch (vdev->device_endian) { - case VIRTIO_DEVICE_ENDIAN_LITTLE: - status->device_endian =3D g_strdup("little"); - break; - case VIRTIO_DEVICE_ENDIAN_BIG: - status->device_endian =3D g_strdup("big"); - break; - default: - status->device_endian =3D g_strdup("unknown"); - break; - } - - status->num_vqs =3D virtio_get_num_queues(vdev); - status->status =3D qmp_decode_status(vdev->status); - status->isr =3D vdev->isr; - status->queue_sel =3D vdev->queue_sel; - status->vm_running =3D vdev->vm_running; - status->broken =3D vdev->broken; - status->disabled =3D vdev->disabled; - status->use_started =3D vdev->use_started; - status->started =3D vdev->started; - status->start_on_kick =3D vdev->start_on_kick; - status->disable_legacy_check =3D vdev->disable_legacy_check; - status->bus_name =3D g_strdup(vdev->bus_name); - status->use_guest_notifier_mask =3D vdev->use_guest_notifier_mask; - - if (vdev->vhost_started) { - VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(vdev); - struct vhost_dev *hdev =3D vdc->get_vhost(vdev); - - status->vhost_dev =3D g_new0(VhostStatus, 1); - status->vhost_dev->n_mem_sections =3D hdev->n_mem_sections; - status->vhost_dev->n_tmp_sections =3D hdev->n_tmp_sections; - status->vhost_dev->nvqs =3D hdev->nvqs; - status->vhost_dev->vq_index =3D hdev->vq_index; - status->vhost_dev->features =3D - qmp_decode_features(vdev->device_id, hdev->features); - status->vhost_dev->acked_features =3D - qmp_decode_features(vdev->device_id, hdev->acked_features); - status->vhost_dev->backend_features =3D - qmp_decode_features(vdev->device_id, hdev->backend_features); - status->vhost_dev->protocol_features =3D - qmp_decode_protocols(hdev->protocol_features); - status->vhost_dev->max_queues =3D hdev->max_queues; - status->vhost_dev->backend_cap =3D hdev->backend_cap; - status->vhost_dev->log_enabled =3D hdev->log_enabled; - status->vhost_dev->log_size =3D hdev->log_size; - } - - return status; -} - -VirtVhostQueueStatus *qmp_x_query_virtio_vhost_queue_status(const char *pa= th, - uint16_t queue, - Error **errp) -{ - VirtIODevice *vdev; - VirtVhostQueueStatus *status; - - vdev =3D qmp_find_virtio_device(path); - if (vdev =3D=3D NULL) { - error_setg(errp, "Path %s is not a VirtIODevice", path); - return NULL; - } - - if (!vdev->vhost_started) { - error_setg(errp, "Error: vhost device has not started yet"); - return NULL; - } - - VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(vdev); - struct vhost_dev *hdev =3D vdc->get_vhost(vdev); - - if (queue < hdev->vq_index || queue >=3D hdev->vq_index + hdev->nvqs) { - error_setg(errp, "Invalid vhost virtqueue number %d", queue); - return NULL; - } - - status =3D g_new0(VirtVhostQueueStatus, 1); - status->name =3D g_strdup(vdev->name); - status->kick =3D hdev->vqs[queue].kick; - status->call =3D hdev->vqs[queue].call; - status->desc =3D (uintptr_t)hdev->vqs[queue].desc; - status->avail =3D (uintptr_t)hdev->vqs[queue].avail; - status->used =3D (uintptr_t)hdev->vqs[queue].used; - status->num =3D hdev->vqs[queue].num; - status->desc_phys =3D hdev->vqs[queue].desc_phys; - status->desc_size =3D hdev->vqs[queue].desc_size; - status->avail_phys =3D hdev->vqs[queue].avail_phys; - status->avail_size =3D hdev->vqs[queue].avail_size; - status->used_phys =3D hdev->vqs[queue].used_phys; - status->used_size =3D hdev->vqs[queue].used_size; - - return status; -} - VirtQueueStatus *qmp_x_query_virtio_queue_status(const char *path, uint16_t queue, Error **errp) --=20 MST From nobody Wed May 15 07:51:38 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=1672910191; cv=none; d=zohomail.com; s=zohoarc; b=L1QEInVuwluDawdp88PVj6aDcYuXAi/RSrnuyBfIE6JDTn7kAjPpivxcej30tTbRfIslfMFLoDYQqDq4abWVAn8TQsHKu2CE6TY1Ix6pOr6kPRvsGrL1TqTp6rxHmm9dJKZ0kY+9PKLqTRgVVoCRWzktnH+iYpUnuAzWrXXM1iM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910191; 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=WvJnFbsqNB85Ex5Jy9JWOBFwO+5P6BtsVC31mbY8Jko=; b=Ozl74ovAeSc2dkyWCwppoPkToUKb1KjuNv1z4MmZljo0q8qimkhsZiNecx7QepTS6UYHO600qjhLh6BHFM0IPmi0QlEmvvaVjM3CFSoZWMag28hJICtmKKlPpSLtNzL2+0U4141VUHiK5GViic437ndsVx9cQCVXqUHNm+Zlh9Q= 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 1672910191889297.5121473859898; Thu, 5 Jan 2023 01:16:31 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.471748.731722 (Exim 4.92) (envelope-from ) id 1pDMLt-0000fe-7K; Thu, 05 Jan 2023 09:15:57 +0000 Received: by outflank-mailman (output) from mailman id 471748.731722; Thu, 05 Jan 2023 09:15:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDMLt-0000fX-4W; Thu, 05 Jan 2023 09:15:57 +0000 Received: by outflank-mailman (input) for mailman id 471748; Thu, 05 Jan 2023 09:15:55 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDMLr-0000fR-GJ for xen-devel@lists.xenproject.org; Thu, 05 Jan 2023 09:15:55 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8cb48600-8cd9-11ed-b8d0-410ff93cb8f0; Thu, 05 Jan 2023 10:15:52 +0100 (CET) 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_128_GCM_SHA256) id us-mta-528-JEsIRH6WNHSAI5I6i2C_2w-1; Thu, 05 Jan 2023 04:15:48 -0500 Received: by mail-wm1-f70.google.com with SMTP id bd6-20020a05600c1f0600b003d96f7f2396so733188wmb.3 for ; Thu, 05 Jan 2023 01:15:47 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id ba13-20020a0560001c0d00b002a91572638csm2863835wrb.75.2023.01.05.01.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:45 -0800 (PST) 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: 8cb48600-8cd9-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910151; 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=WvJnFbsqNB85Ex5Jy9JWOBFwO+5P6BtsVC31mbY8Jko=; b=HGzcLJ606AZB/ucSA1nWJFKnp1HlzdqXu6SEDIXKCDKhXiTVK0xrq4KlRntjXb0/Bzwxfu FQ505qUj3nQ26ZKspbJwUtwJZH8zigoamnsR1gACilibxPWEOfvg1LAEoJPHpasYgXfVrE PX3cNW1H/Oij72e50RlgcFkegM5w45s= X-MC-Unique: JEsIRH6WNHSAI5I6i2C_2w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WvJnFbsqNB85Ex5Jy9JWOBFwO+5P6BtsVC31mbY8Jko=; b=qtM4et2NBL9rHncv9LHOc0I/G0cF0qsv9qH+yJNv3r0VV4Mpvnxd0Knn7OtT1wFYUf 2gpAarIXD6DNr4UtrTKC+s36eEpaHLA7tCddPEsayz86B/2eOQSMMq69xRzmmuf99KSB 7Xh1Fu/Im5QmIR0mzdwraxNNZMkYpbqzYH9aYR+y069NnyPxuQMcHlkaqUDidU5r5lwU FnO5SltrYVGOuLt0azgi5KSpWusSH6aq/jD7Ul4VRJ9V0beJHymBBQhLrkS6ybIgF42Z Q7ZChzJ0tPQalCEp5oyJbmx9boUPpfOesaBtmCQf0ztSlOqGsTyKydOveO/Wu6jEazlS V2GA== X-Gm-Message-State: AFqh2kquoTlnpfIvXgMNGM0SPY/BowL0Vxb8Ba2d4rxkw+4pvMgSnC8y 0BqGiBcHA2SXApVHsjdB6SsU8B2HAOo9rRfdO+PerbBWqBJLMnXDKSmpf4KtDLattSSYt5JXBjz 1GHKtscOtaCC7aDqnW/UIJ5MwwiA= X-Received: by 2002:a5d:63cb:0:b0:293:b54e:4f09 with SMTP id c11-20020a5d63cb000000b00293b54e4f09mr10584293wrw.4.1672910146658; Thu, 05 Jan 2023 01:15:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXtL7rkgthxuayEoRod50MDK5WIP+ZyW54cKv1y5T8C/qx/fxyUAvKbsu59WxqwvfyS7nCS0Gg== X-Received: by 2002:a5d:63cb:0:b0:293:b54e:4f09 with SMTP id c11-20020a5d63cb000000b00293b54e4f09mr10584279wrw.4.1672910146407; Thu, 05 Jan 2023 01:15:46 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:41 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Richard Henderson , Igor Mammedov , Ani Sinha , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , Yuval Shaia , Fam Zheng , Gerd Hoffmann , Stefano Stabellini , Anthony Perard , Paul Durrant , Ben Widawsky , Jonathan Cameron , Huacai Chen , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Jiaxun Yang , Andrey Smirnov , Xiaojuan Yang , Song Gao , =?utf-8?Q?C=C3=A9dric?= Le Goater , Paul Burton , Aleksandar Rikalo , xen-devel@lists.xenproject.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org Subject: [PULL 27/51] include/hw/pci: Break inclusion loop pci_bridge.h and cxl.h Message-ID: <20230105091310.263867-28-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: 1672910193546100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Markus Armbruster hw/pci/pci_bridge.h and hw/cxl/cxl.h include each other. Fortunately, breaking the loop is merely a matter of deleting unnecessary includes from headers, and adding them back in places where they are now missing. Signed-off-by: Markus Armbruster Message-Id: <20221222100330.380143-2-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/alpha/alpha_sys.h | 1 - hw/rdma/rdma_utils.h | 1 - hw/rdma/vmw/pvrdma.h | 1 - hw/usb/hcd-ehci.h | 1 - hw/xen/xen_pt.h | 1 - include/hw/cxl/cxl.h | 1 - include/hw/cxl/cxl_cdat.h | 1 + include/hw/cxl/cxl_device.h | 1 + include/hw/cxl/cxl_pci.h | 2 -- include/hw/i386/ich9.h | 4 ---- include/hw/i386/x86-iommu.h | 1 - include/hw/isa/vt82c686.h | 1 - include/hw/pci-host/designware.h | 3 --- include/hw/pci-host/i440fx.h | 2 +- include/hw/pci-host/ls7a.h | 2 -- include/hw/pci-host/pnv_phb3.h | 2 -- include/hw/pci-host/pnv_phb4.h | 3 +-- include/hw/pci-host/xilinx-pcie.h | 1 - include/hw/pci/pcie.h | 1 - include/hw/virtio/virtio-scsi.h | 1 - hw/alpha/pci.c | 1 + hw/alpha/typhoon.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/pci-bridge/i82801b11.c | 2 +- hw/rdma/rdma_utils.c | 1 + hw/scsi/virtio-scsi.c | 1 + 26 files changed, 10 insertions(+), 30 deletions(-) diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h index 2263e821da..a303c58438 100644 --- a/hw/alpha/alpha_sys.h +++ b/hw/alpha/alpha_sys.h @@ -5,7 +5,6 @@ =20 #include "target/alpha/cpu-qom.h" #include "hw/pci/pci.h" -#include "hw/pci/pci_host.h" #include "hw/boards.h" #include "hw/intc/i8259.h" =20 diff --git a/hw/rdma/rdma_utils.h b/hw/rdma/rdma_utils.h index 0c6414e7e0..54e4f56edd 100644 --- a/hw/rdma/rdma_utils.h +++ b/hw/rdma/rdma_utils.h @@ -18,7 +18,6 @@ #define RDMA_UTILS_H =20 #include "qemu/error-report.h" -#include "hw/pci/pci.h" #include "sysemu/dma.h" =20 #define rdma_error_report(fmt, ...) \ diff --git a/hw/rdma/vmw/pvrdma.h b/hw/rdma/vmw/pvrdma.h index d08965d3e2..0caf95ede8 100644 --- a/hw/rdma/vmw/pvrdma.h +++ b/hw/rdma/vmw/pvrdma.h @@ -18,7 +18,6 @@ =20 #include "qemu/units.h" #include "qemu/notify.h" -#include "hw/pci/pci.h" #include "hw/pci/msix.h" #include "chardev/char-fe.h" #include "hw/net/vmxnet3_defs.h" diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index a173707d9b..4d4b2830b7 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -23,7 +23,6 @@ #include "sysemu/dma.h" #include "hw/pci/pci.h" #include "hw/sysbus.h" -#include "qom/object.h" =20 #ifndef EHCI_DEBUG #define EHCI_DEBUG 0 diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index e7c4316a7d..cf10fc7bbf 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -2,7 +2,6 @@ #define XEN_PT_H =20 #include "hw/xen/xen_common.h" -#include "hw/pci/pci.h" #include "xen-host-pci-device.h" #include "qom/object.h" =20 diff --git a/include/hw/cxl/cxl.h b/include/hw/cxl/cxl.h index 38e0e271d5..5129557bee 100644 --- a/include/hw/cxl/cxl.h +++ b/include/hw/cxl/cxl.h @@ -13,7 +13,6 @@ =20 #include "qapi/qapi-types-machine.h" #include "qapi/qapi-visit-machine.h" -#include "hw/pci/pci_bridge.h" #include "hw/pci/pci_host.h" #include "cxl_pci.h" #include "cxl_component.h" diff --git a/include/hw/cxl/cxl_cdat.h b/include/hw/cxl/cxl_cdat.h index e9eda00142..7f67638685 100644 --- a/include/hw/cxl/cxl_cdat.h +++ b/include/hw/cxl/cxl_cdat.h @@ -11,6 +11,7 @@ #define CXL_CDAT_H =20 #include "hw/cxl/cxl_pci.h" +#include "hw/pci/pcie_doe.h" =20 /* * Reference: diff --git a/include/hw/cxl/cxl_device.h b/include/hw/cxl/cxl_device.h index 449b0edfe9..fd475b947b 100644 --- a/include/hw/cxl/cxl_device.h +++ b/include/hw/cxl/cxl_device.h @@ -10,6 +10,7 @@ #ifndef CXL_DEVICE_H #define CXL_DEVICE_H =20 +#include "hw/pci/pci.h" #include "hw/register.h" =20 /* diff --git a/include/hw/cxl/cxl_pci.h b/include/hw/cxl/cxl_pci.h index 3cb79eca1e..aca14845ab 100644 --- a/include/hw/cxl/cxl_pci.h +++ b/include/hw/cxl/cxl_pci.h @@ -11,8 +11,6 @@ #define CXL_PCI_H =20 #include "qemu/compiler.h" -#include "hw/pci/pci.h" -#include "hw/pci/pcie.h" #include "hw/cxl/cxl_cdat.h" =20 #define CXL_VENDOR_ID 0x1e98 diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 23ee8e371b..222781e8b9 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -5,12 +5,8 @@ #include "hw/sysbus.h" #include "hw/i386/pc.h" #include "hw/isa/apm.h" -#include "hw/pci/pci.h" -#include "hw/pci/pcie_host.h" -#include "hw/pci/pci_bridge.h" #include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" -#include "hw/pci/pci_bus.h" #include "qom/object.h" =20 void ich9_lpc_set_irq(void *opaque, int irq_num, int level); diff --git a/include/hw/i386/x86-iommu.h b/include/hw/i386/x86-iommu.h index 7637edb430..8d8d53b18b 100644 --- a/include/hw/i386/x86-iommu.h +++ b/include/hw/i386/x86-iommu.h @@ -21,7 +21,6 @@ #define HW_I386_X86_IOMMU_H =20 #include "hw/sysbus.h" -#include "hw/pci/pci.h" #include "hw/pci/msi.h" #include "qom/object.h" =20 diff --git a/include/hw/isa/vt82c686.h b/include/hw/isa/vt82c686.h index eaa07881c5..e273cd38dc 100644 --- a/include/hw/isa/vt82c686.h +++ b/include/hw/isa/vt82c686.h @@ -1,7 +1,6 @@ #ifndef HW_VT82C686_H #define HW_VT82C686_H =20 -#include "hw/pci/pci.h" =20 #define TYPE_VT82C686B_ISA "vt82c686b-isa" #define TYPE_VT82C686B_USB_UHCI "vt82c686b-usb-uhci" diff --git a/include/hw/pci-host/designware.h b/include/hw/pci-host/designw= are.h index 6d9b51ae67..908f3d946b 100644 --- a/include/hw/pci-host/designware.h +++ b/include/hw/pci-host/designware.h @@ -22,9 +22,6 @@ #define DESIGNWARE_H =20 #include "hw/sysbus.h" -#include "hw/pci/pci.h" -#include "hw/pci/pci_bus.h" -#include "hw/pci/pcie_host.h" #include "hw/pci/pci_bridge.h" #include "qom/object.h" =20 diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index d02bf1ed6b..fc93e22732 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -11,7 +11,7 @@ #ifndef HW_PCI_I440FX_H #define HW_PCI_I440FX_H =20 -#include "hw/pci/pci_bus.h" +#include "hw/pci/pci.h" #include "hw/pci-host/pam.h" #include "qom/object.h" =20 diff --git a/include/hw/pci-host/ls7a.h b/include/hw/pci-host/ls7a.h index df7fa55a30..b27db8e2ca 100644 --- a/include/hw/pci-host/ls7a.h +++ b/include/hw/pci-host/ls7a.h @@ -8,8 +8,6 @@ #ifndef HW_LS7A_H #define HW_LS7A_H =20 -#include "hw/pci/pci.h" -#include "hw/pci/pcie_host.h" #include "hw/pci-host/pam.h" #include "qemu/units.h" #include "qemu/range.h" diff --git a/include/hw/pci-host/pnv_phb3.h b/include/hw/pci-host/pnv_phb3.h index 4854f6d2f6..f791ebda9b 100644 --- a/include/hw/pci-host/pnv_phb3.h +++ b/include/hw/pci-host/pnv_phb3.h @@ -10,8 +10,6 @@ #ifndef PCI_HOST_PNV_PHB3_H #define PCI_HOST_PNV_PHB3_H =20 -#include "hw/pci/pcie_host.h" -#include "hw/pci/pcie_port.h" #include "hw/ppc/xics.h" #include "qom/object.h" #include "hw/pci-host/pnv_phb.h" diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 50d4faa001..d9cea3f952 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -10,8 +10,7 @@ #ifndef PCI_HOST_PNV_PHB4_H #define PCI_HOST_PNV_PHB4_H =20 -#include "hw/pci/pcie_host.h" -#include "hw/pci/pcie_port.h" +#include "hw/pci/pci_bus.h" #include "hw/ppc/xive.h" #include "qom/object.h" =20 diff --git a/include/hw/pci-host/xilinx-pcie.h b/include/hw/pci-host/xilinx= -pcie.h index 89be88d87f..e1b3c1c280 100644 --- a/include/hw/pci-host/xilinx-pcie.h +++ b/include/hw/pci-host/xilinx-pcie.h @@ -21,7 +21,6 @@ #define HW_XILINX_PCIE_H =20 #include "hw/sysbus.h" -#include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pcie_host.h" #include "qom/object.h" diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index 698d3de851..798a262a0a 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -26,7 +26,6 @@ #include "hw/pci/pcie_aer.h" #include "hw/pci/pcie_sriov.h" #include "hw/hotplug.h" -#include "hw/pci/pcie_doe.h" =20 typedef enum { /* for attention and power indicator */ diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scs= i.h index a36aad9c86..37b75e15e3 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -20,7 +20,6 @@ #define VIRTIO_SCSI_SENSE_SIZE 0 #include "standard-headers/linux/virtio_scsi.h" #include "hw/virtio/virtio.h" -#include "hw/pci/pci.h" #include "hw/scsi/scsi.h" #include "chardev/char-fe.h" #include "sysemu/iothread.h" diff --git a/hw/alpha/pci.c b/hw/alpha/pci.c index 72251fcdf0..7c18297177 100644 --- a/hw/alpha/pci.c +++ b/hw/alpha/pci.c @@ -7,6 +7,7 @@ */ =20 #include "qemu/osdep.h" +#include "hw/pci/pci_host.h" #include "alpha_sys.h" #include "qemu/log.h" #include "trace.h" diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index bd39c8ca86..49a80550c5 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -10,10 +10,10 @@ #include "qemu/module.h" #include "qemu/units.h" #include "qapi/error.h" +#include "hw/pci/pci_host.h" #include "cpu.h" #include "hw/irq.h" #include "alpha_sys.h" -#include "qom/object.h" =20 =20 #define TYPE_TYPHOON_PCI_HOST_BRIDGE "typhoon-pcihost" diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index aa15b11cde..127c4e2d50 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -27,7 +27,7 @@ #include "acpi-common.h" #include "qemu/bitmap.h" #include "qemu/error-report.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_bridge.h" #include "hw/cxl/cxl.h" #include "hw/core/cpu.h" #include "target/i386/cpu.h" diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c index d9f224818b..f3b4a14611 100644 --- a/hw/pci-bridge/i82801b11.c +++ b/hw/pci-bridge/i82801b11.c @@ -42,7 +42,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_bridge.h" #include "migration/vmstate.h" #include "qemu/module.h" #include "hw/i386/ich9.h" diff --git a/hw/rdma/rdma_utils.c b/hw/rdma/rdma_utils.c index 5a7ef63ad2..77008552f4 100644 --- a/hw/rdma/rdma_utils.c +++ b/hw/rdma/rdma_utils.c @@ -14,6 +14,7 @@ */ =20 #include "qemu/osdep.h" +#include "hw/pci/pci.h" #include "trace.h" #include "rdma_utils.h" =20 diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 6f6e2e32ba..2b649ca976 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -22,6 +22,7 @@ #include "qemu/iov.h" #include "qemu/module.h" #include "sysemu/block-backend.h" +#include "sysemu/dma.h" #include "hw/qdev-properties.h" #include "hw/scsi/scsi.h" #include "scsi/constants.h" --=20 MST From nobody Wed May 15 07:51:38 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=1672911294; cv=none; d=zohomail.com; s=zohoarc; b=EXUyfA5CzHkJqqMDyRPJOtHtWq0vOtpHvHF8LJ8gg6rY3r+x8YxjAllNBFbq/tya0iKsLEXqCtR1Mf/nvf59ylMT1KucaByEwl5zKqbR+i79m92rokqd9Z/E+3UQquXEYYKs3nv7f4dogfw3+EfRtpxo+sRCkbQuXL3HDp4EWjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911294; 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=nxGdrdwQae8hDG8cOVhv322TfPtg6lEqDQKrYnjbzdQ=; b=XVJqAmj2ooi7+3GB9Y1vxJrRW9q8bF2f01aLOkHtCVBuHQjC7jQhyARP4PU/utEGErm9b3RJ6BOJ8D74WD0SZy6tZC25CmEvMbqO89k4gjynamhXi/Ps75PLfd6am5yx9c2feCifEUNFIulNTdBhNfQfdLy1SEvI8qYXiOWKwhs= 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 1672911294518341.33520835903335; Thu, 5 Jan 2023 01:34:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMRf-0000J5-63; Thu, 05 Jan 2023 04:21:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMRc-0000FO-R7 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:21:53 -0500 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 1pDMRb-0002qG-3m for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:21:52 -0500 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_128_GCM_SHA256) id us-mta-187-xUmXMWrMOe2gXlYkZtmNeA-1; Thu, 05 Jan 2023 04:21:46 -0500 Received: by mail-wm1-f72.google.com with SMTP id k20-20020a05600c1c9400b003d9717c8b11so17476327wms.7 for ; Thu, 05 Jan 2023 01:21:46 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id r7-20020a05600c458700b003c6b7f5567csm6716579wmo.0.2023.01.05.01.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:21:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910510; 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=nxGdrdwQae8hDG8cOVhv322TfPtg6lEqDQKrYnjbzdQ=; b=TywzSDEVM+ppgDm4gCa5L9gaGbklZ1vD33/qTpHWPr1WieZTbeA2hi+crfz50Zvi4hxUUk 1XFdATICh8psk0692W6D08tDnQJghvM5CskuI+XoqAXAayMW4XXatnHWx2M4B9I56NnPFP okNL9zcJJ7m076sl88+Q11lhhsTxO+8= X-MC-Unique: xUmXMWrMOe2gXlYkZtmNeA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=nxGdrdwQae8hDG8cOVhv322TfPtg6lEqDQKrYnjbzdQ=; b=ODue2Qk5y4j1B3MUKIY/4ETbJAZjTiwj+riJ7KwlX3t0jd4U/ZCSIPj5IqBrqNsVLw uBZZtOwWJAk1/rmWJyeNpM7hsgCIfQJuVo/u1WOuXzGKN0xei2iOg21FvcjNsgpiINtW +iMKX66MF6VtjXVJra2VJPcS/KXht9pzrZSTal7cej8tul1Auzvlgc/BoWSNPnWTKlnd xETIaymIZC+73YobWf9+O8wZyb0u+ke+R1l5MhD24XuvUd0LiNj42OY1xt9hmD7Q+1F/ kG1Fvrq2uu92ZTP4+yDP/8vNAAJdSoQv92OGK8KVy2a7WngtBMrKbg5GMYdrcelK6oDJ cCKQ== X-Gm-Message-State: AFqh2kqtvCHutvvLtwa7Z2PCaB2EMSOPrQxg/9TiWjypQKMTSjTenHZN ENfeF6VoF2iK9XblrbzGj0AJKrY4m92BNJuMSzdjA6NyAdQ3OxWU7RKxfVe6EZKtCT0nfBovHVv nIr/Rg0IosphuYjwQQn9/iPneM2e5YF31/rHir17L3LnqbEyWdKxawptS+YF0 X-Received: by 2002:a05:600c:1e1e:b0:3d2:3b4d:d619 with SMTP id ay30-20020a05600c1e1e00b003d23b4dd619mr35660963wmb.15.1672910505119; Thu, 05 Jan 2023 01:21:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXub5bYaExI715GwwLCTLhWLETan/SMh2z3TIXT2WQ5hJdKmdDtIwd/tXxl91MQ7y2hjtBEphA== X-Received: by 2002:a05:600c:1e1e:b0:3d2:3b4d:d619 with SMTP id ay30-20020a05600c1e1e00b003d23b4dd619mr35660949wmb.15.1672910504863; Thu, 05 Jan 2023 01:21:44 -0800 (PST) Date: Thu, 5 Jan 2023 04:21:42 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Marcel Apfelbaum , Ben Widawsky , Jonathan Cameron Subject: [PULL 28/51] include/hw/cxl: Move typedef PXBDev to cxl.h, and put it to use Message-ID: <20230105091310.263867-29-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911295350100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Markus Armbruster hw/cxl/cxl.h uses the PXBDev structure tag instead of the typedef name. The typedef name is defined in hw/pci/pci_bridge.h. Its inclusion was dropped in the previous commit to break an inclusion loop. Move the typedef to hw/cxl/cxl.h, and use it there. Delete an extra typedef in hw/pci-bridge/pci_expander_bridge.c. Signed-off-by: Markus Armbruster Message-Id: <20221222100330.380143-3-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/cxl/cxl.h | 4 +++- include/hw/pci/pci_bridge.h | 1 - hw/pci-bridge/pci_expander_bridge.c | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/cxl/cxl.h b/include/hw/cxl/cxl.h index 5129557bee..b161be59b7 100644 --- a/include/hw/cxl/cxl.h +++ b/include/hw/cxl/cxl.h @@ -23,10 +23,12 @@ =20 #define CXL_WINDOW_MAX 10 =20 +typedef struct PXBDev PXBDev; + typedef struct CXLFixedWindow { uint64_t size; char **targets; - struct PXBDev *target_hbs[8]; + PXBDev *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 ca6caf487e..58a3fb0c2c 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -97,7 +97,6 @@ struct PXBDev { } cxl; }; =20 -typedef struct PXBDev PXBDev; #define TYPE_PXB_CXL_DEVICE "pxb-cxl" DECLARE_INSTANCE_CHECKER(PXBDev, PXB_CXL_DEV, TYPE_PXB_CXL_DEVICE) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index c9e817aa58..870d9bab11 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -50,7 +50,6 @@ struct PXBBus { }; =20 #define TYPE_PXB_DEVICE "pxb" -typedef struct PXBDev PXBDev; DECLARE_INSTANCE_CHECKER(PXBDev, PXB_DEV, TYPE_PXB_DEVICE) =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672910453; cv=none; d=zohomail.com; s=zohoarc; b=E1nIMX4XfylIRtiiMjv29XSa5A29B1cCXZXSBh9ZD0ylODy+JK8OQd1ejsoLpBz9cEV6KsaugMQg/5QXdNVbKpLqo0BbdyUwuvfgPqyhH4kKzBSVbCE7fp7aaeQDqzBeGGzRRWmJeGaVtVWsyBJHKLBoiZrCRlBlpbWAd12q5ec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910453; 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=G4hrXMd4rDUPal0M2TeW9Ma+sAaS0nVkSbNj4tpH6/8=; b=euPScnAfiGUvoO4aaFqcVC4WjMArq5dRfP6thBFjR873EUc3qw2+dssZWmGrOUhtUMCee7UNKHa4upOxxrgjoeHU61mJPfFI2PwVQOJDqEVA7PIvGIYDO2o99so14O4iwubscDISDmSuLR8+2/QmGxu5D1uY+SSqJfWo/rN5La0= 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 16729104538561021.874742377028; Thu, 5 Jan 2023 01:20:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMI-0003AF-GA; Thu, 05 Jan 2023 04:16:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMM1-0002uQ-1L for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:06 -0500 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 1pDMLy-0007Qu-K4 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:03 -0500 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_128_GCM_SHA256) id us-mta-592-lncqDwu7MaSYcW5vAS6sgA-1; Thu, 05 Jan 2023 04:15:54 -0500 Received: by mail-wr1-f72.google.com with SMTP id v4-20020adfa1c4000000b002753317406aso3915825wrv.21 for ; Thu, 05 Jan 2023 01:15:53 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id r13-20020adfa14d000000b002779dab8d85sm32840182wrr.8.2023.01.05.01.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910161; 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=G4hrXMd4rDUPal0M2TeW9Ma+sAaS0nVkSbNj4tpH6/8=; b=KCKCSXZEQcuBytfogY1QqM0vbeipQ0vdgdr1RX1bjjTNVCsSiH5s8cRCihsJx3UfqhT3Qi 4VyetFgPnBvn1AHtpC4thgMBng5CeZzjOpL4DsLPEA9MO0EVUN37V/gXwrzRWgWmdahPbZ ND3WexFAH0vJ9fJzahlQoFoYUEaxbUE= X-MC-Unique: lncqDwu7MaSYcW5vAS6sgA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=G4hrXMd4rDUPal0M2TeW9Ma+sAaS0nVkSbNj4tpH6/8=; b=U6goBWHuSuzkxTJPB4ACpDlxn8Wa3YVHBAvGFNXydMlLaj07GhILrtDET90VbTCVYv O5hxVyMTTYfurRNkdby4O7SZfIVx2EjckhHgf85MeGYbUW2GwcD4PK/2j9LkoOOju3Zq AUMnLVev2aI4ItUfCdvx8JwJpRJ+pfdARI0318eQxeLPD6855wmI3P/p9taDfS8U8rwP aHfS1XjqrdjLSitu0lIhdc/9z5YWEbTeWl7ncyH7Mz3ZgNTq3tW4qrCRmTopwRwBt61Q lfQGfy17kpGQqU5107vTxFGgD44biDGecHCv3WfNuzD+r7sb37eJ5Go6ywDFBdsysZlG lbgA== X-Gm-Message-State: AFqh2konzJUF33phxZp7uG5FlQxoqz+83Lbcw7/b7afZoMwstdZvtNIB +cij4QGpiLq407Eu/bkwcWX1FNyRa2c0yQU4sjr/iQw6Ogn02DdQz5xtebaJ5hBEchWgwF1jz6e LyJ9cJZejRjxrK/JDJlsf1HKvlD0RqRoLrA/42Tmp/ESM5n1tfId6XtQ0x7WD X-Received: by 2002:a05:6000:16c3:b0:28f:9b3d:c294 with SMTP id h3-20020a05600016c300b0028f9b3dc294mr15105273wrf.46.1672910152560; Thu, 05 Jan 2023 01:15:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXvt0jyUvvjnQzs2pshw8SiePx3C0HCEtnzHZ6upTSE/RcZvIcv1UTkNIC6CElX31XPdR972Aw== X-Received: by 2002:a05:6000:16c3:b0:28f:9b3d:c294 with SMTP id h3-20020a05600016c300b0028f9b3dc294mr15105260wrf.46.1672910152308; Thu, 05 Jan 2023 01:15:52 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:49 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Jonathan Cameron , Ben Widawsky Subject: [PULL 29/51] include/hw/cxl: Include hw/cxl/*.h where needed Message-ID: <20230105091310.263867-30-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910455378100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Markus Armbruster hw/cxl/cxl_component.h needs CDATObject from hw/cxl/cxl_cdat.h. hw/cxl/cxl_device.h needs CXLComponentState from hw/cxl/cxl_component.h. Signed-off-by: Markus Armbruster Acked-by: Jonathan Cameron Message-Id: <20221222100330.380143-4-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/cxl/cxl_component.h | 1 + include/hw/cxl/cxl_device.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h index 34075cfb72..5dca21e95b 100644 --- a/include/hw/cxl/cxl_component.h +++ b/include/hw/cxl/cxl_component.h @@ -18,6 +18,7 @@ #include "qemu/compiler.h" #include "qemu/range.h" #include "qemu/typedefs.h" +#include "hw/cxl/cxl_cdat.h" #include "hw/register.h" #include "qapi/error.h" =20 diff --git a/include/hw/cxl/cxl_device.h b/include/hw/cxl/cxl_device.h index fd475b947b..3f91969db0 100644 --- a/include/hw/cxl/cxl_device.h +++ b/include/hw/cxl/cxl_device.h @@ -10,6 +10,7 @@ #ifndef CXL_DEVICE_H #define CXL_DEVICE_H =20 +#include "hw/cxl/cxl_component.h" #include "hw/pci/pci.h" #include "hw/register.h" =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672910967; cv=none; d=zohomail.com; s=zohoarc; b=HCYf4+spjilJBiFmcvEwhvwNEGv45aS6AHI3lvDqGZVjQfzmYAC9uc41c19t5SFzsMelqVWo3rHuSMFriL2Ey8ojnKBmRGJJdls+0GuKa2lKzLXjNsYe5z21jzH6TpnBQ2SQDueKA0Vv69NGmhqs90SeBBwkXvh2uwijpDhD184= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910967; 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=66nQmgCzgyTcX+lgKs/BtGyYgun47XDZ8ZsgQt4qE64=; b=Ks9A4WQmqfcj+s1HsufY0ANMR6TG8/SQnlxIlAE6NGAZVCixU7AuClO8PaZbuHpB4o1dGLokpMdLkuFnXhLyOp46dZ4BPRYZyr2vOUXUFnIz947ST26qoviR7XWYPiGe5Qxb/PEqN46angYq6WPel4vWgWrf7wVBOfm7HaLy0uI= 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 1672910967447610.7944488952025; Thu, 5 Jan 2023 01:29:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMH-00036A-DH; Thu, 05 Jan 2023 04:16:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMLv-0002or-SN for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:02 -0500 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 1pDMLu-0007QK-Cs for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:15:59 -0500 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_128_GCM_SHA256) id us-mta-644-8CkOSClKMWinvn9muVQExw-1; Thu, 05 Jan 2023 04:15:56 -0500 Received: by mail-wr1-f69.google.com with SMTP id s3-20020adf9783000000b002ab389f64c1so532781wrb.22 for ; Thu, 05 Jan 2023 01:15:56 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id i3-20020a1c5403000000b003cf5ec79bf9sm1744568wmb.40.2023.01.05.01.15.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:15:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910157; 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=66nQmgCzgyTcX+lgKs/BtGyYgun47XDZ8ZsgQt4qE64=; b=diNbE4gxyl+DUrn/dENGaBNKfSNhoHtb8JHau0NIbtaC8AchLUoBBvGkAv4auuNLhIBOXQ 5lHbTEZFcwzzD8xTkPVE9ardcG+cTwm1xKBfJvzj021bNrnJFpS4gEoh+MvrtrlQs7byiS qHe7ZFVRWLjm9SZYt4LafN6jxoJziJk= X-MC-Unique: 8CkOSClKMWinvn9muVQExw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=66nQmgCzgyTcX+lgKs/BtGyYgun47XDZ8ZsgQt4qE64=; b=dgcXWrtdNYQ5lxKd3pEr/GmvA2xoY6qsVkUlhPS7ly1E1VUmNG328DYl5LV23bhysd 2f/wgcG2OKS5i2MyBYJDZ4NrFFPvLh8LXrP+4CQioLzPv1XU/hGMuUWCo9tZPRSHB1KC AXEiFVo6z16jM5Ezo2gATIt0goggFKXchNJ26wSTFaCGjbqz46+E2ZctQdCVCCpqPz/B a2Ayt8rYUu/nQwpvITpIFV+jJKjKR47tVHeyiv1U04mVOcXqwzVX+LbVuaH4B6g/RB3q m1yTPSJd92mKX8+ionDvuP8qhegkJjDrKQCfjmqWDjOT6S0QxFCSggb3ScKpzejFj+c0 +ojg== X-Gm-Message-State: AFqh2koC24fw3Lv0Cukx9dq4rTwc2GgGlgAw0lf+8nQMv8ICn/oIcZb4 VzEe0pg4JF7z2ygbSFaL0ycRTXrqVxCZ+pPd3objNcDR77Pq1MWqSmephfIyeLtqcTsU2Rtw6eH DOmKjSRDhqrGxv7m7PGhPlwamhY/aJ3ZBQ1J3J68QKeQiBxWYry13OLrptdWD X-Received: by 2002:a05:600c:1503:b0:3d0:8722:a145 with SMTP id b3-20020a05600c150300b003d08722a145mr34673992wmg.40.1672910155300; Thu, 05 Jan 2023 01:15:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXt6ZFhoks+vR3dYRJEbrZWGmOWleJoI1flL0jso8gxb1JgWMrCQtcfm0KW7VtCWxT3DISIyhQ== X-Received: by 2002:a05:600c:1503:b0:3d0:8722:a145 with SMTP id b3-20020a05600c150300b003d08722a145mr34673977wmg.40.1672910154991; Thu, 05 Jan 2023 01:15:54 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:52 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Marcel Apfelbaum Subject: [PULL 30/51] include/hw/pci: Clean up a few things checkpatch.pl would flag Message-ID: <20230105091310.263867-31-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910967731100003 From: Markus Armbruster Fix a few style violations so that checkpatch.pl won't complain when I move this code. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20221222100330.380143-5-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pci.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 954f260f84..5ca2a9df58 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -284,8 +284,10 @@ struct PCIDevice { /* PCI config space */ uint8_t *config; =20 - /* Used to enable config checks on load. Note that writable bits are - * never checked even if set in cmask. */ + /* + * Used to enable config checks on load. Note that writable bits are + * never checked even if set in cmask. + */ uint8_t *cmask; =20 /* Used to implement R/W bytes */ @@ -299,10 +301,11 @@ struct PCIDevice { =20 /* the following fields are read only */ int32_t devfn; - /* Cached device to fetch requester ID from, to avoid the PCI - * tree walking every time we invoke PCI request (e.g., - * MSI). For conventional PCI root complex, this field is - * meaningless. */ + /* + * Cached device to fetch requester ID from, to avoid the PCI tree + * walking every time we invoke PCI request (e.g., MSI). For + * conventional PCI root complex, this field is meaningless. + */ PCIReqIDCache requester_id_cache; char name[64]; PCIIORegion io_regions[PCI_NUM_REGIONS]; @@ -943,7 +946,7 @@ extern const VMStateDescription vmstate_pci_device; .name =3D (stringify(_field)), \ .size =3D sizeof(PCIDevice), \ .vmsd =3D &vmstate_pci_device, \ - .flags =3D VMS_STRUCT|VMS_POINTER, \ + .flags =3D VMS_STRUCT | VMS_POINTER, \ .offset =3D vmstate_offset_pointer(_state, _field, PCIDevice), \ } =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672910204; cv=none; d=zohomail.com; s=zohoarc; b=O6xbwaSLCxvTPspXgcvFfGYax9nwfRwciy69c9Fy4xphKbf3pJFDdE9un5J4C7ZLMFCXMwAWZ4GXiVl7O0+iZngAgXd+vdZ4M1f5SLQipLyts++4pa8lI8WAp6i2qBX3nMhfsdKdNJ0LIHeaGIndkUuJkS6gNJ2PATJs2uTPmUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910204; 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=9E0uGbaHWSARDpwjIvxsxquPxCSk2QGI6Ma+Y/5MGDY=; b=GruGU02vQRsEV2PbZ8x1HC2Ykn0HzvJuKoWs/uEP4fgwCchCiOzAK9PBEkiBUkFRGkkQj7L3WWyrGXkmuy/a8Xz6ZHY12sKb1jTbIbAHBaS62EwvsLZ80S5ny8RKsz0iZmiwT3h7BkSn7D4yFduBq2rWSblPfKXYsINRMDFVyUI= 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 1672910204431743.791283424644; Thu, 5 Jan 2023 01:16:44 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.471749.731733 (Exim 4.92) (envelope-from ) id 1pDMMC-00011z-FI; Thu, 05 Jan 2023 09:16:16 +0000 Received: by outflank-mailman (output) from mailman id 471749.731733; Thu, 05 Jan 2023 09:16:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDMMC-00011s-CH; Thu, 05 Jan 2023 09:16:16 +0000 Received: by outflank-mailman (input) for mailman id 471749; Thu, 05 Jan 2023 09:16:15 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pDMMA-0000fR-OH for xen-devel@lists.xenproject.org; Thu, 05 Jan 2023 09:16:15 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 977c9566-8cd9-11ed-b8d0-410ff93cb8f0; Thu, 05 Jan 2023 10:16:10 +0100 (CET) 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_128_GCM_SHA256) id us-mta-190-4sSTT-oqNt-XxeRmToRbUw-1; Thu, 05 Jan 2023 04:16:07 -0500 Received: by mail-wm1-f70.google.com with SMTP id c23-20020a7bc857000000b003d97c8d4935so15190818wml.8 for ; Thu, 05 Jan 2023 01:16:07 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id g41-20020a05600c4ca900b003cfd0bd8c0asm1541324wmp.30.2023.01.05.01.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:04 -0800 (PST) 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: 977c9566-8cd9-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910169; 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=9E0uGbaHWSARDpwjIvxsxquPxCSk2QGI6Ma+Y/5MGDY=; b=OwnTmi68GSJuI4G7MsG6R8JuxBfwFMowpHaa+4inKJc3c05jbHtQw0UscNKWxSAVnCRS+0 V+f1Srh9j0MvRE3gwVwlio4QGGTlst9ClHncIKhHutI1mmaAJXwyCK9pie5mvcwoRI9+PB AjtLQxp6goMwXOfVOzVxhFDCJeZdxrI= X-MC-Unique: 4sSTT-oqNt-XxeRmToRbUw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=9E0uGbaHWSARDpwjIvxsxquPxCSk2QGI6Ma+Y/5MGDY=; b=7/nMtyW0wSGa2lhuXYUFgcmf1RWAaynhcA2V1IQfnfIR/2JGAMEdwQU6erXavZPyyy hCj1NQ0dFv5acKz7VNK2JFuEvYLsjYNreFOW4q92Y5gXbTXWGyjnnypEX5YXwotDjZjM Jj03V6u25GGJTPAOu5lEZNELrGavpEJbkUXxjQtzTzJbCB0aYy/VLAVLsI9CBCrvaXUC rTJJ219yjOAm4h5+ZxlV3XNe5rEfLda1xasYFebBMn1VHUYu1IeyeqEYCGuWct01t7pM 52h92gbunLR5NyLLxSl0FnNFsXjwYaI4zjhjtQBlakJ3/BENWdCPTyr5WoZNWTNwY3VX z5WQ== X-Gm-Message-State: AFqh2krhZusXrtSlmZAq5vcySSGhDJTvP17Rssd/GV69TN68X+pAFq9B VsJ/9GP6Twd0+K9CWl6tJ6Rb7QfDRbrDUFEbjSvul+r3fWMD02bsHy04QxkmAxXcvqO0KCv40/O QXe0NhHMhKy8HbbdTc6da3Nr+X0g= X-Received: by 2002:a05:600c:44d4:b0:3cf:7925:7a3 with SMTP id f20-20020a05600c44d400b003cf792507a3mr35414326wmo.24.1672910165830; Thu, 05 Jan 2023 01:16:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXtomsIn8w+yG1vNX43EiWLehS044MzumjQUALNU2pfPKqSwYO6JSwdk86MB9u4hPAZrggu7uA== X-Received: by 2002:a05:600c:44d4:b0:3cf:7925:7a3 with SMTP id f20-20020a05600c44d400b003cf792507a3mr35414200wmo.24.1672910164789; Thu, 05 Jan 2023 01:16:04 -0800 (PST) Date: Thu, 5 Jan 2023 04:15:55 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Igor Mammedov , Ani Sinha , Gerd Hoffmann , Paolo Bonzini , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= , Eduardo Habkost , BALATON Zoltan , Stefano Stabellini , Anthony Perard , Paul Durrant , Richard Henderson , Marcel Apfelbaum , John Snow , Alberto Garcia , Corey Minyard , =?utf-8?B?SGVydsOp?= Poussineau , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Aurelien Jarno , Pavel Pisa , Vikram Garhwal , Jason Wang , Dmitry Fleytman , Stefan Weil , Jiri Pirko , Sven Schnelle , Keith Busch , Klaus Jensen , Huacai Chen , Jiaxun Yang , Helge Deller , Mark Cave-Ayland , Yoshinori Sato , Magnus Damm , Daniel Henrique Barboza , =?utf-8?Q?C=C3=A9dric?= Le Goater , David Gibson , Greg Kurz , Yuval Shaia , Matthew Rosato , Eric Farman , David Hildenbrand , Ilya Leoshkevich , Halil Pasic , Christian Borntraeger , Thomas Huth , Fam Zheng , Alex Williamson , Beniamino Galvani , Ben Widawsky , Jonathan Cameron , Elena Ufimtseva , Jagannathan Raman , John G Johnson , Bin Meng , Alexander Bulekov , Bandan Das , Stefan Hajnoczi , Darren Kenny , Qiuhao Li , Laurent Vivier , qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-s390x@nongnu.org Subject: [PULL 31/51] include/hw/pci: Split pci_device.h off pci.h Message-ID: <20230105091310.263867-32-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: 1672910205619100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Markus Armbruster PCIDeviceClass and PCIDevice are defined in pci.h. Many users of the header don't actually need them. Similar structs live in their own headers: PCIBusClass and PCIBus in pci_bus.h, PCIBridge in pci_bridge.h, PCIHostBridgeClass and PCIHostState in pci_host.h, PCIExpressHost in pcie_host.h, and PCIERootPortClass, PCIEPort, and PCIESlot in pcie_port.h. Move PCIDeviceClass and PCIDeviceClass to new pci_device.h, along with the code that needs them. Adjust include directives. This also enables the next commit. Signed-off-by: Markus Armbruster Message-Id: <20221222100330.380143-6-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/display/ati_int.h | 2 +- hw/display/qxl.h | 3 +- hw/ide/ahci_internal.h | 2 +- hw/net/vmxnet3_defs.h | 2 +- hw/nvme/nvme.h | 2 +- hw/rdma/vmw/pvrdma.h | 1 + hw/scsi/mptsas.h | 2 +- hw/usb/hcd-ehci.h | 2 +- hw/usb/hcd-uhci.h | 2 +- hw/usb/hcd-xhci-pci.h | 1 + hw/vfio/pci.h | 2 +- include/hw/acpi/piix4.h | 2 +- include/hw/arm/allwinner-a10.h | 1 + include/hw/cxl/cxl_device.h | 2 +- include/hw/ide/pci.h | 2 +- include/hw/misc/macio/macio.h | 2 +- include/hw/pci-host/gpex.h | 2 +- include/hw/pci-host/i440fx.h | 2 +- include/hw/pci-host/q35.h | 2 +- include/hw/pci-host/sabre.h | 2 +- include/hw/pci/msi.h | 2 +- include/hw/pci/pci.h | 344 ------------------------------ include/hw/pci/pci_bridge.h | 2 +- include/hw/pci/pci_device.h | 350 +++++++++++++++++++++++++++++++ include/hw/pci/pcie_port.h | 1 + include/hw/pci/shpc.h | 2 +- include/hw/remote/iohub.h | 2 +- include/hw/remote/proxy.h | 2 +- include/hw/sd/sdhci.h | 2 +- include/hw/southbridge/piix.h | 3 +- include/hw/xen/xen_common.h | 2 +- hw/acpi/erst.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/via-ac97.c | 2 +- hw/char/serial-pci-multi.c | 2 +- hw/char/serial-pci.c | 2 +- hw/core/qdev-properties-system.c | 1 + hw/display/bochs-display.c | 2 +- hw/display/cirrus_vga.c | 2 +- hw/display/sm501.c | 2 +- hw/display/vga-pci.c | 2 +- hw/display/vmware_vga.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ipack/tpci200.c | 2 +- hw/ipmi/pci_ipmi_bt.c | 2 +- hw/ipmi/pci_ipmi_kcs.c | 2 +- hw/isa/i82378.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/misc/pci-testdev.c | 2 +- hw/misc/pvpanic-pci.c | 2 +- hw/net/can/can_kvaser_pci.c | 2 +- hw/net/can/can_mioe3680_pci.c | 2 +- hw/net/can/can_pcm3680_pci.c | 2 +- hw/net/can/ctucan_pci.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000x_common.c | 2 +- hw/net/eepro100.c | 2 +- hw/net/ne2000-pci.c | 2 +- hw/net/net_tx_pkt.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rocker/rocker_desc.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/sungem.c | 2 +- hw/net/sunhme.c | 2 +- hw/net/tulip.c | 2 +- hw/net/virtio-net.c | 2 +- hw/pci-host/bonito.c | 2 +- hw/pci-host/dino.c | 2 +- hw/pci-host/grackle.c | 2 +- hw/pci-host/mv64361.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/raven.c | 2 +- hw/pci-host/sh_pci.c | 2 +- hw/pci-host/uninorth.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci/pci-hmp-cmds.c | 1 + hw/pci/pcie_host.c | 2 +- hw/pci/pcie_sriov.c | 2 +- hw/pci/slotid_cap.c | 2 +- hw/ppc/ppc440_pcix.c | 2 +- hw/ppc/ppc4xx_pci.c | 2 +- hw/ppc/spapr_pci_vfio.c | 1 + hw/rdma/rdma_utils.c | 2 +- hw/s390x/s390-pci-inst.c | 1 + hw/scsi/esp-pci.c | 2 +- hw/scsi/lsi53c895a.c | 2 +- hw/smbios/smbios.c | 1 + hw/usb/hcd-ohci-pci.c | 2 +- hw/watchdog/wdt_i6300esb.c | 2 +- tests/qtest/fuzz/generic_fuzz.c | 1 + ui/util.c | 2 +- 93 files changed, 441 insertions(+), 427 deletions(-) create mode 100644 include/hw/pci/pci_device.h diff --git a/hw/display/ati_int.h b/hw/display/ati_int.h index 8acb9c7466..e8d3c7af75 100644 --- a/hw/display/ati_int.h +++ b/hw/display/ati_int.h @@ -10,7 +10,7 @@ #define ATI_INT_H =20 #include "qemu/timer.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/i2c/bitbang_i2c.h" #include "vga_int.h" #include "qom/object.h" diff --git a/hw/display/qxl.h b/hw/display/qxl.h index 7894bd5134..cd82c7a6fe 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -1,8 +1,7 @@ #ifndef HW_QXL_H #define HW_QXL_H =20 - -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "vga_int.h" #include "qemu/thread.h" =20 diff --git a/hw/ide/ahci_internal.h b/hw/ide/ahci_internal.h index 109de9e2d1..303fcd7235 100644 --- a/hw/ide/ahci_internal.h +++ b/hw/ide/ahci_internal.h @@ -26,7 +26,7 @@ =20 #include "hw/ide/ahci.h" #include "hw/ide/internal.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" =20 #define AHCI_MEM_BAR_SIZE 0x1000 #define AHCI_MAX_PORTS 32 diff --git a/hw/net/vmxnet3_defs.h b/hw/net/vmxnet3_defs.h index 71440509ca..64034af6d5 100644 --- a/hw/net/vmxnet3_defs.h +++ b/hw/net/vmxnet3_defs.h @@ -19,7 +19,7 @@ =20 #include "net/net.h" #include "hw/net/vmxnet3.h" -#include "qom/object.h" +#include "hw/pci/pci_device.h" =20 #define TYPE_VMXNET3 "vmxnet3" typedef struct VMXNET3State VMXNET3State; diff --git a/hw/nvme/nvme.h b/hw/nvme/nvme.h index 7adf042ec3..16da27a69b 100644 --- a/hw/nvme/nvme.h +++ b/hw/nvme/nvme.h @@ -19,7 +19,7 @@ #define HW_NVME_NVME_H =20 #include "qemu/uuid.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/block/block.h" =20 #include "block/nvme.h" diff --git a/hw/rdma/vmw/pvrdma.h b/hw/rdma/vmw/pvrdma.h index 0caf95ede8..4cbc10c980 100644 --- a/hw/rdma/vmw/pvrdma.h +++ b/hw/rdma/vmw/pvrdma.h @@ -19,6 +19,7 @@ #include "qemu/units.h" #include "qemu/notify.h" #include "hw/pci/msix.h" +#include "hw/pci/pci_device.h" #include "chardev/char-fe.h" #include "hw/net/vmxnet3_defs.h" =20 diff --git a/hw/scsi/mptsas.h b/hw/scsi/mptsas.h index c046497db7..04e97ce3af 100644 --- a/hw/scsi/mptsas.h +++ b/hw/scsi/mptsas.h @@ -2,7 +2,7 @@ #define MPTSAS_H =20 #include "mpi.h" -#include "qom/object.h" +#include "hw/pci/pci_device.h" =20 #define MPTSAS_NUM_PORTS 8 #define MPTSAS_MAX_FRAMES 2048 /* Firmware limit at 65535 */ diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index 4d4b2830b7..2cd821f49e 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -21,7 +21,7 @@ #include "qemu/timer.h" #include "hw/usb.h" #include "sysemu/dma.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/sysbus.h" =20 #ifndef EHCI_DEBUG diff --git a/hw/usb/hcd-uhci.h b/hw/usb/hcd-uhci.h index c85ab7868e..5843af504a 100644 --- a/hw/usb/hcd-uhci.h +++ b/hw/usb/hcd-uhci.h @@ -30,7 +30,7 @@ =20 #include "exec/memory.h" #include "qemu/timer.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/usb.h" =20 typedef struct UHCIQueue UHCIQueue; diff --git a/hw/usb/hcd-xhci-pci.h b/hw/usb/hcd-xhci-pci.h index c193f79443..08f70ce97c 100644 --- a/hw/usb/hcd-xhci-pci.h +++ b/hw/usb/hcd-xhci-pci.h @@ -24,6 +24,7 @@ #ifndef HW_USB_HCD_XHCI_PCI_H #define HW_USB_HCD_XHCI_PCI_H =20 +#include "hw/pci/pci_device.h" #include "hw/usb.h" #include "hcd-xhci.h" =20 diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h index 7c236a52f4..177abcc8fb 100644 --- a/hw/vfio/pci.h +++ b/hw/vfio/pci.h @@ -13,7 +13,7 @@ #define HW_VFIO_VFIO_PCI_H =20 #include "exec/memory.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/vfio/vfio-common.h" #include "qemu/event_notifier.h" #include "qemu/queue.h" diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index 32686a75c5..be1f8ea80e 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -22,7 +22,7 @@ #ifndef HW_ACPI_PIIX4_H #define HW_ACPI_PIIX4_H =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/acpi/acpi.h" #include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/memory_hotplug.h" diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index a76dc7b84d..f9240ffa64 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -4,6 +4,7 @@ #include "qemu/error-report.h" #include "hw/char/serial.h" #include "hw/arm/boot.h" +#include "hw/pci/pci_device.h" #include "hw/timer/allwinner-a10-pit.h" #include "hw/intc/allwinner-a10-pic.h" #include "hw/net/allwinner_emac.h" diff --git a/include/hw/cxl/cxl_device.h b/include/hw/cxl/cxl_device.h index 3f91969db0..250adf18b2 100644 --- a/include/hw/cxl/cxl_device.h +++ b/include/hw/cxl/cxl_device.h @@ -11,7 +11,7 @@ #define CXL_DEVICE_H =20 #include "hw/cxl/cxl_component.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/register.h" =20 /* diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index d8384e1c42..2a6284acac 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -2,7 +2,7 @@ #define HW_IDE_PCI_H =20 #include "hw/ide/internal.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qom/object.h" =20 #define BM_STATUS_DMAING 0x01 diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h index 95d30a1745..86df2c2b60 100644 --- a/include/hw/misc/macio/macio.h +++ b/include/hw/misc/macio/macio.h @@ -27,7 +27,7 @@ #define MACIO_H =20 #include "hw/char/escc.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/ide/internal.h" #include "hw/intc/heathrow_pic.h" #include "hw/misc/macio/cuda.h" diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index fcf8b63820..b0240bd768 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -22,7 +22,7 @@ =20 #include "exec/hwaddr.h" #include "hw/sysbus.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pcie_host.h" #include "qom/object.h" =20 diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index fc93e22732..bf57216c78 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -11,7 +11,7 @@ #ifndef HW_PCI_I440FX_H #define HW_PCI_I440FX_H =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci-host/pam.h" #include "qom/object.h" =20 diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h index ab989698ef..e89329c51e 100644 --- a/include/hw/pci-host/q35.h +++ b/include/hw/pci-host/q35.h @@ -22,7 +22,7 @@ #ifndef HW_Q35_H #define HW_Q35_H =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pcie_host.h" #include "hw/pci-host/pam.h" #include "qemu/units.h" diff --git a/include/hw/pci-host/sabre.h b/include/hw/pci-host/sabre.h index 01190241bb..d12de84ea2 100644 --- a/include/hw/pci-host/sabre.h +++ b/include/hw/pci-host/sabre.h @@ -1,7 +1,7 @@ #ifndef HW_PCI_HOST_SABRE_H #define HW_PCI_HOST_SABRE_H =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "hw/sparc/sun4u_iommu.h" #include "qom/object.h" diff --git a/include/hw/pci/msi.h b/include/hw/pci/msi.h index 58aa576215..ee8ee469a6 100644 --- a/include/hw/pci/msi.h +++ b/include/hw/pci/msi.h @@ -21,7 +21,7 @@ #ifndef QEMU_MSI_H #define QEMU_MSI_H =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" =20 struct MSIMessage { uint64_t address; diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 5ca2a9df58..7048a373d1 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -166,7 +166,6 @@ enum { #define QEMU_PCI_VGA_IO_HI_SIZE 0x20 =20 #include "hw/pci/pci_regs.h" -#include "hw/pci/pcie.h" =20 /* PCI HEADER_TYPE */ #define PCI_HEADER_TYPE_MULTI_FUNCTION 0x80 @@ -210,23 +209,6 @@ enum { QEMU_PCIE_CAP_CXL =3D (1 << QEMU_PCIE_CXL_BITNR), }; =20 -#define TYPE_PCI_DEVICE "pci-device" -typedef struct PCIDeviceClass PCIDeviceClass; -DECLARE_OBJ_CHECKERS(PCIDevice, PCIDeviceClass, - PCI_DEVICE, TYPE_PCI_DEVICE) - -/* - * Implemented by devices that can be plugged on CXL buses. In the spec, t= his is - * actually a "CXL Component, but we name it device to match the PCI namin= g. - */ -#define INTERFACE_CXL_DEVICE "cxl-device" - -/* Implemented by devices that can be plugged on PCI Express buses */ -#define INTERFACE_PCIE_DEVICE "pci-express-device" - -/* Implemented by devices that can be plugged on Conventional PCI buses */ -#define INTERFACE_CONVENTIONAL_PCI_DEVICE "conventional-pci-device" - typedef struct PCIINTxRoute { enum { PCI_INTX_ENABLED, @@ -236,24 +218,6 @@ typedef struct PCIINTxRoute { int irq; } PCIINTxRoute; =20 -struct PCIDeviceClass { - DeviceClass parent_class; - - void (*realize)(PCIDevice *dev, Error **errp); - PCIUnregisterFunc *exit; - PCIConfigReadFunc *config_read; - PCIConfigWriteFunc *config_write; - - uint16_t vendor_id; - uint16_t device_id; - uint8_t revision; - uint16_t class_id; - uint16_t subsystem_vendor_id; /* only for header type =3D 0 */ - uint16_t subsystem_id; /* only for header type =3D 0 */ - - const char *romfile; /* rom bar */ -}; - typedef void (*PCIINTxRoutingNotifier)(PCIDevice *dev); typedef int (*MSIVectorUseNotifier)(PCIDevice *dev, unsigned int vector, MSIMessage msg); @@ -262,129 +226,6 @@ typedef void (*MSIVectorPollNotifier)(PCIDevice *dev, unsigned int vector_start, unsigned int vector_end); =20 -enum PCIReqIDType { - PCI_REQ_ID_INVALID =3D 0, - PCI_REQ_ID_BDF, - PCI_REQ_ID_SECONDARY_BUS, - PCI_REQ_ID_MAX, -}; -typedef enum PCIReqIDType PCIReqIDType; - -struct PCIReqIDCache { - PCIDevice *dev; - PCIReqIDType type; -}; -typedef struct PCIReqIDCache PCIReqIDCache; - -struct PCIDevice { - DeviceState qdev; - bool partially_hotplugged; - bool has_power; - - /* PCI config space */ - uint8_t *config; - - /* - * Used to enable config checks on load. Note that writable bits are - * never checked even if set in cmask. - */ - uint8_t *cmask; - - /* Used to implement R/W bytes */ - uint8_t *wmask; - - /* Used to implement RW1C(Write 1 to Clear) bytes */ - uint8_t *w1cmask; - - /* Used to allocate config space for capabilities. */ - uint8_t *used; - - /* the following fields are read only */ - int32_t devfn; - /* - * Cached device to fetch requester ID from, to avoid the PCI tree - * walking every time we invoke PCI request (e.g., MSI). For - * conventional PCI root complex, this field is meaningless. - */ - PCIReqIDCache requester_id_cache; - char name[64]; - PCIIORegion io_regions[PCI_NUM_REGIONS]; - AddressSpace bus_master_as; - MemoryRegion bus_master_container_region; - MemoryRegion bus_master_enable_region; - - /* do not access the following fields */ - PCIConfigReadFunc *config_read; - PCIConfigWriteFunc *config_write; - - /* Legacy PCI VGA regions */ - MemoryRegion *vga_regions[QEMU_PCI_VGA_NUM_REGIONS]; - bool has_vga; - - /* Current IRQ levels. Used internally by the generic PCI code. */ - uint8_t irq_state; - - /* Capability bits */ - uint32_t cap_present; - - /* Offset of MSI-X capability in config space */ - uint8_t msix_cap; - - /* MSI-X entries */ - int msix_entries_nr; - - /* Space to store MSIX table & pending bit array */ - uint8_t *msix_table; - uint8_t *msix_pba; - - /* May be used by INTx or MSI during interrupt notification */ - void *irq_opaque; - - MSITriggerFunc *msi_trigger; - MSIPrepareMessageFunc *msi_prepare_message; - MSIxPrepareMessageFunc *msix_prepare_message; - - /* MemoryRegion container for msix exclusive BAR setup */ - MemoryRegion msix_exclusive_bar; - /* Memory Regions for MSIX table and pending bit entries. */ - MemoryRegion msix_table_mmio; - MemoryRegion msix_pba_mmio; - /* Reference-count for entries actually in use by driver. */ - unsigned *msix_entry_used; - /* MSIX function mask set or MSIX disabled */ - bool msix_function_masked; - /* Version id needed for VMState */ - int32_t version_id; - - /* Offset of MSI capability in config space */ - uint8_t msi_cap; - - /* PCI Express */ - PCIExpressDevice exp; - - /* SHPC */ - SHPCDevice *shpc; - - /* Location of option rom */ - char *romfile; - uint32_t romsize; - bool has_rom; - MemoryRegion rom; - uint32_t rom_bar; - - /* INTx routing notifier */ - PCIINTxRoutingNotifier intx_routing_notifier; - - /* MSI-X notifiers */ - MSIVectorUseNotifier msix_vector_use_notifier; - MSIVectorReleaseNotifier msix_vector_release_notifier; - MSIVectorPollNotifier msix_vector_poll_notifier; - - /* ID of standby device in net_failover pair */ - char *failover_pair_id; - uint32_t acpi_index; -}; - void pci_register_bar(PCIDevice *pci_dev, int region_num, uint8_t attr, MemoryRegion *memory); void pci_register_vga(PCIDevice *pci_dev, MemoryRegion *mem, @@ -745,11 +586,6 @@ void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_= dev); qemu_irq pci_allocate_irq(PCIDevice *pci_dev); void pci_set_irq(PCIDevice *pci_dev, int level); =20 -static inline int pci_intx(PCIDevice *pci_dev) -{ - return pci_get_byte(pci_dev->config + PCI_INTERRUPT_PIN) - 1; -} - static inline void pci_irq_assert(PCIDevice *pci_dev) { pci_set_irq(pci_dev, 1); @@ -770,186 +606,6 @@ static inline void pci_irq_pulse(PCIDevice *pci_dev) pci_irq_deassert(pci_dev); } =20 -static inline int pci_is_cxl(const PCIDevice *d) -{ - return d->cap_present & QEMU_PCIE_CAP_CXL; -} - -static inline int pci_is_express(const PCIDevice *d) -{ - return d->cap_present & QEMU_PCI_CAP_EXPRESS; -} - -static inline int pci_is_express_downstream_port(const PCIDevice *d) -{ - uint8_t type; - - if (!pci_is_express(d) || !d->exp.exp_cap) { - return 0; - } - - type =3D pcie_cap_get_type(d); - - return type =3D=3D PCI_EXP_TYPE_DOWNSTREAM || type =3D=3D PCI_EXP_TYPE= _ROOT_PORT; -} - -static inline int pci_is_vf(const PCIDevice *d) -{ - return d->exp.sriov_vf.pf !=3D NULL; -} - -static inline uint32_t pci_config_size(const PCIDevice *d) -{ - return pci_is_express(d) ? PCIE_CONFIG_SPACE_SIZE : PCI_CONFIG_SPACE_S= IZE; -} - -static inline uint16_t pci_get_bdf(PCIDevice *dev) -{ - return PCI_BUILD_BDF(pci_bus_num(pci_get_bus(dev)), dev->devfn); -} - -uint16_t pci_requester_id(PCIDevice *dev); - -/* DMA access functions */ -static inline AddressSpace *pci_get_address_space(PCIDevice *dev) -{ - return &dev->bus_master_as; -} - -/** - * pci_dma_rw: Read from or write to an address space from PCI device. - * - * Return a MemTxResult indicating whether the operation succeeded - * or failed (eg unassigned memory, device rejected the transaction, - * IOMMU fault). - * - * @dev: #PCIDevice doing the memory access - * @addr: address within the #PCIDevice address space - * @buf: buffer with the data transferred - * @len: the number of bytes to read or write - * @dir: indicates the transfer direction - */ -static inline MemTxResult pci_dma_rw(PCIDevice *dev, dma_addr_t addr, - void *buf, dma_addr_t len, - DMADirection dir, MemTxAttrs attrs) -{ - return dma_memory_rw(pci_get_address_space(dev), addr, buf, len, - dir, attrs); -} - -/** - * pci_dma_read: Read from an address space from PCI device. - * - * Return a MemTxResult indicating whether the operation succeeded - * or failed (eg unassigned memory, device rejected the transaction, - * IOMMU fault). Called within RCU critical section. - * - * @dev: #PCIDevice doing the memory access - * @addr: address within the #PCIDevice address space - * @buf: buffer with the data transferred - * @len: length of the data transferred - */ -static inline MemTxResult pci_dma_read(PCIDevice *dev, dma_addr_t addr, - void *buf, dma_addr_t len) -{ - return pci_dma_rw(dev, addr, buf, len, - DMA_DIRECTION_TO_DEVICE, MEMTXATTRS_UNSPECIFIED); -} - -/** - * pci_dma_write: Write to address space from PCI device. - * - * Return a MemTxResult indicating whether the operation succeeded - * or failed (eg unassigned memory, device rejected the transaction, - * IOMMU fault). - * - * @dev: #PCIDevice doing the memory access - * @addr: address within the #PCIDevice address space - * @buf: buffer with the data transferred - * @len: the number of bytes to write - */ -static inline MemTxResult pci_dma_write(PCIDevice *dev, dma_addr_t addr, - const void *buf, dma_addr_t len) -{ - return pci_dma_rw(dev, addr, (void *) buf, len, - DMA_DIRECTION_FROM_DEVICE, MEMTXATTRS_UNSPECIFIED); -} - -#define PCI_DMA_DEFINE_LDST(_l, _s, _bits) \ - static inline MemTxResult ld##_l##_pci_dma(PCIDevice *dev, \ - dma_addr_t addr, \ - uint##_bits##_t *val, \ - MemTxAttrs attrs) \ - { \ - return ld##_l##_dma(pci_get_address_space(dev), addr, val, attrs);= \ - } \ - static inline MemTxResult st##_s##_pci_dma(PCIDevice *dev, \ - dma_addr_t addr, \ - uint##_bits##_t val, \ - MemTxAttrs attrs) \ - { \ - return st##_s##_dma(pci_get_address_space(dev), addr, val, attrs);= \ - } - -PCI_DMA_DEFINE_LDST(ub, b, 8); -PCI_DMA_DEFINE_LDST(uw_le, w_le, 16) -PCI_DMA_DEFINE_LDST(l_le, l_le, 32); -PCI_DMA_DEFINE_LDST(q_le, q_le, 64); -PCI_DMA_DEFINE_LDST(uw_be, w_be, 16) -PCI_DMA_DEFINE_LDST(l_be, l_be, 32); -PCI_DMA_DEFINE_LDST(q_be, q_be, 64); - -#undef PCI_DMA_DEFINE_LDST - -/** - * pci_dma_map: Map device PCI address space range into host virtual addre= ss - * @dev: #PCIDevice to be accessed - * @addr: address within that device's address space - * @plen: pointer to length of buffer; updated on return to indicate - * if only a subset of the requested range has been mapped - * @dir: indicates the transfer direction - * - * Return: A host pointer, or %NULL if the resources needed to - * perform the mapping are exhausted (in that case *@plen - * is set to zero). - */ -static inline void *pci_dma_map(PCIDevice *dev, dma_addr_t addr, - dma_addr_t *plen, DMADirection dir) -{ - return dma_memory_map(pci_get_address_space(dev), addr, plen, dir, - MEMTXATTRS_UNSPECIFIED); -} - -static inline void pci_dma_unmap(PCIDevice *dev, void *buffer, dma_addr_t = len, - DMADirection dir, dma_addr_t access_len) -{ - dma_memory_unmap(pci_get_address_space(dev), buffer, len, dir, access_= len); -} - -static inline void pci_dma_sglist_init(QEMUSGList *qsg, PCIDevice *dev, - int alloc_hint) -{ - qemu_sglist_init(qsg, DEVICE(dev), alloc_hint, pci_get_address_space(d= ev)); -} - -extern const VMStateDescription vmstate_pci_device; - -#define VMSTATE_PCI_DEVICE(_field, _state) { \ - .name =3D (stringify(_field)), \ - .size =3D sizeof(PCIDevice), \ - .vmsd =3D &vmstate_pci_device, \ - .flags =3D VMS_STRUCT, \ - .offset =3D vmstate_offset_value(_state, _field, PCIDevice), \ -} - -#define VMSTATE_PCI_DEVICE_POINTER(_field, _state) { \ - .name =3D (stringify(_field)), \ - .size =3D sizeof(PCIDevice), \ - .vmsd =3D &vmstate_pci_device, \ - .flags =3D VMS_STRUCT | VMS_POINTER, \ - .offset =3D vmstate_offset_pointer(_state, _field, PCIDevice), \ -} - MSIMessage pci_get_msi_message(PCIDevice *dev, int vector); void pci_set_power(PCIDevice *pci_dev, bool state); =20 diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h index 58a3fb0c2c..63a7521567 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -26,7 +26,7 @@ #ifndef QEMU_PCI_BRIDGE_H #define QEMU_PCI_BRIDGE_H =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "hw/cxl/cxl.h" #include "qom/object.h" diff --git a/include/hw/pci/pci_device.h b/include/hw/pci/pci_device.h new file mode 100644 index 0000000000..d3dd0f64b2 --- /dev/null +++ b/include/hw/pci/pci_device.h @@ -0,0 +1,350 @@ +#ifndef QEMU_PCI_DEVICE_H +#define QEMU_PCI_DEVICE_H + +#include "hw/pci/pci.h" +#include "hw/pci/pcie.h" + +#define TYPE_PCI_DEVICE "pci-device" +typedef struct PCIDeviceClass PCIDeviceClass; +DECLARE_OBJ_CHECKERS(PCIDevice, PCIDeviceClass, + PCI_DEVICE, TYPE_PCI_DEVICE) + +/* + * Implemented by devices that can be plugged on CXL buses. In the spec, t= his is + * actually a "CXL Component, but we name it device to match the PCI namin= g. + */ +#define INTERFACE_CXL_DEVICE "cxl-device" + +/* Implemented by devices that can be plugged on PCI Express buses */ +#define INTERFACE_PCIE_DEVICE "pci-express-device" + +/* Implemented by devices that can be plugged on Conventional PCI buses */ +#define INTERFACE_CONVENTIONAL_PCI_DEVICE "conventional-pci-device" + +struct PCIDeviceClass { + DeviceClass parent_class; + + void (*realize)(PCIDevice *dev, Error **errp); + PCIUnregisterFunc *exit; + PCIConfigReadFunc *config_read; + PCIConfigWriteFunc *config_write; + + uint16_t vendor_id; + uint16_t device_id; + uint8_t revision; + uint16_t class_id; + uint16_t subsystem_vendor_id; /* only for header type =3D 0 */ + uint16_t subsystem_id; /* only for header type =3D 0 */ + + const char *romfile; /* rom bar */ +}; + +enum PCIReqIDType { + PCI_REQ_ID_INVALID =3D 0, + PCI_REQ_ID_BDF, + PCI_REQ_ID_SECONDARY_BUS, + PCI_REQ_ID_MAX, +}; +typedef enum PCIReqIDType PCIReqIDType; + +struct PCIReqIDCache { + PCIDevice *dev; + PCIReqIDType type; +}; +typedef struct PCIReqIDCache PCIReqIDCache; + +struct PCIDevice { + DeviceState qdev; + bool partially_hotplugged; + bool has_power; + + /* PCI config space */ + uint8_t *config; + + /* + * Used to enable config checks on load. Note that writable bits are + * never checked even if set in cmask. + */ + uint8_t *cmask; + + /* Used to implement R/W bytes */ + uint8_t *wmask; + + /* Used to implement RW1C(Write 1 to Clear) bytes */ + uint8_t *w1cmask; + + /* Used to allocate config space for capabilities. */ + uint8_t *used; + + /* the following fields are read only */ + int32_t devfn; + /* + * Cached device to fetch requester ID from, to avoid the PCI tree + * walking every time we invoke PCI request (e.g., MSI). For + * conventional PCI root complex, this field is meaningless. + */ + PCIReqIDCache requester_id_cache; + char name[64]; + PCIIORegion io_regions[PCI_NUM_REGIONS]; + AddressSpace bus_master_as; + MemoryRegion bus_master_container_region; + MemoryRegion bus_master_enable_region; + + /* do not access the following fields */ + PCIConfigReadFunc *config_read; + PCIConfigWriteFunc *config_write; + + /* Legacy PCI VGA regions */ + MemoryRegion *vga_regions[QEMU_PCI_VGA_NUM_REGIONS]; + bool has_vga; + + /* Current IRQ levels. Used internally by the generic PCI code. */ + uint8_t irq_state; + + /* Capability bits */ + uint32_t cap_present; + + /* Offset of MSI-X capability in config space */ + uint8_t msix_cap; + + /* MSI-X entries */ + int msix_entries_nr; + + /* Space to store MSIX table & pending bit array */ + uint8_t *msix_table; + uint8_t *msix_pba; + + /* May be used by INTx or MSI during interrupt notification */ + void *irq_opaque; + + MSITriggerFunc *msi_trigger; + MSIPrepareMessageFunc *msi_prepare_message; + MSIxPrepareMessageFunc *msix_prepare_message; + + /* MemoryRegion container for msix exclusive BAR setup */ + MemoryRegion msix_exclusive_bar; + /* Memory Regions for MSIX table and pending bit entries. */ + MemoryRegion msix_table_mmio; + MemoryRegion msix_pba_mmio; + /* Reference-count for entries actually in use by driver. */ + unsigned *msix_entry_used; + /* MSIX function mask set or MSIX disabled */ + bool msix_function_masked; + /* Version id needed for VMState */ + int32_t version_id; + + /* Offset of MSI capability in config space */ + uint8_t msi_cap; + + /* PCI Express */ + PCIExpressDevice exp; + + /* SHPC */ + SHPCDevice *shpc; + + /* Location of option rom */ + char *romfile; + uint32_t romsize; + bool has_rom; + MemoryRegion rom; + uint32_t rom_bar; + + /* INTx routing notifier */ + PCIINTxRoutingNotifier intx_routing_notifier; + + /* MSI-X notifiers */ + MSIVectorUseNotifier msix_vector_use_notifier; + MSIVectorReleaseNotifier msix_vector_release_notifier; + MSIVectorPollNotifier msix_vector_poll_notifier; + + /* ID of standby device in net_failover pair */ + char *failover_pair_id; + uint32_t acpi_index; +}; + +static inline int pci_intx(PCIDevice *pci_dev) +{ + return pci_get_byte(pci_dev->config + PCI_INTERRUPT_PIN) - 1; +} + +static inline int pci_is_cxl(const PCIDevice *d) +{ + return d->cap_present & QEMU_PCIE_CAP_CXL; +} + +static inline int pci_is_express(const PCIDevice *d) +{ + return d->cap_present & QEMU_PCI_CAP_EXPRESS; +} + +static inline int pci_is_express_downstream_port(const PCIDevice *d) +{ + uint8_t type; + + if (!pci_is_express(d) || !d->exp.exp_cap) { + return 0; + } + + type =3D pcie_cap_get_type(d); + + return type =3D=3D PCI_EXP_TYPE_DOWNSTREAM || type =3D=3D PCI_EXP_TYPE= _ROOT_PORT; +} + +static inline int pci_is_vf(const PCIDevice *d) +{ + return d->exp.sriov_vf.pf !=3D NULL; +} + +static inline uint32_t pci_config_size(const PCIDevice *d) +{ + return pci_is_express(d) ? PCIE_CONFIG_SPACE_SIZE : PCI_CONFIG_SPACE_S= IZE; +} + +static inline uint16_t pci_get_bdf(PCIDevice *dev) +{ + return PCI_BUILD_BDF(pci_bus_num(pci_get_bus(dev)), dev->devfn); +} + +uint16_t pci_requester_id(PCIDevice *dev); + +/* DMA access functions */ +static inline AddressSpace *pci_get_address_space(PCIDevice *dev) +{ + return &dev->bus_master_as; +} + +/** + * pci_dma_rw: Read from or write to an address space from PCI device. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). + * + * @dev: #PCIDevice doing the memory access + * @addr: address within the #PCIDevice address space + * @buf: buffer with the data transferred + * @len: the number of bytes to read or write + * @dir: indicates the transfer direction + */ +static inline MemTxResult pci_dma_rw(PCIDevice *dev, dma_addr_t addr, + void *buf, dma_addr_t len, + DMADirection dir, MemTxAttrs attrs) +{ + return dma_memory_rw(pci_get_address_space(dev), addr, buf, len, + dir, attrs); +} + +/** + * pci_dma_read: Read from an address space from PCI device. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). Called within RCU critical section. + * + * @dev: #PCIDevice doing the memory access + * @addr: address within the #PCIDevice address space + * @buf: buffer with the data transferred + * @len: length of the data transferred + */ +static inline MemTxResult pci_dma_read(PCIDevice *dev, dma_addr_t addr, + void *buf, dma_addr_t len) +{ + return pci_dma_rw(dev, addr, buf, len, + DMA_DIRECTION_TO_DEVICE, MEMTXATTRS_UNSPECIFIED); +} + +/** + * pci_dma_write: Write to address space from PCI device. + * + * Return a MemTxResult indicating whether the operation succeeded + * or failed (eg unassigned memory, device rejected the transaction, + * IOMMU fault). + * + * @dev: #PCIDevice doing the memory access + * @addr: address within the #PCIDevice address space + * @buf: buffer with the data transferred + * @len: the number of bytes to write + */ +static inline MemTxResult pci_dma_write(PCIDevice *dev, dma_addr_t addr, + const void *buf, dma_addr_t len) +{ + return pci_dma_rw(dev, addr, (void *) buf, len, + DMA_DIRECTION_FROM_DEVICE, MEMTXATTRS_UNSPECIFIED); +} + +#define PCI_DMA_DEFINE_LDST(_l, _s, _bits) \ + static inline MemTxResult ld##_l##_pci_dma(PCIDevice *dev, \ + dma_addr_t addr, \ + uint##_bits##_t *val, \ + MemTxAttrs attrs) \ + { \ + return ld##_l##_dma(pci_get_address_space(dev), addr, val, attrs);= \ + } \ + static inline MemTxResult st##_s##_pci_dma(PCIDevice *dev, \ + dma_addr_t addr, \ + uint##_bits##_t val, \ + MemTxAttrs attrs) \ + { \ + return st##_s##_dma(pci_get_address_space(dev), addr, val, attrs);= \ + } + +PCI_DMA_DEFINE_LDST(ub, b, 8); +PCI_DMA_DEFINE_LDST(uw_le, w_le, 16) +PCI_DMA_DEFINE_LDST(l_le, l_le, 32); +PCI_DMA_DEFINE_LDST(q_le, q_le, 64); +PCI_DMA_DEFINE_LDST(uw_be, w_be, 16) +PCI_DMA_DEFINE_LDST(l_be, l_be, 32); +PCI_DMA_DEFINE_LDST(q_be, q_be, 64); + +#undef PCI_DMA_DEFINE_LDST + +/** + * pci_dma_map: Map device PCI address space range into host virtual addre= ss + * @dev: #PCIDevice to be accessed + * @addr: address within that device's address space + * @plen: pointer to length of buffer; updated on return to indicate + * if only a subset of the requested range has been mapped + * @dir: indicates the transfer direction + * + * Return: A host pointer, or %NULL if the resources needed to + * perform the mapping are exhausted (in that case *@plen + * is set to zero). + */ +static inline void *pci_dma_map(PCIDevice *dev, dma_addr_t addr, + dma_addr_t *plen, DMADirection dir) +{ + return dma_memory_map(pci_get_address_space(dev), addr, plen, dir, + MEMTXATTRS_UNSPECIFIED); +} + +static inline void pci_dma_unmap(PCIDevice *dev, void *buffer, dma_addr_t = len, + DMADirection dir, dma_addr_t access_len) +{ + dma_memory_unmap(pci_get_address_space(dev), buffer, len, dir, access_= len); +} + +static inline void pci_dma_sglist_init(QEMUSGList *qsg, PCIDevice *dev, + int alloc_hint) +{ + qemu_sglist_init(qsg, DEVICE(dev), alloc_hint, pci_get_address_space(d= ev)); +} + +extern const VMStateDescription vmstate_pci_device; + +#define VMSTATE_PCI_DEVICE(_field, _state) { \ + .name =3D (stringify(_field)), \ + .size =3D sizeof(PCIDevice), \ + .vmsd =3D &vmstate_pci_device, \ + .flags =3D VMS_STRUCT, \ + .offset =3D vmstate_offset_value(_state, _field, PCIDevice), \ +} + +#define VMSTATE_PCI_DEVICE_POINTER(_field, _state) { \ + .name =3D (stringify(_field)), \ + .size =3D sizeof(PCIDevice), \ + .vmsd =3D &vmstate_pci_device, \ + .flags =3D VMS_STRUCT | VMS_POINTER, \ + .offset =3D vmstate_offset_pointer(_state, _field, PCIDevice), \ +} + +#endif diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h index d9b5d07504..fd484afb30 100644 --- a/include/hw/pci/pcie_port.h +++ b/include/hw/pci/pcie_port.h @@ -23,6 +23,7 @@ =20 #include "hw/pci/pci_bridge.h" #include "hw/pci/pci_bus.h" +#include "hw/pci/pci_device.h" #include "qom/object.h" =20 #define TYPE_PCIE_PORT "pcie-port" diff --git a/include/hw/pci/shpc.h b/include/hw/pci/shpc.h index d5683b7399..89c7a3b7fa 100644 --- a/include/hw/pci/shpc.h +++ b/include/hw/pci/shpc.h @@ -3,7 +3,7 @@ =20 #include "exec/memory.h" #include "hw/hotplug.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "migration/vmstate.h" =20 struct SHPCDevice { diff --git a/include/hw/remote/iohub.h b/include/hw/remote/iohub.h index 0bf98e0d78..6a8444f9a9 100644 --- a/include/hw/remote/iohub.h +++ b/include/hw/remote/iohub.h @@ -11,7 +11,7 @@ #ifndef REMOTE_IOHUB_H #define REMOTE_IOHUB_H =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qemu/event_notifier.h" #include "qemu/thread-posix.h" #include "hw/remote/mpqemu-link.h" diff --git a/include/hw/remote/proxy.h b/include/hw/remote/proxy.h index 741def71f1..0cfd9665be 100644 --- a/include/hw/remote/proxy.h +++ b/include/hw/remote/proxy.h @@ -9,7 +9,7 @@ #ifndef PROXY_H #define PROXY_H =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "io/channel.h" #include "hw/remote/proxy-memory-listener.h" #include "qemu/event_notifier.h" diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h index a989fca3b2..6cd2822f1d 100644 --- a/include/hw/sd/sdhci.h +++ b/include/hw/sd/sdhci.h @@ -25,7 +25,7 @@ #ifndef SDHCI_H #define SDHCI_H =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/sysbus.h" #include "hw/sd/sd.h" #include "qom/object.h" diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index 2693778b23..0bf48e936d 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -12,8 +12,7 @@ #ifndef HW_SOUTHBRIDGE_PIIX_H #define HW_SOUTHBRIDGE_PIIX_H =20 -#include "hw/pci/pci.h" -#include "qom/object.h" +#include "hw/pci/pci_device.h" =20 /* PIRQRC[A:D]: PIRQx Route Control Registers */ #define PIIX_PIRQCA 0x60 diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h index 77ce17d8a4..9a13a756ae 100644 --- a/include/hw/xen/xen_common.h +++ b/include/hw/xen/xen_common.h @@ -15,7 +15,7 @@ #include "hw/xen/interface/io/xenbus.h" =20 #include "hw/xen/xen.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/xen/trace.h" =20 extern xc_interface *xen_xc; diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c index aefcc03ad6..35007d8017 100644 --- a/hw/acpi/erst.c +++ b/hw/acpi/erst.c @@ -14,7 +14,7 @@ #include "hw/qdev-core.h" #include "exec/memory.h" #include "qom/object.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qom/object_interfaces.h" #include "qemu/error-report.h" #include "migration/vmstate.h" diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index be2dd701a4..364cdfa733 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "hw/audio/soundhw.h" #include "audio/audio.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qemu/module.h" diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 6904589814..54cc19a637 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -29,7 +29,7 @@ #include "qemu/osdep.h" #include "hw/audio/soundhw.h" #include "audio/audio.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/dma.h" diff --git a/hw/audio/via-ac97.c b/hw/audio/via-ac97.c index 6d556f74fc..d1a856f63d 100644 --- a/hw/audio/via-ac97.c +++ b/hw/audio/via-ac97.c @@ -11,7 +11,7 @@ =20 #include "qemu/osdep.h" #include "hw/isa/vt82c686.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" =20 static void via_ac97_realize(PCIDevice *pci_dev, Error **errp) { diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c index 3a9f96c2d1..f18b8dcce5 100644 --- a/hw/char/serial-pci-multi.c +++ b/hw/char/serial-pci-multi.c @@ -31,7 +31,7 @@ #include "qapi/error.h" #include "hw/char/serial.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "migration/vmstate.h" diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index 93d6f99244..801b769aba 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -30,7 +30,7 @@ #include "qemu/module.h" #include "hw/char/serial.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h" diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 97a968f477..54a09fa9ac 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -32,6 +32,7 @@ #include "sysemu/blockdev.h" #include "net/net.h" #include "hw/pci/pci.h" +#include "hw/pci/pcie.h" #include "util/block-helpers.h" =20 static bool check_prop_still_unset(Object *obj, const char *name, diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c index 8ed734b195..e7ec268184 100644 --- a/hw/display/bochs-display.c +++ b/hw/display/bochs-display.c @@ -8,7 +8,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qemu/units.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/display/bochs-vbe.h" diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 6e8c747c46..55c32e3e40 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -39,7 +39,7 @@ #include "sysemu/reset.h" #include "qapi/error.h" #include "trace.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "ui/pixel_ops.h" diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 663c37e7f2..52e42585af 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -32,7 +32,7 @@ #include "ui/console.h" #include "hw/sysbus.h" #include "migration/vmstate.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "hw/i2c/i2c.h" #include "hw/display/i2c-ddc.h" diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index df23dbf3a0..b351b8f299 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -25,7 +25,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "vga_int.h" diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 53949d2539..59ae7f74b8 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -29,7 +29,7 @@ #include "qemu/log.h" #include "hw/loader.h" #include "trace.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h" diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index 1ea95fa601..e62e06622b 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -32,7 +32,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "trace.h" diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c index 1f764fc85b..6b3edbf017 100644 --- a/hw/ipack/tpci200.c +++ b/hw/ipack/tpci200.c @@ -12,7 +12,7 @@ #include "qemu/units.h" #include "hw/ipack/ipack.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "migration/vmstate.h" #include "qemu/bitops.h" #include "qemu/module.h" diff --git a/hw/ipmi/pci_ipmi_bt.c b/hw/ipmi/pci_ipmi_bt.c index b6e52730d3..633931b825 100644 --- a/hw/ipmi/pci_ipmi_bt.c +++ b/hw/ipmi/pci_ipmi_bt.c @@ -25,7 +25,7 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "hw/ipmi/ipmi_bt.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qom/object.h" =20 #define TYPE_PCI_IPMI_BT "pci-ipmi-bt" diff --git a/hw/ipmi/pci_ipmi_kcs.c b/hw/ipmi/pci_ipmi_kcs.c index de13418862..1a581413c2 100644 --- a/hw/ipmi/pci_ipmi_kcs.c +++ b/hw/ipmi/pci_ipmi_kcs.c @@ -25,7 +25,7 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "hw/ipmi/ipmi_kcs.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qom/object.h" =20 #define TYPE_PCI_IPMI_KCS "pci-ipmi-kcs" diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 2a2ff05b93..e3322e03bf 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -18,7 +18,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/irq.h" #include "hw/intc/i8259.h" #include "hw/timer/i8254.h" diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index 19d0d9889f..164866cf3e 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -26,7 +26,7 @@ #include "qapi/error.h" #include "qemu/units.h" #include "qemu/log.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "migration/vmstate.h" #include "hw/intc/i8259.h" diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index 03845c8de3..49303134e4 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -19,7 +19,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "qemu/event_notifier.h" #include "qemu/module.h" diff --git a/hw/misc/pvpanic-pci.c b/hw/misc/pvpanic-pci.c index 99cf7e2041..fbcaa50731 100644 --- a/hw/misc/pvpanic-pci.c +++ b/hw/misc/pvpanic-pci.c @@ -20,7 +20,7 @@ #include "migration/vmstate.h" #include "hw/misc/pvpanic.h" #include "qom/object.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "standard-headers/linux/pvpanic.h" =20 OBJECT_DECLARE_SIMPLE_TYPE(PVPanicPCIState, PVPANIC_PCI_DEVICE) diff --git a/hw/net/can/can_kvaser_pci.c b/hw/net/can/can_kvaser_pci.c index 94b3a534f8..2cd90cef1e 100644 --- a/hw/net/can/can_kvaser_pci.c +++ b/hw/net/can/can_kvaser_pci.c @@ -37,7 +37,7 @@ #include "qapi/error.h" #include "chardev/char.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/can_emu.h" diff --git a/hw/net/can/can_mioe3680_pci.c b/hw/net/can/can_mioe3680_pci.c index 29dc696f7c..b9918773b3 100644 --- a/hw/net/can/can_mioe3680_pci.c +++ b/hw/net/can/can_mioe3680_pci.c @@ -33,7 +33,7 @@ #include "qapi/error.h" #include "chardev/char.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/can_emu.h" diff --git a/hw/net/can/can_pcm3680_pci.c b/hw/net/can/can_pcm3680_pci.c index e8e57f4f33..8ef3e4659c 100644 --- a/hw/net/can/can_pcm3680_pci.c +++ b/hw/net/can/can_pcm3680_pci.c @@ -33,7 +33,7 @@ #include "qapi/error.h" #include "chardev/char.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/can_emu.h" diff --git a/hw/net/can/ctucan_pci.c b/hw/net/can/ctucan_pci.c index 50f4ea6cd6..ea079e2af5 100644 --- a/hw/net/can/ctucan_pci.c +++ b/hw/net/can/ctucan_pci.c @@ -34,7 +34,7 @@ #include "qapi/error.h" #include "chardev/char.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/can_emu.h" diff --git a/hw/net/e1000.c b/hw/net/e1000.c index e26e0a64c1..7efb8a4c52 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -26,7 +26,7 @@ =20 =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/eth.h" diff --git a/hw/net/e1000x_common.c b/hw/net/e1000x_common.c index a8d93870b5..2f43e8cd13 100644 --- a/hw/net/e1000x_common.c +++ b/hw/net/e1000x_common.c @@ -24,7 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/units.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "net/net.h" =20 #include "e1000x_common.h" diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 679f52f80f..dc07984ae9 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -42,7 +42,7 @@ =20 #include "qemu/osdep.h" #include "qemu/units.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/net.h" diff --git a/hw/net/ne2000-pci.c b/hw/net/ne2000-pci.c index 9e5d10859a..edc6689d33 100644 --- a/hw/net/ne2000-pci.c +++ b/hw/net/ne2000-pci.c @@ -24,7 +24,7 @@ =20 #include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "ne2000.h" diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index 1cb1125d9f..2533ea2700 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -21,7 +21,7 @@ #include "net/checksum.h" #include "net/tap.h" #include "net/net.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" =20 enum { NET_TX_PKT_VHDR_FRAG =3D 0, diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c index 95d27102aa..96a302c141 100644 --- a/hw/net/pcnet-pci.c +++ b/hw/net/pcnet-pci.c @@ -29,7 +29,7 @@ =20 #include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "net/net.h" diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 281d43e6cf..cf54ddf49d 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -16,7 +16,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "migration/vmstate.h" diff --git a/hw/net/rocker/rocker_desc.c b/hw/net/rocker/rocker_desc.c index 01845f1157..f3068c9250 100644 --- a/hw/net/rocker/rocker_desc.c +++ b/hw/net/rocker/rocker_desc.c @@ -16,7 +16,7 @@ =20 #include "qemu/osdep.h" #include "net/net.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" =20 #include "rocker.h" #include "rocker_hw.h" diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 700b1b66b6..5a5aaf868d 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -53,7 +53,7 @@ #include "qemu/osdep.h" #include =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "sysemu/dma.h" diff --git a/hw/net/sungem.c b/hw/net/sungem.c index 3684a4d733..eb01520790 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -8,7 +8,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qemu/log.h" diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index fc34905f87..1f3d8011ae 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -23,7 +23,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/net/mii.h" diff --git a/hw/net/tulip.c b/hw/net/tulip.c index c2b3b1bdfa..915e5fb595 100644 --- a/hw/net/tulip.c +++ b/hw/net/tulip.c @@ -9,7 +9,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "hw/nvram/eeprom93xx.h" #include "migration/vmstate.h" diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index f191e3037f..3ae909041a 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -42,7 +42,7 @@ #include "sysemu/sysemu.h" #include "trace.h" #include "monitor/qdev.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "net_rx_pkt.h" #include "hw/virtio/vhost.h" #include "sysemu/qtest.h" diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index a57e81e3a9..f04f3ad668 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -42,7 +42,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/irq.h" #include "hw/mips/mips.h" #include "hw/pci/pci_host.h" diff --git a/hw/pci-host/dino.c b/hw/pci-host/dino.c index f257c24e64..e8eaebca54 100644 --- a/hw/pci-host/dino.c +++ b/hw/pci-host/dino.c @@ -15,7 +15,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "hw/qdev-properties.h" #include "hw/pci-host/dino.h" diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 95945ac0f4..8cf318cb80 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -25,7 +25,7 @@ =20 #include "qemu/osdep.h" #include "hw/qdev-properties.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/irq.h" #include "qapi/error.h" #include "qemu/module.h" diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c index cc9c4d6d3b..015b92bd5f 100644 --- a/hw/pci-host/mv64361.c +++ b/hw/pci-host/mv64361.c @@ -13,7 +13,7 @@ #include "qapi/error.h" #include "hw/hw.h" #include "hw/sysbus.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "hw/irq.h" #include "hw/intc/i8259.h" diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 89c1b53dd7..568849e930 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -19,7 +19,7 @@ #include "hw/ppc/e500-ccsr.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "qemu/bswap.h" #include "qemu/module.h" diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 7a105e4a63..2c96ddf8fe 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -28,7 +28,7 @@ #include "qemu/units.h" #include "qemu/log.h" #include "qapi/error.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" #include "hw/qdev-properties.h" diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index 719d6ca2a6..77e7bbc65f 100644 --- a/hw/pci-host/sh_pci.c +++ b/hw/pci-host/sh_pci.c @@ -26,7 +26,7 @@ #include "hw/sysbus.h" #include "hw/sh4/sh.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "qemu/bswap.h" #include "qemu/module.h" diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index 8396c91d59..e3abe3c0f9 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -26,7 +26,7 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "qemu/module.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "hw/pci-host/uninorth.h" #include "trace.h" diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index f66384fa02..0d50ea4cc0 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -12,7 +12,7 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" #include "hw/qdev-properties.h" diff --git a/hw/pci/pci-hmp-cmds.c b/hw/pci/pci-hmp-cmds.c index fb7591d6ab..b09fce9377 100644 --- a/hw/pci/pci-hmp-cmds.c +++ b/hw/pci/pci-hmp-cmds.c @@ -15,6 +15,7 @@ =20 #include "qemu/osdep.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "monitor/hmp.h" #include "monitor/monitor.h" #include "pci-internal.h" diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c index 5abbe83220..3717e1a086 100644 --- a/hw/pci/pcie_host.c +++ b/hw/pci/pcie_host.c @@ -20,7 +20,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pcie_host.h" #include "qemu/module.h" =20 diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 8e3faf1f59..f0bd72e069 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -11,7 +11,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pcie.h" #include "hw/pci/pci_bus.h" #include "hw/qdev-properties.h" diff --git a/hw/pci/slotid_cap.c b/hw/pci/slotid_cap.c index 36d021b4a6..8372d05d9e 100644 --- a/hw/pci/slotid_cap.c +++ b/hw/pci/slotid_cap.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" #include "hw/pci/slotid_cap.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "qemu/error-report.h" #include "qapi/error.h" =20 diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c index 788d25514a..f10f93c533 100644 --- a/hw/ppc/ppc440_pcix.c +++ b/hw/ppc/ppc440_pcix.c @@ -26,7 +26,7 @@ #include "hw/irq.h" #include "hw/ppc/ppc.h" #include "hw/ppc/ppc4xx.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "trace.h" #include "qom/object.h" diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index 8642b96455..1d4a50fa7c 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -29,7 +29,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" #include "sysemu/reset.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "trace.h" #include "qom/object.h" diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c index 2a76b4e0b5..d8aeee0b7e 100644 --- a/hw/ppc/spapr_pci_vfio.c +++ b/hw/ppc/spapr_pci_vfio.c @@ -22,6 +22,7 @@ #include "hw/ppc/spapr.h" #include "hw/pci-host/spapr.h" #include "hw/pci/msix.h" +#include "hw/pci/pci_device.h" #include "hw/vfio/vfio.h" #include "qemu/error-report.h" =20 diff --git a/hw/rdma/rdma_utils.c b/hw/rdma/rdma_utils.c index 77008552f4..c948baf052 100644 --- a/hw/rdma/rdma_utils.c +++ b/hw/rdma/rdma_utils.c @@ -14,7 +14,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "trace.h" #include "rdma_utils.h" =20 diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 9abe95130c..69137e0757 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -16,6 +16,7 @@ #include "exec/memory-internal.h" #include "qemu/error-report.h" #include "sysemu/hw_accel.h" +#include "hw/pci/pci_device.h" #include "hw/s390x/s390-pci-inst.h" #include "hw/s390x/s390-pci-bus.h" #include "hw/s390x/s390-pci-kvm.h" diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index 1792f84cea..2f7f11e70b 100644 --- a/hw/scsi/esp-pci.c +++ b/hw/scsi/esp-pci.c @@ -24,7 +24,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/irq.h" #include "hw/nvram/eeprom93xx.h" #include "hw/scsi/esp.h" diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 50979640c3..af93557a9a 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -16,7 +16,7 @@ #include "qemu/osdep.h" =20 #include "hw/irq.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/scsi/scsi.h" #include "migration/vmstate.h" #include "sysemu/dma.h" diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index b4243de735..4869566cf5 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -28,6 +28,7 @@ #include "hw/loader.h" #include "hw/boards.h" #include "hw/pci/pci_bus.h" +#include "hw/pci/pci_device.h" #include "smbios_build.h" =20 /* legacy structures and constants for <=3D 2.0 machines */ diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index 8e1146b862..6b630d35a7 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -23,7 +23,7 @@ #include "qemu/timer.h" #include "hw/usb.h" #include "migration/vmstate.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/sysbus.h" #include "hw/qdev-dma.h" #include "hw/qdev-properties.h" diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c index 5693ec6a09..54c167cd35 100644 --- a/hw/watchdog/wdt_i6300esb.c +++ b/hw/watchdog/wdt_i6300esb.c @@ -24,7 +24,7 @@ #include "qemu/module.h" #include "qemu/timer.h" #include "sysemu/watchdog.h" -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "migration/vmstate.h" #include "qom/object.h" =20 diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuz= z.c index afc1d20355..7326f6840b 100644 --- a/tests/qtest/fuzz/generic_fuzz.c +++ b/tests/qtest/fuzz/generic_fuzz.c @@ -24,6 +24,7 @@ #include "exec/ramblock.h" #include "hw/qdev-core.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/boards.h" #include "generic_fuzz_configs.h" #include "hw/mem/sparse-mem.h" diff --git a/ui/util.c b/ui/util.c index 907d60e032..d54bbb74fb 100644 --- a/ui/util.c +++ b/ui/util.c @@ -17,7 +17,7 @@ =20 #include "qemu/osdep.h" =20 -#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" #include "hw/pci/pci_bus.h" #include "qapi/error.h" #include "ui/console.h" --=20 MST From nobody Wed May 15 07:51:38 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=1672911413; cv=none; d=zohomail.com; s=zohoarc; b=UGpBU7b49r2k6mvsrXgTgpTTUH7S1nlJbd15AJhGoUzziov27Im7jT1Ag4K7rt5GWF+KdNRqqtzgYpljcyHL+MV7Ly5NuIG+6O5a+5CmIajzcogjWa/VYaXlm+B0b3F+jZzF0sBPxUvFrEBpmsiUsH+GyF9qWCpZLNt8dFFDHH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911413; 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=gf6urgZ0331uiPj/HrTkbtrhp5tMVYmuc/Q/Xm+wfIY=; b=g8jWjccvDVp8685oBZqLR5GcvYS7ybSE8OMiHxiEmKemTKYIK27o9ahViWsKReyeZn69zwfl5LuWx5aOA6mLMoQETFJO79gWneUppRySRryNM9cIz2a7S+i1FIh6H20/gJjYPRZFuFhDZ9DWdHBcqWFyhfdOjQymvzrToHrgrvk= 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 16729114133561004.6595108439002; Thu, 5 Jan 2023 01:36:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMS2-00012F-4F; Thu, 05 Jan 2023 04:22:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMS0-0000xm-Dj for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:22:16 -0500 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 1pDMRy-0002wL-U4 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:22:16 -0500 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_128_GCM_SHA256) id us-mta-613-QsNLc7LmNIKMLnlyop_xyw-1; Thu, 05 Jan 2023 04:22:13 -0500 Received: by mail-wr1-f69.google.com with SMTP id v4-20020adfa1c4000000b002753317406aso3920706wrv.21 for ; Thu, 05 Jan 2023 01:22:13 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id i10-20020adfdeca000000b002b6667d3adfsm43202wrn.80.2023.01.05.01.22.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910534; 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=gf6urgZ0331uiPj/HrTkbtrhp5tMVYmuc/Q/Xm+wfIY=; b=Aoix99SHyM+GvWGKZgCjlDwD4ZoKbpPRffXNCzqXmyNg6MZmQJKQEUIVTtPsbd27mwq/H1 kuKKTVdzC29IZWvQZS34/PRpoXJ3iLkzVBSn9XCNvtsihf1+knsB+iPVsCCl2AlVG/7emm q1bcChvSIwSbJnzIBiPy/9QecA8pbIM= X-MC-Unique: QsNLc7LmNIKMLnlyop_xyw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=gf6urgZ0331uiPj/HrTkbtrhp5tMVYmuc/Q/Xm+wfIY=; b=IUDGtQNOjY5CSBegPiiyDAPEP02t3g07XdSUFQaGD0VUskn+LOaIefL1IZSagSz58o MH0YEdbe85MffOR3B/hlmSLe2TEA4os0FZ+jJ2kmnmt8y5usl07PlXrW+olQgVhJVzuI FMrgvr0BoO+quoeNN74x/+3o7mWqH+6Ap06PxcuSoWoecKa4+7ii18L9qzcWyi53bfeK LKFCj1920CBMCQjfYfGNYbu7FJWcyaaZKiUP7yZgTGWbUxk5nByBB8upcIrGRwBiutst 7FqJTzKaxw+Q408YT3e/YqDL6QBtLz/tbBQqhPxDVUdbzEM8FGhNqxyAKpgLlzHuahT1 5ssA== X-Gm-Message-State: AFqh2kq05OAcaHyBcGoZKcjGdRG3FHjnuYl9r941lXvLcbsBaktHCk49 nnZmrDZ+B5Dt1cRL4C2bD/QYlKlhWdKN2E+EXk9NzufLX+mGmXobdgSKwNgvSDV0sh1fS2o7GWo oOiyZOH7qdIcdLCZyBcyIxADTCgg16qm9PormE8XjfER4fI6+gFe1sM9bfPWN X-Received: by 2002:adf:a51a:0:b0:272:dcae:259b with SMTP id i26-20020adfa51a000000b00272dcae259bmr29201312wrb.43.1672910531747; Thu, 05 Jan 2023 01:22:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXt84CbN9J1lPo0Fsll+Bo9ZTHwCmmlrNWODF6RASsrkljwCT3lhE2YIbaPmIaFdpFlpfdJ1Kg== X-Received: by 2002:adf:a51a:0:b0:272:dcae:259b with SMTP id i26-20020adfa51a000000b00272dcae259bmr29201294wrb.43.1672910531430; Thu, 05 Jan 2023 01:22:11 -0800 (PST) Date: Thu, 5 Jan 2023 04:22:08 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Marcel Apfelbaum Subject: [PULL 32/51] include/hw/pci: Include hw/pci/pci.h where needed Message-ID: <20230105091310.263867-33-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911413761100001 From: Markus Armbruster hw/pci/pcie_sriov.h needs PCI_NUM_REGIONS. Without the previous commit, this would close an inclusion loop: hw/pci/pci.h used to include hw/pci/pcie.h for PCIExpressDevice, which includes pcie_sriov.h for PCIESriovPF, which now includes hw/pci/pci.h for PCI_NUM_REGIONS. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20221222100330.380143-7-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pcie_sriov.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hw/pci/pcie_sriov.h b/include/hw/pci/pcie_sriov.h index 80f5c84e75..96cc743309 100644 --- a/include/hw/pci/pcie_sriov.h +++ b/include/hw/pci/pcie_sriov.h @@ -13,6 +13,8 @@ #ifndef QEMU_PCIE_SRIOV_H #define QEMU_PCIE_SRIOV_H =20 +#include "hw/pci/pci.h" + struct PCIESriovPF { uint16_t num_vfs; /* Number of virtual functions created */ uint8_t vf_bar_type[PCI_NUM_REGIONS]; /* Store type for each VF bar = */ --=20 MST From nobody Wed May 15 07:51:38 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=1672912379; cv=none; d=zohomail.com; s=zohoarc; b=Lc4JpHq+2Bi9QHDSO5IehNHFz8ek2gsU49rvSH5/Hipbs4TggGb+jVhouf2M/5w7I3dbsoaDeoevBjNcwTe57c+pZr4crholHunW7R5NTYwHaf3nZh9p160mVfNgQYnoGxT+JywWy98cOTpUNt6iGE9cvm+icAQEzPVn05mgINU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672912379; 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=VoRK0rFzs7S75xU/1rZXD4cpNyYJB5XutA3jtZ6rHPg=; b=EkWJWfJ2QAZ+CEyKhuSTHmMlbtDW2NHY4Y6WCD7k9LU2reT49AH6tgRNe16ztyvRwdBWfjXYB6SrdCUFhKZ+uJ7Db5FVVh2HXkO1xdd6DGsjT6kIEZhAoCciNf5+8mkimVfsfhTEoLjyL5yWT3h0G8BBwOdBUh3d8tErxGeqfWY= 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 1672912379486232.06613428298476; Thu, 5 Jan 2023 01:52:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMSA-0001If-Tt; Thu, 05 Jan 2023 04:22:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMS8-0001EW-O3 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:22:24 -0500 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 1pDMS7-0002zN-BD for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:22:24 -0500 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_128_GCM_SHA256) id us-mta-455-5qYjwYNhOoCL3drrV7Oemw-1; Thu, 05 Jan 2023 04:22:21 -0500 Received: by mail-wr1-f69.google.com with SMTP id h24-20020adfaa98000000b0028abfe5b8d9so2517210wrc.2 for ; Thu, 05 Jan 2023 01:22:21 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id z16-20020a1c4c10000000b003c65c9a36dfsm1575721wmf.48.2023.01.05.01.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910542; 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=VoRK0rFzs7S75xU/1rZXD4cpNyYJB5XutA3jtZ6rHPg=; b=XaTpD5MIa2hXdkXz7uuIwVsoGYVzmieKi+GKFdzJq2SXocOWXY/+LgJhE670O2y9JpbEAV m6howwhNy/a7TjofPt4CwdIyACltGhTDEyJdO3zc26UoURQtAwt8QeX3yX7ecevyq7HaQL zPKC6axtFiyN0sJw8ofk7/2muoHeXHI= X-MC-Unique: 5qYjwYNhOoCL3drrV7Oemw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=VoRK0rFzs7S75xU/1rZXD4cpNyYJB5XutA3jtZ6rHPg=; b=uacZ7EyTVnQ5/eIbHz0wtlIMKnlmOOfhZ/PnMzHMW7zC2s7lRoOtn/b9SsjM7i6sJn SyFUpOMVUTjK8TPZn97JOMrzBXMAfXn9z/i+mAM1B3grdCLLS4PECrMEzl2biJJQWWZR eZ+Q88I+add+9nehSX+XeE6ea/XQpx5LkVbmVOLSewVnNUrJ9Bk6Okzghhl0MozDTw+u XS744dW//TEPy5HejtvpgaUO3E0ks5FgztJOvmY3quWB5AwnfPGkldWf9APgztCdjl57 Oko0C7D40iM4JNFmKZBxtOtrr7xlA0Bn0DBinrmw7UA0JK7+U/Hxoe1ecfv7/DzYYMcw CUKQ== X-Gm-Message-State: AFqh2kqW4McMKf6xdRK/PKqBGAaxRsCccPog85E8o7xhG8205IqPgLPP Dadr4bLkK5vEvGxJonBmYWmMXBTpDxMTFmNq6gSguwrvhZykq/UI9HKjJnWgU/KIqmNaS4r0PTC XTVf7nZBPShpOhw9fNEJL10BfVHyaGSAJN4LUKdkkoJwqyTlVjML8HFrBn/pv X-Received: by 2002:a05:600c:3789:b0:3d1:f234:12cc with SMTP id o9-20020a05600c378900b003d1f23412ccmr37184211wmr.33.1672910539685; Thu, 05 Jan 2023 01:22:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXuZ56Exg9zLmxXPgKn58AO77LvwulxWCrEb5DZfQVvzo/I/ENXFfTniy/7PW85Sc6iDJDIqig== X-Received: by 2002:a05:600c:3789:b0:3d1:f234:12cc with SMTP id o9-20020a05600c378900b003d1f23412ccmr37184195wmr.33.1672910539473; Thu, 05 Jan 2023 01:22:19 -0800 (PST) Date: Thu, 5 Jan 2023 04:22:16 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Ben Widawsky , Jonathan Cameron Subject: [PULL 33/51] include/hw/cxl: Break inclusion loop cxl_pci.h and cxl_cdat_h Message-ID: <20230105091310.263867-34-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672912380920100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Markus Armbruster hw/cxl/cxl_pci.h and hw/cxl/cxl_cdat.h include each other. The former doesn't actually need the latter, so drop that inclusion to break the loop. Signed-off-by: Markus Armbruster Message-Id: <20221222100330.380143-8-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/cxl/cxl_pci.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/cxl/cxl_pci.h b/include/hw/cxl/cxl_pci.h index aca14845ab..01e15ed5b4 100644 --- a/include/hw/cxl/cxl_pci.h +++ b/include/hw/cxl/cxl_pci.h @@ -11,7 +11,6 @@ #define CXL_PCI_H =20 #include "qemu/compiler.h" -#include "hw/cxl/cxl_cdat.h" =20 #define CXL_VENDOR_ID 0x1e98 =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672912012; cv=none; d=zohomail.com; s=zohoarc; b=C6+R17iHVtDsrjyPn1C5Hi5bVq3+1SL4sKiqn+tyYg3cmlMIJR0umdtRCBPo4UnPeJvrLBLv0ICOw6P3MuPo8CjDCFwxFNyoxAcJnaQhy+vXD0lwk7xXV1GuCbP/ZBoJDdyhJcAhRLekwIRHbhMZ7SUvAs69rMITtBRWlCf/k84= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672912012; 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=qI3G7+NMQMU0Spg/H09uIDhVgCH9MOTadRqiBKpnSDc=; b=dQ5dNr7qkVOGv/Y6X6V9114DgZC9xM8ufjORFTpM2hgBJu5pj4JMjfSl0m8sigGgv8dSBL/baQ/OQcRnnbDtTQGTg+uhKf2/sVXMHPKMJ0QnGc2FqlpsPDOKQB3wkIjD0q8y3zT3ZY73ceQnaYQgP8c0JiDQtQ3TXx8d0krFiiQ= 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 1672912012576425.44803962066794; Thu, 5 Jan 2023 01:46:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMK-0003BU-09; Thu, 05 Jan 2023 04:16:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMG-00034n-0W for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:20 -0500 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 1pDMME-0007aP-2q for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:19 -0500 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_128_GCM_SHA256) id us-mta-312-DuYDzaDWMDWThBCHJlao3g-1; Thu, 05 Jan 2023 04:16:15 -0500 Received: by mail-wm1-f70.google.com with SMTP id m8-20020a05600c3b0800b003d96bdce12fso17733070wms.9 for ; Thu, 05 Jan 2023 01:16:15 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id b9-20020adfde09000000b00276d8c2332fsm37286429wrm.108.2023.01.05.01.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910176; 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=qI3G7+NMQMU0Spg/H09uIDhVgCH9MOTadRqiBKpnSDc=; b=gF30ZfF8m9EbzEAAvAUbzz1QQ4uhJqGvc2M4pJFUlhkPZCiwM/s17zXqxbB5hMgLeFaO7y xyv2o7E4efLrX7M5CObkWMLZsyh3umsor3wteA8Z20uAt4FcgfuKetp+iHryeNkczzd+12 T7pUkysglSOeJUmR1C3KyhuTgWk36mk= X-MC-Unique: DuYDzaDWMDWThBCHJlao3g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=qI3G7+NMQMU0Spg/H09uIDhVgCH9MOTadRqiBKpnSDc=; b=5H+Wo32qdDifXszMNKwbtZLskPsLeQBlfbwIEny6krLfrTuSzgX5D08Aivb4tFDqto 9zEQRRqdA4iJnZ9/1tysI8UyLEi2JC2W4JBRuNHOaVCb6y46bEeflRVcK+fCBHb8L5qO yRg0EYVHrFzqQin90CLevFnND/3SEhrzaH8cwBhgCZxziun0A3mMDMn+FE8tjNbw3P8W klDxPdxMM8vvx9zZTUrYWQoCb32UJ+0gAksQ98YrXnSLx4wGOI2ZS1obpUvD5KtaoYo3 12RkNMouGoWKwkh/1FzGiRTpbkn+6GoPE9BSiOma9wnKUY3tKDFlpCWqDjJUqfRij9NH jNMQ== X-Gm-Message-State: AFqh2kpiAmICtEWl54P/cvr9yO5PTDp1Mt+hf3zlVWKMquyXI8DzIt74 llj/SIRDMwO77lWUahyQuTfEYlvZjSFXjxe+xq0sJq04OjbbJWy6V7vMb6T7Y7ZI4qm6k+rcv9Y 9BvD3v43pbbJZmjmhZZAiaTNFta+B025f29bHeasgNzkOT8zev+hmSf4tLZQK X-Received: by 2002:a05:6000:49:b0:242:6777:c7e2 with SMTP id k9-20020a056000004900b002426777c7e2mr29793733wrx.31.1672910174023; Thu, 05 Jan 2023 01:16:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXtF16DX4KeryuEYVOq4e4BVTepgZ+ZGOD/rtcafMGeJShmXDAqM7AnoapDSFE4UZWRMBblJDA== X-Received: by 2002:a05:6000:49:b0:242:6777:c7e2 with SMTP id k9-20020a056000004900b002426777c7e2mr29793713wrx.31.1672910173688; Thu, 05 Jan 2023 01:16:13 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:10 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Alistair Francis , Stefano Garzarella , Jason Wang , "Edgar E . Iglesias" Subject: [PULL 34/51] include/hw/virtio: Break inclusion loop Message-ID: <20230105091310.263867-35-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672912013741100001 From: Markus Armbruster hw/virtio/virtio.h and hw/virtio/vhost.h include each other. The former doesn't actually need the latter, so drop that inclusion to break the loop. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Reviewed-by: Stefano Garzarella Message-Id: <20221222120813.727830-2-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Edgar E. Iglesias --- hw/virtio/virtio-qmp.h | 1 + include/hw/virtio/virtio.h | 1 - hw/virtio/virtio.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-qmp.h b/hw/virtio/virtio-qmp.h index 59681082e5..8af5f5e65a 100644 --- a/hw/virtio/virtio-qmp.h +++ b/hw/virtio/virtio-qmp.h @@ -13,6 +13,7 @@ =20 #include "qapi/qapi-types-virtio.h" #include "hw/virtio/virtio.h" +#include "hw/virtio/vhost.h" =20 #include "qemu/queue.h" =20 diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 4219968fd8..77c6c55929 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -22,7 +22,6 @@ #include "standard-headers/linux/virtio_config.h" #include "standard-headers/linux/virtio_ring.h" #include "qom/object.h" -#include "hw/virtio/vhost.h" =20 /* * A guest should never accept this. It implies negotiation is broken diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 02a49d9fa1..f35178f5fc 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -22,6 +22,7 @@ #include "qom/object_interfaces.h" #include "hw/core/cpu.h" #include "hw/virtio/virtio.h" +#include "hw/virtio/vhost.h" #include "migration/qemu-file-types.h" #include "qemu/atomic.h" #include "hw/virtio/virtio-bus.h" --=20 MST From nobody Wed May 15 07:51:38 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=1672911799; cv=none; d=zohomail.com; s=zohoarc; b=fHPtWi+3exmW/0YG7B1DYlkV9+VAOEvD3uwdgoYBjSsEWVksbT+D6W6xRoYaSmdYnvV8CSZrx2d+QxXL5KdjVCkAvXYAKSdBu1rEJY3NhLELdYiOQk+O8dfEW34wf4zl/fjcc3pByjdaKg1shfauPu7kmQobmLdErJ1lj8+GFIY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911799; 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=/0N4TSirezEiP+2u39la0JId1koBdL1SxU+ZL2aIvnI=; b=AJAhwxbjRUqKkhjLhMgKAK6lQBy/I0aP0Z9rDXmMbQqgwLpBdL9XtFA37RBucEpiqEBeLTCSCss7f764njP8MsWphHTCe/b5xtVxV/BdoIBNqe/UZnslp3F90vTcs1SA6oHNjcXOuIDhwG79mYmz7VCugu4jW8CGIKCQn/SVvCM= 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 1672911799262466.046340950405; Thu, 5 Jan 2023 01:43:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMN-0003IU-5L; Thu, 05 Jan 2023 04:16:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMML-0003Fc-NK for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:25 -0500 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 1pDMMJ-0007bD-40 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:25 -0500 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_128_GCM_SHA256) id us-mta-458-gVkaD9d9MFGUwzGK3wgOxQ-1; Thu, 05 Jan 2023 04:16:21 -0500 Received: by mail-wr1-f71.google.com with SMTP id r10-20020adfa14a000000b0025ba73dff40so4703178wrr.12 for ; Thu, 05 Jan 2023 01:16:20 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id o6-20020adfa106000000b002423620d356sm36638572wro.35.2023.01.05.01.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910182; 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=/0N4TSirezEiP+2u39la0JId1koBdL1SxU+ZL2aIvnI=; b=Gm2FvA4v+/VaCFsv4+CT7yQ2d1tYP1D8XeFrAc9p0mhR0lR+Ljqi5PC5Dm70pinafRAlHh B5q9Cp6P7vFSIhSr31Dyoq7qJzEH96LFZqsiUggiPewMuiBYDmVVwppFl3/9JO0n/9oIol T/7qeeF8+JbO+JwPdumhInA/xYE7dgw= X-MC-Unique: gVkaD9d9MFGUwzGK3wgOxQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=/0N4TSirezEiP+2u39la0JId1koBdL1SxU+ZL2aIvnI=; b=CTCMYPqyGV/O1+8mhtDmLToUn6+CMovyzyrze3qBFk6cySoKRraQqQnHxB/PC6D0EE 70BlMyK2mU30GB9qeUFACt64JrsbzYTEc61zUsz1FncodUj0yTpbZcO1aiXoboRdfEC6 OO/bSuoVhhvatOceDkBy4b4Aa8ZJiOtNlINdxntImOfnsi6BPjwUGzvImksJTKBMIuE3 HPpxRw2jtDHO5HOH6NlrmMOWt42I2TnlIuHa+bAXCt+Kqq+RvHU+MJ+waJwUPxx4KfN+ GPIyERXkWPGDKPqKUNBMAlHklil24N/YdzDCpJmW/bm5YPzFxxGE48Pio9quIZXM7Iqe xm4A== X-Gm-Message-State: AFqh2kpN8J7CPkQjzpG8G1wbC0/dpwpgOMyDTWVI90VOIUDaUXZAWR5u Uqd0TGzQTR4+JjDDgGG+RYUXox3gpgn4BAsNGJqmx2AKE3VVASx3gosSaVdmSFSPHJRc4mZwDW/ SEhNSu13nL8/X0U6pbalWE1g9lkyoDa7S1KvH4Qfs4s7h6j19alENGhFXpuIq X-Received: by 2002:adf:fbc1:0:b0:242:1415:ab02 with SMTP id d1-20020adffbc1000000b002421415ab02mr28221460wrs.9.1672910179178; Thu, 05 Jan 2023 01:16:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXs/WxqBcQ/VZ9K+IQpabjTruMNWiCt8XXDiTFYAiiem2gdYR/dU/nybDTMGbH7uGx523aLbQw== X-Received: by 2002:adf:fbc1:0:b0:242:1415:ab02 with SMTP id d1-20020adffbc1000000b002421415ab02mr28221420wrs.9.1672910178677; Thu, 05 Jan 2023 01:16:18 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:13 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Alistair Francis , Igor Mammedov , Ani Sinha , Laurent Vivier , "Edgar E. Iglesias" , Bin Meng , Palmer Dabbelt , Marcel Apfelbaum , Xiaojuan Yang , Song Gao , Richard Henderson , Helge Deller , Jason Wang , Vikram Garhwal , Francisco Iglesias , =?utf-8?Q?C=C3=A9dric?= Le Goater , Gerd Hoffmann , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Riku Voipio , qemu-arm@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org Subject: [PULL 35/51] include: Include headers where needed Message-ID: <20230105091310.263867-36-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1672911800636100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Markus Armbruster A number of headers neglect to include everything they need. They compile only if the headers they need are already included from elsewhere. Fix that. Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis Message-Id: <20221222120813.727830-3-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/exec/plugin-gen.h | 1 + include/hw/acpi/erst.h | 3 +++ include/hw/char/cmsdk-apb-uart.h | 1 + include/hw/char/goldfish_tty.h | 1 + include/hw/char/xilinx_uartlite.h | 1 + include/hw/cris/etraxfs.h | 1 + include/hw/display/macfb.h | 3 ++- include/hw/dma/sifive_pdma.h | 2 ++ include/hw/i386/ioapic_internal.h | 1 + include/hw/i386/sgx-epc.h | 1 + include/hw/intc/goldfish_pic.h | 2 ++ include/hw/intc/loongarch_pch_msi.h | 2 ++ include/hw/intc/loongarch_pch_pic.h | 2 ++ include/hw/intc/nios2_vic.h | 2 ++ include/hw/misc/mchp_pfsoc_dmc.h | 2 ++ include/hw/misc/mchp_pfsoc_ioscb.h | 2 ++ include/hw/misc/mchp_pfsoc_sysreg.h | 2 ++ include/hw/misc/pvpanic.h | 1 + include/hw/misc/sifive_e_prci.h | 3 ++- include/hw/misc/sifive_u_otp.h | 3 ++- include/hw/misc/sifive_u_prci.h | 3 ++- include/hw/misc/virt_ctrl.h | 2 ++ include/hw/misc/xlnx-versal-pmc-iou-slcr.h | 1 + include/hw/net/lasi_82596.h | 2 +- include/hw/net/xlnx-zynqmp-can.h | 1 + include/hw/ppc/pnv_psi.h | 2 +- include/hw/riscv/boot_opensbi.h | 2 ++ include/hw/riscv/microchip_pfsoc.h | 3 +++ include/hw/riscv/numa.h | 1 + include/hw/riscv/sifive_u.h | 2 ++ include/hw/riscv/spike.h | 2 +- include/hw/riscv/virt.h | 2 +- include/hw/ssi/sifive_spi.h | 3 +++ include/hw/timer/sse-timer.h | 1 + include/hw/usb/hcd-dwc3.h | 1 + include/hw/usb/hcd-musb.h | 2 ++ include/hw/usb/xlnx-usb-subsystem.h | 2 ++ include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 3 +++ include/hw/virtio/virtio-mmio.h | 2 +- include/qemu/plugin-memory.h | 3 +++ include/sysemu/dirtyrate.h | 2 ++ include/sysemu/dump.h | 1 + include/user/syscall-trace.h | 1 + 43 files changed, 71 insertions(+), 9 deletions(-) diff --git a/include/exec/plugin-gen.h b/include/exec/plugin-gen.h index 5004728c61..5f5506f1cc 100644 --- a/include/exec/plugin-gen.h +++ b/include/exec/plugin-gen.h @@ -12,6 +12,7 @@ #ifndef QEMU_PLUGIN_GEN_H #define QEMU_PLUGIN_GEN_H =20 +#include "exec/cpu_ldst.h" #include "qemu/plugin.h" #include "tcg/tcg.h" =20 diff --git a/include/hw/acpi/erst.h b/include/hw/acpi/erst.h index b747fe7739..b2ff663ddc 100644 --- a/include/hw/acpi/erst.h +++ b/include/hw/acpi/erst.h @@ -11,6 +11,9 @@ #ifndef HW_ACPI_ERST_H #define HW_ACPI_ERST_H =20 +#include "hw/acpi/bios-linker-loader.h" +#include "qom/object.h" + void build_erst(GArray *table_data, BIOSLinker *linker, Object *erst_dev, const char *oem_id, const char *oem_table_id); =20 diff --git a/include/hw/char/cmsdk-apb-uart.h b/include/hw/char/cmsdk-apb-u= art.h index 9daff0eeee..64b0a3d534 100644 --- a/include/hw/char/cmsdk-apb-uart.h +++ b/include/hw/char/cmsdk-apb-uart.h @@ -15,6 +15,7 @@ #include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qapi/error.h" #include "qom/object.h" =20 #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart" diff --git a/include/hw/char/goldfish_tty.h b/include/hw/char/goldfish_tty.h index 7503d2fa1e..d59733e5ae 100644 --- a/include/hw/char/goldfish_tty.h +++ b/include/hw/char/goldfish_tty.h @@ -12,6 +12,7 @@ =20 #include "qemu/fifo8.h" #include "chardev/char-fe.h" +#include "hw/sysbus.h" =20 #define TYPE_GOLDFISH_TTY "goldfish_tty" OBJECT_DECLARE_SIMPLE_TYPE(GoldfishTTYState, GOLDFISH_TTY) diff --git a/include/hw/char/xilinx_uartlite.h b/include/hw/char/xilinx_uar= tlite.h index bb32d0fcb3..dd09c06801 100644 --- a/include/hw/char/xilinx_uartlite.h +++ b/include/hw/char/xilinx_uartlite.h @@ -17,6 +17,7 @@ =20 #include "hw/qdev-properties.h" #include "hw/sysbus.h" +#include "qapi/error.h" =20 static inline DeviceState *xilinx_uartlite_create(hwaddr addr, qemu_irq irq, diff --git a/include/hw/cris/etraxfs.h b/include/hw/cris/etraxfs.h index 8b01ed67d3..467b529dc0 100644 --- a/include/hw/cris/etraxfs.h +++ b/include/hw/cris/etraxfs.h @@ -29,6 +29,7 @@ #include "hw/cris/etraxfs_dma.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h" +#include "qapi/error.h" =20 DeviceState *etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr, struct etraxfs_dma_client *dma_out, diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h index 55a50d3fb0..27cebefc9e 100644 --- a/include/hw/display/macfb.h +++ b/include/hw/display/macfb.h @@ -15,9 +15,10 @@ =20 #include "exec/memory.h" #include "hw/irq.h" +#include "hw/nubus/nubus.h" +#include "hw/sysbus.h" #include "ui/console.h" #include "qemu/timer.h" -#include "qom/object.h" =20 typedef enum { MACFB_DISPLAY_APPLE_21_COLOR =3D 0, diff --git a/include/hw/dma/sifive_pdma.h b/include/hw/dma/sifive_pdma.h index e319bbd6c4..8c6cfa7f32 100644 --- a/include/hw/dma/sifive_pdma.h +++ b/include/hw/dma/sifive_pdma.h @@ -23,6 +23,8 @@ #ifndef SIFIVE_PDMA_H #define SIFIVE_PDMA_H =20 +#include "hw/sysbus.h" + struct sifive_pdma_chan { uint32_t control; uint32_t next_config; diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_int= ernal.h index 9880443cc7..e8ff338d7f 100644 --- a/include/hw/i386/ioapic_internal.h +++ b/include/hw/i386/ioapic_internal.h @@ -23,6 +23,7 @@ #define QEMU_IOAPIC_INTERNAL_H =20 #include "exec/memory.h" +#include "hw/i386/ioapic.h" #include "hw/sysbus.h" #include "qemu/notify.h" #include "qom/object.h" diff --git a/include/hw/i386/sgx-epc.h b/include/hw/i386/sgx-epc.h index 581fac389a..3e00efd870 100644 --- a/include/hw/i386/sgx-epc.h +++ b/include/hw/i386/sgx-epc.h @@ -12,6 +12,7 @@ #ifndef QEMU_SGX_EPC_H #define QEMU_SGX_EPC_H =20 +#include "hw/qdev-core.h" #include "hw/i386/hostmem-epc.h" =20 #define TYPE_SGX_EPC "sgx-epc" diff --git a/include/hw/intc/goldfish_pic.h b/include/hw/intc/goldfish_pic.h index e9d552f796..3e79580367 100644 --- a/include/hw/intc/goldfish_pic.h +++ b/include/hw/intc/goldfish_pic.h @@ -10,6 +10,8 @@ #ifndef HW_INTC_GOLDFISH_PIC_H #define HW_INTC_GOLDFISH_PIC_H =20 +#include "hw/sysbus.h" + #define TYPE_GOLDFISH_PIC "goldfish_pic" OBJECT_DECLARE_SIMPLE_TYPE(GoldfishPICState, GOLDFISH_PIC) =20 diff --git a/include/hw/intc/loongarch_pch_msi.h b/include/hw/intc/loongarc= h_pch_msi.h index 6d67560dea..2810665ef7 100644 --- a/include/hw/intc/loongarch_pch_msi.h +++ b/include/hw/intc/loongarch_pch_msi.h @@ -5,6 +5,8 @@ * Copyright (C) 2021 Loongson Technology Corporation Limited */ =20 +#include "hw/sysbus.h" + #define TYPE_LOONGARCH_PCH_MSI "loongarch_pch_msi" OBJECT_DECLARE_SIMPLE_TYPE(LoongArchPCHMSI, LOONGARCH_PCH_MSI) =20 diff --git a/include/hw/intc/loongarch_pch_pic.h b/include/hw/intc/loongarc= h_pch_pic.h index 2d4aa9ed6f..5d5dee9280 100644 --- a/include/hw/intc/loongarch_pch_pic.h +++ b/include/hw/intc/loongarch_pch_pic.h @@ -5,6 +5,8 @@ * Copyright (c) 2021 Loongson Technology Corporation Limited */ =20 +#include "hw/sysbus.h" + #define TYPE_LOONGARCH_PCH_PIC "loongarch_pch_pic" #define PCH_PIC_NAME(name) TYPE_LOONGARCH_PCH_PIC#name OBJECT_DECLARE_SIMPLE_TYPE(LoongArchPCHPIC, LOONGARCH_PCH_PIC) diff --git a/include/hw/intc/nios2_vic.h b/include/hw/intc/nios2_vic.h index ac507b9d74..5c975a2ac4 100644 --- a/include/hw/intc/nios2_vic.h +++ b/include/hw/intc/nios2_vic.h @@ -35,6 +35,8 @@ #ifndef HW_INTC_NIOS2_VIC_H #define HW_INTC_NIOS2_VIC_H =20 +#include "hw/sysbus.h" + #define TYPE_NIOS2_VIC "nios2-vic" OBJECT_DECLARE_SIMPLE_TYPE(Nios2VIC, NIOS2_VIC) =20 diff --git a/include/hw/misc/mchp_pfsoc_dmc.h b/include/hw/misc/mchp_pfsoc_= dmc.h index 2baa1413b0..3bc1581e0f 100644 --- a/include/hw/misc/mchp_pfsoc_dmc.h +++ b/include/hw/misc/mchp_pfsoc_dmc.h @@ -23,6 +23,8 @@ #ifndef MCHP_PFSOC_DMC_H #define MCHP_PFSOC_DMC_H =20 +#include "hw/sysbus.h" + /* DDR SGMII PHY module */ =20 #define MCHP_PFSOC_DDR_SGMII_PHY_REG_SIZE 0x1000 diff --git a/include/hw/misc/mchp_pfsoc_ioscb.h b/include/hw/misc/mchp_pfso= c_ioscb.h index 9235523e33..bab83a96a6 100644 --- a/include/hw/misc/mchp_pfsoc_ioscb.h +++ b/include/hw/misc/mchp_pfsoc_ioscb.h @@ -23,6 +23,8 @@ #ifndef MCHP_PFSOC_IOSCB_H #define MCHP_PFSOC_IOSCB_H =20 +#include "hw/sysbus.h" + typedef struct MchpPfSoCIoscbState { SysBusDevice parent; MemoryRegion container; diff --git a/include/hw/misc/mchp_pfsoc_sysreg.h b/include/hw/misc/mchp_pfs= oc_sysreg.h index 546ba68f6a..a2fd1c9f07 100644 --- a/include/hw/misc/mchp_pfsoc_sysreg.h +++ b/include/hw/misc/mchp_pfsoc_sysreg.h @@ -23,6 +23,8 @@ #ifndef MCHP_PFSOC_SYSREG_H #define MCHP_PFSOC_SYSREG_H =20 +#include "hw/sysbus.h" + #define MCHP_PFSOC_SYSREG_REG_SIZE 0x2000 =20 typedef struct MchpPfSoCSysregState { diff --git a/include/hw/misc/pvpanic.h b/include/hw/misc/pvpanic.h index e520566ab0..fab94165d0 100644 --- a/include/hw/misc/pvpanic.h +++ b/include/hw/misc/pvpanic.h @@ -15,6 +15,7 @@ #ifndef HW_MISC_PVPANIC_H #define HW_MISC_PVPANIC_H =20 +#include "exec/memory.h" #include "qom/object.h" =20 #define TYPE_PVPANIC_ISA_DEVICE "pvpanic" diff --git a/include/hw/misc/sifive_e_prci.h b/include/hw/misc/sifive_e_prc= i.h index 262ca16181..6aa949e910 100644 --- a/include/hw/misc/sifive_e_prci.h +++ b/include/hw/misc/sifive_e_prci.h @@ -18,7 +18,8 @@ =20 #ifndef HW_SIFIVE_E_PRCI_H #define HW_SIFIVE_E_PRCI_H -#include "qom/object.h" + +#include "hw/sysbus.h" =20 enum { SIFIVE_E_PRCI_HFROSCCFG =3D 0x0, diff --git a/include/hw/misc/sifive_u_otp.h b/include/hw/misc/sifive_u_otp.h index 5d0d7df455..170d2148f2 100644 --- a/include/hw/misc/sifive_u_otp.h +++ b/include/hw/misc/sifive_u_otp.h @@ -18,7 +18,8 @@ =20 #ifndef HW_SIFIVE_U_OTP_H #define HW_SIFIVE_U_OTP_H -#include "qom/object.h" + +#include "hw/sysbus.h" =20 #define SIFIVE_U_OTP_PA 0x00 #define SIFIVE_U_OTP_PAIO 0x04 diff --git a/include/hw/misc/sifive_u_prci.h b/include/hw/misc/sifive_u_prc= i.h index d9ebf40b7f..4d2491ad46 100644 --- a/include/hw/misc/sifive_u_prci.h +++ b/include/hw/misc/sifive_u_prci.h @@ -18,7 +18,8 @@ =20 #ifndef HW_SIFIVE_U_PRCI_H #define HW_SIFIVE_U_PRCI_H -#include "qom/object.h" + +#include "hw/sysbus.h" =20 #define SIFIVE_U_PRCI_HFXOSCCFG 0x00 #define SIFIVE_U_PRCI_COREPLLCFG0 0x04 diff --git a/include/hw/misc/virt_ctrl.h b/include/hw/misc/virt_ctrl.h index 25a237e518..81346cf017 100644 --- a/include/hw/misc/virt_ctrl.h +++ b/include/hw/misc/virt_ctrl.h @@ -7,6 +7,8 @@ #ifndef VIRT_CTRL_H #define VIRT_CTRL_H =20 +#include "hw/sysbus.h" + #define TYPE_VIRT_CTRL "virt-ctrl" OBJECT_DECLARE_SIMPLE_TYPE(VirtCtrlState, VIRT_CTRL) =20 diff --git a/include/hw/misc/xlnx-versal-pmc-iou-slcr.h b/include/hw/misc/x= lnx-versal-pmc-iou-slcr.h index 2170420f01..f7d24c93c4 100644 --- a/include/hw/misc/xlnx-versal-pmc-iou-slcr.h +++ b/include/hw/misc/xlnx-versal-pmc-iou-slcr.h @@ -54,6 +54,7 @@ #ifndef XLNX_VERSAL_PMC_IOU_SLCR_H #define XLNX_VERSAL_PMC_IOU_SLCR_H =20 +#include "hw/sysbus.h" #include "hw/register.h" =20 #define TYPE_XILINX_VERSAL_PMC_IOU_SLCR "xlnx.versal-pmc-iou-slcr" diff --git a/include/hw/net/lasi_82596.h b/include/hw/net/lasi_82596.h index 7b62b04833..3ef2f47ba2 100644 --- a/include/hw/net/lasi_82596.h +++ b/include/hw/net/lasi_82596.h @@ -10,7 +10,7 @@ =20 #include "net/net.h" #include "hw/net/i82596.h" -#include "qom/object.h" +#include "hw/sysbus.h" =20 #define TYPE_LASI_82596 "lasi_82596" typedef struct SysBusI82596State SysBusI82596State; diff --git a/include/hw/net/xlnx-zynqmp-can.h b/include/hw/net/xlnx-zynqmp-= can.h index eb1558708b..fd2aa77760 100644 --- a/include/hw/net/xlnx-zynqmp-can.h +++ b/include/hw/net/xlnx-zynqmp-can.h @@ -30,6 +30,7 @@ #ifndef XLNX_ZYNQMP_CAN_H #define XLNX_ZYNQMP_CAN_H =20 +#include "hw/sysbus.h" #include "hw/register.h" #include "net/can_emu.h" #include "net/can_host.h" diff --git a/include/hw/ppc/pnv_psi.h b/include/hw/ppc/pnv_psi.h index 8253469b8f..2a6f715350 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -23,7 +23,7 @@ #include "hw/sysbus.h" #include "hw/ppc/xics.h" #include "hw/ppc/xive.h" -#include "qom/object.h" +#include "hw/qdev-core.h" =20 #define TYPE_PNV_PSI "pnv-psi" OBJECT_DECLARE_TYPE(PnvPsi, PnvPsiClass, diff --git a/include/hw/riscv/boot_opensbi.h b/include/hw/riscv/boot_opensb= i.h index c19cad4818..1b749663dc 100644 --- a/include/hw/riscv/boot_opensbi.h +++ b/include/hw/riscv/boot_opensbi.h @@ -8,6 +8,8 @@ #ifndef RISCV_BOOT_OPENSBI_H #define RISCV_BOOT_OPENSBI_H =20 +#include "exec/cpu-defs.h" + /** Expected value of info magic ('OSBI' ascii string in hex) */ #define FW_DYNAMIC_INFO_MAGIC_VALUE 0x4942534f =20 diff --git a/include/hw/riscv/microchip_pfsoc.h b/include/hw/riscv/microchi= p_pfsoc.h index a757b240e0..9e806b09b1 100644 --- a/include/hw/riscv/microchip_pfsoc.h +++ b/include/hw/riscv/microchip_pfsoc.h @@ -22,13 +22,16 @@ #ifndef HW_MICROCHIP_PFSOC_H #define HW_MICROCHIP_PFSOC_H =20 +#include "hw/boards.h" #include "hw/char/mchp_pfsoc_mmuart.h" +#include "hw/cpu/cluster.h" #include "hw/dma/sifive_pdma.h" #include "hw/misc/mchp_pfsoc_dmc.h" #include "hw/misc/mchp_pfsoc_ioscb.h" #include "hw/misc/mchp_pfsoc_sysreg.h" #include "hw/net/cadence_gem.h" #include "hw/sd/cadence_sdhci.h" +#include "hw/riscv/riscv_hart.h" =20 typedef struct MicrochipPFSoCState { /*< private >*/ diff --git a/include/hw/riscv/numa.h b/include/hw/riscv/numa.h index fcce942cee..1a9cce3344 100644 --- a/include/hw/riscv/numa.h +++ b/include/hw/riscv/numa.h @@ -19,6 +19,7 @@ #ifndef RISCV_NUMA_H #define RISCV_NUMA_H =20 +#include "hw/boards.h" #include "hw/sysbus.h" #include "sysemu/numa.h" =20 diff --git a/include/hw/riscv/sifive_u.h b/include/hw/riscv/sifive_u.h index 8f63a183c4..a43304292c 100644 --- a/include/hw/riscv/sifive_u.h +++ b/include/hw/riscv/sifive_u.h @@ -19,6 +19,8 @@ #ifndef HW_SIFIVE_U_H #define HW_SIFIVE_U_H =20 +#include "hw/boards.h" +#include "hw/cpu/cluster.h" #include "hw/dma/sifive_pdma.h" #include "hw/net/cadence_gem.h" #include "hw/riscv/riscv_hart.h" diff --git a/include/hw/riscv/spike.h b/include/hw/riscv/spike.h index 73d69234de..73bf2a9aad 100644 --- a/include/hw/riscv/spike.h +++ b/include/hw/riscv/spike.h @@ -19,9 +19,9 @@ #ifndef HW_RISCV_SPIKE_H #define HW_RISCV_SPIKE_H =20 +#include "hw/boards.h" #include "hw/riscv/riscv_hart.h" #include "hw/sysbus.h" -#include "qom/object.h" =20 #define SPIKE_CPUS_MAX 8 #define SPIKE_SOCKETS_MAX 8 diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index be4ab8fe7f..3007bb3646 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -19,10 +19,10 @@ #ifndef HW_RISCV_VIRT_H #define HW_RISCV_VIRT_H =20 +#include "hw/boards.h" #include "hw/riscv/riscv_hart.h" #include "hw/sysbus.h" #include "hw/block/flash.h" -#include "qom/object.h" =20 #define VIRT_CPUS_MAX_BITS 9 #define VIRT_CPUS_MAX (1 << VIRT_CPUS_MAX_BITS) diff --git a/include/hw/ssi/sifive_spi.h b/include/hw/ssi/sifive_spi.h index 47d0d6a47c..d0c40cdb11 100644 --- a/include/hw/ssi/sifive_spi.h +++ b/include/hw/ssi/sifive_spi.h @@ -22,6 +22,9 @@ #ifndef HW_SIFIVE_SPI_H #define HW_SIFIVE_SPI_H =20 +#include "qemu/fifo8.h" +#include "hw/sysbus.h" + #define SIFIVE_SPI_REG_NUM (0x78 / 4) =20 #define TYPE_SIFIVE_SPI "sifive.spi" diff --git a/include/hw/timer/sse-timer.h b/include/hw/timer/sse-timer.h index b4ee8e7f6c..265ad32400 100644 --- a/include/hw/timer/sse-timer.h +++ b/include/hw/timer/sse-timer.h @@ -25,6 +25,7 @@ #define SSE_TIMER_H =20 #include "hw/sysbus.h" +#include "qemu/timer.h" #include "qom/object.h" #include "hw/timer/sse-counter.h" =20 diff --git a/include/hw/usb/hcd-dwc3.h b/include/hw/usb/hcd-dwc3.h index 7c804d536d..f752a27e94 100644 --- a/include/hw/usb/hcd-dwc3.h +++ b/include/hw/usb/hcd-dwc3.h @@ -26,6 +26,7 @@ #ifndef HCD_DWC3_H #define HCD_DWC3_H =20 +#include "hw/register.h" #include "hw/usb/hcd-xhci.h" #include "hw/usb/hcd-xhci-sysbus.h" =20 diff --git a/include/hw/usb/hcd-musb.h b/include/hw/usb/hcd-musb.h index f30a26f7f4..4d4b1ec0fc 100644 --- a/include/hw/usb/hcd-musb.h +++ b/include/hw/usb/hcd-musb.h @@ -13,6 +13,8 @@ #ifndef HW_USB_HCD_MUSB_H #define HW_USB_HCD_MUSB_H =20 +#include "exec/hwaddr.h" + enum musb_irq_source_e { musb_irq_suspend =3D 0, musb_irq_resume, diff --git a/include/hw/usb/xlnx-usb-subsystem.h b/include/hw/usb/xlnx-usb-= subsystem.h index 5b730abd84..40f9e97e09 100644 --- a/include/hw/usb/xlnx-usb-subsystem.h +++ b/include/hw/usb/xlnx-usb-subsystem.h @@ -25,6 +25,8 @@ #ifndef XLNX_USB_SUBSYSTEM_H #define XLNX_USB_SUBSYSTEM_H =20 +#include "hw/register.h" +#include "hw/sysbus.h" #include "hw/usb/xlnx-versal-usb2-ctrl-regs.h" #include "hw/usb/hcd-dwc3.h" =20 diff --git a/include/hw/usb/xlnx-versal-usb2-ctrl-regs.h b/include/hw/usb/x= lnx-versal-usb2-ctrl-regs.h index 633bf3013a..6a502006b0 100644 --- a/include/hw/usb/xlnx-versal-usb2-ctrl-regs.h +++ b/include/hw/usb/xlnx-versal-usb2-ctrl-regs.h @@ -26,6 +26,9 @@ #ifndef XLNX_VERSAL_USB2_CTRL_REGS_H #define XLNX_VERSAL_USB2_CTRL_REGS_H =20 +#include "hw/register.h" +#include "hw/sysbus.h" + #define TYPE_XILINX_VERSAL_USB2_CTRL_REGS "xlnx.versal-usb2-ctrl-regs" =20 #define XILINX_VERSAL_USB2_CTRL_REGS(obj) \ diff --git a/include/hw/virtio/virtio-mmio.h b/include/hw/virtio/virtio-mmi= o.h index 090f7730e7..aa49262022 100644 --- a/include/hw/virtio/virtio-mmio.h +++ b/include/hw/virtio/virtio-mmio.h @@ -22,8 +22,8 @@ #ifndef HW_VIRTIO_MMIO_H #define HW_VIRTIO_MMIO_H =20 +#include "hw/sysbus.h" #include "hw/virtio/virtio-bus.h" -#include "qom/object.h" =20 /* QOM macros */ /* virtio-mmio-bus */ diff --git a/include/qemu/plugin-memory.h b/include/qemu/plugin-memory.h index 8ad13c110c..6fd539022a 100644 --- a/include/qemu/plugin-memory.h +++ b/include/qemu/plugin-memory.h @@ -9,6 +9,9 @@ #ifndef PLUGIN_MEMORY_H #define PLUGIN_MEMORY_H =20 +#include "exec/cpu-defs.h" +#include "exec/hwaddr.h" + struct qemu_plugin_hwaddr { bool is_io; bool is_store; diff --git a/include/sysemu/dirtyrate.h b/include/sysemu/dirtyrate.h index 4d3b9a4902..20813f303f 100644 --- a/include/sysemu/dirtyrate.h +++ b/include/sysemu/dirtyrate.h @@ -13,6 +13,8 @@ #ifndef QEMU_DIRTYRATE_H #define QEMU_DIRTYRATE_H =20 +#include "qapi/qapi-types-migration.h" + typedef struct VcpuStat { int nvcpu; /* number of vcpu */ DirtyRateVcpu *rates; /* array of dirty rate for each vcpu */ diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index 4ffed0b659..7008d43d04 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -15,6 +15,7 @@ #define DUMP_H =20 #include "qapi/qapi-types-dump.h" +#include "qemu/thread.h" =20 #define MAKEDUMPFILE_SIGNATURE "makedumpfile" #define MAX_SIZE_MDF_HEADER (4096) /* max size of makedumpfile_hea= der */ diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h index b4e53d3870..c5a220da34 100644 --- a/include/user/syscall-trace.h +++ b/include/user/syscall-trace.h @@ -10,6 +10,7 @@ #ifndef SYSCALL_TRACE_H #define SYSCALL_TRACE_H =20 +#include "exec/user/abitypes.h" #include "trace/trace-root.h" =20 /* --=20 MST From nobody Wed May 15 07:51:38 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=1672910938; cv=none; d=zohomail.com; s=zohoarc; b=ZlNNGQVWUGIVBTFqCuQ/PBA/E7kDIXf2Kz9i/uYIOLFlvbA+FmW/SnfHS2+TPyHfpDhLJV3dr9ls6NQfUuCd+n3LZ2WBsyjenIjAOZ8em70x7hpw+papplf4jbczrOmgXUeu5gwKDTowQkqiCumrQojRInZEc5xfJTu2xoja7VQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910938; 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=EFOIoQLNbqm54L5Do76w2NAFyZTxILsaJK5E5Fz584A=; b=Tu+B5IsNYM8uE7TOPSJxupPMa/+Kq3k31u4VZoP+vtDVpbg/FRUITebnABd3KZAJiiD/62S5t5BmIkA5lKlCpHf/zj6CMdd6oAeskug8Sccy58IcVbA6lZa5iZ0rH6qHQIb4wvYRz+XkJLjzrTvTVvdC0qJEJgLfQZ35jIJqCrc= 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 1672910938090612.4069254997428; Thu, 5 Jan 2023 01:28:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMQ-0003Nd-9t; Thu, 05 Jan 2023 04:16:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMO-0003M6-C9 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:28 -0500 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 1pDMMM-0007bu-Dg for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:28 -0500 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_128_GCM_SHA256) id us-mta-368-E4gS455vP2uNPECS4-Ziqw-1; Thu, 05 Jan 2023 04:16:24 -0500 Received: by mail-wm1-f71.google.com with SMTP id p34-20020a05600c1da200b003d990064285so722902wms.8 for ; Thu, 05 Jan 2023 01:16:24 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id i6-20020a5d55c6000000b00283c7b5ee3bsm24702583wrw.101.2023.01.05.01.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910185; 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=EFOIoQLNbqm54L5Do76w2NAFyZTxILsaJK5E5Fz584A=; b=b5T+PB8zwlBehFt1YpCbmfcUW++3lKNmAtH0S7FteSpzTfAfIgItaemnaNIpkXV/iAcAOK 7pRTzzrAtQUgnMh5bTmW1UJuaYL/na651+DsdG1bcjgaNXotbNgHQ2wa1FpucI1O8b7ayh xXrIW4+mRQjG1gPxxJVx8C2sShV0iL0= X-MC-Unique: E4gS455vP2uNPECS4-Ziqw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=EFOIoQLNbqm54L5Do76w2NAFyZTxILsaJK5E5Fz584A=; b=vCn1Iagdktr85wK//tRo356JvPjVI0xDfL6fTWawc9bNbAAg2xurEL0sI8EyfV4w5d oP1IeDvo3Ou3aYz/exvX5YtBS53DcbGCT7Iqjez4cB/5+/vHlFN1dr693zfiWYM/rMZE 6l4Dv6Bzi83k3Ti+zH8pxPNBsbz3qsSmj7Y39OxIapHNbc2qLXHt8szGB9ogcN/bZEDT e7ujV2sVWSvhrh41YoYxBnyIgaqJBllzxmVjv0ECEX3fmWeO81F4V3EivGFTekPuZMU9 f1NHhdF4O8OJ1KwjRGcXtXNwkmXsdZZkxVePLM4rFiD8ALQgfTjOP5SVHhSRG1GvQHFQ XWzw== X-Gm-Message-State: AFqh2kqbh88IYIGFQyM68OwlSqnVC3SmBogFqki3TAC94vgVP4Rxr01s jiXkxiOcHYS2JTB+ju1lvY8kq0i9trzkiBZxIZ6TugeLRQkf3mdlQJhEjn2t/qi68jS+BIHL4Rj JFbqHeZUhy9FeY9BXwwJF9p2CoyTwP/D8bQBxLaI0def/5oRNM4BLc9evBu6J X-Received: by 2002:a05:600c:1d18:b0:3d9:73fe:9744 with SMTP id l24-20020a05600c1d1800b003d973fe9744mr27399285wms.26.1672910183296; Thu, 05 Jan 2023 01:16:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXtVuPI8Vox1U4kqZB1U3vQi1ZwUCt0811Ii6xGYdnL8bJaBoF8QAepnLpmi3w3uGL5Ox1KdUg== X-Received: by 2002:a05:600c:1d18:b0:3d9:73fe:9744 with SMTP id l24-20020a05600c1d1800b003d973fe9744mr27399256wms.26.1672910183029; Thu, 05 Jan 2023 01:16:23 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:18 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Bin Meng , Taylor Simpson , Alistair Francis , Warner Losh , Kyle Evans , Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= , Ben Widawsky , Jonathan Cameron , Bastian Koppelmann , Jason Wang , Michael Roth , Konstantin Kostiuk , Palmer Dabbelt , Bin Meng , qemu-riscv@nongnu.org Subject: [PULL 36/51] include: Don't include qemu/osdep.h Message-ID: <20230105091310.263867-37-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910939958100002 From: Markus Armbruster docs/devel/style.rst mandates: The "qemu/osdep.h" header contains preprocessor macros that affect the behavior of core system headers like . It must be the first include so that core system headers included by external libraries get the preprocessor macros that QEMU depends on. Do not include "qemu/osdep.h" from header files since the .c file will have already included it. A few violations have crept in. Fix them. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bin Meng Reviewed-by: Taylor Simpson Reviewed-by: Alistair Francis Message-Id: <20221222120813.727830-4-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- bsd-user/qemu.h | 1 - crypto/block-luks-priv.h | 1 - include/hw/cxl/cxl_host.h | 1 - include/hw/input/pl050.h | 1 - include/hw/tricore/triboard.h | 1 - include/qemu/userfaultfd.h | 1 - net/vmnet_int.h | 1 - qga/cutils.h | 1 - target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - target/riscv/pmu.h | 1 - qga/cutils.c | 3 ++- 12 files changed, 2 insertions(+), 12 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index be6105385e..0ceecfb6df 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -17,7 +17,6 @@ #ifndef QEMU_H #define QEMU_H =20 -#include "qemu/osdep.h" #include "cpu.h" #include "qemu/units.h" #include "exec/cpu_ldst.h" diff --git a/crypto/block-luks-priv.h b/crypto/block-luks-priv.h index 90a20d432b..1066df0307 100644 --- a/crypto/block-luks-priv.h +++ b/crypto/block-luks-priv.h @@ -18,7 +18,6 @@ * */ =20 -#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/bswap.h" =20 diff --git a/include/hw/cxl/cxl_host.h b/include/hw/cxl/cxl_host.h index a1b662ce40..c9bc9c7c50 100644 --- a/include/hw/cxl/cxl_host.h +++ b/include/hw/cxl/cxl_host.h @@ -7,7 +7,6 @@ * COPYING file in the top-level directory. */ =20 -#include "qemu/osdep.h" #include "hw/cxl/cxl.h" #include "hw/boards.h" =20 diff --git a/include/hw/input/pl050.h b/include/hw/input/pl050.h index 89ec4fafc9..4cb8985f31 100644 --- a/include/hw/input/pl050.h +++ b/include/hw/input/pl050.h @@ -10,7 +10,6 @@ #ifndef HW_PL050_H #define HW_PL050_H =20 -#include "qemu/osdep.h" #include "hw/sysbus.h" #include "migration/vmstate.h" #include "hw/input/ps2.h" diff --git a/include/hw/tricore/triboard.h b/include/hw/tricore/triboard.h index 094c8bd563..4fdd2d7d97 100644 --- a/include/hw/tricore/triboard.h +++ b/include/hw/tricore/triboard.h @@ -18,7 +18,6 @@ * License along with this library; if not, see . */ =20 -#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/boards.h" #include "sysemu/sysemu.h" diff --git a/include/qemu/userfaultfd.h b/include/qemu/userfaultfd.h index 6b74f92792..55c95998e8 100644 --- a/include/qemu/userfaultfd.h +++ b/include/qemu/userfaultfd.h @@ -13,7 +13,6 @@ #ifndef USERFAULTFD_H #define USERFAULTFD_H =20 -#include "qemu/osdep.h" #include "exec/hwaddr.h" #include =20 diff --git a/net/vmnet_int.h b/net/vmnet_int.h index adf6e8c20d..d0b90594f2 100644 --- a/net/vmnet_int.h +++ b/net/vmnet_int.h @@ -10,7 +10,6 @@ #ifndef VMNET_INT_H #define VMNET_INT_H =20 -#include "qemu/osdep.h" #include "vmnet_int.h" #include "clients.h" =20 diff --git a/qga/cutils.h b/qga/cutils.h index f0f30a7d28..2bfaf554a8 100644 --- a/qga/cutils.h +++ b/qga/cutils.h @@ -1,7 +1,6 @@ #ifndef CUTILS_H_ #define CUTILS_H_ =20 -#include "qemu/osdep.h" =20 int qga_open_cloexec(const char *name, int flags, mode_t mode); =20 diff --git a/target/hexagon/hex_arch_types.h b/target/hexagon/hex_arch_type= s.h index 885f68f760..52a7f2b2f3 100644 --- a/target/hexagon/hex_arch_types.h +++ b/target/hexagon/hex_arch_types.h @@ -18,7 +18,6 @@ #ifndef HEXAGON_HEX_ARCH_TYPES_H #define HEXAGON_HEX_ARCH_TYPES_H =20 -#include "qemu/osdep.h" #include "mmvec/mmvec.h" #include "qemu/int128.h" =20 diff --git a/target/hexagon/mmvec/macros.h b/target/hexagon/mmvec/macros.h index 8c864e8c68..1201d778d0 100644 --- a/target/hexagon/mmvec/macros.h +++ b/target/hexagon/mmvec/macros.h @@ -18,7 +18,6 @@ #ifndef HEXAGON_MMVEC_MACROS_H #define HEXAGON_MMVEC_MACROS_H =20 -#include "qemu/osdep.h" #include "qemu/host-utils.h" #include "arch.h" #include "mmvec/system_ext_mmvec.h" diff --git a/target/riscv/pmu.h b/target/riscv/pmu.h index 3004ce37b6..0c819ca983 100644 --- a/target/riscv/pmu.h +++ b/target/riscv/pmu.h @@ -16,7 +16,6 @@ * this program. If not, see . */ =20 -#include "qemu/osdep.h" #include "qemu/log.h" #include "cpu.h" #include "qemu/main-loop.h" diff --git a/qga/cutils.c b/qga/cutils.c index b8e142ef64..b21bcf3683 100644 --- a/qga/cutils.c +++ b/qga/cutils.c @@ -2,8 +2,9 @@ * This work is licensed under the terms of the GNU GPL, version 2 or late= r. * See the COPYING file in the top-level directory. */ -#include "cutils.h" =20 +#include "qemu/osdep.h" +#include "cutils.h" #include "qapi/error.h" =20 /** --=20 MST From nobody Wed May 15 07:51:38 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=1672911552; cv=none; d=zohomail.com; s=zohoarc; b=iCfKers5qAUmX2/aulcktbAgfighXKO2/x2rp5phBxaXJFBqqamB9c/nX1g58IrOTpXwcKnLGTvItSHLR3lkZ3o3n31G3byl7A4g+GdpTLlqV+WDnE5NBF70Nd9FcrPUoDgQ8tGzb9cQhQfoWyuv2CxH0GMLV56e6746v83gl3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911552; 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=JihRFo0ZYwPQcoOoSXD+qKoI9mP+I5ykh4xASrS6DhI=; b=kFDUYom1RkcYSPURJoQ4ndNBu29il5zSABH8al/xVff2+Rnae7XmU2AtQvfGCIh7Gf7EcpQEt90JRyqWUj2E+B68EkCIctDcAA+Xcug3OMj6GfvzKinyAIHJ16UvjegvE9C8wOOZpe+CipT2YlQkDs0Mhh69Xi01fefSifoYpU0= 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 1672911552422499.0068346311816; Thu, 5 Jan 2023 01:39:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMX-0003Tv-Bp; Thu, 05 Jan 2023 04:16:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMR-0003Pg-9W for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:32 -0500 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 1pDMMP-0007cM-Lv for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:31 -0500 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_128_GCM_SHA256) id us-mta-159-HcuLR3S7OIubHsRkO9MegA-1; Thu, 05 Jan 2023 04:16:27 -0500 Received: by mail-wm1-f72.google.com with SMTP id m8-20020a05600c3b0800b003d96bdce12fso17733309wms.9 for ; Thu, 05 Jan 2023 01:16:27 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id o14-20020a05600c4fce00b003d99a39b846sm2282748wmq.5.2023.01.05.01.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910189; 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=JihRFo0ZYwPQcoOoSXD+qKoI9mP+I5ykh4xASrS6DhI=; b=ecvN1Qe8qUUFiTubPBQsa0eT33keWQfB1HxEgCtabN/jOzMz8XJ1RivFDK1D3Fji4oIufa TIW1HqkdcYPG4QWxW8WWexvDnsLGhQuSrJ/Qf0z7LPiiGOtufJPYVHz+LKKqCZPN6OcXlC YAvzMqB/BHnhXJB/XOa81cLjlf8JYaU= X-MC-Unique: HcuLR3S7OIubHsRkO9MegA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JihRFo0ZYwPQcoOoSXD+qKoI9mP+I5ykh4xASrS6DhI=; b=fztCdetqks5Wly0BjtT71WBJv4bLWpISg/op1fDSHUWEVvdudGwux0POoChKeSS1a1 1xJAMGtDP5nDKABqtGMhIFJ1dnou3muv5ZV352tVNSzormuQ2ShY+Bn5ebJZKb25+A5D BGkD3fEbERCXxgmDR75SPFei2MCCdAU/49wp4JyqUv3IaAp6NffMChX6go/oDEg7/UfD QOWmrvgniW+gbfgbGcxiT7hTbnGdX3XXKy/ca9TCZPQKCUD95pG6IW9llsdfQUi5Z5aD 6v34f9XC8c44nvtYSZXtNuNywQyFD5+kfYAm/kLZJwu04fOxU2nni5wPBMsf8h19ce5U ut4g== X-Gm-Message-State: AFqh2kpHbX+R9nK4KvdBJz5+0WybFaezvxHpnhS72a0IqRE1hSYDzL2r vO6cJmgZ9HO2vNp9geRcSru81T3GS7nURLZp7v1bi8vtqxpz2wZkmEoTA58YmD0S/0QuqT9GdSb wajtvkxRtFyQOkN5pkGUEDMC/fp0vAUss0X82qzjROXqxUpMNA1u1I37/iYWt X-Received: by 2002:a05:600c:4d21:b0:3d2:2a72:2573 with SMTP id u33-20020a05600c4d2100b003d22a722573mr35849364wmp.11.1672910186305; Thu, 05 Jan 2023 01:16:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXuddwOcWy5tlf3/3iD03l+QbUokem9vgjCq67fupts5RmqyIopo2RRLOWbGXXZn6a+opU1XNg== X-Received: by 2002:a05:600c:4d21:b0:3d2:2a72:2573 with SMTP id u33-20020a05600c4d2100b003d22a722573mr35849346wmp.11.1672910186075; Thu, 05 Jan 2023 01:16:26 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:23 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , Bernhard Beschow , Alex =?utf-8?Q?Benn=C3=A9e?= , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= , Richard Henderson Subject: [PULL 37/51] docs/devel: Rules on #include in headers Message-ID: <20230105091310.263867-38-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911552769100001 From: Markus Armbruster Rules for headers were proposed a long time ago, and generally liked: Message-ID: <87h9g8j57d.fsf@blackfin.pond.sub.org> https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html Wortk them into docs/devel/style.rst. Suggested-by: Bernhard Beschow Signed-off-by: Markus Armbruster Message-Id: <20221222120813.727830-5-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Bernhard Beschow --- docs/devel/style.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 7ddd42b6c2..68aa776930 100644 --- a/docs/devel/style.rst +++ b/docs/devel/style.rst @@ -293,6 +293,13 @@ that QEMU depends on. Do not include "qemu/osdep.h" from header files since the .c file will have already included it. =20 +Headers should normally include everything they need beyond osdep.h. +If exceptions are needed for some reason, they must be documented in +the header. If all that's needed from a header is typedefs, consider +putting those into qemu/typedefs.h instead of including the header. + +Cyclic inclusion is forbidden. + C types =3D=3D=3D=3D=3D=3D=3D =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672911622; cv=none; d=zohomail.com; s=zohoarc; b=YwC+6hk5PsBMTh3bWYH1VkI0yMl+wZeAsT42yCYbywcycdqWvVhzEswFgjmT3A6CtZVWYp04FONzQw9Que+cfZIYezJQ97/Y7dSOfOV4XbRC+0NpfdzumC6qDz5RQPp1dfXB3yz2HLPOMeqc4qAOAK1VLjn/mU7GAv0a72rrZXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911622; 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=1QRUIoZW03V+WuN5kcOEjsXyY4l1LhkTY1EinszEnRo=; b=S11laZUvtoWjgD2i+P3qeR5bNWjHuQXpd+o4sG0MlF1eRZxvMvNY+WNhsE4Aw0qynh18q3icPi1gwcbv4GXg5YrtD+WsR+yXNJgMeYJ3tj1EzssUCVw9U3Jhv0T04tfHRWakd15X4BgHdEudrv+K9DOOI6Jw/Ik/LfzZ9tPlwuQ= 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 1672911622338299.3840251944596; Thu, 5 Jan 2023 01:40:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMj-0003iO-Uz; Thu, 05 Jan 2023 04:16:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMU-0003QF-6T for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:34 -0500 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 1pDMMS-0007cc-Bi for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:33 -0500 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_128_GCM_SHA256) id us-mta-460-ysoN5BYdOYKu_zFh7Xtixw-1; Thu, 05 Jan 2023 04:16:30 -0500 Received: by mail-wm1-f70.google.com with SMTP id bi18-20020a05600c3d9200b003d991844dbcso729839wmb.4 for ; Thu, 05 Jan 2023 01:16:30 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id h10-20020a05600c2caa00b003cfd58409desm1748193wmc.13.2023.01.05.01.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910191; 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=1QRUIoZW03V+WuN5kcOEjsXyY4l1LhkTY1EinszEnRo=; b=M1TtKENQnqunhOXkbnBMplUrPBZaeX7YYwnScaJl+43tRvPNRtvsGtPkvIzOMnHIJ25zW9 p4VHa1btE3a3BmoMtnAwh3BSorND7LoqI3ILYQnvCRJfiVjpXl/n9tDTAucDaYBzTu1OXP z+M/fXC81U61xWbI09x7byKlQMgKQ/M= X-MC-Unique: ysoN5BYdOYKu_zFh7Xtixw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=1QRUIoZW03V+WuN5kcOEjsXyY4l1LhkTY1EinszEnRo=; b=lLn0eIznH0AhjPocGmixIKiYDYNhLkhy+JYwbVcRY1pi64/yMVZnRKJsLWpK0uJNSF BUQlZOaFGlVMCQFriCLSh3EItOcs4nwjiczZpCyFauXwj5D7z/qLGCmVEdO5K8TNdXO/ bMDTlk+l/ZqO8sNLyOTDCjyRAJXuhjbC+VsMaCdpo+kQYxnW2YgkJXaNDxdURm+TuW8D pnVfbzYmhQrHFIU/ACUBWmB8xnacwAwp38Bi0slhbBjhm8d7w4ywa475DoCQ5ZkGxPiq DvTq+XgjeIXJUB2P8ZJEfmlFyeITxnQvTE41fnuPOLRrpVC8t+hsusUpIECl34cg1k3B e4XQ== X-Gm-Message-State: AFqh2kqWUnG9DS6+WbrJcjofrjTOcjVagc/dlFQzskbt7WJyisWOSGdY IZB2asX1XrpXEvf3Nfkj6X+4Atv0CeuuyDtIYm4nHieCrd7jIA045MvAGr9ElyfZUO9YdGy/T0S Z7iO8RWhsXmUWBLLD+MtkUlsf01XPq/WfFECG9JGs9kiLX04HGbY7QfpJ14HN X-Received: by 2002:adf:ed51:0:b0:242:659f:9411 with SMTP id u17-20020adfed51000000b00242659f9411mr37296583wro.9.1672910188982; Thu, 05 Jan 2023 01:16:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXsE64Gl3PIzdb5GX+i1WqF7FA9FJqcGc+VSuCzQjjzVJmNB0IUmZq3SZIa5u52EZtNyBen5qA== X-Received: by 2002:adf:ed51:0:b0:242:659f:9411 with SMTP id u17-20020adfed51000000b00242659f9411mr37296565wro.9.1672910188665; Thu, 05 Jan 2023 01:16:28 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:26 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Longpeng , Jason Wang Subject: [PULL 38/51] vdpa-dev: get iova range explicitly Message-ID: <20230105091310.263867-39-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911623349100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Longpeng In commit a585fad26b ("vdpa: request iova_range only once") we remove GET_IOVA_RANGE form vhost_vdpa_init, the generic vdpa device will start without iova_range populated, so the device won't work. Let's call GET_IOVA_RANGE ioctl explicitly. Fixes: a585fad26b2e6ccc ("vdpa: request iova_range only once") Signed-off-by: Longpeng Message-Id: <20221224114848.3062-2-longpeng2@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 2 ++ hw/virtio/vdpa-dev.c | 9 +++++++++ hw/virtio/vhost-vdpa.c | 7 +++++++ net/vhost-vdpa.c | 8 -------- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h index 45b969a311..7997f09a8d 100644 --- a/include/hw/virtio/vhost-vdpa.h +++ b/include/hw/virtio/vhost-vdpa.h @@ -51,6 +51,8 @@ typedef struct vhost_vdpa { VhostVDPAHostNotifier notifier[VIRTIO_QUEUE_MAX]; } VhostVDPA; =20 +int vhost_vdpa_get_iova_range(int fd, struct vhost_vdpa_iova_range *iova_r= ange); + int vhost_vdpa_dma_map(struct vhost_vdpa *v, uint32_t asid, hwaddr iova, hwaddr size, void *vaddr, bool readonly); int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, uint32_t asid, hwaddr iova, diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index db6ba61152..01b41eb0f1 100644 --- a/hw/virtio/vdpa-dev.c +++ b/hw/virtio/vdpa-dev.c @@ -53,6 +53,7 @@ static void vhost_vdpa_device_realize(DeviceState *dev, E= rror **errp) { VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); VhostVdpaDevice *v =3D VHOST_VDPA_DEVICE(vdev); + struct vhost_vdpa_iova_range iova_range; uint16_t max_queue_size; struct vhost_virtqueue *vqs; int i, ret; @@ -108,6 +109,14 @@ static void vhost_vdpa_device_realize(DeviceState *dev= , Error **errp) v->dev.backend_features =3D 0; v->started =3D false; =20 + ret =3D vhost_vdpa_get_iova_range(v->vhostfd, &iova_range); + if (ret < 0) { + error_setg(errp, "vhost-vdpa-device: get iova range failed: %s", + strerror(-ret)); + goto free_vqs; + } + v->vdpa.iova_range =3D iova_range; + ret =3D vhost_dev_init(&v->dev, &v->vdpa, VHOST_BACKEND_TYPE_VDPA, 0, = NULL); if (ret < 0) { error_setg(errp, "vhost-vdpa-device: vhost initialization failed: = %s", diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index fcb1e96316..c295a8c917 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -378,6 +378,13 @@ static int vhost_vdpa_add_status(struct vhost_dev *dev= , uint8_t status) return 0; } =20 +int vhost_vdpa_get_iova_range(int fd, struct vhost_vdpa_iova_range *iova_r= ange) +{ + int ret =3D ioctl(fd, VHOST_VDPA_GET_IOVA_RANGE, iova_range); + + return ret < 0 ? -errno : 0; +} + /* * The use of this function is for requests that only need to be * applied once. Typically such request occurs at the beginning diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index b0c6109230..b6e1e84ed2 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -710,14 +710,6 @@ static NetClientState *net_vhost_vdpa_init(NetClientSt= ate *peer, return nc; } =20 -static int vhost_vdpa_get_iova_range(int fd, - struct vhost_vdpa_iova_range *iova_ra= nge) -{ - int ret =3D ioctl(fd, VHOST_VDPA_GET_IOVA_RANGE, iova_range); - - return ret < 0 ? -errno : 0; -} - static int vhost_vdpa_get_features(int fd, uint64_t *features, Error **err= p) { int ret =3D ioctl(fd, VHOST_GET_FEATURES, features); --=20 MST From nobody Wed May 15 07:51:38 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=1672911544; cv=none; d=zohomail.com; s=zohoarc; b=b5WVxe58HecN3ar+qBpIWSAbWhLquwUE20fWbSjZRvMtHC6AwDPKyuozi2uPnvJ+OlwQATqc2kI4J6RCreUnQKPEaaGlmASMTx++xdV2bKMXtM8iG7s+YMB+Ji5sDiogrX0VR5IGRb14OvJNA9vRL9Z9m4/fg0zDIoykKTvzMgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911544; 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=7LskVb0WftUs5Y9U6s9hpIbm/dgd89CPNCSIXPh1law=; b=V1H9mc6brFktXBQZhM/CJRHY3CyTof9sSH99nFX0vV/cqA7xX1m2EGYtRmFp3nYiF0RlbmY2yaGM2j/LIKK/b6/L10yQKKbv7JdmmwwCXNPpGyzHwVbG4Pq+J5OLT7Ebma7guDfog3ASAyY3FeblmhNHNT9X3K9gFp7/EtzVB5o= 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 1672911544840762.2120129699025; Thu, 5 Jan 2023 01:39:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMi-0003gV-7N; Thu, 05 Jan 2023 04:16:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMX-0003T0-0s for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:37 -0500 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 1pDMMV-0007co-Ip for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:36 -0500 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_128_GCM_SHA256) id us-mta-621-AIidXt9AN0ieZiQo66bRug-1; Thu, 05 Jan 2023 04:16:33 -0500 Received: by mail-wm1-f71.google.com with SMTP id m38-20020a05600c3b2600b003d23f8c6ebdso1263929wms.0 for ; Thu, 05 Jan 2023 01:16:33 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id o5-20020a05600c510500b003b4ff30e566sm6184184wms.3.2023.01.05.01.16.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910195; 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=7LskVb0WftUs5Y9U6s9hpIbm/dgd89CPNCSIXPh1law=; b=Hqt+6QsfIeXMBT716N2202eCO0wjVz/XzCIqCsPezVl4g5oBg8QwX5Y8Vi8z/3jRdnSKNT wK+P2e0lAiBFoER0Wkvcms2Fid219cd67ijCKePZ7Q5CHhd1/PDMHu/j6zfCEpmYJ7ZreV BPazuhrg01iUiktgfVNRdHAIXDKmOSE= X-MC-Unique: AIidXt9AN0ieZiQo66bRug-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7LskVb0WftUs5Y9U6s9hpIbm/dgd89CPNCSIXPh1law=; b=noq5XrBGtkNixsswcJY+jqepiLeLnszrO3cZdmq7+3/t1sOTyl4Z6pPJAdpBhiDrpp w/gOUPJ0FppnLIBKxkp8H197Jmo1Y2rlJB2IEYIj9Kp5/wgjrLUgoyFeDDBXhK0QIuNA vbPkUD2hQJD4LnbOy6oievPqkBEUR6qx7KkI30G57rOcS1IF0ZzYHtT7/aEf+vOESFaU 51Kb8nRZwBmZki5h+9VgJvN46UBXLv4BHzEyY/BsrGYWIdOYqohmXIA6G4SQf1Kk0eaT 9HkXBLCbLEETklemcrcAdBsLPSzpalMJDXjzx3QHS0JHQFVonD/MNS1Tm7e0IW0T//5+ Ksyw== X-Gm-Message-State: AFqh2kpUImFg7z+52BSM5l+gpvQB9teqF7f5CsRQOe+ELQQK50P+8IVx LQ0uh+CDR9A22iZT1xCLDYQPNAdpHy8Am2k+LFjZijVoAk96ptR/20zmTrHyuqaS64N7ZKOhuz/ +p08azplaS4v5RoGAtxJhWraKOR8GXI8jsbtLaj47VzrHhXYzkTvheSBbDPcU X-Received: by 2002:a05:600c:4995:b0:3d3:4f43:fbc2 with SMTP id h21-20020a05600c499500b003d34f43fbc2mr36185602wmp.41.1672910191635; Thu, 05 Jan 2023 01:16:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXtx9i/+UCEddPXe4GcL5V2c0G3pR5RnxTtE+O9nOw2vR05yTvEAHf+ggHpmV7c6YEPpPJFL7g== X-Received: by 2002:a05:600c:4995:b0:3d3:4f43:fbc2 with SMTP id h21-20020a05600c499500b003d34f43fbc2mr36185584wmp.41.1672910191339; Thu, 05 Jan 2023 01:16:31 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:28 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Longpeng , Jason Wang Subject: [PULL 39/51] vdpa: harden the error path if get_iova_range failed Message-ID: <20230105091310.263867-40-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911546753100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Longpeng We should stop if the GET_IOVA_RANGE ioctl failed. Signed-off-by: Longpeng Message-Id: <20221224114848.3062-3-longpeng2@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- net/vhost-vdpa.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index b6e1e84ed2..1a13a34d35 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -805,7 +805,13 @@ int net_init_vhost_vdpa(const Netdev *netdev, const ch= ar *name, return queue_pairs; } =20 - vhost_vdpa_get_iova_range(vdpa_device_fd, &iova_range); + r =3D vhost_vdpa_get_iova_range(vdpa_device_fd, &iova_range); + if (unlikely(r < 0)) { + error_setg(errp, "vhost-vdpa: get iova range failed: %s", + strerror(-r)); + goto err; + } + if (opts->x_svq) { if (!vhost_vdpa_net_valid_svq_features(features, errp)) { goto err_svq; --=20 MST From nobody Wed May 15 07:51:38 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=1672911690; cv=none; d=zohomail.com; s=zohoarc; b=FLNSI7WkNfxmCD5U2wZreGgN0if4K46mLEc+1RMGkV25rBEnbMLMy02/zOUkWAAfrLceFIe8Qgz8P+GmO+gi2dtPyyaYL4tVSaG5JjiZL7uzfMFZ/XZututH/HuJ8F9N+OzwZwBxRGunrqmLfOLgPkeJt7iJKm670L157+VS1v0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911690; 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=dwzRVI2ztB1zYurY7r7UlysiEcUkeDrm2KTfIAufzmo=; b=NMEKp9tZ1ArdQ5fEl54GvGHkDYd0lZCu4yGMWWIDC24Y5f6jL7vZU9DLZg4wtSYfnos3LJboaMOz9IM8vfsyVLo5snjB+hOLgEGVFh/j5H0NUEMDKbrn/TjBH2z2Jb5t6d6kAgmXHM/6tik2BFT3UiWgo1Bwt1WyFvuWuoYMsQg= 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 1672911690250980.4446818258324; Thu, 5 Jan 2023 01:41:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMj-0003i0-Hq; Thu, 05 Jan 2023 04:16:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMY-0003VV-UJ for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:41 -0500 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 1pDMMX-0007dB-I1 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:38 -0500 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_128_GCM_SHA256) id us-mta-336-NHcQmqv3MvWvBOCNxkOnsg-1; Thu, 05 Jan 2023 04:16:35 -0500 Received: by mail-wm1-f69.google.com with SMTP id bd6-20020a05600c1f0600b003d96f7f2396so734165wmb.3 for ; Thu, 05 Jan 2023 01:16:35 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id h7-20020a05600c314700b003d973e939d3sm1905349wmo.1.2023.01.05.01.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910197; 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=dwzRVI2ztB1zYurY7r7UlysiEcUkeDrm2KTfIAufzmo=; b=jI6mXUIap24TbMvEsPyiiuna+Ld+wlVS6yWcMuTRJRICX1BUS3RawiP2V9pAmwgBpyZ6hV zmnoGBOYgbKt9/mwhXCtDXx8X96IGOZNImizCwbhKZndBL0gqwl2rDo/BdN9g7r9xnb8Au 4iX41U5qJOVgN3xtuBHX7bdBltpMZgE= X-MC-Unique: NHcQmqv3MvWvBOCNxkOnsg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=dwzRVI2ztB1zYurY7r7UlysiEcUkeDrm2KTfIAufzmo=; b=HSBUIG00k9n29I1SdFKtZxIKdfv5ETgKsMbDuRQy4LPZhMoomJZJFsUEUq7lbY5GFh ugE7o5Nnb0ctUqG1O2NLEjNqvlEaIW7bB7u93pWM6bW3N9DIMrpcnE7JkAkgX9h6P0fk 4luXkQPRg2x71aJQcgSB1SY60XpCbvXpqE1YYppNGIUz2v3Wc6L0mgHKfluIRmQ1wXWY SAiIB4CWfVVD51I5p8RicoWjK8ooLPZH/Tt2ORC68bccIonN/0SXCsLLgO0HyQ08eq5p uPpjs56MeqCNjyu6szC5DMGHFMG0mcs/Sx9+eh9ZvDIn2IbFBYZrtooh0kEzAIGQdRFG C5zA== X-Gm-Message-State: AFqh2kor0xn3y1ZzMkdVLW216MStErukSSjrV776DgUUGAaOAhFgGwcr Y3ZNyhcko8qaVJZdsmVx0pTUj3psbQJpb8FpGKdjnSuOJMgL0o8ZHH6WZsdI42i6memvPJZZjWN xnhJFN31QzM0Mq3/lFcYhWn50CIALhOxgdXI5g1wu0j3ccwri7Hwm/TpssP3F X-Received: by 2002:a05:600c:4193:b0:3c6:e60f:3f4f with SMTP id p19-20020a05600c419300b003c6e60f3f4fmr34725520wmh.6.1672910194302; Thu, 05 Jan 2023 01:16:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXtcroqHfDALVs/a+ajuC2o7D8BKKs9CVlitclH56P5dzXqwwDgd5QmdkZrB29z5Pm1qiw2Gbw== X-Received: by 2002:a05:600c:4193:b0:3c6:e60f:3f4f with SMTP id p19-20020a05600c419300b003c6e60f3f4fmr34725503wmh.6.1672910194005; Thu, 05 Jan 2023 01:16:34 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:31 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Longpeng Subject: [PULL 40/51] vhost: simplify vhost_dev_enable_notifiers Message-ID: <20230105091310.263867-41-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911691880100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Longpeng Simplify the error path in vhost_dev_enable_notifiers by using vhost_dev_disable_notifiers directly. Signed-off-by: Longpeng Message-Id: <20221227072015.3134-2-longpeng2@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 2c566dc539..87c49fa679 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1551,7 +1551,7 @@ void vhost_dev_cleanup(struct vhost_dev *hdev) int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev) { BusState *qbus =3D BUS(qdev_get_parent_bus(DEVICE(vdev))); - int i, r, e; + int i, r; =20 /* We will pass the notifiers to the kernel, make sure that QEMU * doesn't interfere. @@ -1559,7 +1559,7 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev= , VirtIODevice *vdev) r =3D virtio_device_grab_ioeventfd(vdev); if (r < 0) { error_report("binding does not support host notifiers"); - goto fail; + return r; } =20 for (i =3D 0; i < hdev->nvqs; ++i) { @@ -1567,24 +1567,12 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hd= ev, VirtIODevice *vdev) true); if (r < 0) { error_report("vhost VQ %d notifier binding failed: %d", i, -r); - goto fail_vq; + vhost_dev_disable_notifiers(hdev, vdev); + return r; } } =20 return 0; -fail_vq: - while (--i >=3D 0) { - e =3D virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_inde= x + i, - false); - if (e < 0) { - error_report("vhost VQ %d notifier cleanup error: %d", i, -r); - } - assert (e >=3D 0); - virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index = + i); - } - virtio_device_release_ioeventfd(vdev); -fail: - return r; } =20 /* Stop processing guest IO notifications in vhost. --=20 MST From nobody Wed May 15 07:51:38 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=1672910557; cv=none; d=zohomail.com; s=zohoarc; b=iZQcjG0wmSGayjg82s2rBKjoFmcvpwWdE96hlvJs/NJBvAkWAgfdmi/1BAKkvkt2D8eObukK7ErcWHelL3YYzurzzG1QQ/FcU6P0gKLRtywRtFw+dHqir7935ErAeGXFMFQKxV7OWoGLIFMr3DW/dWNJS0I01tc+/VYClcxbdlM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910557; 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=7MKwmvr8s6aJ5ApbCXF6c9zrRH+PpORtzNSI8FfuQZA=; b=UC2fJkJdAHGL29KoHRBJG5GahJvMW0qZgPyVCnqwT/9EnyRggUq/a/e9kmLTCiGTifgo3t4Dwl3Dfqf/Bvy3WvHtq3rn3SrlSujH6eW1fNCy+yJ1prhpqibm9w7OEKKPvzwrHNANMbCx3o8GjO2WeAVb0EtXG2zk/daT9LADUEY= 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 1672910557768242.00548063074802; Thu, 5 Jan 2023 01:22:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMk-0003jq-Eh; Thu, 05 Jan 2023 04:16:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMd-0003Z2-L1 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:47 -0500 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 1pDMMb-0007dm-FP for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:42 -0500 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_128_GCM_SHA256) id us-mta-260-QwVPWg70NKWFvwcRRHtDYQ-1; Thu, 05 Jan 2023 04:16:39 -0500 Received: by mail-wm1-f70.google.com with SMTP id f20-20020a7bc8d4000000b003d1cda5bd6fso261508wml.9 for ; Thu, 05 Jan 2023 01:16:38 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id r126-20020a1c2b84000000b003d35c845cbbsm1638574wmr.21.2023.01.05.01.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910200; 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=7MKwmvr8s6aJ5ApbCXF6c9zrRH+PpORtzNSI8FfuQZA=; b=ejdIdquaIA1/JwLRni3I0l3qxSQvvzUJ66feS3e6rd82MOKre5rrfbRUS5gnStMld17pRX IsoZQ3YwsR9Wi9/cpzCJUp/YjwSbIjz5RvXIoQuu33UgnLOcoVDSz32+2z6MgiMjY1Twhq BhIPwCp/KucL6ilrYHhBN0sR7YQvwIA= X-MC-Unique: QwVPWg70NKWFvwcRRHtDYQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7MKwmvr8s6aJ5ApbCXF6c9zrRH+PpORtzNSI8FfuQZA=; b=Woy85ZqKZlRJ6sSFMTrlcGwKRcJwY2ockeD5LbBrh6mU87GP9RY3S8efvaNa0Mhhbm 7LDIga7dOun7boG2tP+NILEMjH2Bsm4Awk+sDAHRJpypdZw0ZuaH4SLQKzL+VTqInsg9 NmC8/HFsADgg4EFt00REQsxj1c74JIIrP5S1AsOe5MpwjYgTFK+saaM4zB+Jlh65tD2B b8AWxidmglnsWEns+gc9TfYpYSo33AE/MIQiRxSVx/zKYwzj/WjzwaGtoqswJ+xp5s2u 4plcUc35wEh+DAfZ6Mfyg/lCwqeJo4GKD/V9xLP7+3v2/5MCBUIhXDc8D/3DSzKCEitc o4iw== X-Gm-Message-State: AFqh2krhIjJ2QKG15/jlw1VnsMz+xFLQtjqPy6UBSNf4yEzAV3JGb477 YnkCIhrg/aRgPgNLoLPjiL6gUE2YZShoZvAN4ZnLe6qTq8dOGd/iy85LHUEfNYdeH8X1G+458RM IgyoqxZFbPkhjg/TcFA0hsEXWmrrJ4iRxKQizpS1nkIEfNelE62QITaRjQ3WQ X-Received: by 2002:a05:600c:4b0f:b0:3d2:2651:64bd with SMTP id i15-20020a05600c4b0f00b003d2265164bdmr35757770wmp.10.1672910197369; Thu, 05 Jan 2023 01:16:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXth58H8czbO03pn6kwXRNwi3abBYFulPomPGo0ZBodF0WlDB4atkvUdnSS7d/DKkC6ga1ggyQ== X-Received: by 2002:a05:600c:4b0f:b0:3d2:2651:64bd with SMTP id i15-20020a05600c4b0f00b003d2265164bdmr35757758wmp.10.1672910197074; Thu, 05 Jan 2023 01:16:37 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:34 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Longpeng , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: [PULL 41/51] vhost: configure all host notifiers in a single MR transaction Message-ID: <20230105091310.263867-42-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910559941100003 From: Longpeng This allows the vhost device to batch the setup of all its host notifiers. This significantly reduces the device starting time, e.g. the time spend on enabling notifiers reduce from 376ms to 9.1ms for a VM with 64 vCPUs and 3 vhost-vDPA generic devices (vdpa_sim_blk, 64vq per device) Signed-off-by: Longpeng Message-Id: <20221227072015.3134-3-longpeng2@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/vhost.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 87c49fa679..eb8c4c378c 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1562,16 +1562,25 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hd= ev, VirtIODevice *vdev) return r; } =20 + /* + * Batch all the host notifiers in a single transaction to avoid + * quadratic time complexity in address_space_update_ioeventfds(). + */ + memory_region_transaction_begin(); + for (i =3D 0; i < hdev->nvqs; ++i) { r =3D virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_inde= x + i, true); if (r < 0) { error_report("vhost VQ %d notifier binding failed: %d", i, -r); + memory_region_transaction_commit(); vhost_dev_disable_notifiers(hdev, vdev); return r; } } =20 + memory_region_transaction_commit(); + return 0; } =20 @@ -1585,6 +1594,12 @@ void vhost_dev_disable_notifiers(struct vhost_dev *h= dev, VirtIODevice *vdev) BusState *qbus =3D BUS(qdev_get_parent_bus(DEVICE(vdev))); int i, r; =20 + /* + * Batch all the host notifiers in a single transaction to avoid + * quadratic time complexity in address_space_update_ioeventfds(). + */ + memory_region_transaction_begin(); + for (i =3D 0; i < hdev->nvqs; ++i) { r =3D virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_inde= x + i, false); @@ -1592,6 +1607,15 @@ void vhost_dev_disable_notifiers(struct vhost_dev *h= dev, VirtIODevice *vdev) error_report("vhost VQ %d notifier cleanup failed: %d", i, -r); } assert (r >=3D 0); + } + + /* + * The transaction expects the ioeventfds to be open when it + * commits. Do it now, before the cleanup loop. + */ + memory_region_transaction_commit(); + + for (i =3D 0; i < hdev->nvqs; ++i) { virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index = + i); } virtio_device_release_ioeventfd(vdev); --=20 MST From nobody Wed May 15 07:51:38 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=1672910629; cv=none; d=zohomail.com; s=zohoarc; b=Q+3hVdWx4CBZFJim43t2cCfOBFI7uTI3yYEt1M3SwoliYqr7pKDh6/xNrsm5TuQnGwDyrBsVElQ5Syj94wBuUc01VHD6HOu8nehyDEEjpaZD295XsP2D1W3UOELoUpCoVvZjoVb9MSoHOIzapor/rOWy+OVhayO/1Yb25Qv9sWo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910629; 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=7O+vNVhmLUQjfn3Cyf7aQgAL9ZeGEbnP6Cc3i+Bvxck=; b=TRnWIdDq9mdoDfkcn1A7BjQ0m6YTznh5z1Df+0hv5gUGahVecZXwiro4CU7cWlYyffknis2zgPKfYffqBgvr8Thknsl2wl27n2wg5QNrdjWULL+wpNDapjspJz9jMnAk9AL6F5ZCWRkBJ7Jz67MNqEyHWfNQPiF4NpkA82LfyTU= 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 1672910629779800.9583019493564; Thu, 5 Jan 2023 01:23:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMl-0003m3-Mg; Thu, 05 Jan 2023 04:16:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMf-0003Z6-5T for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:47 -0500 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 1pDMMd-0007dz-E7 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:44 -0500 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_128_GCM_SHA256) id us-mta-247-EK7dlHmMP4mMf5-faWxpAw-1; Thu, 05 Jan 2023 04:16:41 -0500 Received: by mail-wm1-f70.google.com with SMTP id q6-20020a05600c2e4600b003d211775a99so1181966wmf.1 for ; Thu, 05 Jan 2023 01:16:41 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id g19-20020a05600c4ed300b003d978f8f255sm2376826wmq.27.2023.01.05.01.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910202; 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=7O+vNVhmLUQjfn3Cyf7aQgAL9ZeGEbnP6Cc3i+Bvxck=; b=Az6Nr1wZty/ekuG/njj2rq+n1nts8kjYn4cHJ/DyfdO4il7aDDiGdtqigE4bp4MskN/8Qe Z57TUVg2cOu4iSEEGnFAcr1mw/dGUC/xmQ/moU/reagKqjItijFUzYiSDLe2eufw8m4jdS rr8xyMa5sogqeAMhCocnNKUzTbVbB70= X-MC-Unique: EK7dlHmMP4mMf5-faWxpAw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7O+vNVhmLUQjfn3Cyf7aQgAL9ZeGEbnP6Cc3i+Bvxck=; b=C842n7/7Fhw14XrIKtlt43zFSv2GM9vgO2wtT3GD60ArydN4eqEz5h7zzZ8S1fBceD l/KnUV7/wJjjmCWuS2pcEVQ6+An9vsnHGsuNQ8KsyP7O/YCypSK47xZdEo7j/S6litkO yV7LRaViS31SwcYFEQm0DOZeBn5+B6miBZU9d3wJPsfK+HErzi4Rd83fsCX/yjb4sgHV ILkCdZjgByaEgqy9ieQ0CBonD3ATpqrMqPzTMFd9BUkue5d2yzU63Hr9iiOlbBgUc0X9 I1k+tLUNg9RoWTMdJX3XnLywNjMw1DFD3lWmT4HV9oywwSkmOhjpbx1wNK6Dz01VhxYo qRUg== X-Gm-Message-State: AFqh2kpXauQ5ns1AbLq6GPIyTgjuy+WmEVgQFjtS2aJqWICW1gqjlm43 YEsGDoQZ2uLJ8toXFFhEwlgXF4ot6ZT4hb/d6FBAY5+69I5QyAEZoavuSNRX4mbMpMHMB21aTCM eF1zoYtoMUP2uwciaRYL4d/8uD9lbZjo97LmVvq+R/hfkKjqtLsL4FW2yU8Ee X-Received: by 2002:a05:600c:4920:b0:3cf:7514:a82e with SMTP id f32-20020a05600c492000b003cf7514a82emr36460184wmp.23.1672910200255; Thu, 05 Jan 2023 01:16:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXsltgO1Yhgqji6i+39X28oeZwo4vsyQhyFiW5c6tGZ127jeMtw2DiH48yaywowHvSr+xezboA== X-Received: by 2002:a05:600c:4920:b0:3cf:7514:a82e with SMTP id f32-20020a05600c492000b003cf7514a82emr36460168wmp.23.1672910199984; Thu, 05 Jan 2023 01:16:39 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:37 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Longpeng , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: [PULL 42/51] vdpa: commit all host notifier MRs in a single MR transaction Message-ID: <20230105091310.263867-43-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910630166100001 From: Longpeng This allows the vhost-vdpa device to batch the setup of all its MRs of host notifiers. This significantly reduces the device starting time, e.g. the time spend on setup the host notifier MRs reduce from 423ms to 32ms for a VM with 64 vCPUs and 3 vhost-vDPA generic devices (vdpa_sim_blk, 64vq per device). Signed-off-by: Longpeng Message-Id: <20221227072015.3134-4-longpeng2@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/vhost-vdpa.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index c295a8c917..542e003101 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -519,9 +519,18 @@ static void vhost_vdpa_host_notifiers_uninit(struct vh= ost_dev *dev, int n) { int i; =20 + /* + * Pack all the changes to the memory regions in a single + * transaction to avoid a few updating of the address space + * topology. + */ + memory_region_transaction_begin(); + for (i =3D dev->vq_index; i < dev->vq_index + n; i++) { vhost_vdpa_host_notifier_uninit(dev, i); } + + memory_region_transaction_commit(); } =20 static void vhost_vdpa_host_notifiers_init(struct vhost_dev *dev) @@ -534,17 +543,21 @@ static void vhost_vdpa_host_notifiers_init(struct vho= st_dev *dev) return; } =20 + /* + * Pack all the changes to the memory regions in a single + * transaction to avoid a few updating of the address space + * topology. + */ + memory_region_transaction_begin(); + for (i =3D dev->vq_index; i < dev->vq_index + dev->nvqs; i++) { if (vhost_vdpa_host_notifier_init(dev, i)) { - goto err; + vhost_vdpa_host_notifiers_uninit(dev, i - dev->vq_index); + break; } } =20 - return; - -err: - vhost_vdpa_host_notifiers_uninit(dev, i - dev->vq_index); - return; + memory_region_transaction_commit(); } =20 static void vhost_vdpa_svq_cleanup(struct vhost_dev *dev) --=20 MST From nobody Wed May 15 07:51:38 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=1672910805; cv=none; d=zohomail.com; s=zohoarc; b=Cq5Hqyl6ni2I+Rw7YQJpJxcAfpgEZ/KqluVdqRsem30+Ywx+3EWjqrJ7BMoKB++5BxbEgUjVluYCz8c7h4vFoyhzfdaGhrvZ8N2vzMvlqe1E4bJ6j8SEjAs4wxwLBhXjtpmPyH3RAuhO0wfIUmXA+HPjJ8G+I//wy2mtX7C4v3A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910805; 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=4lntb2rpWAHBlL8xXgDvi/s6siK86I3wdWk8O24n8Mw=; b=KYTG3XMOO9dZXnyhFa3BVxOqrc1KlGbdioF4RbcLKniWGJ947EOI4/B5JXxLHNFKQCoU439fuhC03ID8GsGDqYwMRvRNm04N4lsNKaJYZ8LN6musoar4dkQ21xRDhuDglWhs7SUiuXFCxKbGFYLdh0jLqT3T8WQbFKDjn8FFwY4= 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 16729108055101004.1367874662443; Thu, 5 Jan 2023 01:26:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMj-0003hc-2E; Thu, 05 Jan 2023 04:16:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMi-0003gW-5c for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:48 -0500 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 1pDMMg-0007eF-PV for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:47 -0500 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_128_GCM_SHA256) id us-mta-617-nbg9Ao5JOumLXGZ0HJelFA-1; Thu, 05 Jan 2023 04:16:44 -0500 Received: by mail-wm1-f72.google.com with SMTP id fm25-20020a05600c0c1900b003d9702a11e5so17813900wmb.0 for ; Thu, 05 Jan 2023 01:16:44 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id q6-20020a05600c46c600b003d1f3e9df3csm1843956wmo.7.2023.01.05.01.16.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910206; 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=4lntb2rpWAHBlL8xXgDvi/s6siK86I3wdWk8O24n8Mw=; b=Vp1CMkicz3KIjAOMrKgudhR87k/J4wGZzI55ArNeaCTdSyYB+sSDQ8lbMHx8utAiKwuo11 5H3ZxyZHnqDCtlQUwShpKiB6bX2WP+xQ5g6I1ko+PKJBaUOT11auQVGPe9NRLyJtteQHJx ZRQCbq9629jZ79Ryh3tR5s+zFcJ0WZI= X-MC-Unique: nbg9Ao5JOumLXGZ0HJelFA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4lntb2rpWAHBlL8xXgDvi/s6siK86I3wdWk8O24n8Mw=; b=LcQCgJl+qxwqQpp1GVAA9fnthgucjCBmPvz4tQmUg6MVP9GwkmUGpXhdTyF/R8rFa4 pD7q0hVLspSk9XYoYjKdQFfbixO55/dGZvZlH3GRE6g8ZWsmHj3fbPFYLISOOEVwsVxr jr01VW9ZSWGwpboqc8hs7/g25dHEEU9KErR4A8HPa6s4+94JmcUP2+/ZqKUwbSVos/Zp oZJu1HZHoYGdl1fgQx6s3OfOlo4bkzaQxKd3/YVWU3vAAM22wroshXw1FfmbMbJrDBYm EjgAleJAMsAPNCoS8HU4KHZE0anfiqv5KdW6HGblGFvWXQX82Zu/XWNnwtAi14Nszp1f w3+Q== X-Gm-Message-State: AFqh2koA+5FLU8TdPXi61V3kFZRKGx16RounRags891U8TYMReD5WkWz Gpme0rZQDRJQOb7BezDT+VB0+BgVjaQHo+RAZ5B6/XTqUI+H5U5DOLvJhp4P3cM69jII0VaBnAl pFLQTu1ELCrxx597KOpen+21TFDMEOZ3DTqOsBhI6f7xzUmfDK9njqqST26AF X-Received: by 2002:a05:600c:b92:b0:3d9:779e:9788 with SMTP id fl18-20020a05600c0b9200b003d9779e9788mr26759559wmb.37.1672910203290; Thu, 05 Jan 2023 01:16:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXusrzLXpmdAreX46nS3rUB4p2GVtSvZOL19Vjd7CuliYw+/Vu69F/eJCpdVoDPF5Iyq1SkhaA== X-Received: by 2002:a05:600c:b92:b0:3d9:779e:9788 with SMTP id fl18-20020a05600c0b9200b003d9779e9788mr26759544wmb.37.1672910203025; Thu, 05 Jan 2023 01:16:43 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:40 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , leixiang , Zeng Chi , Xie Ming Subject: [PULL 43/51] virtio-pci: fix proxy->vector_irqfd leak in virtio_pci_set_guest_notifiers Message-ID: <20230105091310.263867-44-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910806997100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: leixiang proxy->vector_irqfd did not free when kvm_virtio_pci_vector_use or msix_set_vector_notifiers failed in virtio_pci_set_guest_notifiers. Fixes: 7d37d351 Signed-off-by: Lei Xiang Tested-by: Zeng Chi Suggested-by: Xie Ming Message-Id: <20221227081604.806415-1-leixiang@kylinos.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 7bc60fcf94..247325c193 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1291,6 +1291,8 @@ assign_error: while (--n >=3D 0) { virtio_pci_set_guest_notifier(d, n, !assign, with_irqfd); } + g_free(proxy->vector_irqfd); + proxy->vector_irqfd =3D NULL; return r; } =20 --=20 MST From nobody Wed May 15 07:51:38 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=1672910565; cv=none; d=zohomail.com; s=zohoarc; b=l/XSWK1peoL7Ic8XEFaAsD5HApLiiFZxmn2cWznoUwxBzAWtHCTg8kzJ26eJU5+A35th274A82kdOel9JSJu+zCjiZqPrZ7SqAbqX0A1vyCvKLtd6H3wgrb1npX+QM2OXqr54UaBJgXz96wscOCJPw5K+BreRvJyyCCfsTLHSKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910565; 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=V+M/t3F4PL2PXLYQa8aSHPchO06DtfXoQlvlpKy7gEc=; b=HZq6x000M22na98I4GkFHfABSceYZ4NTl1k1fLFbWH798mcNTDArC9QGr8ow0h9WT2lOq2+yBUzAtuUwnmb5I5gcv1vjqxco310+5h0mE+wbivHsiLk5WjoKaqfSkbGUBl7HSZ9NTD+sjPERH1yAXGQInL7fmRoobPuNFeeeK50= 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 167291056536763.61260313672119; Thu, 5 Jan 2023 01:22:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMo-0003rV-I0; Thu, 05 Jan 2023 04:16:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMl-0003la-Bs for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:51 -0500 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 1pDMMj-0007eT-VF for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:51 -0500 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_128_GCM_SHA256) id us-mta-269-3IxwFvLhPzubjWXuhqK3NQ-1; Thu, 05 Jan 2023 04:16:48 -0500 Received: by mail-wm1-f72.google.com with SMTP id i7-20020a05600c354700b003d62131fe46so728382wmq.5 for ; Thu, 05 Jan 2023 01:16:48 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id p7-20020a05600c1d8700b003d973d4fb28sm1775065wms.4.2023.01.05.01.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910209; 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=V+M/t3F4PL2PXLYQa8aSHPchO06DtfXoQlvlpKy7gEc=; b=FnxymxmI7fHGdU/XOFnmjGb1LH1RhcpnbHcVOo1OX9BzxC++qJ2lEwLh9+1DjjLBEs3w/D EVCcPTCDWRHv1A/HYQPyH4yv/u8aawEDCWOnUkC59kK7JQmH3U7lwpBuAuu0gxoWYzkrKt YUSGDa8KzVom4st1oVoT+rQi0QvtzZg= X-MC-Unique: 3IxwFvLhPzubjWXuhqK3NQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=V+M/t3F4PL2PXLYQa8aSHPchO06DtfXoQlvlpKy7gEc=; b=0kpNMK/zAyYlQhwSwDFqDPXB/6DTtbhn7zboyFm0pGyLHTH7MAZS6XGHl5GMu6nLqf dypAuD5pJAETMzB5uVFJwTaPjvsMw72Q2eD5YXZUElnD3b1k59OEOCz4b8LxPs6aZn+0 LdFdjGah5tAWC8vO68+YAwWQ1Y4YVSfkLDvGKSs9YBgPjtyw1P5Qt225Venh1IxjMCdo A6ZvIcsSLN2kv8I+9nL9D25dUEtwedtZzY2+tBMSsi/3Sk5UAyJOXFt32MMksuyaILkQ IFZiyITraF0QgyL8rVAHz8Keu6bCkObZoJ9ceopubzhmDOx5Iwvm2Huv+GdxCBJEMebO QLUg== X-Gm-Message-State: AFqh2kozFHOcIctyi6qCQEQiEXliwJ/B6jieLhAA8Mh59HRRKXe7gyiv /+Q8Xl37/uA1l82x1ibMaCwSIbB5eygWX+odFLp20Ts230BvFZVMXUZqpgCohwCLNV2t7naQVO5 jJqkVejEovH0jQ6cszIrpfTTfLJIkR0Amdvgx73UoRacSWOtNsL9h47JYOFft X-Received: by 2002:a05:600c:4e11:b0:3d3:4012:8da8 with SMTP id b17-20020a05600c4e1100b003d340128da8mr36434979wmq.40.1672910206682; Thu, 05 Jan 2023 01:16:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXuUbUnpKtCrSS3r3zkwd9UgbUQobPkLMH7AJk7kPMdKeXW9DEWVI7pwYKoCw3lpIaRpl3dIeA== X-Received: by 2002:a05:600c:4e11:b0:3d3:4012:8da8 with SMTP id b17-20020a05600c4e1100b003d340128da8mr36434958wmq.40.1672910206401; Thu, 05 Jan 2023 01:16:46 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:43 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Yicong Yang , Yanan Wang , Igor Mammedov , Ani Sinha Subject: [PULL 44/51] tests: virt: Allow changes to PPTT test table Message-ID: <20230105091310.263867-45-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910565796100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yicong Yang Allow changes to test/data/acpi/virt/PPTT*, prepare to change the building policy of the cluster topology. Reviewed-by: Yanan Wang Signed-off-by: Yicong Yang Message-Id: <20221229065513.55652-2-yangyicong@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..fc12cd8c5c 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,3 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/PPTT", +"tests/data/acpi/virt/PPTT.acpihmatvirt", --=20 MST From nobody Wed May 15 07:51:38 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=1672911643; cv=none; d=zohomail.com; s=zohoarc; b=cgmNn7iNPja4S+KZ3wbQQkxLf3ROSnaQYhtmEY2B3iVfwMLbtqc7x6g56m/L8Pgf+g1C5YGnj41Y2wcg9tjr/ZQn4bYhENGmjaE0CtwJQIZCoyYXxjP585Mcm3yykNYTt7Jd1FeWPX4HpT9u/iAU6p82bMB9fOWrnZbJzi2qPxo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911643; 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=X5TtsCljZSNcnA12xQ7QTfbnHFhdOa8MT79on78YvQ0=; b=m3Mvbf0ma932WQwxhzO7RQK+4cBTWkREjyf2eQgRL5H6cRZEFTg7W8Dch+NPZ+fZyR/Hv0EUa09WvlKl0doubSkkzsBlxFPz2fqBY5+/vxR7iV6NjSo8LJHBb0r60o68HVxPP6aRe46qDPRW7xaqkGIzQMFFfcTnbXPvWTe80VM= 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 1672911643445891.6691132898058; Thu, 5 Jan 2023 01:40:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMq-0003wV-Gz; Thu, 05 Jan 2023 04:16:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMp-0003vM-BW for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:55 -0500 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 1pDMMn-0007gH-OH for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:55 -0500 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_128_GCM_SHA256) id us-mta-447-qa97RqT2PWOqlQOgibW6sw-1; Thu, 05 Jan 2023 04:16:51 -0500 Received: by mail-wm1-f72.google.com with SMTP id q21-20020a7bce95000000b003d236c91639so261686wmj.8 for ; Thu, 05 Jan 2023 01:16:51 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id m42-20020a05600c092a00b003d9a3a0d461sm1620836wmp.4.2023.01.05.01.16.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910213; 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=X5TtsCljZSNcnA12xQ7QTfbnHFhdOa8MT79on78YvQ0=; b=DEjErJ1YfodIIbDJLHVEfjPrCWFsar+JN686bKjX2u2ot8Fbn+IICKQc3oRjZuMDz51CYZ Ygluchgt4q8pEqRvJ8MC7TpEiv2J96e45A/2lgltg7UqT+/Z8ZleipLz/L/FM7ogfCiNm1 KaY9isMTadkZNEuqMwa+6N7iy8PuMMU= X-MC-Unique: qa97RqT2PWOqlQOgibW6sw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=X5TtsCljZSNcnA12xQ7QTfbnHFhdOa8MT79on78YvQ0=; b=1pYJyaNQ/F9AMjpKrtjSdf/r1HXtFYJBGw7f4CiRxlv7+kx4iQ8tso7vsUUGXncDU3 r+Mqb86B+Zl2Z4PgaJbdRedbBSJmtXi9E0BHO4mePtT107+b8oxELoONEBd/11uey5in KVUezGcebF/6a/HQr0pwYwKfNTyJ8y9f6q8u6ZqdTLQ1FYH9AejF65TRwpv4FBzj90M6 278kc464QuPFqNCtdmebKleKxgo1mPY5+DNmsbNEQB+rCt7b5N/bq0AITr9TiA9wzhGL UetGZ/c0j7sp6svZVZH7DnRHmcVqjeE1IodMI4rFS0ZWnCpT88o57Maejgmm81W+Ol8R V84g== X-Gm-Message-State: AFqh2kry7UBYIeg/Js1WBPzMrhy0IjNZl5FfY0yv8mCt1M2dvXa5mkYi jRaMW4LIwTHyYEz3HYX7DSLi2bTXPuH22E8q46EDmNbRBwZAWFQFF1ol9vA2npX+9CDarWhCAG9 BOCHccZeklb3QmUKiDX6pPITJ7AG1n+9DDgYxzLEmnFv/pUuFLwDaCDFIvihP X-Received: by 2002:a05:600c:5012:b0:3d3:5a4a:9103 with SMTP id n18-20020a05600c501200b003d35a4a9103mr35187949wmr.31.1672910209773; Thu, 05 Jan 2023 01:16:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8Dzj2JOKykrTmmwFP86w1yN+ha/YMnXLxK9I4+1l7tw/lrmXaLZoV7UeA3Y/fSivxl8NIxA== X-Received: by 2002:a05:600c:5012:b0:3d3:5a4a:9103 with SMTP id n18-20020a05600c501200b003d35a4a9103mr35187931wmr.31.1672910209553; Thu, 05 Jan 2023 01:16:49 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:46 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Yicong Yang , Yanan Wang , Igor Mammedov , Ani Sinha , Eduardo Habkost , Marcel Apfelbaum , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: [PULL 45/51] hw/acpi/aml-build: Only generate cluster node in PPTT when specified Message-ID: <20230105091310.263867-46-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911645467100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yicong Yang Currently we'll always generate a cluster node no matter user has specified '-smp clusters=3DX' or not. Cluster is an optional level and will participant the building of Linux scheduling domains and only appears on a few platforms. It's unncessary to always build it when it cannot reflect the real topology on platforms having no cluster implementation and to avoid affecting the linux scheduling domains in the VM. So only generate the cluster topology in ACPI PPTT when the user has specified it explicitly in -smp. Tested qemu-system-aarch64 with `-smp 8` and linux 6.1-rc1, without this patch: estuary:/sys/devices/system/cpu/cpu0/topology$ cat cluster_* ff # cluster_cpus 0-7 # cluster_cpus_list 56 # cluster_id with this patch: estuary:/sys/devices/system/cpu/cpu0/topology$ cat cluster_* ff # cluster_cpus 0-7 # cluster_cpus_list 36 # cluster_id, with no cluster node kernel will make it to physical package id Acked-by: Michael S. Tsirkin Reviewed-by: Yanan Wang Tested-by: Yanan Wang Signed-off-by: Yicong Yang Message-Id: <20221229065513.55652-3-yangyicong@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/boards.h | 3 +++ hw/acpi/aml-build.c | 2 +- hw/core/machine-smp.c | 2 ++ qemu-options.hx | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index d18d6d0073..b0abbdd5dc 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -130,11 +130,14 @@ typedef struct { * @prefer_sockets - whether sockets are preferred over cores in smp parsi= ng * @dies_supported - whether dies are supported by the machine * @clusters_supported - whether clusters are supported by the machine + * @has_clusters - whether clusters are explicitly specified in the user + * provided SMP configuration */ typedef struct { bool prefer_sockets; bool dies_supported; bool clusters_supported; + bool has_clusters; } SMPCompatProps; =20 /** diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 42feb4d4d7..ea331a20d1 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -2030,7 +2030,7 @@ void build_pptt(GArray *table_data, BIOSLinker *linke= r, MachineState *ms, 0, socket_id, NULL, 0); } =20 - if (mc->smp_props.clusters_supported) { + if (mc->smp_props.clusters_supported && mc->smp_props.has_clusters= ) { if (cpus->cpus[n].props.cluster_id !=3D cluster_id) { assert(cpus->cpus[n].props.cluster_id > cluster_id); cluster_id =3D cpus->cpus[n].props.cluster_id; diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index b39ed21e65..c3dab007da 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -158,6 +158,8 @@ void machine_parse_smp_config(MachineState *ms, ms->smp.threads =3D threads; ms->smp.max_cpus =3D maxcpus; =20 + mc->smp_props.has_clusters =3D config->has_clusters; + /* sanity-check of the computed topology */ if (sockets * dies * clusters * cores * threads !=3D maxcpus) { g_autofree char *topo_msg =3D cpu_hierarchy_to_string(ms); diff --git a/qemu-options.hx b/qemu-options.hx index 7f99d15b23..8662568324 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -343,6 +343,9 @@ SRST :: =20 -smp 2 + + Note: The cluster topology will only be generated in ACPI and exposed + to guest if it's explicitly specified in -smp. ERST =20 DEF("numa", HAS_ARG, QEMU_OPTION_numa, --=20 MST From nobody Wed May 15 07:51:38 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=1672911274; cv=none; d=zohomail.com; s=zohoarc; b=OsMiDVT71sjiR5p2wmH84hMO42qElItCx1I6Ctyz8MZTm1Oroc34z6BBLZqXeN7dAnCblRIeyQ4eNRKhqeOKJEx93HGuy7XU9VIP1kJIysm12s+jEe51oyIPVbIv3QTGcD4IH4lc3UTzmGZXrS5K7y7wJI51HXtIn22/o8wjQgo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911274; 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=9eilQ/elC2L4ysihao2tjz+9UKpztPtett7/15n8lDs=; b=jKte7VAl0v9u6c1Eim+5s3rOaK7rMykmOcjwUICJGgQBE4UZwmyOw7NrMH5b4W4Pe6Uow3QnMoyOUh5U8H1p/ArMy3ZKVlO8hWTgu51OI9Yc9Dob51hpim+wM03FSjiaY7ruNajIiDkBicwC4fFBEdZY9TQ95K2HH0gzvZoNbHk= 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 1672911274474241.0387286193569; Thu, 5 Jan 2023 01:34:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMw-000414-9l; Thu, 05 Jan 2023 04:17:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMt-0003xb-KS for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:00 -0500 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 1pDMMr-0007gZ-IE for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:16:59 -0500 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_128_GCM_SHA256) id us-mta-333-VshaYHAYO9aEVx_HqKwptw-1; Thu, 05 Jan 2023 04:16:55 -0500 Received: by mail-wr1-f72.google.com with SMTP id e10-20020adf9bca000000b0026e2396ab34so4695624wrc.18 for ; Thu, 05 Jan 2023 01:16:55 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id g3-20020a5d6983000000b00287da7ee033sm21535477wru.46.2023.01.05.01.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910216; 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=9eilQ/elC2L4ysihao2tjz+9UKpztPtett7/15n8lDs=; b=bvlgSVDv6vaFxOY766hWDPFL84iACrmh9sgXk0hwGayNfSth5TAhUIrbEBnqRRXuXQ4Ce6 +WTRp8328sRwFaqmDYdFyEV+c6wJoiCygPZ2LMZgeQW7Vsdx7zP6XLfp8At6aziG0bhaEX E2HHJurJfyqW5SLBjPsTrz5/dytADUA= X-MC-Unique: VshaYHAYO9aEVx_HqKwptw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=9eilQ/elC2L4ysihao2tjz+9UKpztPtett7/15n8lDs=; b=7wfLFXtp54RFxEwOpu4IG1cOmdf++PTgdAiqTE4tB8PtVbA9a8oFSfHf6PX7fwM4f9 qYtI8ET9PUTKJr4MXRTR/SVlC9HJNO8FO6z1ebB+aNk9GQzjTRLApvP52C84EZiBm4CX PL/rYIcELBZjLfRFXkBQ+J/fiIVPTg5M7G/IUQG1M2r8dPhwjctXDem0J9kqzk3x1vrd 4dyc9EBRqbvNrad2aFJO5XJXYApmGTkMx8Gsl3kKjyGMnzARUXKPJ6AbMJQ+fvfqtl76 QCk7VKCQUE9nUNmAhL+RuKGfRo+OiE63XOAqK+m4qXWQCuuDH07kww9XU7XV+4yJ12rf 0lgw== X-Gm-Message-State: AFqh2kp+n32kUg4zu/5vXpR8GqV1YovikAANOdAe+hfi9fHnQq/kY2IS xExC0M5+INgGDvEFOXJtR5HeCGtiXQaPMAUc3iNXZ9XR9FQICKGdS1FgyNJ08jMjaskObXg+Mi3 pboUBeu6d6N5OETcLhq5xbqaP2XEIwuppMHj2Xgbr3/Lw44mvxN8WP8l8C0Zp X-Received: by 2002:adf:ce0a:0:b0:246:e6df:86e7 with SMTP id p10-20020adfce0a000000b00246e6df86e7mr32039382wrn.5.1672910213570; Thu, 05 Jan 2023 01:16:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXtfNki8wBVAOiRI6cMT721rqRnJ8nbvPgdHeEyI+BoOVC46gHmXSH4kPIlY9sjHsgZ302feqQ== X-Received: by 2002:adf:ce0a:0:b0:246:e6df:86e7 with SMTP id p10-20020adfce0a000000b00246e6df86e7mr32039361wrn.5.1672910213161; Thu, 05 Jan 2023 01:16:53 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:49 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Yicong Yang , Yanan Wang , Igor Mammedov , Ani Sinha Subject: [PULL 46/51] tests: virt: Update expected ACPI tables for virt test Message-ID: <20230105091310.263867-47-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911276589100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yicong Yang Update the ACPI tables according to the acpi aml_build change, also empty bios-tables-test-allowed-diff.h. The disassembled differences between actual and expected PPTT: /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20180105 (64-bit version) * Copyright (c) 2000 - 2018 Intel Corporation * - * Disassembly of tests/data/acpi/virt/PPTT, Tue Nov 1 09:29:12 2022 + * Disassembly of /tmp/aml-DIIGV1, Tue Nov 1 09:29:12 2022 * * ACPI Data Table [PPTT] * * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */ [000h 0000 4] Signature : "PPTT" [Processor Prope= rties Topology Table] -[004h 0004 4] Table Length : 00000060 +[004h 0004 4] Table Length : 0000004C [008h 0008 1] Revision : 02 -[009h 0009 1] Checksum : 48 +[009h 0009 1] Checksum : A8 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 [024h 0036 1] Subtable Type : 00 [Processor Hierarchy No= de] [025h 0037 1] Length : 14 [026h 0038 2] Reserved : 0000 [028h 0040 4] Flags (decoded below) : 00000001 Physical package : 1 ACPI Processor ID valid : 0 [02Ch 0044 4] Parent : 00000000 [030h 0048 4] ACPI Processor ID : 00000000 [034h 0052 4] Private Resource Number : 00000000 [038h 0056 1] Subtable Type : 00 [Processor Hierarchy No= de] [039h 0057 1] Length : 14 [03Ah 0058 2] Reserved : 0000 -[03Ch 0060 4] Flags (decoded below) : 00000000 +[03Ch 0060 4] Flags (decoded below) : 0000000A Physical package : 0 - ACPI Processor ID valid : 0 + ACPI Processor ID valid : 1 [040h 0064 4] Parent : 00000024 [044h 0068 4] ACPI Processor ID : 00000000 [048h 0072 4] Private Resource Number : 00000000 -[04Ch 0076 1] Subtable Type : 00 [Processor Hierarchy No= de] -[04Dh 0077 1] Length : 14 -[04Eh 0078 2] Reserved : 0000 -[050h 0080 4] Flags (decoded below) : 0000000A - Physical package : 0 - ACPI Processor ID valid : 1 -[054h 0084 4] Parent : 00000038 -[058h 0088 4] ACPI Processor ID : 00000000 -[05Ch 0092 4] Private Resource Number : 00000000 - -Raw Table Data: Length 96 (0x60) +Raw Table Data: Length 76 (0x4C) - 0000: 50 50 54 54 60 00 00 00 02 48 42 4F 43 48 53 20 // PPTT`....HBOC= HS + 0000: 50 50 54 54 4C 00 00 00 02 A8 42 4F 43 48 53 20 // PPTTL.....BOC= HS 0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....B= XPC 0020: 01 00 00 00 00 14 00 00 01 00 00 00 00 00 00 00 // .............= ... - 0030: 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // .............= ... - 0040: 24 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // $............= ... - 0050: 0A 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 // ....8........= ... + 0030: 00 00 00 00 00 00 00 00 00 14 00 00 0A 00 00 00 // .............= ... + 0040: 24 00 00 00 00 00 00 00 00 00 00 00 // $........... PPTT.acpihmatvirt is also updated: /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20180105 (64-bit version) * Copyright (c) 2000 - 2018 Intel Corporation * - * Disassembly of tests/data/acpi/virt/PPTT.acpihmatvirt, Wed Dec 28 15:3= 6:06 2022 + * Disassembly of /tmp/aml-IPKJX1, Wed Dec 28 15:36:06 2022 * * ACPI Data Table [PPTT] * * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */ [000h 0000 4] Signature : "PPTT" [Processor Prope= rties Topology Table] -[004h 0004 4] Table Length : 000000C4 +[004h 0004 4] Table Length : 0000009C [008h 0008 1] Revision : 02 -[009h 0009 1] Checksum : 9E +[009h 0009 1] Checksum : FE [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 [024h 0036 1] Subtable Type : 00 [Processor Hierarchy No= de] [025h 0037 1] Length : 14 [026h 0038 2] Reserved : 0000 [028h 0040 4] Flags (decoded below) : 00000001 Physical package : 1 ACPI Processor ID valid : 0 [02Ch 0044 4] Parent : 00000000 [030h 0048 4] ACPI Processor ID : 00000000 [034h 0052 4] Private Resource Number : 00000000 [038h 0056 1] Subtable Type : 00 [Processor Hierarchy No= de] [039h 0057 1] Length : 14 [03Ah 0058 2] Reserved : 0000 -[03Ch 0060 4] Flags (decoded below) : 00000000 +[03Ch 0060 4] Flags (decoded below) : 0000000A Physical package : 0 - ACPI Processor ID valid : 0 + ACPI Processor ID valid : 1 [040h 0064 4] Parent : 00000024 [044h 0068 4] ACPI Processor ID : 00000000 [048h 0072 4] Private Resource Number : 00000000 [04Ch 0076 1] Subtable Type : 00 [Processor Hierarchy No= de] [04Dh 0077 1] Length : 14 [04Eh 0078 2] Reserved : 0000 [050h 0080 4] Flags (decoded below) : 0000000A Physical package : 0 ACPI Processor ID valid : 1 -[054h 0084 4] Parent : 00000038 -[058h 0088 4] ACPI Processor ID : 00000000 +[054h 0084 4] Parent : 00000024 +[058h 0088 4] ACPI Processor ID : 00000001 [05Ch 0092 4] Private Resource Number : 00000000 [060h 0096 1] Subtable Type : 00 [Processor Hierarchy No= de] [061h 0097 1] Length : 14 [062h 0098 2] Reserved : 0000 -[064h 0100 4] Flags (decoded below) : 0000000A - Physical package : 0 - ACPI Processor ID valid : 1 -[068h 0104 4] Parent : 00000038 +[064h 0100 4] Flags (decoded below) : 00000001 + Physical package : 1 + ACPI Processor ID valid : 0 +[068h 0104 4] Parent : 00000000 [06Ch 0108 4] ACPI Processor ID : 00000001 [070h 0112 4] Private Resource Number : 00000000 [074h 0116 1] Subtable Type : 00 [Processor Hierarchy No= de] [075h 0117 1] Length : 14 [076h 0118 2] Reserved : 0000 -[078h 0120 4] Flags (decoded below) : 00000001 - Physical package : 1 - ACPI Processor ID valid : 0 -[07Ch 0124 4] Parent : 00000000 -[080h 0128 4] ACPI Processor ID : 00000001 +[078h 0120 4] Flags (decoded below) : 0000000A + Physical package : 0 + ACPI Processor ID valid : 1 +[07Ch 0124 4] Parent : 00000060 +[080h 0128 4] ACPI Processor ID : 00000002 [084h 0132 4] Private Resource Number : 00000000 [088h 0136 1] Subtable Type : 00 [Processor Hierarchy No= de] [089h 0137 1] Length : 14 [08Ah 0138 2] Reserved : 0000 -[08Ch 0140 4] Flags (decoded below) : 00000000 - Physical package : 0 - ACPI Processor ID valid : 0 -[090h 0144 4] Parent : 00000074 -[094h 0148 4] ACPI Processor ID : 00000000 -[098h 0152 4] Private Resource Number : 00000000 - -[09Ch 0156 1] Subtable Type : 00 [Processor Hierarchy No= de] -[09Dh 0157 1] Length : 14 -[09Eh 0158 2] Reserved : 0000 -[0A0h 0160 4] Flags (decoded below) : 0000000A - Physical package : 0 - ACPI Processor ID valid : 1 -[0A4h 0164 4] Parent : 00000088 -[0A8h 0168 4] ACPI Processor ID : 00000002 -[0ACh 0172 4] Private Resource Number : 00000000 - -[0B0h 0176 1] Subtable Type : 00 [Processor Hierarchy No= de] -[0B1h 0177 1] Length : 14 -[0B2h 0178 2] Reserved : 0000 -[0B4h 0180 4] Flags (decoded below) : 0000000A +[08Ch 0140 4] Flags (decoded below) : 0000000A Physical package : 0 ACPI Processor ID valid : 1 -[0B8h 0184 4] Parent : 00000088 -[0BCh 0188 4] ACPI Processor ID : 00000003 -[0C0h 0192 4] Private Resource Number : 00000000 +[090h 0144 4] Parent : 00000060 +[094h 0148 4] ACPI Processor ID : 00000003 +[098h 0152 4] Private Resource Number : 00000000 -Raw Table Data: Length 196 (0xC4) +Raw Table Data: Length 156 (0x9C) - 0000: 50 50 54 54 C4 00 00 00 02 9E 42 4F 43 48 53 20 // PPTT......BOC= HS + 0000: 50 50 54 54 9C 00 00 00 02 FE 42 4F 43 48 53 20 // PPTT......BOC= HS 0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....B= XPC 0020: 01 00 00 00 00 14 00 00 01 00 00 00 00 00 00 00 // .............= ... - 0030: 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // .............= ... + 0030: 00 00 00 00 00 00 00 00 00 14 00 00 0A 00 00 00 // .............= ... 0040: 24 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // $............= ... - 0050: 0A 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 // ....8........= ... - 0060: 00 14 00 00 0A 00 00 00 38 00 00 00 01 00 00 00 // ........8....= ... - 0070: 00 00 00 00 00 14 00 00 01 00 00 00 00 00 00 00 // .............= ... - 0080: 01 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // .............= ... - 0090: 74 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // t............= ... - 00A0: 0A 00 00 00 88 00 00 00 02 00 00 00 00 00 00 00 // .............= ... - 00B0: 00 14 00 00 0A 00 00 00 88 00 00 00 03 00 00 00 // .............= ... - 00C0: 00 00 00 00 // .... + 0050: 0A 00 00 00 24 00 00 00 01 00 00 00 00 00 00 00 // ....$........= ... + 0060: 00 14 00 00 01 00 00 00 00 00 00 00 01 00 00 00 // .............= ... + 0070: 00 00 00 00 00 14 00 00 0A 00 00 00 60 00 00 00 // ............`= ... + 0080: 02 00 00 00 00 00 00 00 00 14 00 00 0A 00 00 00 // .............= ... + 0090: 60 00 00 00 03 00 00 00 00 00 00 00 // `........... Acked-by: Michael S. Tsirkin Reviewed-by: Yanan Wang Signed-off-by: Yicong Yang Message-Id: <20221229065513.55652-4-yangyicong@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 2 -- tests/data/acpi/virt/PPTT | Bin 96 -> 76 bytes tests/data/acpi/virt/PPTT.acpihmatvirt | Bin 196 -> 156 bytes 3 files changed, 2 deletions(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index fc12cd8c5c..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,3 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/PPTT", -"tests/data/acpi/virt/PPTT.acpihmatvirt", diff --git a/tests/data/acpi/virt/PPTT b/tests/data/acpi/virt/PPTT index f56ea63b369a604877374ad696c396e796ab1c83..7a1258ecf123555b24462c98ccb= b76b4ac1d0c2b 100644 GIT binary patch delta 32 fcmYfB;R*-{3GrcIU|?D?k;`ae01J-_kOKn%ZFdCM delta 53 pcmeZC;0g!`2}xjJU|{l?$YrDgWH5jU5Ca567#O&Klm(arApowi1QY-O diff --git a/tests/data/acpi/virt/PPTT.acpihmatvirt b/tests/data/acpi/virt/= PPTT.acpihmatvirt index 710dba5e793cf36df94087666db58af5f8d03684..4eef303a5b6168c6bc3795c2e2c= 53f65b4c4cfd4 100644 GIT binary patch delta 66 zcmX@YIERrdARr`U4g&)N)4z#aMiT>ACOU{Ps!YsOR^b8)CV(V>7z{)h7+_+|P$2-t C;0Zeb delta 75 zcmbQkc!ZHFARr{<2m=3DEH)4YjXMvM#-ZN(WaCOQfOiBM%$pg2Pbkf+cAQUT(DfCvKv N7mxypF@yL(0023a3f%wz --=20 MST From nobody Wed May 15 07:51:38 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=1672910527; cv=none; d=zohomail.com; s=zohoarc; b=hxcZVL14LgYe7YvDxro1ZcbvRGdEbwYJQMHwa4iU81giaYBvdWRKLz8oNILnffYNgfPRNnsuTnGkXaur0yKVsnmFKtyttxZjpwvoCaDw8x5s4QNK9VGAI1chATQj40mLu5ug6HShayePvY5pPFtSu9zyZFaT9hkUqJ8JGX0hb7M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672910527; 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=ybQ5VPM0RQMC9FhQy/98mXEjzu6B6AxIQ5B3/rDG9cY=; b=Nrspvyo3BmcindqASLnrcxfsTj2klAGltItEOMGO7lqEwOtYJwBIZLFf1QPqU/+xyJy3t2Kuzd3PhcjiTwvP8lmo2SbxvWO+ldUjJelGePNA3B+mIAofsREo5ud/VMrDPg4nHnRLAiXlJ8VLoipQjTB3llKDqJm8r1rKyJZNBGU= 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 1672910527073254.8119362351381; Thu, 5 Jan 2023 01:22:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMMx-00043Y-DZ; Thu, 05 Jan 2023 04:17:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMv-0003zP-Hk for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:01 -0500 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 1pDMMu-0007gh-4L for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:01 -0500 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_128_GCM_SHA256) id us-mta-590-U0zH7TGVN7OKEM0d-GhcuQ-1; Thu, 05 Jan 2023 04:16:58 -0500 Received: by mail-wr1-f71.google.com with SMTP id e10-20020adf9bca000000b0026e2396ab34so4695656wrc.18 for ; Thu, 05 Jan 2023 01:16:58 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id r16-20020a05600c35d000b003d2157627a8sm1725148wmq.47.2023.01.05.01.16.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910219; 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=ybQ5VPM0RQMC9FhQy/98mXEjzu6B6AxIQ5B3/rDG9cY=; b=fq2FnLlhpJtFYaQ3CauZT3iBeO+4vCbmv7CJ/gXSZWwbCSIHErxFwfx+P/Smx9PANvsphD Hb0dvFMB6X8V6TeBZRZDJ9GeLgZA/0EUywtBaadfy+lXdytrBthKinZBMn+5hK246EKXBN GOVop1qvYX1/+/WP2V2E+4tANV6wfMQ= X-MC-Unique: U0zH7TGVN7OKEM0d-GhcuQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ybQ5VPM0RQMC9FhQy/98mXEjzu6B6AxIQ5B3/rDG9cY=; b=6pr3qNW2SKbHnnB/z4JEqZiR43aqvbjmudX+NIPRrlYCjYTCcq9UHHwi0oZSBkJ+Gd zQEW8ZuCg1xtpi61rfnFcE7L4dSB6zfZCE9PFWy3cp8gc8IvIYpuiLBcVTZldmyO4amv QG1YEN2maWvncKeJOKHY2Sl5d5yVbP/DrVE6aUKlYcJVxNdOIuP8EeoEqrokvJYHrk88 RteQ0bL8HH2WWfufcXrsFLiGR0/ZA/HKyOoh61f206yoPcAqdCn/EMv2r0ZoM6adno9I 1OXAA4EdEaTzjQTXsyQrU0Qm6HGjXQymh9Z/py1FZNkUHBPVWBzhasQ7g/UGhguDriaq RQ8g== X-Gm-Message-State: AFqh2kpj55GCA7YaIDaMZ3uQ2Kv7Lw4eeF/gBUkUkpgsvgpvYpYUqUqI vFW9sZVWRUL2V/uFG3YClL8KaFX/TP8L0tjJz3yy1lIEBECdw1Mc1gegM8EKsghkvIZpHkMrkJL HAGjObwNcQUQ2mlt2is3Lh0oFKlUozsIYt2g3XCdIXXOk/1kMpYgUYUNmf9E/ X-Received: by 2002:a05:600c:1d28:b0:3d2:1d51:246e with SMTP id l40-20020a05600c1d2800b003d21d51246emr39082518wms.9.1672910216698; Thu, 05 Jan 2023 01:16:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXteDmINfxAz4daWAS3hfnTiE8Yenqon/ZRp97xVM6C21rO7k+6UZMLie8qFotwgdw+LZCZHhg== X-Received: by 2002:a05:600c:1d28:b0:3d2:1d51:246e with SMTP id l40-20020a05600c1d2800b003d21d51246emr39082496wms.9.1672910216373; Thu, 05 Jan 2023 01:16:56 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:53 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Yicong Yang , Yanan Wang , Igor Mammedov , Ani Sinha Subject: [PULL 47/51] tests: acpi: Add and whitelist *.topology blobs Message-ID: <20230105091310.263867-48-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672910527886100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yicong Yang Add and whitelist *.topology blobs, prepares for the aarch64's ACPI topology building test. Reviewed-by: Yanan Wang Signed-off-by: Yicong Yang Message-Id: <20221229065513.55652-5-yangyicong@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 3 +++ tests/data/acpi/virt/APIC.topology | 0 tests/data/acpi/virt/DSDT.topology | 0 tests/data/acpi/virt/PPTT.topology | 0 4 files changed, 3 insertions(+) create mode 100644 tests/data/acpi/virt/APIC.topology create mode 100644 tests/data/acpi/virt/DSDT.topology create mode 100644 tests/data/acpi/virt/PPTT.topology diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..90f53f9c1d 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,4 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/APIC.topology", +"tests/data/acpi/virt/DSDT.topology", +"tests/data/acpi/virt/PPTT.topology", diff --git a/tests/data/acpi/virt/APIC.topology b/tests/data/acpi/virt/APIC= .topology new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/virt/DSDT.topology b/tests/data/acpi/virt/DSDT= .topology new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/virt/PPTT.topology b/tests/data/acpi/virt/PPTT= .topology new file mode 100644 index 0000000000..e69de29bb2 --=20 MST From nobody Wed May 15 07:51:38 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=1672911798; cv=none; d=zohomail.com; s=zohoarc; b=V1r5BJ7cXGtC84pwHy6qsZs81DQrU7LVO9Yc42qjGrymcx7mkezuu4t1gEf25XnWtnp9r4auTi+bCh+fmF7hu8AJikhkb3r+9PMyirG4EY454qkY/x3gydliP3Ts4g3fwXurIOHVFpQnNxMzjS4Aeq4Cw4i8T/PVEYOySmwuyCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911798; 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=33CZpHdF+tcuk4L8apS5bqjpuwv5xoitissTN5dMCIs=; b=AMi26nQG12EO/DDweA+SoHUuZvKudcYJ7lZx4FYIRBjTDaydtDsCCrkWyuE8+1lUEMOBi/wVj3QApZSDy3ihdMi3jOGxgQSqRgeRHGr5nCl+iJe67zJgYhMvVUcTKusM4jeXlvOxqHaFjXNzrkOvmXj3qBYRbR8wC7+xkY/M8cQ= 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 1672911798919769.8986973617918; Thu, 5 Jan 2023 01:43:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMN0-00049n-UL; Thu, 05 Jan 2023 04:17:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMMy-000463-Mi for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:04 -0500 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 1pDMMx-0007h8-86 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:04 -0500 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_128_GCM_SHA256) id us-mta-213-DgzN2UOyPyS43_C29CZpyg-1; Thu, 05 Jan 2023 04:17:01 -0500 Received: by mail-wr1-f69.google.com with SMTP id v4-20020adfa1c4000000b002753317406aso3916659wrv.21 for ; Thu, 05 Jan 2023 01:17:00 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id h8-20020a05600c350800b003d990372dd5sm1850899wmq.20.2023.01.05.01.16.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910222; 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=33CZpHdF+tcuk4L8apS5bqjpuwv5xoitissTN5dMCIs=; b=FFMr62t/udm48qdCTePJZ0dh4CUjpErpUI5tnrKOI6lBUNYj8S6E+vddXscNdjxohivTYm hiFTsArnIpBovmH+0cL5xyVjNGB4lvBjwyUfGm+Ddu1ggdwN+uxGhWjUxT9RAeX+OeMbwK gKNSf0ndRXvRb/uAZCtfwUcUV3MYgwI= X-MC-Unique: DgzN2UOyPyS43_C29CZpyg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=33CZpHdF+tcuk4L8apS5bqjpuwv5xoitissTN5dMCIs=; b=p4TsSvn3vM0fwxumeJEsAWqnD7Fqy91WNWpIjM3wdwkDVDJcPEFQDPwijnRRwOyCRe i/4Q7Ibn2+vrPM+NmupVtIlFs5pluNnoagQz6YFmR2KHwi6MYi/bCgpui5zC+yPJIFQ3 4tXUq9pe5NU8D8XJygmsaXghYniaLLemyOry6Nq89gUv3WMjHWbYOK2lIVo5udoiSBB5 VU3sPjHrrhRuzb+xf2gS9n2pFeDlVzyoz5VrBGJc15aSb7AWbmJZ+XF2VDtelUYmO1j0 cuCXLRdOkQXSY3qr6PHBjeysgKEF7TVCDnoMKByGgCk/7QUTqU7KkuBund2gOBq0ahMh TH1g== X-Gm-Message-State: AFqh2kq9zSfoy1TGyhQ1oPwvOzdojeiAxZlpasGtCBfmZbBbMXcRZI5k 76uPJ5dPE9VJTeltmT4qNxZE+3zTT/omaMKvNrTar3eL9StezpGQ/EV77at9remQ82kBcw+/hnl gIFJ+vK2f8pRxWDRLj3C86CQzGad5qM3G1K/Wdaav6rrwmhTXl6xeULkmW6zO X-Received: by 2002:a05:600c:250:b0:3d2:2043:9cbf with SMTP id 16-20020a05600c025000b003d220439cbfmr34721577wmj.10.1672910219732; Thu, 05 Jan 2023 01:16:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXtmk1uklPvsjnLG7WgTciEdmTH9BXmeLjlfZgPN0ZXetsauEz+7inFIQ31ZfIqoP2n2fw4YQQ== X-Received: by 2002:a05:600c:250:b0:3d2:2043:9cbf with SMTP id 16-20020a05600c025000b003d220439cbfmr34721559wmj.10.1672910219514; Thu, 05 Jan 2023 01:16:59 -0800 (PST) Date: Thu, 5 Jan 2023 04:16:56 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Yicong Yang , Yanan Wang , Igor Mammedov , Ani Sinha Subject: [PULL 48/51] tests: acpi: aarch64: Add topology test for aarch64 Message-ID: <20230105091310.263867-49-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911800439100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yicong Yang Add test for aarch64's ACPI topology building for all the supported levels. Acked-by: Michael S. Tsirkin Reviewed-by: Yanan Wang Tested-by: Yanan Wang Signed-off-by: Yicong Yang Message-Id: <20221229065513.55652-6-yangyicong@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 395d441212..e954a9cb39 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1720,6 +1720,24 @@ static void test_acpi_virt_tcg(void) free_test_data(&data); } =20 +static void test_acpi_virt_tcg_topology(void) +{ + test_data data =3D { + .machine =3D "virt", + .variant =3D ".topology", + .tcg_only =3D true, + .uefi_fl1 =3D "pc-bios/edk2-aarch64-code.fd", + .uefi_fl2 =3D "pc-bios/edk2-arm-vars.fd", + .cd =3D "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.= qcow2", + .ram_start =3D 0x40000000ULL, + .scan_len =3D 128ULL * 1024 * 1024, + }; + + test_acpi_one("-cpu cortex-a57 " + "-smp sockets=3D1,clusters=3D2,cores=3D2,threads=3D2", &= data); + free_test_data(&data); +} + static void test_acpi_q35_viot(void) { test_data data =3D { @@ -2057,6 +2075,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/virt", test_acpi_virt_tcg); qtest_add_func("acpi/virt/acpihmatvirt", test_acpi_virt_tcg_acpi_hmat); + qtest_add_func("acpi/virt/topology", test_acpi_virt_tcg_topolo= gy); qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem= ); qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp); qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); --=20 MST From nobody Wed May 15 07:51:38 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=1672911646; cv=none; d=zohomail.com; s=zohoarc; b=KuZyF4r60omsTMCH8GB80OOXLlhyGZzWpytv1xmxsn9wj0KpsrBaZhqsQvPqCLvLDFnnjN7izxftZqvGxk3pXHrOqKflVx94Cz78vjVZTd43/Pbx1iFZL+491sHnnrla5ThTF8+V7tRPkcZRopzN/qGxrI1hvx5xTo4e/nnLyiw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672911646; 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=42eEBg1Y5QA2bIupu3kj4wjuENoQcVq+79ay8y26Ts4=; b=b2ZUN01DcbdA6PVuWSDa9wNCgPsrewk5evvn9DFdvewc+ZqVel/YmRps+yiLHyLdoYOr0oRTExxrGdZpXw9kM0rem0irHAq5PCowxj4U42d8oUBCGCOgbq7tk+TnFVD3+jrZySYAXn381mpgx/6LUfR3qH1Zy0hwg7G34j40TT4= 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 1672911646751917.9408873200051; Thu, 5 Jan 2023 01:40:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMN6-0004JZ-Tf; Thu, 05 Jan 2023 04:17:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMN4-0004IQ-J7 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:11 -0500 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 1pDMN1-0007i0-Pm for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:09 -0500 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_128_GCM_SHA256) id us-mta-612-ySU3VWPoOPiGSRLfE_7Ufg-1; Thu, 05 Jan 2023 04:17:06 -0500 Received: by mail-wr1-f72.google.com with SMTP id v4-20020adfa1c4000000b002753317406aso3916724wrv.21 for ; Thu, 05 Jan 2023 01:17:06 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id m18-20020a05600c4f5200b003c71358a42dsm2186117wmq.18.2023.01.05.01.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910227; 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=42eEBg1Y5QA2bIupu3kj4wjuENoQcVq+79ay8y26Ts4=; b=ReC4ZNtKUsXzpWwozfjGS7WJTak9rcIUaJb75YLzWFvRoN3znuuVyZ4Fq6Rsx4C2PWAgsd /TvA+BnBK3DkUTnJ9s4gYrJu/A/bBgBfoxVMT9apOVdj0ytVC2a5Cr3WKAtoqYj/uLcZHe dHn/hkKt5jkjXGwD9ELMFpoqywXXeS4= X-MC-Unique: ySU3VWPoOPiGSRLfE_7Ufg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=42eEBg1Y5QA2bIupu3kj4wjuENoQcVq+79ay8y26Ts4=; b=VdHCCNQMwyrpkgC3DBWfjHLjja7t+xvVrWZD+yp9ESuVjtpAdVyxwOsRqwlJhFFyT1 iMH3uaV6AWNEdd9OZNiX0lp2uMqiszdD5N7WBizZEGEFZ/X1uOSXn/MF2GyBmCJFu6KA dhbomZ2/VzqxlUmVwcGIDyfPXq50otOO2s1MM/3udrVBEm2lFOuoKz38IVAkKaxRngmj 3xirjvHUK3SnDczS1G7DY5uIKqtLGMvKFjfo+d7tWLakI83DsCHkmwQkAfVVrSRJ0EHb nigCLrvvZhyB2C6w4vHjsfXtXvShF0jNRIDmGXtrrSH1ohcysuAdZ/llwrN1XC9zcAGv koOQ== X-Gm-Message-State: AFqh2kojHJ6EIc/3Ztf0m9yrqpe/wDfbHOdK2V4Kgw2XEPvQfCRBOgjd FO4FXEgakJTY945JLFoUF8TFFklNpHW6M+WPRiiNsrlV4vKSdBtlnwlxSvU6K2MLlDjulRvzCg6 Dp2nj6NDdCDfAfDcCXSkdcY/nxaSKqCRZTpqH1HvH4OBfk2PHUTmkrJhDDMvS X-Received: by 2002:a05:600c:4e4f:b0:3cf:9d32:db67 with SMTP id e15-20020a05600c4e4f00b003cf9d32db67mr35264652wmq.3.1672910223335; Thu, 05 Jan 2023 01:17:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXtFVwsoLatHXy3evYUgpMzBq9UbVIBce7+Tdkyt/BUlq5HyoTPUZgm44kdETM/tKbZZQv3apQ== X-Received: by 2002:a05:600c:4e4f:b0:3cf:9d32:db67 with SMTP id e15-20020a05600c4e4f00b003cf9d32db67mr35264621wmq.3.1672910222874; Thu, 05 Jan 2023 01:17:02 -0800 (PST) Date: Thu, 5 Jan 2023 04:17:00 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Yicong Yang , Yanan Wang , Igor Mammedov , Ani Sinha Subject: [PULL 49/51] tests: acpi: aarch64: Add *.topology tables Message-ID: <20230105091310.263867-50-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672911647443100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yicong Yang Add *.topology tables for the aarch64's topology test and empty bios-tables-test-allowed-diff.h The disassembled differences between actual and expected PPTT (the table which we actually care about): +/* + * Intel ACPI Component Architecture + * AML/ASL+ Disassembler version 20180105 (64-bit version) + * Copyright (c) 2000 - 2018 Intel Corporation + * + * Disassembly of /tmp/aml-WUN4U1, Tue Nov 1 09:51:52 2022 + * + * ACPI Data Table [PPTT] + * + * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue + */ + +[000h 0000 4] Signature : "PPTT" [Processor Prope= rties Topology Table] +[004h 0004 4] Table Length : 00000150 +[008h 0008 1] Revision : 02 +[009h 0009 1] Checksum : 7C +[00Ah 0010 6] Oem ID : "BOCHS " +[010h 0016 8] Oem Table ID : "BXPC " +[018h 0024 4] Oem Revision : 00000001 +[01Ch 0028 4] Asl Compiler ID : "BXPC" +[020h 0032 4] Asl Compiler Revision : 00000001 + + +[024h 0036 1] Subtable Type : 00 [Processor Hierarchy No= de] +[025h 0037 1] Length : 14 +[026h 0038 2] Reserved : 0000 +[028h 0040 4] Flags (decoded below) : 00000001 + Physical package : 1 + ACPI Processor ID valid : 0 +[02Ch 0044 4] Parent : 00000000 +[030h 0048 4] ACPI Processor ID : 00000000 +[034h 0052 4] Private Resource Number : 00000000 + +[038h 0056 1] Subtable Type : 00 [Processor Hierarchy No= de] +[039h 0057 1] Length : 14 +[03Ah 0058 2] Reserved : 0000 +[03Ch 0060 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[040h 0064 4] Parent : 00000024 +[044h 0068 4] ACPI Processor ID : 00000000 +[048h 0072 4] Private Resource Number : 00000000 + +[04Ch 0076 1] Subtable Type : 00 [Processor Hierarchy No= de] +[04Dh 0077 1] Length : 14 +[04Eh 0078 2] Reserved : 0000 +[050h 0080 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[054h 0084 4] Parent : 00000038 +[058h 0088 4] ACPI Processor ID : 00000000 +[05Ch 0092 4] Private Resource Number : 00000000 + +[060h 0096 1] Subtable Type : 00 [Processor Hierarchy No= de] +[061h 0097 1] Length : 14 +[062h 0098 2] Reserved : 0000 +[064h 0100 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[068h 0104 4] Parent : 0000004C +[06Ch 0108 4] ACPI Processor ID : 00000000 +[070h 0112 4] Private Resource Number : 00000000 + +[074h 0116 1] Subtable Type : 00 [Processor Hierarchy No= de] +[075h 0117 1] Length : 14 +[076h 0118 2] Reserved : 0000 +[078h 0120 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[07Ch 0124 4] Parent : 0000004C +[080h 0128 4] ACPI Processor ID : 00000001 +[084h 0132 4] Private Resource Number : 00000000 + +[088h 0136 1] Subtable Type : 00 [Processor Hierarchy No= de] +[089h 0137 1] Length : 14 +[08Ah 0138 2] Reserved : 0000 +[08Ch 0140 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[090h 0144 4] Parent : 00000038 +[094h 0148 4] ACPI Processor ID : 00000001 +[098h 0152 4] Private Resource Number : 00000000 + +[09Ch 0156 1] Subtable Type : 00 [Processor Hierarchy No= de] +[09Dh 0157 1] Length : 14 +[09Eh 0158 2] Reserved : 0000 +[0A0h 0160 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[0A4h 0164 4] Parent : 00000088 +[0A8h 0168 4] ACPI Processor ID : 00000002 +[0ACh 0172 4] Private Resource Number : 00000000 + +[0B0h 0176 1] Subtable Type : 00 [Processor Hierarchy No= de] +[0B1h 0177 1] Length : 14 +[0B2h 0178 2] Reserved : 0000 +[0B4h 0180 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[0B8h 0184 4] Parent : 00000088 +[0BCh 0188 4] ACPI Processor ID : 00000003 +[0C0h 0192 4] Private Resource Number : 00000000 + +[0C4h 0196 1] Subtable Type : 00 [Processor Hierarchy No= de] +[0C5h 0197 1] Length : 14 +[0C6h 0198 2] Reserved : 0000 +[0C8h 0200 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[0CCh 0204 4] Parent : 00000024 +[0D0h 0208 4] ACPI Processor ID : 00000001 +[0D4h 0212 4] Private Resource Number : 00000000 + +[0D8h 0216 1] Subtable Type : 00 [Processor Hierarchy No= de] +[0D9h 0217 1] Length : 14 +[0DAh 0218 2] Reserved : 0000 +[0DCh 0220 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[0E0h 0224 4] Parent : 000000C4 +[0E4h 0228 4] ACPI Processor ID : 00000000 +[0E8h 0232 4] Private Resource Number : 00000000 + +[0ECh 0236 1] Subtable Type : 00 [Processor Hierarchy No= de] +[0EDh 0237 1] Length : 14 +[0EEh 0238 2] Reserved : 0000 +[0F0h 0240 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[0F4h 0244 4] Parent : 000000D8 +[0F8h 0248 4] ACPI Processor ID : 00000004 +[0FCh 0252 4] Private Resource Number : 00000000 + +[100h 0256 1] Subtable Type : 00 [Processor Hierarchy No= de] +[101h 0257 1] Length : 14 +[102h 0258 2] Reserved : 0000 +[104h 0260 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[108h 0264 4] Parent : 000000D8 +[10Ch 0268 4] ACPI Processor ID : 00000005 +[110h 0272 4] Private Resource Number : 00000000 + +[114h 0276 1] Subtable Type : 00 [Processor Hierarchy No= de] +[115h 0277 1] Length : 14 +[116h 0278 2] Reserved : 0000 +[118h 0280 4] Flags (decoded below) : 00000000 + Physical package : 0 + ACPI Processor ID valid : 0 +[11Ch 0284 4] Parent : 000000C4 +[120h 0288 4] ACPI Processor ID : 00000001 +[124h 0292 4] Private Resource Number : 00000000 + +[128h 0296 1] Subtable Type : 00 [Processor Hierarchy No= de] +[129h 0297 1] Length : 14 +[12Ah 0298 2] Reserved : 0000 +[12Ch 0300 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[130h 0304 4] Parent : 00000114 +[134h 0308 4] ACPI Processor ID : 00000006 +[138h 0312 4] Private Resource Number : 00000000 + +[13Ch 0316 1] Subtable Type : 00 [Processor Hierarchy No= de] +[13Dh 0317 1] Length : 14 +[13Eh 0318 2] Reserved : 0000 +[140h 0320 4] Flags (decoded below) : 0000000E + Physical package : 0 + ACPI Processor ID valid : 1 +[144h 0324 4] Parent : 00000114 +[148h 0328 4] ACPI Processor ID : 00000007 +[14Ch 0332 4] Private Resource Number : 00000000 + +Raw Table Data: Length 336 (0x150) + + 0000: 50 50 54 54 50 01 00 00 02 7C 42 4F 43 48 53 20 // PPTTP....|BOC= HS + 0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....B= XPC + 0020: 01 00 00 00 00 14 00 00 01 00 00 00 00 00 00 00 // .............= ... + 0030: 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // .............= ... + 0040: 24 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // $............= ... + 0050: 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 // ....8........= ... + 0060: 00 14 00 00 0E 00 00 00 4C 00 00 00 00 00 00 00 // ........L....= ... + 0070: 00 00 00 00 00 14 00 00 0E 00 00 00 4C 00 00 00 // ............L= ... + 0080: 01 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // .............= ... + 0090: 38 00 00 00 01 00 00 00 00 00 00 00 00 14 00 00 // 8............= ... + 00A0: 0E 00 00 00 88 00 00 00 02 00 00 00 00 00 00 00 // .............= ... + 00B0: 00 14 00 00 0E 00 00 00 88 00 00 00 03 00 00 00 // .............= ... + 00C0: 00 00 00 00 00 14 00 00 00 00 00 00 24 00 00 00 // ............$= ... + 00D0: 01 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 // .............= ... + 00E0: C4 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 // .............= ... + 00F0: 0E 00 00 00 D8 00 00 00 04 00 00 00 00 00 00 00 // .............= ... + 0100: 00 14 00 00 0E 00 00 00 D8 00 00 00 05 00 00 00 // .............= ... + 0110: 00 00 00 00 00 14 00 00 00 00 00 00 C4 00 00 00 // .............= ... + 0120: 01 00 00 00 00 00 00 00 00 14 00 00 0E 00 00 00 // .............= ... + 0130: 14 01 00 00 06 00 00 00 00 00 00 00 00 14 00 00 // .............= ... + 0140: 0E 00 00 00 14 01 00 00 07 00 00 00 00 00 00 00 // .............= ... Acked-by: Michael S. Tsirkin Reviewed-by: Yanan Wang Signed-off-by: Yicong Yang Message-Id: <20221229065513.55652-7-yangyicong@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 3 --- tests/data/acpi/virt/APIC.topology | Bin 0 -> 732 bytes tests/data/acpi/virt/DSDT.topology | Bin 0 -> 5398 bytes tests/data/acpi/virt/PPTT.topology | Bin 0 -> 336 bytes 4 files changed, 3 deletions(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index 90f53f9c1d..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,4 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/APIC.topology", -"tests/data/acpi/virt/DSDT.topology", -"tests/data/acpi/virt/PPTT.topology", diff --git a/tests/data/acpi/virt/APIC.topology b/tests/data/acpi/virt/APIC= .topology index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3a6ac525e7faeaec025fa6b3fc0= 1dc67110e1296 100644 GIT binary patch literal 732 zcmbV~I}XAy5JV@5`A9$wWsU-I0~MBNI4nouFziE~Aj){8k#|;}Cl|hyTYmRadQJCy zeT>ty$Z0RrCRg C#|;4h literal 0 HcmV?d00001 diff --git a/tests/data/acpi/virt/DSDT.topology b/tests/data/acpi/virt/DSDT= .topology index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..501314c91be01d927fd125e0c72= e919fdd85592e 100644 GIT binary patch literal 5398 zcmZvg%WoT16o>EFlh__VVmr?J;S@^6vl`n?la>}@kDbINPK+mQkX*@?5QvgZB`Ty+ zA*ERq=3D#EBW9i&M78%V6!v17rS4gUZ;%(-)ClHYO9NEy$Wd(SuX%^YWrr|CEMr>B&P zoiz5mZGWZlN!MGU#ZpS?ZT*>lwrAZR_>DpTc;0heH#yjDH?wuG+ooVmB?ougO=3DZR^ z(wNmhUZA|HH0H$2U`-s1o55@1plt?M#lbN%cwHPEH-l^9V4{C~)7$Grmc7ol>sBhE zWpd#4{KC95^E{>WrAev0Qa_9<%eq9-6S@lPn+M*e0e{@;+@&j2rCfi%?xZQ%t6K(9 zaB>C_OU;Ivb^Bf~y0|;Ly*)}@y*TW7=3DEcDs6$=3DmUA|kv89H9^U3L>U15S0+o&}R|e zDvoes62k^Y6&c|j9bv>J#yBu)$Ov!z2*Z{bNnl(zR@(?8Au)2mSVP9TDXbAjQexzRv5t%zA|oX+iom!5j7s?B7 |Vw8Y!6B%Ne z@-InL>eIk@9~p9;W~B3&1;#C8$aR{P81ulmjSRU?a}r|_7#|=3D*uG0yLu?&n4ks;S< zUSg~OV*?p-ofagz}P{CT&GJC<0ddVz^KV}x-2nn0b>^#a-EhX#s|RI3mLn=3D zbiH z3nQIH6LV%P$fK!Is56Nl%%v{L%nc)*8BL`YNFR}=3D2ALG<%;+fbATv6HxYC)?)VRr{ zsX-=3D%I+M;QIEo!)MrU9LnbA~gnL^7TlS1?yW1eF{X5=3D|$GNY5H5Ix74CpD#XKG9Ta zvCxx3^h_|%1oKRAPYTg9$vl(HlUg$Lq!2w*%#+$_bM=3DBtlH#5eqNl?=3D9p*_b9C}iS zo@wTpW}a#8Ng;Y>m}iE0Qp<;)6ryLAd1jesmU~i&o;l{3W1iF^q9=3DvuIl(+9nCArd zq!2yn=3DZvZGpo;U%lUhpjq!2v|%(K8e3*3`J^ei&ZBJ-pc6g??K&q?Mv$vh{yCxz%) zVxA@DNi8dSQiz`PW0|f{^dDl1c}{Up3ej_#c}_D=3DYH`t%LiC(ro-@pIhI>+op7i4q z?&mD?q?Q;xDMZgX<~hea=3DeQ?@=3DsC|k=3Db0z9(CA4adM+@}1?IWHJt;)bMdrE4JgMbI zPYTgLGEjoHqh@NHUS!SMP?n$BX>>syneJjn+H~mod+|Ba` zahG08=3D+n|-V-3|vVb!C&QW*tS%nQQL+SSg z$a+IynSGoUHoBZe?+uW3MPQkIA*+-hc#XO`qyM2Qzd-$9U!Fws%AgYI@7Sl8%-Q_0_WR%d>NlMqXa4ET{pNK}Qzu`lvqIdm^om||b?jctXVs`* zbm^L_IqoahC%6Z6b;=3DtTmqu^V^Txb4Yb5Sp)$bU$TFrqear1()q8m?o!I-6ikZ@GArKLgZ-hS$l4j!E5Po6$-bien!d(dk*NB!eD My@B5+&m2qr5A>`*Jpcdz literal 0 HcmV?d00001 diff --git a/tests/data/acpi/virt/PPTT.topology b/tests/data/acpi/virt/PPTT= .topology index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3fbcae5ff08aaf16fedf4da45e9= 41661d79c1174 100644 GIT binary patch literal 336 zcmWFt2nh*bWME*baq@Te2v%^42yj*a0-z8Bhz+6{L>L&rG>8oYKrs+dflv?45YUMh?!vef$Csl%t&G&Cde(wdO>1GKm-gx_1*yTS+Iz)B8h>R aAic=3Duf$S9l3b27BK>%tVNQ@mK!T (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 1672910578406680.2982280915986; Thu, 5 Jan 2023 01:22:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMN8-0004Lr-71; Thu, 05 Jan 2023 04:17:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMN6-0004JO-HT for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:12 -0500 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 1pDMN4-0007iF-Ga for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:12 -0500 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_128_GCM_SHA256) id us-mta-371--K3nEbfQMJCShNkD2COJfA-1; Thu, 05 Jan 2023 04:17:08 -0500 Received: by mail-wr1-f70.google.com with SMTP id k11-20020adfb34b000000b0027811695ca6so3588234wrd.16 for ; Thu, 05 Jan 2023 01:17:08 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id v16-20020a05600c445000b003c6c3fb3cf6sm1865192wmn.18.2023.01.05.01.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:17:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910229; 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=m9Zrv13isEEPPm2NdgxNIU2t+AnjncN+LEIS9+UfuxQ=; b=QTS9LOtyHOEHVqrpM6/yeVcwyBGvoyrfhumhDC7viGrLrIhAcpMavZ92fYy/On1sPR7OwF XpR3e+He6PN/b1rVaySB1VrwSxwilo5vAnroSIE6k7ieaeolDoqEK4FXKUX9KOn9W++ye3 AQ3YUyzkDn9stuZ5DkgBQlCndPa13rc= X-MC-Unique: -K3nEbfQMJCShNkD2COJfA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=m9Zrv13isEEPPm2NdgxNIU2t+AnjncN+LEIS9+UfuxQ=; b=xMGw4dCOA+21DhTpEKX4qIKkBUmU5s6GSmtLkgE/GILXEvvOmXplt600qEoCwrFYSJ EmPoeg0Nb4xhgX+EjmDDa02K0z+N5zlbt8gdFQ49vRDpkmP/W/Foxe0e2phQ/r/hvbyo 8lUuihFJBxoaBw939fD+tLoYtEzahtCiGz6JPxrPOcTWVvA65ksUN3RcRhkA7ig8WohC KO8IdC1EP8D7Va5QLF5BLofiSl2QipvjTza0iWZSOSa5sJJciO/OzPq3E34g6DtMpRSb 9IFexonDl8djEV5NXTFmMstzpxGJDUpEirIF/nnQ1ErvvTrbg5JAsY2w5+AjZJp714Bf IIEQ== X-Gm-Message-State: AFqh2krlBsqEK7zGeITymMNVe5FlIn7sXjBMzL+Ll3cJC/OsJo2+Z1X6 lBXHUXCZV3BMqfWTlnIfWzzDkmg6frJq4tHS28OpYygjObydyJKGngV9OiwoZu4+MhlwLypTzIO 9aJT9HWP5iFYOYe/ZMvbj3XX92z0XPYJIirOZe4IPcLg0A1nhHUuVXTnmY+Ro X-Received: by 2002:a05:600c:4d25:b0:3d3:5b7a:1791 with SMTP id u37-20020a05600c4d2500b003d35b7a1791mr44344724wmp.41.1672910226790; Thu, 05 Jan 2023 01:17:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXvj3QDRD7BdqYe9ZRX4QP38RyIXNQI1wLNp4NwoN+3pTSgrsyAPVDwNA8AJwz3zE7oF0mFJnQ== X-Received: by 2002:a05:600c:4d25:b0:3d3:5b7a:1791 with SMTP id u37-20020a05600c4d2500b003d35b7a1791mr44344701wmp.41.1672910226463; Thu, 05 Jan 2023 01:17:06 -0800 (PST) Date: Thu, 5 Jan 2023 04:17:03 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Laszlo Ersek , Ani Sinha , Ard Biesheuvel , Igor Mammedov , Paolo Bonzini , qemu-stable@nongnu.org, Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: [PULL 50/51] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block Message-ID: <20230105091310.263867-51-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1672910580033100003 From: Laszlo Ersek The modern ACPI CPU hotplug interface was introduced in the following series (aa1dd39ca307..679dd1a957df), released in v2.7.0: 1 abd49bc2ed2f docs: update ACPI CPU hotplug spec with new protocol 2 16bcab97eb9f pc: piix4/ich9: add 'cpu-hotplug-legacy' property 3 5e1b5d93887b acpi: cpuhp: add CPU devices AML with _STA method 4 ac35f13ba8f8 pc: acpi: introduce AcpiDeviceIfClass.madt_cpu hook 5 d2238cb6781d acpi: cpuhp: implement hot-add parts of CPU hotplug interface 6 8872c25a26cc acpi: cpuhp: implement hot-remove parts of CPU hotplug interface 7 76623d00ae57 acpi: cpuhp: add cpu._OST handling 8 679dd1a957df pc: use new CPU hotplug interface since 2.7 machine type Before patch#1, "docs/specs/acpi_cpu_hotplug.txt" only specified 1-byte accesses for the hotplug register block. Patch#1 preserved the same restriction for the legacy register block, but: - it specified DWORD accesses for some of the modern registers, - in particular, the switch from the legacy block to the modern block would require a DWORD write to the *legacy* block. The latter functionality was then implemented in cpu_status_write() [hw/acpi/cpu_hotplug.c], in patch#8. Unfortunately, all DWORD accesses depended on a dormant bug: the one introced in earlier commit a014ed07bd5a ("memory: accept mismatching sizes in memory_region_access_valid", 2013-05-29); first released in v1.6.0. Due to commit a014ed07bd5a, the DWORD accesses to the *legacy* CPU hotplug register block would work in spite of the above series *not* relaxing "valid.max_access_size =3D 1" in "hw/acpi/cpu_hotplug.c": > static const MemoryRegionOps AcpiCpuHotplug_ops =3D { > .read =3D cpu_status_read, > .write =3D cpu_status_write, > .endianness =3D DEVICE_LITTLE_ENDIAN, > .valid =3D { > .min_access_size =3D 1, > .max_access_size =3D 1, > }, > }; Later, in commits e6d0c3ce6895 ("acpi: cpuhp: introduce 'Command data 2' field", 2020-01-22) and ae340aa3d256 ("acpi: cpuhp: spec: add typical usecases", 2020-01-22), first released in v5.0.0, the modern CPU hotplug interface (including the documentation) was extended with another DWORD *read* access, namely to the "Command data 2" register, which would be important for the guest to confirm whether it managed to switch the register block from legacy to modern. This functionality too silently depended on the bug from commit a014ed07bd5a. In commit 5d971f9e6725 ('memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"', 2020-06-26), first released in v5.1.0, the bug from commit a014ed07bd5a was fixed (the commit was reverted). That swiftly exposed the bug in "AcpiCpuHotplug_ops", still present from the v2.7.0 series quoted at the top -- namely the fact that "valid.max_access_size =3D 1" didn't match what the guest was supposed to do, according to the spec ("docs/specs/acpi_cpu_hotplug.txt"). The symptom is that the "modern interface negotiation protocol" described in commit ae340aa3d256: > + Use following steps to detect and enable modern CPU hotplug interf= ace: > + 1. Store 0x0 to the 'CPU selector' register, > + attempting to switch to modern mode > + 2. Store 0x0 to the 'CPU selector' register, > + to ensure valid selector value > + 3. Store 0x0 to the 'Command field' register, > + 4. Read the 'Command data 2' register. > + If read value is 0x0, the modern interface is enabled. > + Otherwise legacy or no CPU hotplug interface available falls apart for the guest: steps 1 and 2 are lost, because they are DWORD writes; so no switching happens. Step 3 (a single-byte write) is not lost, but it has no effect; see the condition in cpu_status_write() in patch#8. And step 4 *misleads* the guest into thinking that the switch worked: the DWORD read is lost again -- it returns zero to the guest without ever reaching the device model, so the guest never learns the switch didn't work. This means that guest behavior centered on the "Command data 2" register worked *only* in the v5.0.0 release; it got effectively regressed in v5.1.0. To make things *even more* complicated, the breakage was (and remains, as of today) visible with TCG acceleration only. Commit 5d971f9e6725 makes no difference with KVM acceleration -- the DWORD accesses still work, despite "valid.max_access_size =3D 1". As commit 5d971f9e6725 suggests, fix the problem by raising "valid.max_access_size" to 4 -- the spec now clearly instructs the guest to perform DWORD accesses to the legacy register block too, for enabling (and verifying!) the modern block. In order to keep compatibility for the device model implementation though, set "impl.max_access_size =3D 1", so that wide accesses be split before they reach the legacy read/write handlers, like they always have been on KVM, and like they were on TCG before 5d971f9e6725 (v5.1.0). Tested with: - OVMF IA32 + qemu-system-i386, CPU hotplug/hot-unplug with SMM, intermixed with ACPI S3 suspend/resume, using KVM accel (regression-test); - OVMF IA32X64 + qemu-system-x86_64, CPU hotplug/hot-unplug with SMM, intermixed with ACPI S3 suspend/resume, using KVM accel (regression-test); - OVMF IA32 + qemu-system-i386, SMM enabled, using TCG accel; verified the register block switch and the present/possible CPU counting through the modern hotplug interface, during OVMF boot (bugfix test); - I do not have any testcase (guest payload) for regression-testing CPU hotplug through the *legacy* CPU hotplug register block. Cc: "Michael S. Tsirkin" Cc: Ani Sinha Cc: Ard Biesheuvel Cc: Igor Mammedov Cc: Paolo Bonzini Cc: Peter Maydell Cc: qemu-stable@nongnu.org Ref: "IO port write width clamping differs between TCG and KVM" Link: http://mid.mail-archive.com/aaedee84-d3ed-a4f9-21e7-d221a28d1683@redh= at.com Link: https://lists.gnu.org/archive/html/qemu-devel/2023-01/msg00199.html Reported-by: Ard Biesheuvel Signed-off-by: Laszlo Ersek Message-Id: <20230104090138.214862-1-lersek@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Ard Biesheuvel Fixes: b8622725cf ("acpi_piix4: Add infrastructure to send CPU hot-plug GPE= to guest") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Igor Mammedov --- hw/acpi/cpu_hotplug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index 53654f8638..ff14c3f410 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -52,6 +52,9 @@ static const MemoryRegionOps AcpiCpuHotplug_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, .valid =3D { .min_access_size =3D 1, + .max_access_size =3D 4, + }, + .impl =3D { .max_access_size =3D 1, }, }; --=20 MST From nobody Wed May 15 07:51:38 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=1672936246; cv=none; d=zohomail.com; s=zohoarc; b=jMES/ZbLEIPe48mI9UjeRp49CRhjvT4NAEsJogPUUrY6wirrnG4Yz8vxL+9RkJQ6lj/OQ1ggIi85mrJeP1pzWVGJmVAYEhukIInPV4KlGvoZJ+WYC7vxr2gON5CTkSrOJiyeTltWCsuCGxTOgjoW19mjuZpABPh6dSGIPD/Vs5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672936246; 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=MgWM9O15A8/cm5m/GANwmeVmLHC3puCV01rJJY8Exg8=; b=EfGWOS74ctUAao+d/EvLdQwwTgoWKMdVNOC1EZP/GsMKKY+J/kM/+gQmTFSOYf5qB3S7Rd+kUQXlzqGBuweQ5Yyu917UYxwG/mi/TF4tehkFzKPtoX5IIsRRXz/3ExD0825HJ3l5lBCX/01UAeUhl+xVE/CObNSJc3jjVmw+GZ4= 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 1672936246869383.09557251704564; Thu, 5 Jan 2023 08:30:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDT8Y-0008I9-DZ; Thu, 05 Jan 2023 11:30:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDT8W-0008FM-WA for qemu-devel@nongnu.org; Thu, 05 Jan 2023 11:30:37 -0500 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 1pDT8U-0007Up-W3 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 11:30:36 -0500 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_128_GCM_SHA256) id us-mta-542-NXWbASn0N_C0Kt4-IPqaoQ-1; Thu, 05 Jan 2023 11:30:32 -0500 Received: by mail-wr1-f71.google.com with SMTP id g18-20020adfa492000000b0027174820fdbso4874734wrb.4 for ; Thu, 05 Jan 2023 08:30:32 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id q6-20020a05600c46c600b003d1f3e9df3csm3271472wmo.7.2023.01.05.08.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 08:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672936233; 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=MgWM9O15A8/cm5m/GANwmeVmLHC3puCV01rJJY8Exg8=; b=dQTTAWGxbSWw9sLqETf97FlqnXBid1wI184i6MlEo01v+4vxO8SmDeK/oWlKxqlmMgbXVh erRwY6PK32LogdWOaxKdlKyVMFrpkYQ72+TpqeLeAVcxJetpbPoxfkb3Qdx7M1Mp5Y6Ux6 KctRajNcyGs1OlBV4ZQHX9C9AfcxgWo= X-MC-Unique: NXWbASn0N_C0Kt4-IPqaoQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=MgWM9O15A8/cm5m/GANwmeVmLHC3puCV01rJJY8Exg8=; b=Zk1QNZ+fXv5WtwuGl8iL8ad0hFB6FcLUDGdhQJTW8LJa4UzsuR2PvnhfKbZE3g2+Uq m6PzthjeSh3RbeaC8FCKiOlrg0ArET3V/KWZhR87UztPKN8oTnYAx5P5dk7wrQsW4m8O 0zXfrgzz9VgN7iJBd0S+H6gAIlxDjuWwji9X1ddjwo+UI1xRRRpFf67naTp3afrNDn5S dX3KKlfqLeIuqKk5jN3YUeWW0g5Z2PwGKp2ZRoGJDJx5cLYPQhPs87Y7M5x2gTYzuBuT Crd7/6eL8oJ2jQsVjU/mzGRhDJceZ5B5PGP96A6eFE2CfE0ljpIxO4qJmcYI7cHhL1WM yfdg== X-Gm-Message-State: AFqh2kok1rjTwu9q1zZuMjlllzxMNP/i+2zJNl4INBhf4rvlog0qFWGW TKa6fTkB0UUFcep28sz6gc4G0xqTEC8H1/qo0NKjKUrRtUTwSXWwwukf5XmktvwtoY4vCG6sPR/ o7M/WGNjjCCiZ830jEjzjyR4/iPGr+hBGNefCHynUP07L3234DR9g9dGypgvX X-Received: by 2002:a05:600c:3c88:b0:3d9:69fd:7707 with SMTP id bg8-20020a05600c3c8800b003d969fd7707mr34648666wmb.2.1672936230866; Thu, 05 Jan 2023 08:30:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXvq0f7/3xLjo6NBlkhmcYhBV4e3BvbEYrXSch60TU9IYqVJnQFRzZryHhMqfFmzWs1Ui20l4w== X-Received: by 2002:a05:600c:3c88:b0:3d9:69fd:7707 with SMTP id bg8-20020a05600c3c8800b003d969fd7707mr34648638wmb.2.1672936230556; Thu, 05 Jan 2023 08:30:30 -0800 (PST) Date: Thu, 5 Jan 2023 11:30:27 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Laszlo Ersek , Ani Sinha , Ard Biesheuvel , Igor Mammedov , Paolo Bonzini , Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org Subject: [PULL v2 50/51] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block Message-ID: <20230105162836.275244-1-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672936247561100006 From: Laszlo Ersek The modern ACPI CPU hotplug interface was introduced in the following series (aa1dd39ca307..679dd1a957df), released in v2.7.0: 1 abd49bc2ed2f docs: update ACPI CPU hotplug spec with new protocol 2 16bcab97eb9f pc: piix4/ich9: add 'cpu-hotplug-legacy' property 3 5e1b5d93887b acpi: cpuhp: add CPU devices AML with _STA method 4 ac35f13ba8f8 pc: acpi: introduce AcpiDeviceIfClass.madt_cpu hook 5 d2238cb6781d acpi: cpuhp: implement hot-add parts of CPU hotplug interface 6 8872c25a26cc acpi: cpuhp: implement hot-remove parts of CPU hotplug interface 7 76623d00ae57 acpi: cpuhp: add cpu._OST handling 8 679dd1a957df pc: use new CPU hotplug interface since 2.7 machine type Before patch#1, "docs/specs/acpi_cpu_hotplug.txt" only specified 1-byte accesses for the hotplug register block. Patch#1 preserved the same restriction for the legacy register block, but: - it specified DWORD accesses for some of the modern registers, - in particular, the switch from the legacy block to the modern block would require a DWORD write to the *legacy* block. The latter functionality was then implemented in cpu_status_write() [hw/acpi/cpu_hotplug.c], in patch#8. Unfortunately, all DWORD accesses depended on a dormant bug: the one introduced in earlier commit a014ed07bd5a ("memory: accept mismatching sizes in memory_region_access_valid", 2013-05-29); first released in v1.6.0. Due to commit a014ed07bd5a, the DWORD accesses to the *legacy* CPU hotplug register block would work in spite of the above series *not* relaxing "valid.max_access_size =3D 1" in "hw/acpi/cpu_hotplug.c": > static const MemoryRegionOps AcpiCpuHotplug_ops =3D { > .read =3D cpu_status_read, > .write =3D cpu_status_write, > .endianness =3D DEVICE_LITTLE_ENDIAN, > .valid =3D { > .min_access_size =3D 1, > .max_access_size =3D 1, > }, > }; Later, in commits e6d0c3ce6895 ("acpi: cpuhp: introduce 'Command data 2' field", 2020-01-22) and ae340aa3d256 ("acpi: cpuhp: spec: add typical usecases", 2020-01-22), first released in v5.0.0, the modern CPU hotplug interface (including the documentation) was extended with another DWORD *read* access, namely to the "Command data 2" register, which would be important for the guest to confirm whether it managed to switch the register block from legacy to modern. This functionality too silently depended on the bug from commit a014ed07bd5a. In commit 5d971f9e6725 ('memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"', 2020-06-26), first released in v5.1.0, the bug from commit a014ed07bd5a was fixed (the commit was reverted). That swiftly exposed the bug in "AcpiCpuHotplug_ops", still present from the v2.7.0 series quoted at the top -- namely the fact that "valid.max_access_size =3D 1" didn't match what the guest was supposed to do, according to the spec ("docs/specs/acpi_cpu_hotplug.txt"). The symptom is that the "modern interface negotiation protocol" described in commit ae340aa3d256: > + Use following steps to detect and enable modern CPU hotplug interf= ace: > + 1. Store 0x0 to the 'CPU selector' register, > + attempting to switch to modern mode > + 2. Store 0x0 to the 'CPU selector' register, > + to ensure valid selector value > + 3. Store 0x0 to the 'Command field' register, > + 4. Read the 'Command data 2' register. > + If read value is 0x0, the modern interface is enabled. > + Otherwise legacy or no CPU hotplug interface available falls apart for the guest: steps 1 and 2 are lost, because they are DWORD writes; so no switching happens. Step 3 (a single-byte write) is not lost, but it has no effect; see the condition in cpu_status_write() in patch#8. And step 4 *misleads* the guest into thinking that the switch worked: the DWORD read is lost again -- it returns zero to the guest without ever reaching the device model, so the guest never learns the switch didn't work. This means that guest behavior centered on the "Command data 2" register worked *only* in the v5.0.0 release; it got effectively regressed in v5.1.0. To make things *even more* complicated, the breakage was (and remains, as of today) visible with TCG acceleration only. Commit 5d971f9e6725 makes no difference with KVM acceleration -- the DWORD accesses still work, despite "valid.max_access_size =3D 1". As commit 5d971f9e6725 suggests, fix the problem by raising "valid.max_access_size" to 4 -- the spec now clearly instructs the guest to perform DWORD accesses to the legacy register block too, for enabling (and verifying!) the modern block. In order to keep compatibility for the device model implementation though, set "impl.max_access_size =3D 1", so that wide accesses be split before they reach the legacy read/write handlers, like they always have been on KVM, and like they were on TCG before 5d971f9e6725 (v5.1.0). Tested with: - OVMF IA32 + qemu-system-i386, CPU hotplug/hot-unplug with SMM, intermixed with ACPI S3 suspend/resume, using KVM accel (regression-test); - OVMF IA32X64 + qemu-system-x86_64, CPU hotplug/hot-unplug with SMM, intermixed with ACPI S3 suspend/resume, using KVM accel (regression-test); - OVMF IA32 + qemu-system-i386, SMM enabled, using TCG accel; verified the register block switch and the present/possible CPU counting through the modern hotplug interface, during OVMF boot (bugfix test); - I do not have any testcase (guest payload) for regression-testing CPU hotplug through the *legacy* CPU hotplug register block. Cc: "Michael S. Tsirkin" Cc: Ani Sinha Cc: Ard Biesheuvel Cc: Igor Mammedov Cc: Paolo Bonzini Cc: Peter Maydell Cc: Philippe Mathieu-Daud=C3=A9 Cc: qemu-stable@nongnu.org Ref: "IO port write width clamping differs between TCG and KVM" Link: http://mid.mail-archive.com/aaedee84-d3ed-a4f9-21e7-d221a28d1683@redh= at.com Link: https://lists.gnu.org/archive/html/qemu-devel/2023-01/msg00199.html Reported-by: Ard Biesheuvel Signed-off-by: Laszlo Ersek Tested-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Igor Mammedov Message-Id: <20230105161804.82486-1-lersek@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/cpu_hotplug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index 53654f8638..ff14c3f410 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -52,6 +52,9 @@ static const MemoryRegionOps AcpiCpuHotplug_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, .valid =3D { .min_access_size =3D 1, + .max_access_size =3D 4, + }, + .impl =3D { .max_access_size =3D 1, }, }; --=20 MST From nobody Wed May 15 07:51:38 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=1672912144; cv=none; d=zohomail.com; s=zohoarc; b=n0I2qfkf71RF+ms1/VgSwpmhruDtoFLUnVi2DHMmDsSOQtg4TkpjF+UCiObT3dKxxFfbTwEUJemM44JxsdNbfR3o4l6g2D2Yr9eRExWbNuV/UfXviOeLuMH4wIqxqoJroihnMEdCXARrSeq+jo1F4a7LJn4ww1/TyvcBhFT8VwA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672912144; 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=WNSb3P3e/gJyxANZkmJtP90PraSrI8QixAcWG1RrDLA=; b=OhoDGjL3c2fNGdfvwkas+5/RTGkFfZ407G5qDbwENEG7h1covTXOFSv4XJcdK06In1J63932NlMaoi2i+nHlJB8I/pPdG55Pgg253qnsom/ecifgHLCHSFPak5d260+QlWIjC3/vpuO/bGB2CUdtzeN3OscZlqcW/4vPDZqmOok= 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 1672912144223977.9369577128585; Thu, 5 Jan 2023 01:49:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDMNA-0004PR-6C; Thu, 05 Jan 2023 04:17:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDMN8-0004Mg-J8 for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:14 -0500 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 1pDMN7-0007ij-0O for qemu-devel@nongnu.org; Thu, 05 Jan 2023 04:17:14 -0500 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_128_GCM_SHA256) id us-mta-197-kwyNeGKJNNu-waM-llF4fA-1; Thu, 05 Jan 2023 04:17:11 -0500 Received: by mail-wr1-f70.google.com with SMTP id n13-20020adfc60d000000b0029bdfcf52eeso1712812wrg.8 for ; Thu, 05 Jan 2023 01:17:11 -0800 (PST) Received: from redhat.com ([2.52.151.85]) by smtp.gmail.com with ESMTPSA id g9-20020a05600c310900b003c5571c27a1sm2166327wmo.32.2023.01.05.01.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 01:17:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672910232; 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=WNSb3P3e/gJyxANZkmJtP90PraSrI8QixAcWG1RrDLA=; b=Lya7yycCLgAoO1pBVlq3e1/6N9sOr4vNt3FvdDz3BFS3BPpZ1NfyKyfAlsArdrmFFIgvar ry404xGy6qDbYjDzUfLIQTlupyiwUre5/nucDWhsXIjTnidtNHjMfnxfPSJ9T7/Yonv816 RADwxg5/8QOTyGVJ8UoMS7BXrcuiF5g= X-MC-Unique: kwyNeGKJNNu-waM-llF4fA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WNSb3P3e/gJyxANZkmJtP90PraSrI8QixAcWG1RrDLA=; b=VUhvVsLmTHsjIaPJ340BxQ5vIfdKPmPHinhTSVdKue2XW10y6iDt74S5E5F2lTsut8 RLPKiDya9L4cATiVtD1B5tw0CNKQ1bra+M1pyCiOb3XTIVZFcbduPN/EAbhuHF0tNYZJ quzNmq59JfYYpU7NEk5fumvlYFGkRPgzzSX/IBxhACSIQtticGMJkr4mrhBuWQ1HpNZv XshXn4tfHSF64zbHwlQ/8OsF1WqCwmt5fH/0SopVUuakgoirmHLz6kPpHxySAgLJu41P PJw6c/1zSC6NgL0WvtNsAbPANOevfsMapzm5yrp4cQ/sebt6zSTOPgU75tGM4fXgjQTr dc3g== X-Gm-Message-State: AFqh2krwjduSCnTMTF9gCRtTOpWeJQ3aAWml2Alk5izjHYlY3pEVzsaZ zBWJx3/uuasC7q8MLbtzWukW7MlFs05KmUfajGLUiIjkPuiFOkFCTG4xfS2QVRwTu1+70Y0eeNe UG8rd069DnmnTj5BuS3y6bnySmT3usGnpL8ss2Zeaq64nAme45ACwsmNCcAyJ X-Received: by 2002:a05:600c:5399:b0:3d9:c6f5:c63d with SMTP id hg25-20020a05600c539900b003d9c6f5c63dmr4577575wmb.28.1672910229821; Thu, 05 Jan 2023 01:17:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXt+dasS3Egp1HZ7sh+iOLsEsJrCjLfZbTS6RftP8tpDejBQxeVIJUrMcqh6gE6/Fzi79uTGXQ== X-Received: by 2002:a05:600c:5399:b0:3d9:c6f5:c63d with SMTP id hg25-20020a05600c539900b003d9c6f5c63dmr4577558wmb.28.1672910229583; Thu, 05 Jan 2023 01:17:09 -0800 (PST) Date: Thu, 5 Jan 2023 04:17:06 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Dongli Zhang , Joe Jin , Li Feng , Paolo Bonzini , Fam Zheng Subject: [PULL 51/51] vhost-scsi: fix memleak of vsc->inflight Message-ID: <20230105091310.263867-52-mst@redhat.com> References: <20230105091310.263867-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230105091310.263867-1-mst@redhat.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672912144754100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Dongli Zhang This is below memleak detected when to quit the qemu-system-x86_64 (with vhost-scsi-pci). (qemu) quit =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D15568=3D=3DERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7f00aec57917 in __interceptor_calloc (/lib64/libasan.so.6+0xb4917) #1 0x7f00ada0d7b5 in g_malloc0 (/lib64/libglib-2.0.so.0+0x517b5) #2 0x5648ffd38bac in vhost_scsi_start ../hw/scsi/vhost-scsi.c:92 #3 0x5648ffd38d52 in vhost_scsi_set_status ../hw/scsi/vhost-scsi.c:131 #4 0x5648ffda340e in virtio_set_status ../hw/virtio/virtio.c:2036 #5 0x5648ff8de281 in virtio_ioport_write ../hw/virtio/virtio-pci.c:431 #6 0x5648ff8deb29 in virtio_pci_config_write ../hw/virtio/virtio-pci.c:= 576 #7 0x5648ffe5c0c2 in memory_region_write_accessor ../softmmu/memory.c:4= 93 #8 0x5648ffe5c424 in access_with_adjusted_size ../softmmu/memory.c:555 #9 0x5648ffe6428f in memory_region_dispatch_write ../softmmu/memory.c:1= 515 #10 0x5648ffe8613d in flatview_write_continue ../softmmu/physmem.c:2825 #11 0x5648ffe86490 in flatview_write ../softmmu/physmem.c:2867 #12 0x5648ffe86d9f in address_space_write ../softmmu/physmem.c:2963 #13 0x5648ffe86e57 in address_space_rw ../softmmu/physmem.c:2973 #14 0x5648fffbfb3d in kvm_handle_io ../accel/kvm/kvm-all.c:2639 #15 0x5648fffc0e0d in kvm_cpu_exec ../accel/kvm/kvm-all.c:2890 #16 0x5648fffc90a7 in kvm_vcpu_thread_fn ../accel/kvm/kvm-accel-ops.c:51 #17 0x56490042400a in qemu_thread_start ../util/qemu-thread-posix.c:505 #18 0x7f00ac3b6ea4 in start_thread (/lib64/libpthread.so.0+0x7ea4) Free the vsc->inflight at the 'stop' path. Fixes: b82526c7ee ("vhost-scsi: support inflight io track") Cc: Joe Jin Cc: Li Feng Signed-off-by: Dongli Zhang Message-Id: <20230104160433.21353-1-dongli.zhang@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/scsi/vhost-scsi-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index 18ea5dcfa1..a06f01af26 100644 --- a/hw/scsi/vhost-scsi-common.c +++ b/hw/scsi/vhost-scsi-common.c @@ -113,6 +113,7 @@ void vhost_scsi_common_stop(VHostSCSICommon *vsc) =20 if (vsc->inflight) { vhost_dev_free_inflight(vsc->inflight); + g_free(vsc->inflight); vsc->inflight =3D NULL; } =20 --=20 MST