From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748792175; cv=none; d=zohomail.com; s=zohoarc; b=alDbUzInWO+82YDT/7ulvctSI4nTA92Ok9qItUaQE7ns1ZbIBmlNPQLCTjwolFxvdhBGQI3jCo/6ZNPCxsr+IoVIw0HINLgMtYEAFfclOy12vVYc1odRqEvpj6JjjD8iS0vmu1q+vRxF9+oxHP53A1pH9X/5W4zxpkbCXtpXiB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748792175; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hKEH6Z9JCQimLJL8lPwV9KIkJSWOuDTn31SzP3o0in0=; b=R9CjeW9o4ucVJyJN9Q0wwy1G8gV4IFCydbjj9AhuJULEMdgA6335DFQTgt6/KGv5hBUGwhOEJhxENev3XKoo3SqrY6lkZpjGp5rG94kg+BUMA3lrVotO1vuvmKPS2h1UhdT/fJZgwCIgxUReD/bcl8Y0b+nCra5tHqMrYJLD1A8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174879217573383.05375909830434; Sun, 1 Jun 2025 08:36:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkjN-0004Tu-8f; Sun, 01 Jun 2025 11:36:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkjA-0004I5-S0 for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:36:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkiv-0005bm-2Q for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:36:00 -0400 Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-TB5h96x0MiWmahhCZMJlpA-1; Sun, 01 Jun 2025 11:35:37 -0400 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-55324bc26dcso1698209e87.1 for ; Sun, 01 Jun 2025 08:35:37 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4efe5b89dsm11909055f8f.19.2025.06.01.08.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748792138; 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=hKEH6Z9JCQimLJL8lPwV9KIkJSWOuDTn31SzP3o0in0=; b=glS9+XTQkat2uzwCtLf0Vna8AA/r0QMl9cOiPQzB66efpVEFrmzgVwv/GW9Q66yDwAjTVn BVT8tbBheL1SUtS1EH2+VHt8A1AX53HhQIlGgGrAeIOcmbVdLPz03ocBh9txyc84tNE3Ul qMgONcDmLPQpVEiGknewsEF2fAI5XTs= X-MC-Unique: TB5h96x0MiWmahhCZMJlpA-1 X-Mimecast-MFC-AGG-ID: TB5h96x0MiWmahhCZMJlpA_1748792136 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748792136; x=1749396936; 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=hKEH6Z9JCQimLJL8lPwV9KIkJSWOuDTn31SzP3o0in0=; b=fTx8uHw+2zDcJSwEd8ZEaBxcU2Y1lusMmgZyy7kXnrsdiqQfIsQj6a/32k41buu38M sRKXO4K7IamUyQ52G76bZfWuPeSrNtzIOWUeXryAf7vHYqU5hsgqFLPlg1JcPfZ3udhc VEvMUsuXlz3omj+xtk8Rh32KTyavECg1ib5t1idVg1OkhzdQlwn+RTIt4wAdUG6afMcE Zp6xhOSxVNQ5U9YeHq+5IwxiHzqRdunErpU7qeEDNv4iGQswzDrUHZKyhDh87BE7fXvC P/hy8b4y+Lget73MxMj+/ZDSJcNe217fr2vf/UX9aWwaRCilqaaLvBaK3fch9Y3Oc4Ud HTIQ== X-Gm-Message-State: AOJu0Yz5C5iuUucgoJ0uOvVhJNzjq7YnKORQRI4dlZqFC0MlD3lW0Q6t 8F0IQyifU/XGBhLa60XzpFv2tZ/p4e+tnmJo7In+ryEBgJbZ5fZ5MdgABE9shZ7A369Jd5Q8GNI XMh3bR6v3k+LSvrqyjc/aYTE0xc6ski8bYFBYel75W2qo2X4PnlFl+ef+2sgQQwMWGGAn85qe8U 26ZZQMouLuB0skFLzvb43mDB2Jq+sDmQViQA== X-Gm-Gg: ASbGncvx1Jdy/hKfh56YvUJGkMD5Jm3IrdBD2QwEr9n8sPadGau0vFe+J3yst8opl0i N2GzNsjtn4AUKvwWqJNWo4XmSRzLT2Nr98vHdacpzvhef+nQaFNafco6TCOw/nLDCH3kyevt/Dm 8nCx57+gGx88sY1Sownos63m0NoIj0ysTktRLUAij2cL0SVRlP4Wx3kHubaZmrF4hfAz/HPBm9c DToRsAcoUkQUg7rALldbdGDBCZxWfIBs6qTqo5BRVbDwt9Nhy7Pb89um4lfLSZtUtSSm6Bv5KGX Nx4L3D41kBR/sqmn X-Received: by 2002:a05:600c:3f92:b0:442:f904:1305 with SMTP id 5b1f17b1804b1-450d6b5999bmr95833935e9.6.1748791487749; Sun, 01 Jun 2025 08:24:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmKWDFQhl1SCz6HHk2dYVS/WFA74r7SfcWFfZWGmgNxihnFEFlOEzISUoCOe0f5IwNy5AWvw== X-Received: by 2002:a05:600c:3f92:b0:442:f904:1305 with SMTP id 5b1f17b1804b1-450d6b5999bmr95833705e9.6.1748791487265; Sun, 01 Jun 2025 08:24:47 -0700 (PDT) Date: Sun, 1 Jun 2025 11:24:45 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Yuri Benditovich Subject: [PULL 01/31] virtio: check for validity of indirect descriptors Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 1748792177750116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yuri Benditovich virtio processes indirect descriptors even if the respected feature VIRTIO_RING_F_INDIRECT_DESC was not negotiated. If qemu is used with reduced set of features to emulate the hardware device that does not support indirect descriptors, the will probably trigger problematic flows on the hardware setup but do not reveal the mistake on qemu. Add LOG_GUEST_ERROR for such case. This will issue logs with '-d guest_errors' in the command line Signed-off-by: Yuri Benditovich Message-Id: <20250515063237.808293-1-yuri.benditovich@daynix.com> Signed-off-by: Yuri Benditovich --- hw/virtio/virtio.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 2e98cecf64..5534251e01 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -205,6 +205,15 @@ static const char *virtio_id_to_name(uint16_t device_i= d) return name; } =20 +static void virtio_check_indirect_feature(VirtIODevice *vdev) +{ + if (!virtio_vdev_has_feature(vdev, VIRTIO_RING_F_INDIRECT_DESC)) { + qemu_log_mask(LOG_GUEST_ERROR, + "Device %s: indirect_desc was not negotiated!\n", + vdev->name); + } +} + /* Called within call_rcu(). */ static void virtio_free_region_cache(VRingMemoryRegionCaches *caches) { @@ -1733,6 +1742,7 @@ static void *virtqueue_split_pop(VirtQueue *vq, size_= t sz) virtio_error(vdev, "Invalid size for indirect buffer table"); goto done; } + virtio_check_indirect_feature(vdev); =20 /* loop over the indirect descriptor table */ len =3D address_space_cache_init(&indirect_desc_cache, vdev->dma_a= s, @@ -1870,6 +1880,7 @@ static void *virtqueue_packed_pop(VirtQueue *vq, size= _t sz) virtio_error(vdev, "Invalid size for indirect buffer table"); goto done; } + virtio_check_indirect_feature(vdev); =20 /* loop over the indirect descriptor table */ len =3D address_space_cache_init(&indirect_desc_cache, vdev->dma_a= s, --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791539; cv=none; d=zohomail.com; s=zohoarc; b=Q1fnSFFFLr1pfWjHUW21oMTkpolKtVsMNDJcdhiaEBrsmPdd+tpGB4G58X/df4wyuvZJcGTkH9i0kQ5v720O0dnoRoejmoAdeqir87gDhYU2RvokCwMar6xvE+hiJA526af4pygywXtJJ/cNI9ympCL/e0mjOa+fjYhjfOOYb/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791539; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rTv0d6cHxOZy6ieVobHNUbUpmmn/DNQanxQCmUwQh7c=; b=BL8KDWck+rP/rosK7NLKe3W5sfEvtiZ6Y0dIhFAx8P3qCvhwBI+vODsatsX2RSQ4a9tD2EjIuHveNV5u/uvUsvQAn/GkbU8yCYSEfo3tRkpCI61BHNTIqzXi9+64PjNDJCCN8I5EpM94NbD6/BHDgRVAaLlMuxkT8kmiTvuhPVs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791539613139.65971110575026; Sun, 1 Jun 2025 08:25:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYo-0001rW-4b; Sun, 01 Jun 2025 11:25:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYa-0001qp-3X for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYW-0004O6-S6 for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:03 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-8ur90z8oMdOxfqj2XZWkMw-1; Sun, 01 Jun 2025 11:24:53 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-440667e7f92so24461725e9.3 for ; Sun, 01 Jun 2025 08:24:53 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f009745esm11870991f8f.71.2025.06.01.08.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791495; 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=rTv0d6cHxOZy6ieVobHNUbUpmmn/DNQanxQCmUwQh7c=; b=LYFYipz3DFwC52CcNnPbIpg7LJv54PCE5uMaqUes5RHe6wVo1Pa/mn0PbStyGHUF1lq7rq PtkfSHKyuOSjsKFXUrwcjScBYzxbLN/B6iCEMjrXA5tgbySQvSIqzZE41BLrWqE5WfrUMe +stzS20hNOE/zyHPDCBXLilUKlrMM8g= X-MC-Unique: 8ur90z8oMdOxfqj2XZWkMw-1 X-Mimecast-MFC-AGG-ID: 8ur90z8oMdOxfqj2XZWkMw_1748791492 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791491; x=1749396291; 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=rTv0d6cHxOZy6ieVobHNUbUpmmn/DNQanxQCmUwQh7c=; b=A9f1iRqxnyHakjh532aXhSg2S3YwlKZ8fLMnh9Gh/rqXNRdSufAbNz4Y6vPUI+coa+ /WrXNUhSjuwthmMzTQ8mizm2AoASz7jEQJ8TT3+et1nCnB5BAVr824SQpxoZrfKO4IUC lVDfISe8Wc7UCf7Ca9+v3sr7oWv+4vf024DdTEDqvz7QyNQ/Njn4h/sbrHtgDNs0Ckm5 MFZvc3lOzHpBH9nvlFET4ioB5r69LF5GsrhpjtKZFxRB1nGBbDDhh3M7x5nXqT+fPh8c 1GTdVPuQFUBw608OVrkvVHmE6QHkoqoY4M9raNFXJniTHK1yXQhNOIxTV6QZneWnUyoH Zcdg== X-Gm-Message-State: AOJu0Yzx1KSjhUCYMjU31G4ME4zL1s80n4WvIhSYwNa5I6A2bAz3Sqtp uPwGn8C7bRBIVO9EN6j4JDFQREg6lY+fF9mZJ+HjUNOx7EncwmSa7yULwnfPrG46rMcmyia24yS 38K//TRy7LQRonDhLm0l4rkaFtldFI3z2fFX6Vfks86AK+2ZH4uXOvGXWQJ9Y6XvQXFMkthMKLG EmmARSu7tNiYIZhY0sH9vLP+VHbltI1F3lbQ== X-Gm-Gg: ASbGncs/m/YWSP3ndK8R6QKT1x2m2BV/sOXnW83OK3Myt0UITKB4thjIx9DqlijExH2 mFjEKTzVEtOPPyZWFvDiWiQ9C+a+I1AfePw5Spim+xwm2Cz2ewztILlqROeOvDbY8B+DTiOmfw7 P5ZdRAlAE9eNn04yY++OeELGgRDPS3wGHNej4xsQ7QwS39JnEnK01GI7C1TYYGmulomO2M+DmyY OggcxsIE6gYwHlhbzmsJgY+R9dkGD5BDMQxx+jNAEHZVxh9FC1rVV1unVXsZXI5X5JqX+Mo+UKp 3Q3qgXibiM9oIXLY X-Received: by 2002:a05:600c:8b0f:b0:43c:f63c:babb with SMTP id 5b1f17b1804b1-4511ecbbdc4mr39669015e9.1.1748791491278; Sun, 01 Jun 2025 08:24:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHL0U/8L6UeynEtKF1ImDj+ymGfJYvxrSyE7yqMsT7JKI1SqMgqiXF/R45KtLgd+NhJ5QLbAw== X-Received: by 2002:a05:600c:8b0f:b0:43c:f63c:babb with SMTP id 5b1f17b1804b1-4511ecbbdc4mr39668775e9.1.1748791490829; Sun, 01 Jun 2025 08:24:50 -0700 (PDT) Date: Sun, 1 Jun 2025 11:24:47 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Sairaj Kodilkar , Vasant Hegde , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 02/31] hw/i386/amd_iommu: Fix device setup failure when PT is on. Message-ID: <31753d5a336fbb4e9246397f4b90b6f611f27f22.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791542879116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sairaj Kodilkar Commit c1f46999ef506 ("amd_iommu: Add support for pass though mode") introduces the support for "pt" flag by enabling nodma memory when "pt=3Doff". This allowed VFIO devices to successfully register notifiers by using nodma region. But, This also broke things when guest is booted with the iommu=3Dnopt because, devices bypass the IOMMU and use untranslated addresses (IOVA) to perform DMA reads/writes to the nodma memory region, ultimately resulting in a failure to setup the devices in the guest. Fix the above issue by always enabling the amdvi_dev_as->iommu memory regio= n. But this will once again cause VFIO devices to fail while registering the notifiers with AMD IOMMU memory region. Fixes: c1f46999ef506 ("amd_iommu: Add support for pass though mode") Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde Message-Id: <20250516100535.4980-2-sarunkod@amd.com> Fixes: c1f46999ef506 ("amd_iommu: Add support for pass though mode") Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 0775c8f3bb..17379db52a 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1426,7 +1426,6 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bus= , void *opaque, int devfn) AMDVIState *s =3D opaque; AMDVIAddressSpace **iommu_as, *amdvi_dev_as; int bus_num =3D pci_bus_num(bus); - X86IOMMUState *x86_iommu =3D X86_IOMMU_DEVICE(s); =20 iommu_as =3D s->address_spaces[bus_num]; =20 @@ -1486,15 +1485,8 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bu= s, void *opaque, int devfn) AMDVI_INT_ADDR_FIRST, &amdvi_dev_as->iommu_ir, 1); =20 - if (!x86_iommu->pt_supported) { - memory_region_set_enabled(&amdvi_dev_as->iommu_nodma, false); - memory_region_set_enabled(MEMORY_REGION(&amdvi_dev_as->iommu), - true); - } else { - memory_region_set_enabled(MEMORY_REGION(&amdvi_dev_as->iommu), - false); - memory_region_set_enabled(&amdvi_dev_as->iommu_nodma, true); - } + memory_region_set_enabled(&amdvi_dev_as->iommu_nodma, false); + memory_region_set_enabled(MEMORY_REGION(&amdvi_dev_as->iommu), tru= e); } return &iommu_as[devfn]->as; } --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791957; cv=none; d=zohomail.com; s=zohoarc; b=kVHti4/xd8DKQPsPD7/mQ3r1XgFR8Szr/ZxEne3b5pc3pmXhs4MSUqcFmcfv13iC/+yhvobSVFmfWUx36RZp2/gkFVK54DlQ1CR29Qtv6KcH8UeIShdCLR0WmTsqBKnoerEGGZPdE4RJH1eSDgxG1xAlshWvG+nljAgAcLL7WYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791957; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ae+KwjiAG0ycwIGxgYOXtWkgDz9Lvz7odZpaInVMJP4=; b=fTTaV0gVq+uO4cg1xSgSMhxzh1T/Y0dWpfalm0kM6K09MVN70fdLqGcfuE1jXydCYV3MTYFcVIHHERbm4QrfMGTwoV/3vj53nhJj04MY1HA7NVk39FsPcoHrz25sg79GdqkIxgbJ0Dm2acqy9iw2t8MpQrrZwNixF9+6CoQyJTE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174879195720730.42956874810966; Sun, 1 Jun 2025 08:32:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYu-00022v-AV; Sun, 01 Jun 2025 11:25:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYi-0001sz-J0 for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYa-0004Oh-Sp for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:07 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-187-nP7J-zssMv6P2sK2Lmh6CA-1; Sun, 01 Jun 2025 11:24:57 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-3a1f6c5f4f2so1312269f8f.2 for ; Sun, 01 Jun 2025 08:24:56 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f009fb0bsm11545616f8f.87.2025.06.01.08.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791501; 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=Ae+KwjiAG0ycwIGxgYOXtWkgDz9Lvz7odZpaInVMJP4=; b=Ls8yQJYthO7pZSxAmG3DxfZjcsIidDibJn4iGJL2HL4dzjWunOaZw/8hCKRNdEHRZ2ujwR gFMCTWTEbAtH0K01IMSOcID1+9Jt/rFRya8jTRvipbA+D7kCTTaYEIgUtLZYeu/g17Cct+ 7GW96Dd/7Sunb7TrhiivGDRMvSv+TIc= X-MC-Unique: nP7J-zssMv6P2sK2Lmh6CA-1 X-Mimecast-MFC-AGG-ID: nP7J-zssMv6P2sK2Lmh6CA_1748791495 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791495; x=1749396295; 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=Ae+KwjiAG0ycwIGxgYOXtWkgDz9Lvz7odZpaInVMJP4=; b=kAvlUE+QEokUrP0rxwMtqsgBq/clFTzmEBhYpW8qaXRU6FFN/humtPylWiQs9Oh9pe PZ2FKQcqujQu87gSRjPxC4My5xykT/WaP3If3yr4b321TwcG654OWME7m+LjBVBCn81V ZiitphitwU7AMV4MLX3iUT3fmirmr9tlUVEYyt33hiQA/ePGcXOk7BeYI6zk3wXIkvuo KbCxsy10dAksgZ4IV9UMgLor3/Mz+nu3MQTHKq6frRtF8U+mat84oD64Ok0adVnfFwCW bWW0NO9d2XCWG7U4TylRrNBILsFjGDBTJE7KqzBnkXRX6pven67GQtEBjLMTMWSpRuKP hYUw== X-Gm-Message-State: AOJu0Yx1VGHtrEp+vPUorwP6SUBCRmDpVbDjOHVzB4P9GEcSvAk3VP4g vALf/ZzJiNA+l52/YmKw8ctA6sLP7yWg7lhtQCf8o9qrngvhrzCw3fuok4UzswxjLIrjmk0GMI2 hqcOC8Y5fPYmSxSOnqS+Aiy2trtF0Ic5fbK7gC/cuK8cwOeaR9KavMk8xpu4u2P7kiOSdRzYd4r dAWZQjFTH31fQK4TJRH3J3WB62aJf5kQJhWg== X-Gm-Gg: ASbGncshBqnwh8foFu++E6Axgv/iLakmgFqwnq7LjZs+vzYiyruEOGIl/MsJU9U3db4 WP7aWBXN5K/OGIrReuvHJG//MQsu/9FDkGAgG9lGFdqxRUlexmmlJuVswBO05rPor0R3FTNU4n1 RYPPLdIum6wsGvXuA3e3v65SXrjZlJIjhcNFjC1pOrPo1icV2ExnB7G5F7LI5lhV2VWWb8Esuni F5q3dX6ieyfWg+6dRRkccnIlyZFb1+RD9yzM3NAW6cNPBx6A7EDf2TdIeHTbRIXXS3wsq5heZ0W 6SNfXg== X-Received: by 2002:a05:6000:22c6:b0:3a4:f7e6:284b with SMTP id ffacd0b85a97d-3a4f89a7eb0mr6344866f8f.10.1748791494998; Sun, 01 Jun 2025 08:24:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYs5M9CNTTnil6qdeTRlarfVIfVdJ+8sk+4Yu+I5oNukMVcdME1fc855fhEtx0h5Jl7pEjWg== X-Received: by 2002:a05:6000:22c6:b0:3a4:f7e6:284b with SMTP id ffacd0b85a97d-3a4f89a7eb0mr6344842f8f.10.1748791494552; Sun, 01 Jun 2025 08:24:54 -0700 (PDT) Date: Sun, 1 Jun 2025 11:24:51 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Vasant Hegde , Alejandro Jimenez , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Joao Martins , Sairaj Kodilkar , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 03/31] hw/i386/amd_iommu: Fix xtsup when vcpus < 255 Message-ID: <0f178860df3489a9d3c19a5f7f024e6aa6c26515.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791959576116600 From: Vasant Hegde If vCPUs > 255 then x86 common code (x86_cpus_init()) call kvm_enable_x2api= c(). But if vCPUs <=3D 255 then the common code won't calls kvm_enable_x2apic(). This is because commit 8c6619f3e692 ("hw/i386/amd_iommu: Simplify non-KVM checks on XTSup feature") removed the call to kvm_enable_x2apic when xtsup is "on", which break things when guest is booted with x2apic mode and there are <=3D 255 vCPUs. Fix this by adding back kvm_enable_x2apic() call when xtsup=3Don. Fixes: 8c6619f3e692 ("hw/i386/amd_iommu: Simplify non-KVM checks on XTSup f= eature") Reported-by: Alejandro Jimenez Tested-by: Tested-by: Alejandro Jimenez Cc: Philippe Mathieu-Daud=C3=A9 Cc: Joao Martins Signed-off-by: Vasant Hegde Signed-off-by: Sairaj Kodilkar Message-Id: <20250516100535.4980-3-sarunkod@amd.com> Fixes: 8c6619f3e692 ("hw/i386/amd_iommu: Simplify non-KVM checks on XTSup f= eature") Reported-by: Alejandro Jimenez Tested-by: Tested-by: Alejandro Jimenez Cc: Philippe Mathieu-Daud=C3=A9 Cc: Joao Martins Signed-off-by: Vasant Hegde Signed-off-by: Sairaj Kodilkar --- hw/i386/amd_iommu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 17379db52a..963aa2450c 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1715,6 +1715,14 @@ static void amdvi_sysbus_realize(DeviceState *dev, E= rror **errp) exit(EXIT_FAILURE); } =20 + if (s->xtsup) { + if (kvm_irqchip_is_split() && !kvm_enable_x2apic()) { + error_report("AMD IOMMU xtsup=3Don requires x2APIC support on " + "the KVM side"); + exit(EXIT_FAILURE); + } + } + pci_setup_iommu(bus, &amdvi_iommu_ops, s); amdvi_init(s); } --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748792006; cv=none; d=zohomail.com; s=zohoarc; b=GVOutxX1fRuBOMSwvrdu1uHejbmBZ1pLmKPOMhIVY2/WAk5uL3sx0pTuCdJmb573PFWhiKHKWJH/w5Pty5OMv6PeFGTMM05kmrM+mNXyDSIsW+KDbkTeMXHmutXoyrTbs6ho4WaoA9E9qxbYQfUbxBdq3xUtou1qn3/hDLv3h/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748792006; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=M7r5BkbW1mUobtgoU/VoVdhf/Ou78PkCr7ce5yIfFgU=; b=frhWH9E2CYjV7tmaIWG0tSuZBgxsk3+QDVPJAb/mZ9I0YaBDMg28Til3lW340HZFUAOD3eLajF1K2k1l2eQwtwwepFJeR57Xg7ocof7wJl/wjiUeBd6kEjREtLYevpdImp82SbKYIo/gL5/uyotnMmNz5y/+uJS6Crxqca95h8M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748792006109957.8089642145053; Sun, 1 Jun 2025 08:33:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYx-00024m-7g; Sun, 01 Jun 2025 11:25:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYh-0001rb-LM for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYZ-0004ON-NM for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:06 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-329-LtG99R3YMEyK27iBG9IV3g-1; Sun, 01 Jun 2025 11:24:58 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3a4e713e05bso1679973f8f.3 for ; Sun, 01 Jun 2025 08:24:58 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f009fd9bsm11617081f8f.82.2025.06.01.08.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791500; 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=M7r5BkbW1mUobtgoU/VoVdhf/Ou78PkCr7ce5yIfFgU=; b=Y4bWQZlkpV/xxPmQhHdn6Ho7k6fKNB1jtSXvyYZsOtKU2oPgewjcnLj6fqvzlAWtP0zQZt 7yKxKU791ZKGGOod1g5wFFe7HvKEKSufjDM5M3yfru5jYQhoeNJgQKVGkQgfbPW1AOBoWc AqPQfKT+MVaBhfg/qorvU2whG+gXsOA= X-MC-Unique: LtG99R3YMEyK27iBG9IV3g-1 X-Mimecast-MFC-AGG-ID: LtG99R3YMEyK27iBG9IV3g_1748791498 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791497; x=1749396297; 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=M7r5BkbW1mUobtgoU/VoVdhf/Ou78PkCr7ce5yIfFgU=; b=iENKT7QeAA0L5nmug1lHiCGMi7A5jg0eAZkC4IlOkFNsBE4etgzyjBs8TGr9Ttl1HT RpWbRQqtlO36QBC+XXbj3TZCZapYVNoEEK8nEs362LqRZI+1OD06Dr2R0nslGOx4snyT HW0L81c2J/U7LFJLSGYOVksd0dQ3WZScR7/HR+UjkTGTUtgl7RyhryACABLaDifOci+b tyIFRwR4RAhYSGrO1FVEA9CmfFuaKvCM+3Ieij80bSSNePR6a/0p0u9fVRzfYCq2xFtW 4//5OhQktm0ROG8nRACgq0GztjWLkytzgosJSHzNGp+0ueLszPsaJEyp4Zr9+Kf6WBed zWtg== X-Gm-Message-State: AOJu0Yz4wHCTfDBIsFOjKDz9uyOPjPshONhOJtqDwaOXUYdtUbKjPz/A ONl1SxpRK9LwEJnl9fgAy1L3DcKVtOMtLXpGP3xsouW+QjR/ZvktQge9r/pbWSkxWMHf3qYmED1 E0I/MEV1LLCW4rwa4UurbU7ghXNk2bYCiVRcrQrDb+XxY4jq+rw8vUWur8AO8oK+GSnX2/LATFa W59Lzl+Y8Dy8w3EuNHmd2QJGFJpVBwb+fjaw== X-Gm-Gg: ASbGncuHlk8d1s8JcDQxFCArVjhjxcMbhfJwrwJjul8EV8dw40XHYlKKTCUa/DOdw7+ sK60GgR2xHDYYl47GFdSSC4ReyDZDreNV8ewLA9iajB1baCfo3FVFolUP5odhp01iIth7j643a/ JPms+CV4ktpgzE+joVN8FKv2I2ZeFFHRJH1817YGGDnAvpiGlIWN3Kddv+FSKIlc8A+JWUlxeJG kt45MSc8WCJWBzYB85RCwZLAj6hQ938uN7bm6O0BS9kvo9xhOC1XRI14/0J9DPGQxhrYQ4hCABg 2e0zDg== X-Received: by 2002:a05:6000:420a:b0:3a4:e0e1:8d9d with SMTP id ffacd0b85a97d-3a4fe394737mr3422857f8f.32.1748791497213; Sun, 01 Jun 2025 08:24:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGk6IqIOqua+smqV1E0pvvYEMaeMu9/TCuwRyz7w0a6T8Vni51W7WZ4QcsOTkDexDd+Dib2Bw== X-Received: by 2002:a05:6000:420a:b0:3a4:e0e1:8d9d with SMTP id ffacd0b85a97d-3a4fe394737mr3422838f8f.32.1748791496768; Sun, 01 Jun 2025 08:24:56 -0700 (PDT) Date: Sun, 1 Jun 2025 11:24:54 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Marcel Apfelbaum Subject: [PULL 04/31] pcie: Add helper to declare PASID capability for a pcie device Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748792008151116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF Signed-off-by: Clement Mathieu--Drif Message-Id: <20250520071823.764266-2-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pcie.h | 6 +++++- include/hw/pci/pcie_regs.h | 5 +++++ hw/pci/pcie.c | 25 +++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index 70a5de09de..fe82e0a915 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -70,8 +70,9 @@ struct PCIExpressDevice { uint16_t aer_cap; PCIEAERLog aer_log; =20 - /* Offset of ATS capability in config space */ + /* Offset of ATS and PASID capabilities in config space */ uint16_t ats_cap; + uint16_t pasid_cap; =20 /* ACS */ uint16_t acs_cap; @@ -150,4 +151,7 @@ void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_de= v, DeviceState *dev, Error **errp); void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); + +void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, + bool exec_perm, bool priv_mod); #endif /* QEMU_PCIE_H */ diff --git a/include/hw/pci/pcie_regs.h b/include/hw/pci/pcie_regs.h index 9d3b6868dc..4d9cf4a29c 100644 --- a/include/hw/pci/pcie_regs.h +++ b/include/hw/pci/pcie_regs.h @@ -86,6 +86,11 @@ typedef enum PCIExpLinkWidth { #define PCI_ARI_VER 1 #define PCI_ARI_SIZEOF 8 =20 +/* PASID */ +#define PCI_PASID_VER 1 +#define PCI_EXT_CAP_PASID_MAX_WIDTH 20 +#define PCI_PASID_CAP_WIDTH_SHIFT 8 + /* AER */ #define PCI_ERR_VER 2 #define PCI_ERR_SIZEOF 0x48 diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 1b12db6fa2..4f935ff420 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1214,3 +1214,28 @@ void pcie_acs_reset(PCIDevice *dev) pci_set_word(dev->config + dev->exp.acs_cap + PCI_ACS_CTRL, 0); } } + +/* PASID */ +void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, + bool exec_perm, bool priv_mod) +{ + static const uint16_t control_reg_rw_mask =3D 0x07; + uint16_t capability_reg; + + assert(pasid_width <=3D PCI_EXT_CAP_PASID_MAX_WIDTH); + + pcie_add_capability(dev, PCI_EXT_CAP_ID_PASID, PCI_PASID_VER, offset, + PCI_EXT_CAP_PASID_SIZEOF); + + capability_reg =3D ((uint16_t)pasid_width) << PCI_PASID_CAP_WIDTH_SHIF= T; + capability_reg |=3D exec_perm ? PCI_PASID_CAP_EXEC : 0; + capability_reg |=3D priv_mod ? PCI_PASID_CAP_PRIV : 0; + pci_set_word(dev->config + offset + PCI_PASID_CAP, capability_reg); + + /* Everything is disabled by default */ + pci_set_word(dev->config + offset + PCI_PASID_CTRL, 0); + + pci_set_word(dev->wmask + offset + PCI_PASID_CTRL, control_reg_rw_mask= ); + + dev->exp.pasid_cap =3D offset; +} --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791820; cv=none; d=zohomail.com; s=zohoarc; b=XPDmgH8g0Zsgohe6JDuFX2XkUw2cz3Jrl6lJMy2+Z0kvf+dPmN6G6FrHJiht8hTQz1V3XbS+k5Piea1Az8tDkkMzHKOl58K6763HJ67j/1O1R9K8VOvz/USkz8WG6bJXUpuCqH49EwB4C5w8PiOGiIUfTt3bZkFqPlYf624GGF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791820; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=K3hh+nsreMps0mGehLZKh8JmUU9TDLRDwrt24jOn5dk=; b=V8DsQmjd5ZLGugM3V0YzrQpCFPmJqk6fc/x5PwqCxFpQJRgq15ObfevCYn39d8xNfqEEvCB8PsE7q6ucSHzrwLakNtQxfuneKPfayG9c0W9chLl6wu+U6CTNbKzrHgTDRb5kr8A/njoY6IlrPTV9/j9FynRyTK1GTpbh2Z2/2SA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791820116763.9009906383412; Sun, 1 Jun 2025 08:30:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYt-00022C-2f; Sun, 01 Jun 2025 11:25:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYh-0001rc-LM for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYZ-0004P1-NY for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:06 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-HCpmHa7KOcSxqaPH9EFg5A-1; Sun, 01 Jun 2025 11:25:01 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-450d6768d4dso15953155e9.2 for ; Sun, 01 Jun 2025 08:25:00 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7fc24d7sm89368775e9.36.2025.06.01.08.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791502; 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=K3hh+nsreMps0mGehLZKh8JmUU9TDLRDwrt24jOn5dk=; b=KSxlqFXnaK9WpOVdL9ITiyKeSxusrjph4Z0cwhKA2Cb6ILrfw9Aa6cMZYgwjwZshpZfHCO ByCkTEnQurQ1MFEUOWCP4AP3b3EjL5XPbTzGaJlunCbNA2UsOp6gTFAmidXLZhbny6xx/Y cMxn54Li/RHfmMDuXOr8F7U+ekwi3iM= X-MC-Unique: HCpmHa7KOcSxqaPH9EFg5A-1 X-Mimecast-MFC-AGG-ID: HCpmHa7KOcSxqaPH9EFg5A_1748791500 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791499; x=1749396299; 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=K3hh+nsreMps0mGehLZKh8JmUU9TDLRDwrt24jOn5dk=; b=IjJeriwc8/qMNehq332QfQ+56aX777pRg4i/8p+jOYQ2D4jhPAZjQ1+gaCFod8gFHS aglGRG0T3gygf/jNAwTi8TPycTbpzKJvqktkZKLI0NhcRcTWGo0Wzb1RdiculB3676OK VmyE5DQgTKd89rFHMORy0YnuHDnOopmuSEkvvTR5ALO9I0XMtHMrmjnTWE5o8uAA//oq WI4xCWe4VObwsAWfEmHZFTm7rqgArTVJUg7ah1LVZBlB7mpB/X841+/8uAbnm23kxfoo L7BJFLmhxiIom7CMVDNzW9pWin/ZWMBHAAj2b0zmGYNphkttNq6J1gaM2CL5oJR4GYFH +B4g== X-Gm-Message-State: AOJu0Yy8bLcszucU4WbVgtv7RGMRq9vEjQOWxTduwJJim0Y0JewR4jVl wEaYK9ioV3E9nLhdUl9YkT8+BqAeOZjns3uNoM5xRp5zz/CjjOX0bOFfxTs8GeBxCf5AYD0h2CA wrED6qhgUH/7rtQTSjcttxJJup/5EXreoV/EAydDG8iw/JzepNSvE1sLryhOwiPppP9/6xY//QS KPwUckTyowUcXp+wMr6e/73wHDN80Ai9NK2w== X-Gm-Gg: ASbGncsALE5wNX212eeHXc8U3v3pwtYvvIH3JSQaHZZvWoEXTaKSgD2FyI4yxPBx/cS LEHgXAbJA6mMd+j09DaNqfNVHvzhJeR+wjxmhoyBfUNfQ7Qbnm1MyzsbTnOif0JZ1W+VwH22jXD nsWJp2RXCXkbyQl/aUqR8A/PmIrmYbopArq4b8Z4Y4ZJQO79WU31625VXV9Fcv8x51Y9KfbQaJn 1zpf61hze0QerpFXl+2K0jd5vBo5UlThow024gJgC++nHfHbEcCJbSVDJ2MZtG/oo3dme0ScQ0y hQywDQ== X-Received: by 2002:a05:6000:2586:b0:3a4:ef0d:e614 with SMTP id ffacd0b85a97d-3a4f89d30d8mr7536985f8f.33.1748791499428; Sun, 01 Jun 2025 08:24:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFYcQF/339ewniPmbtp+gM8KQO5fTU849NVHyrDzN/N3VoKh69PSUz2qgEZPNagOTR16hDgA== X-Received: by 2002:a05:6000:2586:b0:3a4:ef0d:e614 with SMTP id ffacd0b85a97d-3a4f89d30d8mr7536963f8f.33.1748791499035; Sun, 01 Jun 2025 08:24:59 -0700 (PDT) Date: Sun, 1 Jun 2025 11:24:56 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Marcel Apfelbaum Subject: [PULL 05/31] pcie: Helper functions to check if PASID is enabled Message-ID: <1e82e8a828cf18a8abfeca7295322db91879de04.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791821919116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF pasid_enabled checks whether the capability is present or not. If so, we read the configuration space to get the status of the feature (enabled or not). Signed-off-by: Clement Mathieu--Drif Message-Id: <20250520071823.764266-3-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pcie.h | 2 ++ hw/pci/pcie.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index fe82e0a915..dff98ff2c6 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -154,4 +154,6 @@ void pcie_cap_slot_unplug_request_cb(HotplugHandler *ho= tplug_dev, =20 void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, bool exec_perm, bool priv_mod); + +bool pcie_pasid_enabled(const PCIDevice *dev); #endif /* QEMU_PCIE_H */ diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 4f935ff420..db9756d861 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1239,3 +1239,12 @@ void pcie_pasid_init(PCIDevice *dev, uint16_t offset= , uint8_t pasid_width, =20 dev->exp.pasid_cap =3D offset; } + +bool pcie_pasid_enabled(const PCIDevice *dev) +{ + if (!pci_is_express(dev) || !dev->exp.pasid_cap) { + return false; + } + return (pci_get_word(dev->config + dev->exp.pasid_cap + PCI_PASID_CTRL= ) & + PCI_PASID_CTRL_ENABLE) !=3D 0; +} --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748792072; cv=none; d=zohomail.com; s=zohoarc; b=bG1J5yOdgy/BVUJxPMSOFQ2ZaxzyuGwxGDnqPzM1pihZ1t3NQ9BV3zme0okRVXpzzhRmIbnKFPe4jR2CjS6aeR+B5jgbUoR4E2+KfVINSBbkgiSmqnU8fRyLXj49hMmL5e2arY4Cjs7HIKUIe7M5LwzOpVMLjsoleTh+kaoN7Ls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748792072; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qFZ2Ib3XpNyI2PboRJ3fi4hOzy8N9yk8xKqfp9YMBCU=; b=P6Dmo33Wf0apSPJwKCco+RE5hwD8x7hBw22WGaZPnJDRAb8cghCbuyajkyKcYKTLxCn/JN6dSyXZTaCTAbi0Qay5ZrHwbZoC3qxnzzWlHBDgneYeb0KsQyayQ0YmrGddFFCzMC0ToM4RDEpCsNaB4d/sSf22WCmH3eV7T2V7/D0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748792072931735.9343105613327; Sun, 1 Jun 2025 08:34:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYu-000230-C0; Sun, 01 Jun 2025 11:25:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYh-0001rd-LO for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYb-0004Zl-UP for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:07 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-539-fqrwcUoSO76niR0ZbUsalg-1; Sun, 01 Jun 2025 11:25:03 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3a50816ccc6so201063f8f.1 for ; Sun, 01 Jun 2025 08:25:03 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f009f9d6sm11616102f8f.84.2025.06.01.08.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791504; 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=qFZ2Ib3XpNyI2PboRJ3fi4hOzy8N9yk8xKqfp9YMBCU=; b=EawHNDgrmSWsx7q5loOM3EW+fKK+DkFafucS327FaeE4F20I315OLIGLJubcHS5MMf/uVQ PQGwZbdxRsi3u5GXU+y/vCxNAv8hzOqv/ppNCu/wWmRmDA9V739dfGncAeZkpP4AI6wP3n Ei9iKsn6WcKVOWVZlkECq+VUcN97Arg= X-MC-Unique: fqrwcUoSO76niR0ZbUsalg-1 X-Mimecast-MFC-AGG-ID: fqrwcUoSO76niR0ZbUsalg_1748791502 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791501; x=1749396301; 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=qFZ2Ib3XpNyI2PboRJ3fi4hOzy8N9yk8xKqfp9YMBCU=; b=wOnVF0XwIoOxRi8klush38QoJjiiDkXhWxuKCraroYUzrrRujC7bGi+JP5DInRFUkW /FvazhDo1wnXg3hRKYdCK4EPQ3GYj7fF5igvCa7Tvk5ULBEudYlrTiSh6+c627YiwuAP nwwrVvbIjcOKfgz8GGyVtT6G5qAJHXUuY9cTFfjCkiZuTKOX0mWZ3eha5kpjle9N/8fA FePsj5s7OTbMKAnTnh0eySnxO3G88/KEsO44c5yXAVQm6zLlf+H92zmnqNqPI61hZJl8 hP4En86YCg73OVChPm7gk9XJYj5W86XT2P1RQEONF3rE08WsFIXJM7sGqCn2yvRPZcET jt5g== X-Gm-Message-State: AOJu0YzIUAOj8pzklwD3Cy7ffu1c6c8WiDrtTesi3Mr/703JOZiIU2Dv 2UpH5+8onGEMPfEL0mE74Lx0yrZB0i7bAMhe+SO7amIw+W+gz9ffik4rY6EaZTAg5P0Eb+Evt2c zLFwF2RIRRNGpCJu7QlxeJKY2NPAO3In3vdSaRlyJa7wW5+Gpa2jsPkD1Cc9cF3yyRkYVu4rmYK p4pJHQ3pGslZx+uPT6AOh14S+vEehaDdMSWQ== X-Gm-Gg: ASbGnct1uxw4QhWgq0FngK/Cl5nnjkrk4D/JneZY2SryltN2pxZk7Nm33uU3IRA8Xml raNXge7DcLS1P/+yat3fQUEuqtXJOkTu0qU6Kyz8Xv8mhuKrOwEqyk/bs2KBIZsBOmOzD3LRIyO CnHBeAuqMdGqaxRETf65me72dUnpTcsIxqpCUBBTxHRyQQWWAhX/uLFa+qVzCyBSAtcJupoD4qo iNvqSBh5u9iasrEyofziYvQvcuBbuL+9KCnzKW/+lRpW3DCFq77iUmnY4+A1wTly9qk27JfTcMf 60Xgag== X-Received: by 2002:a05:6000:2283:b0:3a3:652d:1640 with SMTP id ffacd0b85a97d-3a4fe160ba5mr4232362f8f.2.1748791501617; Sun, 01 Jun 2025 08:25:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDki4BypTlxeuAIOwTeTy3VgGmdVvQZPG7DDlD6e8SQR8m84KVHMjTDtCN1Hmdav+/RZCaow== X-Received: by 2002:a05:6000:2283:b0:3a3:652d:1640 with SMTP id ffacd0b85a97d-3a4fe160ba5mr4232343f8f.2.1748791501203; Sun, 01 Jun 2025 08:25:01 -0700 (PDT) Date: Sun, 1 Jun 2025 11:24:59 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Marcel Apfelbaum Subject: [PULL 06/31] pcie: Helper function to check if ATS is enabled Message-ID: <6a3ae6a2440dead9dd8e3f84152dc53a5214c48d.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748792074477116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF ats_enabled checks whether the capability is present or not. If so, we read the configuration space to get the status of the feature (enabled or not). Signed-off-by: Clement Mathieu--Drif Message-Id: <20250520071823.764266-4-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pcie.h | 1 + hw/pci/pcie.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index dff98ff2c6..497d0bc2d2 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -156,4 +156,5 @@ void pcie_pasid_init(PCIDevice *dev, uint16_t offset, u= int8_t pasid_width, bool exec_perm, bool priv_mod); =20 bool pcie_pasid_enabled(const PCIDevice *dev); +bool pcie_ats_enabled(const PCIDevice *dev); #endif /* QEMU_PCIE_H */ diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index db9756d861..36de709801 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1248,3 +1248,12 @@ bool pcie_pasid_enabled(const PCIDevice *dev) return (pci_get_word(dev->config + dev->exp.pasid_cap + PCI_PASID_CTRL= ) & PCI_PASID_CTRL_ENABLE) !=3D 0; } + +bool pcie_ats_enabled(const PCIDevice *dev) +{ + if (!pci_is_express(dev) || !dev->exp.ats_cap) { + return false; + } + return (pci_get_word(dev->config + dev->exp.ats_cap + PCI_ATS_CTRL) & + PCI_ATS_CTRL_ENABLE) !=3D 0; +} --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748792073; cv=none; d=zohomail.com; s=zohoarc; b=jbJ3N1tuel8U+K8RnhpMgI1mPf83M+ZAkGu0A37QiWdTYspLHgw3HD2C+ZuNdX8mbpjyaFx2v/EY7awRmZj1HkqlmorXjS5gz9dTtGPu1fbCHATUFuBnSAmo65pIaEEabL9yciLYmCrLrD7j4hkW3Tdk3eh2F3uLRVWWlCSzeOo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748792073; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BNH2pN0u94IUph1O8LRlSEdPOqYaYPrObBwYqpFSiHs=; b=RCqZRZqKogPhH3i2JelGgZNYcPCWwyAl3H1k4SljYxM7e5LCntnEdoKr9sth24zsV1iVlm/aSoOQP5N2w1b99gxajBQ8o/5E/dRiZhEoTY0L0H6D5BLNvhu+DWa4RChcRhIbA+39dQcMWNt9iukdtufcXt/a1djP4AdB9KR2n0I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748792073867684.4769149999042; Sun, 1 Jun 2025 08:34:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYu-00022o-7Q; Sun, 01 Jun 2025 11:25:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYl-0001wf-Nl for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYf-0004aH-NL for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:15 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-326-e1IWxMe3PuSRCyJf5JDXew-1; Sun, 01 Jun 2025 11:25:05 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-451d5600a54so4822475e9.2 for ; Sun, 01 Jun 2025 08:25:05 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7f8edf9sm87826135e9.3.2025.06.01.08.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791506; 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=BNH2pN0u94IUph1O8LRlSEdPOqYaYPrObBwYqpFSiHs=; b=AL1EeyWVcSmtd1/VzuBLgb8SLbWmDtWJuX0QO07jIl/wjTfdQWiAdylVHggMwAw676xPTJ 4uyZpoEctyxVTTQbW0whq+Z6sitsZtF1n2uskM6BLlin5CrRcA8CJ23qjZWj/dn4Hd28ih F3WZHI4F/TLAdF61/moj4WFFl6D3QWo= X-MC-Unique: e1IWxMe3PuSRCyJf5JDXew-1 X-Mimecast-MFC-AGG-ID: e1IWxMe3PuSRCyJf5JDXew_1748791504 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791504; x=1749396304; 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=BNH2pN0u94IUph1O8LRlSEdPOqYaYPrObBwYqpFSiHs=; b=wN51aOhjZ62yrFRh5wmoDeWEZIwmvXWTenRKP/QEdyAIOlRUGqS8GhCd+W0FWxro4+ CXtCBzZzqgYWfBeeQgwZvRHTG7E08T55+FLKyQHGP8gBiKpKUGMyjYQl5parQNPjupxe XN2HwjHCR8RMNMFe0TVqSVFv8cFgFuXxyOS94MWT4/R/4DVVlZq+Ji8w16xLcPp8LoFY qRZ1fMwWxjDSNCcoix1+JkcCfhXqJR9dGzTc36BLexI0a/Z9Du1+2pG5W30QfZD3ZN8F NNPnFTqU+1g0dVpdK5IX67DiojaMXkpyCyJU91XyfY24zf52GfDvHYzVpxG05HbXnfai B62w== X-Gm-Message-State: AOJu0YzejCfS6u6+a9XSyiNPW2DdYXZwzV5pzfuo4EU0dMu21XyKrDB2 c/lv5V743fvynJSLEpK+qPsjirjFGYG+9aUrJzK6yk4s4gnG3FbSGsjDaGl2w2r7Fn23oLonrjM FIAZTky6LOIQM9JRLx2WCEwBw+XsaU9V7mEHEKwU7U8ShqU0AHS9HZm2H35//c2LBA+8OSwO82v aufuBwnsaHY3kQ42j70ffvbwpPJVVXB5DZKg== X-Gm-Gg: ASbGncvfZbY/N4qmpyAf2UBSRpuIejoHZ6O20+s/w+jMI6K/fWnwSEoQhnfcQiOBoyL 2YsJ3kyAcWL5w+K6yFhzT5yxQ62HLjzvWGDls2fMvfjH9JknIxbT0biDsgMLQ4/xuqJGq5knZ/3 YKEaZ9TMK74zB1XAvfX0l1KuCsnUApb8E9V6O1SkSAWtLCkuMrkZmfyTmCBxejSVtCL36LZClxZ NIaDxvSNgqA88sE8PgEUhorNXNLd16IXauaKG8rDuuvIgOy9LovcwqmdB8IA2VZxs4Vn5OqCL9c +09/VWUGi0BXP/pq X-Received: by 2002:a05:600c:3f10:b0:43d:fa59:af97 with SMTP id 5b1f17b1804b1-450d6591a0cmr81504115e9.32.1748791504021; Sun, 01 Jun 2025 08:25:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcpYmUcW4ddwEGeMlju21OGvKaEaOH0ahLk/BxKlzlyAKq2Anx4271y3mjDyF9gW9m00/yCg== X-Received: by 2002:a05:600c:3f10:b0:43d:fa59:af97 with SMTP id 5b1f17b1804b1-450d6591a0cmr81503945e9.32.1748791503616; Sun, 01 Jun 2025 08:25:03 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:01 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Marcel Apfelbaum Subject: [PULL 07/31] pcie: Add a helper to declare the PRI capability for a pcie device Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748792074432116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF Signed-off-by: Clement Mathieu--Drif Message-Id: <20250520071823.764266-5-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pcie.h | 5 ++++- include/hw/pci/pcie_regs.h | 3 +++ hw/pci/pcie.c | 26 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index 497d0bc2d2..17f06cd5d6 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -70,9 +70,10 @@ struct PCIExpressDevice { uint16_t aer_cap; PCIEAERLog aer_log; =20 - /* Offset of ATS and PASID capabilities in config space */ + /* Offset of ATS, PRI and PASID capabilities in config space */ uint16_t ats_cap; uint16_t pasid_cap; + uint16_t pri_cap; =20 /* ACS */ uint16_t acs_cap; @@ -154,6 +155,8 @@ void pcie_cap_slot_unplug_request_cb(HotplugHandler *ho= tplug_dev, =20 void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, bool exec_perm, bool priv_mod); +void pcie_pri_init(PCIDevice *dev, uint16_t offset, uint32_t outstanding_p= r_cap, + bool prg_response_pasid_req); =20 bool pcie_pasid_enabled(const PCIDevice *dev); bool pcie_ats_enabled(const PCIDevice *dev); diff --git a/include/hw/pci/pcie_regs.h b/include/hw/pci/pcie_regs.h index 4d9cf4a29c..33a22229fe 100644 --- a/include/hw/pci/pcie_regs.h +++ b/include/hw/pci/pcie_regs.h @@ -91,6 +91,9 @@ typedef enum PCIExpLinkWidth { #define PCI_EXT_CAP_PASID_MAX_WIDTH 20 #define PCI_PASID_CAP_WIDTH_SHIFT 8 =20 +/* PRI */ +#define PCI_PRI_VER 1 + /* AER */ #define PCI_ERR_VER 2 #define PCI_ERR_SIZEOF 0x48 diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 36de709801..542172b3fa 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1240,6 +1240,32 @@ void pcie_pasid_init(PCIDevice *dev, uint16_t offset= , uint8_t pasid_width, dev->exp.pasid_cap =3D offset; } =20 +/* PRI */ +void pcie_pri_init(PCIDevice *dev, uint16_t offset, uint32_t outstanding_p= r_cap, + bool prg_response_pasid_req) +{ + static const uint16_t control_reg_rw_mask =3D 0x3; + static const uint16_t status_reg_rw1_mask =3D 0x3; + static const uint32_t pr_alloc_reg_rw_mask =3D 0xffffffff; + uint16_t status_reg; + + status_reg =3D prg_response_pasid_req ? PCI_PRI_STATUS_PASID : 0; + status_reg |=3D PCI_PRI_STATUS_STOPPED; /* Stopped by default */ + + pcie_add_capability(dev, PCI_EXT_CAP_ID_PRI, PCI_PRI_VER, offset, + PCI_EXT_CAP_PRI_SIZEOF); + /* Disabled by default */ + + pci_set_word(dev->config + offset + PCI_PRI_STATUS, status_reg); + pci_set_long(dev->config + offset + PCI_PRI_MAX_REQ, outstanding_pr_ca= p); + + pci_set_word(dev->wmask + offset + PCI_PRI_CTRL, control_reg_rw_mask); + pci_set_word(dev->w1cmask + offset + PCI_PRI_STATUS, status_reg_rw1_ma= sk); + pci_set_long(dev->wmask + offset + PCI_PRI_ALLOC_REQ, pr_alloc_reg_rw_= mask); + + dev->exp.pri_cap =3D offset; +} + bool pcie_pasid_enabled(const PCIDevice *dev) { if (!pci_is_express(dev) || !dev->exp.pasid_cap) { --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791881; cv=none; d=zohomail.com; s=zohoarc; b=feaCkAfM6e0blnjoi5EZGNMG9K5gtr8TKeAtAXSSBLXOMWHMD71vAeoqsDeGHD0ggNAbN6ZMlg8YHJMMKVAf422vELlJ1kqms9Leuej/XnKoYZr2dvGJjRiPj5Cytp1/w/P54KpbSmoR9j7zQ0mcD+D+ATgdOBJaqpUqV91VJ8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791881; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZDSsFEzywjh9OxEWL6pzAyxwPIhej9RWGxAoQQErVX4=; b=gr9LPFMuAhPMl3vLy2oGf7UyxrgiZrlczskCxe/Ij0BWHf+IVbd3ACaBzMG7aayFwp3Kzyn1yuPKL01fuLbXM84ZfPf6KMLefXxa7KwJ7zVNQD3XEeX4TKoUwD90rYyjZQDAnjo1HNyAoE2NF65HbWgB+HY0Sp0SCpqwufZu5bc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791881192449.776540762579; Sun, 1 Jun 2025 08:31:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYt-00022G-43; Sun, 01 Jun 2025 11:25:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYl-0001wg-Nn for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYj-0004aX-Fw for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:15 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-486-7LNTfkrtM52UkWzxQr8vmw-1; Sun, 01 Jun 2025 11:25:08 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3a4f6ff23ccso1563856f8f.2 for ; Sun, 01 Jun 2025 08:25:07 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d8013e0esm87687235e9.39.2025.06.01.08.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791509; 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=ZDSsFEzywjh9OxEWL6pzAyxwPIhej9RWGxAoQQErVX4=; b=JUN+F2XAwRKYQOB/orSUOxUpN6pSQ2o3ElMpcdO6Q04XCYr+ky0Tn9077UFCj4TcmFj6bk 6QeDqelb/jg0SyIvHyUcJcPgHqTWdIDonI+9O5Xmzze1DbLY63WS+PXuqwGUC45B0b0noc BzZ+6xVNscu+LxzuTEdT3Az9rHEEB6M= X-MC-Unique: 7LNTfkrtM52UkWzxQr8vmw-1 X-Mimecast-MFC-AGG-ID: 7LNTfkrtM52UkWzxQr8vmw_1748791507 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791506; x=1749396306; 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=ZDSsFEzywjh9OxEWL6pzAyxwPIhej9RWGxAoQQErVX4=; b=ZLewJDudA/jzWHzHhNQPTrjq3tXC84NnXhq5Q7SgNfVn4J1RXAIt/wqAMAiVN/su7a t3AcLuUtHdz0zOHiG0uEAJvzXnIOyWrUsfIcmjeuUv3p4ioif8D+paBE3tucUcIwbBQk ajyRLpt/3kMp3K8uX5+McUptsudL3Y32vlLz48heyDmnhLFYO0xhj2W8bJSUvYKRYn/h c88/HWT/Is9yAimvJU3zdgIzuZZpVWqjTpJuqQdFEokMpFs0DPSky+TtpyX8Nh4dAO63 hgWABMp3TJ13wiIjAAW7xeDKkPG+CVl2pR5hXK/qFuNe9QzK4Yp8XKKOteHUx/WslKPy VlfA== X-Gm-Message-State: AOJu0Yy7ckAYERDYtOB8ijGo8sT0+/Mfi9dcHOy2sd0SYIQgX6qfdQJb ZRYN7ACwCWXEGMsJvE9/BYZObiii8hw5UKpYrX/x1FluiWm4Uk+fpW+WWeDPIfPrrfZJ5x/+7Xb o3AJC2RzqLxtnNf27BgS56fERnTMDAeXoQi3FRfXEtaNi6wzWwnzClt0NeswbxstiL3bgdO6CKc mZrsIiJJKHQcEP3kNSqVj45rcvh3wJUoytgw== X-Gm-Gg: ASbGncsBwqjJ6Nplq4Cau1OS3DiFexMsWxKzfBrsHl6OblhE92JlHa0S/oYwTNnc5BX 3QZYcW2GoiVlSLDJX63O4spp0OWSn2+dA6IE62UVbw6+hB+PleFq7kQNMR0IU6t+BD/6sAOpwUD G7KJO684aFRFMDjaqrf3D8slbXeKfIVeQup0qdQnQ7/GfauiwwuOdvhpSwrV7o/vCczA5Y4BoGe qRF79DgP38Jmvm7PgxsRlRntj6ZdcbDw7+gHTHsfIKs90bCl7qyjJUhjzx+B4zzp6ftSGLhCyNG FQb+Lg== X-Received: by 2002:a5d:64ed:0:b0:3a4:f51c:21a9 with SMTP id ffacd0b85a97d-3a4f7ab12a5mr7889761f8f.52.1748791506209; Sun, 01 Jun 2025 08:25:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAcjJF6g+byLvSoBtxBrabkU4aCLTkZrOdWxEpTUostWIklT4x+FbaGhGkGDryG3QKZYa0Vg== X-Received: by 2002:a5d:64ed:0:b0:3a4:f51c:21a9 with SMTP id ffacd0b85a97d-3a4f7ab12a5mr7889741f8f.52.1748791505822; Sun, 01 Jun 2025 08:25:05 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:03 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Marcel Apfelbaum Subject: [PULL 08/31] pcie: Helper functions to check to check if PRI is enabled Message-ID: <5be8cf79188a2a1c73d16f3a8b458d909ac976f4.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791882560116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF pri_enabled can be used to check whether the capability is present and enabled on a PCIe device Signed-off-by: Clement Mathieu--Drif Message-Id: <20250520071823.764266-6-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pcie.h | 1 + hw/pci/pcie.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index 17f06cd5d6..ff6ce08e13 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -158,6 +158,7 @@ void pcie_pasid_init(PCIDevice *dev, uint16_t offset, u= int8_t pasid_width, void pcie_pri_init(PCIDevice *dev, uint16_t offset, uint32_t outstanding_p= r_cap, bool prg_response_pasid_req); =20 +bool pcie_pri_enabled(const PCIDevice *dev); bool pcie_pasid_enabled(const PCIDevice *dev); bool pcie_ats_enabled(const PCIDevice *dev); #endif /* QEMU_PCIE_H */ diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 542172b3fa..eaeb68894e 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1266,6 +1266,15 @@ void pcie_pri_init(PCIDevice *dev, uint16_t offset, = uint32_t outstanding_pr_cap, dev->exp.pri_cap =3D offset; } =20 +bool pcie_pri_enabled(const PCIDevice *dev) +{ + if (!pci_is_express(dev) || !dev->exp.pri_cap) { + return false; + } + return (pci_get_word(dev->config + dev->exp.pri_cap + PCI_PRI_CTRL) & + PCI_PRI_CTRL_ENABLE) !=3D 0; +} + bool pcie_pasid_enabled(const PCIDevice *dev) { if (!pci_is_express(dev) || !dev->exp.pasid_cap) { --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748792002; cv=none; d=zohomail.com; s=zohoarc; b=PuKUaBvAWOdcyvFEjCokttnZ+5lvbLwHKjQAVHxwVJSfORqzkxvE+0iBB6g3Dkw0JULt0v29NcNObhcY7g5DuzvEepA9qzfWmON5jXY0spcgoZpF+hjxZMTw9is2TjDJFM497PrCYML/znEki89X8wJ5ioSaM04NBavI8TGWH5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748792002; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wHQQCAnK0yg5PoT18e6XbDRnMAD0iEsb4QQNqN7pqwI=; b=B43h0c0qkK0Tyo7mvKvdCzC1hVfi1vikIb05PzrSOsJ7YcgBqRfqk8cGbz50ylcp5DUaTQ724r20kvN84kkP434WLDWz5b/NlER3WT5l58yvFCubX4Gg9wH04s01vR9yTWccUfIx3NiMJ74xXeakc7/ohlhdLErN4xs4JaUxh7I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748792002773882.8017338171304; Sun, 1 Jun 2025 08:33:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYx-00024t-D1; Sun, 01 Jun 2025 11:25:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYm-0001y8-Kc for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYj-0004b6-GZ for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:16 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-286-y6HyuIKPOX6eRMeg4RB74w-1; Sun, 01 Jun 2025 11:25:11 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-440667e7f92so24462885e9.3 for ; Sun, 01 Jun 2025 08:25:11 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7fa2278sm89609925e9.12.2025.06.01.08.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791512; 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=wHQQCAnK0yg5PoT18e6XbDRnMAD0iEsb4QQNqN7pqwI=; b=NHOM2rwPAQyAIuU9ZEdnEfRUy9qrL5Fg0Ufgx0eATQspYiSd7aCEeG1gctBU+WtFcYh8aY M0V9ISzD2joXw/yl27U40ad+K0ce2j0wvy3thsioGNMjG5oSw1lbdSEX2Q9lJCJA+eMeI0 UI90CHd5Ziklgainigiz05X2y1QMM7Y= X-MC-Unique: y6HyuIKPOX6eRMeg4RB74w-1 X-Mimecast-MFC-AGG-ID: y6HyuIKPOX6eRMeg4RB74w_1748791510 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791509; x=1749396309; 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=wHQQCAnK0yg5PoT18e6XbDRnMAD0iEsb4QQNqN7pqwI=; b=CmfqJluAGjbVYNSm2HhK2AZ4Q5GFq59uL81jZvjZjV1sS4MKHKuRuVsPXRGc1qRjur GJVs0gZv+KxR188B6aMD5bjxkLogLqkLxhe9RXzYHH/LkXRopu/tQSVrWFlQspL0k5bI I9a4ZEZrddNV7DPucr6CmpuheR/0QlFIgmd29XZISNOQluz+HDreMO4cm5ARUq9UYAnD 1e01U4pVPKHjMKBaoBPJGxdbtBWEelTY2/xjhxZlQ1Bspkt3rJ6HgmCiculQ9c/iiSeu obTeyTC7V+A5zM0KX8wnMy6AflySGKikhq5c4fgjTAtQkB42NtNK6zpJN/kzHwMtSrFI EK2Q== X-Gm-Message-State: AOJu0YyxtofhdveOJjUkKTpb1zKdDKOuNL1NkuUa/8RIfMbDT55fW4qR fmPnxq9wm/SSPVKyTvQrXbY77kFPpCbuJHsX1JDWQetGrO80rbH8GPp08ug+7GvODEtFjnV3TfN hHs4NkCdgc1lGHgc4MYc7vnlRKXvgD8LvW3nLZZCaryir8AASjKXi2Vrf+Fiw6H4IGO9RNFgifC ff4WwSgpiGLq0tmOCXlfkJTPQ1XMiuj7y2Hg== X-Gm-Gg: ASbGncuQ64P6cT5KN/RYO89pSxODXoWwQOl9KiDshgZJSDupARvJlkspx3kgu4DdAEj Z85q0+WGTFkMzzlwUqbXLt2Q4gK0JejHYDfnubXxIMPdGIgEWlfCxIeE8AM0nUBBdaQ7yZ3aIqL Ek70vnTfs2l+y2fLOaPPu71nVp5geQJ+Galagh6gHNWXM91Nvy6vfwyrSWvQxhUFFH7WedR4t16 kn7TbWv+2Xa95tYCtIUkf5LLnYkjVuf9Hjt72G2DxrpKWY3TY7Qp0Of8838OrSO8UTUF7FlCno8 WE8fEw== X-Received: by 2002:a05:600c:5007:b0:442:f4d4:522 with SMTP id 5b1f17b1804b1-4511ecbaa8dmr41654465e9.5.1748791509536; Sun, 01 Jun 2025 08:25:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSitZJG8mEpqAbldandhlkLpNzIX0v25LDDbgKUce+cPRuwN0lDVkVQn2as6jqCqAJ1c/vSg== X-Received: by 2002:a05:600c:5007:b0:442:f4d4:522 with SMTP id 5b1f17b1804b1-4511ecbaa8dmr41654255e9.5.1748791509051; Sun, 01 Jun 2025 08:25:09 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:06 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Marcel Apfelbaum Subject: [PULL 09/31] pci: Cache the bus mastering status in the device Message-ID: <8ff9e1def0ef3388333b6cc639c9f958f97ebe05.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748792004025116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF The cached is_master value is necessary to know if a device is allowed to issue ATS/PRI requests or not as these operations do not go through the master_enable memory region. Signed-off-by: Clement Mathieu--Drif Message-Id: <20250520071823.764266-7-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pci_device.h | 1 + hw/pci/pci.c | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/hw/pci/pci_device.h b/include/hw/pci/pci_device.h index e41d95b0b0..eee0338568 100644 --- a/include/hw/pci/pci_device.h +++ b/include/hw/pci/pci_device.h @@ -90,6 +90,7 @@ struct PCIDevice { char name[64]; PCIIORegion io_regions[PCI_NUM_REGIONS]; AddressSpace bus_master_as; + bool is_master; MemoryRegion bus_master_container_region; MemoryRegion bus_master_enable_region; =20 diff --git a/hw/pci/pci.c b/hw/pci/pci.c index f5ab510697..1114ba8529 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -128,6 +128,12 @@ static GSequence *pci_acpi_index_list(void) return used_acpi_index_list; } =20 +static void pci_set_master(PCIDevice *d, bool enable) +{ + memory_region_set_enabled(&d->bus_master_enable_region, enable); + d->is_master =3D enable; /* cache the status */ +} + static void pci_init_bus_master(PCIDevice *pci_dev) { AddressSpace *dma_as =3D pci_device_iommu_address_space(pci_dev); @@ -135,7 +141,7 @@ static void pci_init_bus_master(PCIDevice *pci_dev) memory_region_init_alias(&pci_dev->bus_master_enable_region, OBJECT(pci_dev), "bus master", dma_as->root, 0, memory_region_size(dma_as->r= oot)); - memory_region_set_enabled(&pci_dev->bus_master_enable_region, false); + pci_set_master(pci_dev, false); memory_region_add_subregion(&pci_dev->bus_master_container_region, 0, &pci_dev->bus_master_enable_region); } @@ -804,9 +810,8 @@ static int get_pci_config_device(QEMUFile *f, void *pv,= size_t size, pci_bridge_update_mappings(PCI_BRIDGE(s)); } =20 - memory_region_set_enabled(&s->bus_master_enable_region, - pci_get_word(s->config + PCI_COMMAND) - & PCI_COMMAND_MASTER); + pci_set_master(s, pci_get_word(s->config + PCI_COMMAND) + & PCI_COMMAND_MASTER); =20 g_free(config); return 0; @@ -1787,9 +1792,8 @@ void pci_default_write_config(PCIDevice *d, uint32_t = addr, uint32_t val_in, int =20 if (ranges_overlap(addr, l, PCI_COMMAND, 2)) { pci_update_irq_disabled(d, was_irq_disabled); - memory_region_set_enabled(&d->bus_master_enable_region, - (pci_get_word(d->config + PCI_COMMAND) - & PCI_COMMAND_MASTER) && d->enabled); + pci_set_master(d, (pci_get_word(d->config + PCI_COMMAND) & + PCI_COMMAND_MASTER) && d->enabled); } =20 msi_write_config(d, addr, val_in, l); @@ -3100,9 +3104,8 @@ void pci_set_enabled(PCIDevice *d, bool state) =20 d->enabled =3D state; pci_update_mappings(d); - memory_region_set_enabled(&d->bus_master_enable_region, - (pci_get_word(d->config + PCI_COMMAND) - & PCI_COMMAND_MASTER) && d->enabled); + pci_set_master(d, (pci_get_word(d->config + PCI_COMMAND) + & PCI_COMMAND_MASTER) && d->enabled); if (qdev_is_realized(&d->qdev)) { pci_device_reset(d); } --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791724; cv=none; d=zohomail.com; s=zohoarc; b=bI4rKtKBqH0Q9VnuLOrqWF7O1T40ibT8SmGQVmeJQCtscawLdzCJsUY0rXO4P5eoUGsfIoSp1vyKE5TUGt7oFgQaqV6bTCkPhFGmnjtLCqy4Xhf/c3J7QLCgtUbZ0lVKXAUF1AcPE/uzUCm5t2+S6q2ABCfnqIzL8LHEgHpbtsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791724; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MwBttvuXo9B6rx2/RlekvI4+H6DQqjR7+n57u3/7wG4=; b=f+dnEEBJ2ZUINbYMc/xPbyYj6qzMoZ9OQOmRJM38vPpZlkHby9oxn5TqrJofYa7/vSbGp/b5C83OFEo/WG0ShaBFqaq4A18LvS62xTF3IEQau08OEoIDaVsV788a5TbEjv3cOhKUWjendU5Pij8v7hWqWq15rqMcW0J6NqQJrZ4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791724976200.86582501850933; Sun, 1 Jun 2025 08:28:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYw-00024A-6h; Sun, 01 Jun 2025 11:25:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYn-0001yL-Gg for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYl-0004bc-FV for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:16 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-645-wOQD4cilMTa7T2uYCjSIhg-1; Sun, 01 Jun 2025 11:25:13 -0400 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3a4edf5bb4dso1966095f8f.0 for ; Sun, 01 Jun 2025 08:25:13 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f0097210sm11755182f8f.73.2025.06.01.08.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791514; 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=MwBttvuXo9B6rx2/RlekvI4+H6DQqjR7+n57u3/7wG4=; b=OaNOBlp4OIAMTvUZEC55K2bJLQdItawT5/3dpAWV6yGbQIe19wkRvdTHTeKPB7BSAH/uxo 9CAqL7YJOsNDSKQLFYemQpg84wc1wYJkdv4i6xb+cr/autZqRGLYTjlJ6fQ7b3t8Wd6bcM vZsRIPzinIk5fKNiBugvQSXa3oxRvIo= X-MC-Unique: wOQD4cilMTa7T2uYCjSIhg-1 X-Mimecast-MFC-AGG-ID: wOQD4cilMTa7T2uYCjSIhg_1748791512 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791512; x=1749396312; 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=MwBttvuXo9B6rx2/RlekvI4+H6DQqjR7+n57u3/7wG4=; b=VZvbb5wvqgIRojOM0FLU/FkcDkV+R8IrucGgF2PN0vieKZg/udIq/gOG7d4L3EQGIj CHtCdLivzMg3E61afLrJkuCSf0/LxC4o4qP8TDrshidFvD+Cc9bPmnyNtpIemztibyYB NV5+xrFIh1be34Jkqe1We0o0Ry+X7kb+Hf70ghGwEQM1jGtWYZQvX6LUNgJ01hQo3aLX F47U/ioY4E4rByHGfRrgQHdw92XZb5LYvIOv4lk5KOrEMVc1RlMRNUJWHkJI6rbmZuGJ JvEAoxkpHzTXoFa2APE7JRecp8bJS0sKX4Inc+AEcK8E6musLKmfQqaNT4tepIMvUJDl X95g== X-Gm-Message-State: AOJu0YzitS11ObWXk76MqOEZtXnweVZFctY1xm67mOpRi3UIKQUCK9Zd FvJw0r6/xbLEkqXQQakHEI3Rnp8eNLCQQX9rKkPIfkJjHnmGBX7qXCwM5H9WwD0MlPdBjhFRZC+ DhEHd0Z4MgJ6+quqYO2z3qriMYJvzL6u7NlOD6u8HWtX1D1zdIpMTufx3szTgvKtpXaFj9ByUxO dtovXwcDnqiBNnnJ79hob/RwctUJWBW+RLMg== X-Gm-Gg: ASbGncvX4SWWyz4ZhJQUh7H17UlL4ztsY8hDFCDrbZimQ8NSiSAZJ1qfhzQCJrwo2Qp MZFoRHDTRJoXaR/qr0Us4WGoLoIW3VZUWHueyqUbXcj/NKThUqV+lg+Hd0SQSQkgD4WCQDqFmWD 6+looa4OcbMZl0jpA9DtO1lfBeEJWTO3awB+4TKC6aoi6Vh1reL//pvUIk9rukUQMLup8Cdu5QD h7tzF/FJ6V/6ggzRTpqudGlz5gyM+UaWIU3MbQN6CNLCJcjL0V+lSiwEy+UwKS99vWOvFDAqt8H GX2BxQ== X-Received: by 2002:a05:6000:250d:b0:3a1:fe77:9e1d with SMTP id ffacd0b85a97d-3a4f7a4d55amr7696163f8f.16.1748791511927; Sun, 01 Jun 2025 08:25:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/UePlmHvH59O/Ma6rwu8/EnmX6ovCcZ8HFYYRiL8t0+trkRhcwksWZabWcCGlWxDljvSuyg== X-Received: by 2002:a05:6000:250d:b0:3a1:fe77:9e1d with SMTP id ffacd0b85a97d-3a4f7a4d55amr7696140f8f.16.1748791511460; Sun, 01 Jun 2025 08:25:11 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:09 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Marcel Apfelbaum Subject: [PULL 10/31] pci: Add an API to get IOMMU's min page size and virtual address width Message-ID: <042cbc9aec7caca639dcb1a8a996406a7c572706.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791726782116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF This kind of information is needed by devices implementing ATS in order to initialize their translation cache. Signed-off-by: Clement Mathieu--Drif Message-Id: <20250520071823.764266-8-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pci.h | 26 ++++++++++++++++++++++++++ hw/pci/pci.c | 17 +++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index c2fe6caa2c..d67ffe12db 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -429,6 +429,19 @@ typedef struct PCIIOMMUOps { * @devfn: device and function number of the PCI device. */ void (*unset_iommu_device)(PCIBus *bus, void *opaque, int devfn); + /** + * @get_iotlb_info: get properties required to initialize a device IOT= LB. + * + * Callback required if devices are allowed to cache translations. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @addr_width: the address width of the IOMMU (output parameter). + * + * @min_page_size: the page size of the IOMMU (output parameter). + */ + void (*get_iotlb_info)(void *opaque, uint8_t *addr_width, + uint32_t *min_page_size); } PCIIOMMUOps; =20 AddressSpace *pci_device_iommu_address_space(PCIDevice *dev); @@ -436,6 +449,19 @@ bool pci_device_set_iommu_device(PCIDevice *dev, HostI= OMMUDevice *hiod, Error **errp); void pci_device_unset_iommu_device(PCIDevice *dev); =20 +/** + * pci_iommu_get_iotlb_info: get properties required to initialize a + * device IOTLB. + * + * Returns 0 on success, or a negative errno otherwise. + * + * @dev: the device that wants to get the information. + * @addr_width: the address width of the IOMMU (output parameter). + * @min_page_size: the page size of the IOMMU (output parameter). + */ +int pci_iommu_get_iotlb_info(PCIDevice *dev, uint8_t *addr_width, + uint32_t *min_page_size); + /** * pci_setup_iommu: Initialize specific IOMMU handlers for a PCIBus * diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 1114ba8529..fc4954ac81 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2970,6 +2970,23 @@ void pci_device_unset_iommu_device(PCIDevice *dev) } } =20 +int pci_iommu_get_iotlb_info(PCIDevice *dev, uint8_t *addr_width, + uint32_t *min_page_size) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->get_iotlb_info) { + iommu_bus->iommu_ops->get_iotlb_info(iommu_bus->iommu_opaque, + addr_width, min_page_size); + return 0; + } + + return -ENODEV; +} + void pci_setup_iommu(PCIBus *bus, const PCIIOMMUOps *ops, void *opaque) { /* --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791801; cv=none; d=zohomail.com; s=zohoarc; b=jweDnasXQK6sw2qP4KCxtxfA5P7MGTbEvKX08bjA/i+njnqjhlCufKGCBYqJRoTfn+yFsS8n1mvzP1K5m8dKcO+8Z3aRnigA5ur/OJ6qhM3S2JnbrnMhflv8Y7hbDgJBhAOExMoclnXnk2QRuyh3HiiEOedeg+pgrRsHyfsgxzg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791801; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=V57bXBa/NJD+DZ1mz9DxqFOQwYrQd//dPwL/338ok+k=; b=Xpi+vvwpYEjOt+Uiwpy3HSLZMs0c368gAlQdgU/SkTm8eO0T1G5SWq4ukL3iNNloVoFKT6Qiy5mogKyLFRFT4UTMxbSHYlmtSSiVNB9k2+7hKIWJXhKuQNN+ouZqdXAXlv9GIuFgwrGBrWfoREmJuemBdNQDNkfZvAQibuaYAh8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791801019110.80577291032; Sun, 1 Jun 2025 08:30:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYw-00024W-D3; Sun, 01 Jun 2025 11:25:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYp-00020I-Eu for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYo-0004cK-2V for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:19 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-6k-3SxwUMHiP3AIYL6VDXQ-1; Sun, 01 Jun 2025 11:25:16 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-451d5600a54so4823335e9.2 for ; Sun, 01 Jun 2025 08:25:15 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d8000f3esm88939575e9.23.2025.06.01.08.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791517; 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=V57bXBa/NJD+DZ1mz9DxqFOQwYrQd//dPwL/338ok+k=; b=c/MOnOrjy1BX+hFJPLbY8mOF2yenMLIlanelw/YV6tB9xvkxFLickBtbVpkjXLCk61s1ZY mPh7Am6IiNGSaNFP23mMW/xF2bicDvxvahxrNoFGfXQJCgDAh0Rl4dxuWRBu1PG+u+qD2S HVGlesGhqtFn4sexgWYLqIjDLqKVT7c= X-MC-Unique: 6k-3SxwUMHiP3AIYL6VDXQ-1 X-Mimecast-MFC-AGG-ID: 6k-3SxwUMHiP3AIYL6VDXQ_1748791515 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791514; x=1749396314; 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=V57bXBa/NJD+DZ1mz9DxqFOQwYrQd//dPwL/338ok+k=; b=sjhYTXhAKWZ6xSbNX2KwUMG6XiLrGXl7xd6ogPy7oiq/XPCYV+O86dmFggHGlK/h6V NkpuNc7zg5sNvCXn0ce5604l9WJ+90WOSfb/8RGRGjXT3fh3NGj8Of369lVJjp4dSIeC DQ1+FIygVScM2kZFNIJgGIEUYSFZDb+7iJZRFxWltyzzYsCij7EpNAzwVrSJ7P6RN9cm 1UiTGbFwuBgkqPgnB5dhapJfQwjIHB/A4cNZ/2XsE5e1lQrnSBBsFEA+1gtEbcxTeexJ glSHPqtz7XGp7jL9i8rVg01aufmr115Ezs7O8PBPJpJqHnrXwb22x+cmVBnLyCRTkXOG y8SA== X-Gm-Message-State: AOJu0Yw9WjXqqjeleU946QEEDmQGyfJYEMleEDz60jU0eTWmYBbm5ETf /swictV+LJwkk8etDWaA65XTJRdgZlRJARguDAYRejNE5a0PQ0Z5Zx1tiDcO4mjpu7i4VMb2rdg hOONQwjxOHzkdsC93+/6eU8TJwJwM45ME4G2umOTWGQ9qZHOxDtQaJdA+5ojjQIvAbXkZMjHj77 B+sG8eZqM7HGgycTkO80FX+z0xgnT0CUJ0kw== X-Gm-Gg: ASbGncsHYntx/V6Lw7TSDdEztJC+HxAZldGI56R1KrHFh9MVBB6C7HudmlLwqN/G+11 x5Kb3oQ0d+a7uV0kF4Ts80GZ7vn6RYMXj1ZDaJL5oIpwkJhO9xtAl3NXgV7vnQK8dLNsSXs/Hx0 U418+nYtZFN22Yfysqc/T8Fi5G7GZiJcgRUOP5Ck+sfmvlXrywytqo+BRBo4xXo77EY7dkyHFfK oJ5D9Xq+fPTvr2nPN4coRly68SXeEass1hCTPzw+6X8mMcxGFK4yawvOOhT30gGDlhDjCUfQIwu qQr+Fg== X-Received: by 2002:a05:600c:4711:b0:450:cfa7:5ea1 with SMTP id 5b1f17b1804b1-450d6533b86mr102794445e9.16.1748791514290; Sun, 01 Jun 2025 08:25:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEm9CwCKb258FusvueO+hapmr2ms1xdUB60Y0rCUDWlNnSfmvWLJ7l9kOymMYncq8kCoaUxOw== X-Received: by 2002:a05:600c:4711:b0:450:cfa7:5ea1 with SMTP id 5b1f17b1804b1-450d6533b86mr102794235e9.16.1748791513893; Sun, 01 Jun 2025 08:25:13 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:11 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Paolo Bonzini , Peter Xu , David Hildenbrand , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: [PULL 11/31] memory: Store user data pointer in the IOMMU notifiers Message-ID: <7e94e45296d68982d448ae57e195efcf8f66649e.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791803739116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF This will help developers of ATS-capable devices to track a state. Signed-off-by: Clement Mathieu--Drif Message-Id: <20250520071823.764266-9-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/system/memory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/system/memory.h b/include/system/memory.h index fbbf4cf911..fc35a0dcad 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -183,6 +183,7 @@ struct IOMMUNotifier { hwaddr start; hwaddr end; int iommu_idx; + void *opaque; QLIST_ENTRY(IOMMUNotifier) node; }; typedef struct IOMMUNotifier IOMMUNotifier; --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791597; cv=none; d=zohomail.com; s=zohoarc; b=IYxxylm1qE2KUfhF0kx4t0BtG88nk5qaLps3/DZloA1otAhazARNMKjpcYejFAxaYHLc+TJVgjpsQbpOhUsQ/RY6Pu9dGGzuVciIkUWDQJ8fyqIazpZllY1jP+spDnA4GuNBUBxhsWFeahN1HaNgwy4lH/X9wppQqnDIqME4tkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791597; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YJiOOwAv2YnFSleWHSjNqxKC6KzAim3GjLcQEGjgPCE=; b=a+hvi7eXcd6dbknXaiK9ttM2XlSkctdJTHEYfv2hSWrehpGg0El64uLHrzuWAOZ4gKLxWK0IfG02QXwC8+vpHxoTQxJReJTFP79ghQyoV5HZz0mvj8xjA98qorZL0N4J0eOWkBxytISj4HCJhOoF6e3oMu5pTNzf8pWURK+IzfM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791597191689.096191800686; Sun, 1 Jun 2025 08:26:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYz-00026N-A0; Sun, 01 Jun 2025 11:25:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYs-000220-Ep for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYp-0004ca-Vf for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:21 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-AD4yA8P5M3GgCeVx6yryOw-1; Sun, 01 Jun 2025 11:25:18 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-450d57a0641so21739015e9.3 for ; Sun, 01 Jun 2025 08:25:18 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d8012af3sm87483405e9.35.2025.06.01.08.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791519; 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=YJiOOwAv2YnFSleWHSjNqxKC6KzAim3GjLcQEGjgPCE=; b=MH5a/E3lqSX+AA5sD+hogwqudcEJB0MiSt6MkAHsuauDyYdfj6Qsjqj14U6IQvI1SIjEU7 SXeyHlAC+OrPKMmpI1f6BRG6ZYNlIM4Pa+niukreEgHDn+ujiTt9D8on4gecXucCJo2lbX o20fOwwn0v+/CkDrZhijstI4NoqZ61o= X-MC-Unique: AD4yA8P5M3GgCeVx6yryOw-1 X-Mimecast-MFC-AGG-ID: AD4yA8P5M3GgCeVx6yryOw_1748791517 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791517; x=1749396317; 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=YJiOOwAv2YnFSleWHSjNqxKC6KzAim3GjLcQEGjgPCE=; b=PqHkgWnwMOr6RHOlJhN46mYluQEnMlsweqzq7j/h8TQdaPU+49zFNDmmEvC56hcu5a VoqLidiPaaFYcf6F8KnfW9yCL8y4jQHaD5BdrD+euPyq3xe9UBw7rBs8+qmbOmlumDO8 xKYRlyTrq6E640VcHNN3A29qsNmN6qQvQbiURYeA8+tS8zjLyd+cuPXAn8QX0XAVwTLK gNXnjnQlLdyeavbBzvaxbUznIm5CmUUea72Jc7zL3M30i5VVAGE7BZ/8T0YNQZFpWrjx 3UiLMn6HB1BlyaHVeUYSEVQ0PYO/MQOJrOMt4aur2RbRKEzQwBbjUWZK96K5GciiTHmh 5Q+A== X-Gm-Message-State: AOJu0YzLNowywJzJmm1DRpJEtJeTTu4YnlJmsqRaEVGbQM8uBpyqcn/6 98GxZ0o873onzQZVbVQzHRC9zHUTExj1OosTJDn926aR0mdp3nvLc/J/X3SnWIRaT2C6xaM1Q4I ZEuZCMIWrV0T09AyQCyLwCMNNeZcbqrEfyEhtlsZ7w/uIOE5tqNhqxjULuuM1a2jfJIznrRPJdP uM8gRQxd4Hz6qXLFHS3+cfyGs5FjDKciWQdQ== X-Gm-Gg: ASbGncuWwRhn4ZtoyLUI9rCPghKcHifhNGQ9BRr5bzIdEkyZgrO6P5SWzJMo7QH5iWl Ell46bTIzS/5IwKU052IAsk9HMQmB8LGe9TJW29oIKy7OOH0fk8g9BG4MyhIKC+LMU7mNZ39fjf RlY2q7BDSZAISyNsH4rg5brkSsEFOu1twO+Hkw3jywWVTRPjqoiQiIT8/WGFgGDBUZ5e5zSqmoB 2XnlE2VTZpqsuO/NyamIkJkQRA4KdnHrK73cftm/I9VqKpJL6yYGKcN2OySvXyVNuIqMuait1kc vCJIYQ== X-Received: by 2002:a05:600c:500b:b0:442:ccf0:41e6 with SMTP id 5b1f17b1804b1-4511ecb8b24mr51248835e9.3.1748791516735; Sun, 01 Jun 2025 08:25:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZoR6jNpuzkkkeQQAk/CySquFGt5ogDk51MwX5+nqOtRfRyJXdBv43GrOkD6F210i1dIqomw== X-Received: by 2002:a05:600c:500b:b0:442:ccf0:41e6 with SMTP id 5b1f17b1804b1-4511ecb8b24mr51248615e9.3.1748791516253; Sun, 01 Jun 2025 08:25:16 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:14 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Marcel Apfelbaum Subject: [PULL 12/31] pci: Add a pci-level initialization function for IOMMU notifiers Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791599483116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF This is meant to be used by ATS-capable devices. Signed-off-by: Clement Mathieu--Drif Message-Id: <20250520071823.764266-10-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pci.h | 33 +++++++++++++++++++++++++++++++++ hw/pci/pci.c | 17 +++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index d67ffe12db..f3016fd76f 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -442,6 +442,26 @@ typedef struct PCIIOMMUOps { */ void (*get_iotlb_info)(void *opaque, uint8_t *addr_width, uint32_t *min_page_size); + /** + * @init_iotlb_notifier: initialize an IOMMU notifier. + * + * Optional callback. + * + * @bus: the #PCIBus of the PCI device. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number of the PCI device. + * + * @n: the notifier to be initialized. + * + * @fn: the callback to be installed. + * + * @user_opaque: a user pointer that can be used to track a state. + */ + void (*init_iotlb_notifier)(PCIBus *bus, void *opaque, int devfn, + IOMMUNotifier *n, IOMMUNotify fn, + void *user_opaque); } PCIIOMMUOps; =20 AddressSpace *pci_device_iommu_address_space(PCIDevice *dev); @@ -462,6 +482,19 @@ void pci_device_unset_iommu_device(PCIDevice *dev); int pci_iommu_get_iotlb_info(PCIDevice *dev, uint8_t *addr_width, uint32_t *min_page_size); =20 +/** + * pci_iommu_init_iotlb_notifier: initialize an IOMMU notifier. + * + * This function is used by devices before registering an IOTLB notifier. + * + * @dev: the device. + * @n: the notifier to be initialized. + * @fn: the callback to be installed. + * @opaque: a user pointer that can be used to track a state. + */ +int pci_iommu_init_iotlb_notifier(PCIDevice *dev, IOMMUNotifier *n, + IOMMUNotify fn, void *opaque); + /** * pci_setup_iommu: Initialize specific IOMMU handlers for a PCIBus * diff --git a/hw/pci/pci.c b/hw/pci/pci.c index fc4954ac81..dfa5a0259e 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2939,6 +2939,23 @@ AddressSpace *pci_device_iommu_address_space(PCIDevi= ce *dev) return &address_space_memory; } =20 +int pci_iommu_init_iotlb_notifier(PCIDevice *dev, IOMMUNotifier *n, + IOMMUNotify fn, void *opaque) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->init_iotlb_notifier) { + iommu_bus->iommu_ops->init_iotlb_notifier(bus, iommu_bus->iommu_op= aque, + devfn, n, fn, opaque); + return 0; + } + + return -ENODEV; +} + bool pci_device_set_iommu_device(PCIDevice *dev, HostIOMMUDevice *hiod, Error **errp) { --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748792047; cv=none; d=zohomail.com; s=zohoarc; b=GkQmIe1Bz+9HcY+e+J0jvnArUlGWkyth6SVKTDH5A0zha9m2hbIxP1P2XUTHG7bm+TFmTjSKJmUO7qprM2cmI9EFXGKaZBTB0cZ3Qlys3xf0m7shlMqhjHo0VgSK4hzYnw3lca8g5hsDnbn0WHofw5a/qwaIu9kCM9oUU+hB/ts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748792047; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4oOyhyn0zwWJsClDDP7Djl4UlBECR0W4KSvSBeBDXig=; b=kNSAm5UBwTw+RokSXD7L1C/9hhCPirjBM+MF+2V7n/4U3o2H2bXz2ICV+dvprDTzpfejH9Iz3Jd2FYpOIOLBPmwHnTm9h/WNIWDe6RSlKIcgrqmStrRB6UMjP2W1AsGGmwYx1j3i6658Uy8bZRJNjf8tL5/7IQhFqAYJBJ0OT00= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748792047537228.68170113016708; Sun, 1 Jun 2025 08:34:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkYx-00024l-71; Sun, 01 Jun 2025 11:25:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYu-00023s-UK for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYt-0004cu-1X for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:24 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-245-LiUI1UfRO1C2gxILs-lWnA-1; Sun, 01 Jun 2025 11:25:21 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-442dc702850so24188755e9.1 for ; Sun, 01 Jun 2025 08:25:20 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d8006946sm87957085e9.31.2025.06.01.08.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791522; 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=4oOyhyn0zwWJsClDDP7Djl4UlBECR0W4KSvSBeBDXig=; b=KxCzsCLf7J1ppACQzBEauNfEsXT41IZklK0S9KfS+ZSlv9K1Ox0FHqhswOLrLYcUFrdVHW 0ZPTBi6CqrbwrY0TM6S6RG2Hc7U5zxeUfgL/sD4lHuMp9bzP1u1wC67CqQqF1aNKQ7XC2k HqcjLt5CX7OH+esST/YVCr2N/kJFgsU= X-MC-Unique: LiUI1UfRO1C2gxILs-lWnA-1 X-Mimecast-MFC-AGG-ID: LiUI1UfRO1C2gxILs-lWnA_1748791520 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791519; x=1749396319; 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=4oOyhyn0zwWJsClDDP7Djl4UlBECR0W4KSvSBeBDXig=; b=S3Xh45fYAwICtZHrYEYR/vTrnSM9Y+wUCvaUPvPi6w0kpHKd7pDqc6544IKlCBocwE gSJ3YiqtY45Hxon1VFAbwjcQmWBarcSX9oeZDS7nRE/Rdv9v6OOxvo/tvldOy8beloqL bLayOETtimP5eI53JYa7pyz8O6Z2kI6ECJJXgEkMgKfIqy5lt/eYIoRq1TapWUcwz+vc JmqIIcH5d6lLpae4JPAWEaBkInCVmzNXaHZuptTH8z86JDibSF+TGWNXbJFFIhAdRRzi EbeuSYaWxKO62aNwBKEeC8BmyrWUoaQpyoWZx8n53t+cYI7W0frXlXp0Q/ziIuRaWT2v CMUw== X-Gm-Message-State: AOJu0YzzAwyP9wQDmElAS83glnb6jNdAWi+BFfOOhk7gyFV66NlztCkn 36lQq9cuu9p9Lrx8s1GB+N5WVg9079EbrOYUZqeaiND4Pj7X5GopCebey9gFz3FNI455rC4LeYi 0nDenjW2vx1Y+RNFkHgySlJWjJ+jjqR7uXm6n80HWqV7srxmzmU6fgGuYwdqmJVzAVtQCCtcEtU 0ugdXBZAwfUff0xjhmb5MRDUY27GS2Zh6qcg== X-Gm-Gg: ASbGncvBVjVoBX3IqB4bjBdoZ1F7XX0KeyFY/krGagPQC/Q8MaGrVdORBUig3jT8ldv BscRXEWpn4wE7BLco5AghKNaAMz+v2oxGAGPj8MuVV0S1/hG//oyg0Atbics2y0x1l33v3aewMY 42ItqUKIp2m4D0rV6ewxdV+U0J9XQyCmK7EC3bkSci0Bd+GwufduFkJ6LkyZSDG9+xiasm3ueXm onsVsKgUCJIuTLYPKgGaAyEIKniYt1inbnIKotf9rgM73vz1Ph6C2Pc9615Qd8ivCy6eV7W+g1c XBMQQw== X-Received: by 2002:a05:600c:4747:b0:442:d9f2:c753 with SMTP id 5b1f17b1804b1-451221a1bbfmr35598245e9.26.1748791519127; Sun, 01 Jun 2025 08:25:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIWBPmbXwauyNBsxvUduJZ1u0g6ygdwkngsvcHVyVzsqVlPZx3M7EVDag8+OJgOGcr0aMWvw== X-Received: by 2002:a05:600c:4747:b0:442:d9f2:c753 with SMTP id 5b1f17b1804b1-451221a1bbfmr35597975e9.26.1748791518577; Sun, 01 Jun 2025 08:25:18 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:16 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Ethan Milon , Marcel Apfelbaum Subject: [PULL 13/31] pci: Add a pci-level API for ATS Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748792048590116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF Devices implementing ATS can send translation requests using pci_ats_request_translation. The invalidation events are sent back to the device using the iommu notifier managed with pci_iommu_register_iotlb_notifier / pci_iommu_unregister_iotlb_notifier. Signed-off-by: Clement Mathieu--Drif Co-authored-by: Ethan Milon Message-Id: <20250520071823.764266-11-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pci.h | 126 +++++++++++++++++++++++++++++++++++++++++++ hw/pci/pci.c | 81 ++++++++++++++++++++++++++++ 2 files changed, 207 insertions(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index f3016fd76f..5d72607ed5 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -462,6 +462,80 @@ typedef struct PCIIOMMUOps { void (*init_iotlb_notifier)(PCIBus *bus, void *opaque, int devfn, IOMMUNotifier *n, IOMMUNotify fn, void *user_opaque); + /** + * @register_iotlb_notifier: setup an IOTLB invalidation notifier. + * + * Callback required if devices are allowed to cache translations. + * + * @bus: the #PCIBus of the PCI device. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number of the PCI device. + * + * @pasid: the pasid of the address space to watch. + * + * @n: the notifier to register. + */ + void (*register_iotlb_notifier)(PCIBus *bus, void *opaque, int devfn, + uint32_t pasid, IOMMUNotifier *n); + /** + * @unregister_iotlb_notifier: remove an IOTLB invalidation notifier. + * + * Callback required if devices are allowed to cache translations. + * + * @bus: the #PCIBus of the PCI device. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number of the PCI device. + * + * @pasid: the pasid of the address space to stop watching. + * + * @n: the notifier to unregister. + */ + void (*unregister_iotlb_notifier)(PCIBus *bus, void *opaque, int devfn, + uint32_t pasid, IOMMUNotifier *n); + /** + * @ats_request_translation: issue an ATS request. + * + * Callback required if devices are allowed to use the address + * translation service. + * + * @bus: the #PCIBus of the PCI device. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number of the PCI device. + * + * @pasid: the pasid of the address space to use for the request. + * + * @priv_req: privileged mode bit (PASID TLP). + * + * @exec_req: execute request bit (PASID TLP). + * + * @addr: start address of the memory range to be translated. + * + * @length: length of the memory range in bytes. + * + * @no_write: request a read-only translation (if supported). + * + * @result: buffer in which the TLB entries will be stored. + * + * @result_length: result buffer length. + * + * @err_count: number of untranslated subregions. + * + * Returns: the number of translations stored in the result buffer, or + * -ENOMEM if the buffer is not large enough. + */ + ssize_t (*ats_request_translation)(PCIBus *bus, void *opaque, int devf= n, + uint32_t pasid, bool priv_req, + bool exec_req, hwaddr addr, + size_t length, bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count); } PCIIOMMUOps; =20 AddressSpace *pci_device_iommu_address_space(PCIDevice *dev); @@ -495,6 +569,58 @@ int pci_iommu_get_iotlb_info(PCIDevice *dev, uint8_t *= addr_width, int pci_iommu_init_iotlb_notifier(PCIDevice *dev, IOMMUNotifier *n, IOMMUNotify fn, void *opaque); =20 +/** + * pci_ats_request_translation: perform an ATS request. + * + * Returns the number of translations stored in @result in case of success, + * a negative error code otherwise. + * -ENOMEM is returned when the result buffer is not large enough to store + * all the translations. + * + * @dev: the ATS-capable PCI device. + * @pasid: the pasid of the address space in which the translation will be= done. + * @priv_req: privileged mode bit (PASID TLP). + * @exec_req: execute request bit (PASID TLP). + * @addr: start address of the memory range to be translated. + * @length: length of the memory range in bytes. + * @no_write: request a read-only translation (if supported). + * @result: buffer in which the TLB entries will be stored. + * @result_length: result buffer length. + * @err_count: number of untranslated subregions. + */ +ssize_t pci_ats_request_translation(PCIDevice *dev, uint32_t pasid, + bool priv_req, bool exec_req, + hwaddr addr, size_t length, + bool no_write, IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count); + +/** + * pci_iommu_register_iotlb_notifier: register a notifier for changes to + * IOMMU translation entries in a specific address space. + * + * Returns 0 on success, or a negative errno otherwise. + * + * @dev: the device that wants to get notified. + * @pasid: the pasid of the address space to track. + * @n: the notifier to register. + */ +int pci_iommu_register_iotlb_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n); + +/** + * pci_iommu_unregister_iotlb_notifier: unregister a notifier that has been + * registerd with pci_iommu_register_iotlb_notifier. + * + * Returns 0 on success, or a negative errno otherwise. + * + * @dev: the device that wants to stop notifications. + * @pasid: the pasid of the address space to stop tracking. + * @n: the notifier to unregister. + */ +int pci_iommu_unregister_iotlb_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n); + /** * pci_setup_iommu: Initialize specific IOMMU handlers for a PCIBus * diff --git a/hw/pci/pci.c b/hw/pci/pci.c index dfa5a0259e..0c63cb4bbe 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2987,6 +2987,87 @@ void pci_device_unset_iommu_device(PCIDevice *dev) } } =20 +ssize_t pci_ats_request_translation(PCIDevice *dev, uint32_t pasid, + bool priv_req, bool exec_req, + hwaddr addr, size_t length, + bool no_write, IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + if (!dev->is_master || + ((pasid !=3D PCI_NO_PASID) && !pcie_pasid_enabled(dev))) { + return -EPERM; + } + + if (result_length =3D=3D 0) { + return -ENOSPC; + } + + if (!pcie_ats_enabled(dev)) { + return -EPERM; + } + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->ats_request_translation) { + return iommu_bus->iommu_ops->ats_request_translation(bus, + iommu_bus->iommu_opaq= ue, + devfn, pasid, priv_re= q, + exec_req, addr, lengt= h, + no_write, result, + result_length, err_co= unt); + } + + return -ENODEV; +} + +int pci_iommu_register_iotlb_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + if ((pasid !=3D PCI_NO_PASID) && !pcie_pasid_enabled(dev)) { + return -EPERM; + } + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->register_iotlb_notifier) { + iommu_bus->iommu_ops->register_iotlb_notifier(bus, + iommu_bus->iommu_opaque, devfn, + pasid, n); + return 0; + } + + return -ENODEV; +} + +int pci_iommu_unregister_iotlb_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + if ((pasid !=3D PCI_NO_PASID) && !pcie_pasid_enabled(dev)) { + return -EPERM; + } + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->unregister_iotlb_notifier) { + iommu_bus->iommu_ops->unregister_iotlb_notifier(bus, + iommu_bus->iommu_o= paque, + devfn, pasid, n); + return 0; + } + + return -ENODEV; +} + int pci_iommu_get_iotlb_info(PCIDevice *dev, uint8_t *addr_width, uint32_t *min_page_size) { --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791958; cv=none; d=zohomail.com; s=zohoarc; b=LFx9p0jKAxGQ4GvSS1radP2onRBL7Qc1tz6SWX3Vuhl6S1AHmQEs7PFxKgyU6jFxywgm+wlSgZ0/S6rv8bEoglGyRofWm4vM2VLVl3uukaJY2OhHs+ILeCQCjoTRULDgNmBjVO382YYloQjES+1m+roX6ZQUGuSlhDcS6/D0lIc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791958; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=f470Te/20A+JI7N7uDj23gq/WhgjwkX/MH5JkqvMLnY=; b=mYK2Cmzkjo/gvpZzI4OL9UwB5YIKy1eLkZ0Th6bB4JZvXj0V6Z7gjZnWyV9Fl+6XNzxLpajeRGgh6Rn2Yl0FcX9wIz0e9qxEoIsPixkcZEDZeG7s42ofGMRvrFFDlSfM1+2fW+pTRHNCxDMZQPsV7BQtV5PI8JHAXYEP20urg4I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174879195816355.36929269913901; Sun, 1 Jun 2025 08:32:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZ1-00027O-Fy; Sun, 01 Jun 2025 11:25:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYx-000255-GM for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYv-0004dD-Bm for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:27 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-357-jOeLjqkdOqan3r5IKu_9cw-1; Sun, 01 Jun 2025 11:25:23 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-451d30992bcso6712815e9.2 for ; Sun, 01 Jun 2025 08:25:23 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d800671csm88636315e9.30.2025.06.01.08.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791524; 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=f470Te/20A+JI7N7uDj23gq/WhgjwkX/MH5JkqvMLnY=; b=QujeeHjwDCPlHPBhORXaLyL3p2WMdLUeT/7TbOHx8Fougf8IsKwhfQvhgayp1CFMTwRSLx Z22ZkV0R/ZpKS5foR01i+3sqF08G5V2DkPXb7vNUzsrpY/pgLRJm3fzEuW0lpab7eZACxR hd68S4oGqJG3QGguMs72LhpyCWVmIwo= X-MC-Unique: jOeLjqkdOqan3r5IKu_9cw-1 X-Mimecast-MFC-AGG-ID: jOeLjqkdOqan3r5IKu_9cw_1748791522 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791522; x=1749396322; 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=f470Te/20A+JI7N7uDj23gq/WhgjwkX/MH5JkqvMLnY=; b=GFyrm8rjPa8VNIwMpftXU+6qL/qQ6Evnbmiag1ExLnJZuhs69vGQzSvNZHBa/PcFhR E5Zjt1HOWSiUVDc/CMyyCe3qSniOp+vxmaGhJ7StBY0ce5oJNeWeN5tL+SGGLGQfpWRh BPBp0mmsWAN/YofjsalOdgkTZ938eu69Q4nVs9ryhykPFfzZG4LqzDbRLNdeL4nmqN57 +9wG0HEHYqux60DkL8wutsueviQAArRd4BD0r7hYYIHX0RKCbEtbR412EnHfrAWfyEP5 +vGcB6A2WOPHvC4vvgRDdFWmCcVhR2Dp3UlGDVm7B5ffmnE79fdZVu3mTNREwlHWe0Pm IqLw== X-Gm-Message-State: AOJu0YzxUpDXy8Gsl5yQDGh5tzIx1kDQ3I+7t1wBFHs9gv5gC4DKe6ek qJr0ma6NWtU7w+WPB+8oRqL+D/mxZZxp73qvsVLdkPfyE01rU7GrPlVgbXyduQ2ZPKia8iNbLVf 84+gSbHkfsNzNFyxlUCEXnhz8fewZqDJdegJiNKnDTY3gnW+ftiUmsT2/O+5BaUKYQULnp8jbhD S5Tv2M+FOO1E1S2784pqM20GWX+qBW2kcOVw== X-Gm-Gg: ASbGncvJykTlp7QkfDgi2KCPJb3HVeyGODcRWmldseBXiG2GegMyHYW07ho3A4sfd/y ua3RAqIT28VIVZsApvGO+ydY+x3tLFz4+V4owhRdqIMJk0/GN8Pb+ycOI1UaeSorOjx2fhmts++ yDvURmN7sEqjYM5RTIq4GvLZviaoMtyx0wRa3B3T9JB9Ex7B3qMYCG3JvSkpGKdBBAIc7O0O4fy KoLtP3X1rGekq7uo/2m5umfDNIPap7iECjrSejA5noyc79K7WCc4bIhQ/K0vfZJ5ugu4kJpbvuN sS1FkQ== X-Received: by 2002:a05:600c:8b11:b0:450:d4ad:b7de with SMTP id 5b1f17b1804b1-4511ecb9cd9mr48814555e9.3.1748791521538; Sun, 01 Jun 2025 08:25:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3oRx0DFOf2pEH7L3o7ZAWFS5oZylVxJXGYiYF8/BUlsrxYWXnjUrKzDZWUdLV3ByHF7WMwg== X-Received: by 2002:a05:600c:8b11:b0:450:d4ad:b7de with SMTP id 5b1f17b1804b1-4511ecb9cd9mr48814315e9.3.1748791520994; Sun, 01 Jun 2025 08:25:20 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:18 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , CLEMENT MATHIEU--DRIF , Ethan Milon , Marcel Apfelbaum Subject: [PULL 14/31] pci: Add a PCI-level API for PRI Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791959481116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: CLEMENT MATHIEU--DRIF A device can send a PRI request to the IOMMU using pci_pri_request_page. The PRI response is sent back using the notifier managed with pci_pri_register_notifier and pci_pri_unregister_notifier. Signed-off-by: Clement Mathieu--Drif Co-authored-by: Ethan Milon Message-Id: <20250520071823.764266-12-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pci.h | 130 +++++++++++++++++++++++++++++++++++++++++++ hw/pci/pci.c | 66 ++++++++++++++++++++++ 2 files changed, 196 insertions(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 5d72607ed5..a6854dad2b 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -375,6 +375,28 @@ void pci_bus_get_w64_range(PCIBus *bus, Range *range); =20 void pci_device_deassert_intx(PCIDevice *dev); =20 +/* Page Request Interface */ +typedef enum { + IOMMU_PRI_RESP_SUCCESS, + IOMMU_PRI_RESP_INVALID_REQUEST, + IOMMU_PRI_RESP_FAILURE, +} IOMMUPRIResponseCode; + +typedef struct IOMMUPRIResponse { + IOMMUPRIResponseCode response_code; + uint16_t prgi; +} IOMMUPRIResponse; + +struct IOMMUPRINotifier; + +typedef void (*IOMMUPRINotify)(struct IOMMUPRINotifier *notifier, + IOMMUPRIResponse *response); + +typedef struct IOMMUPRINotifier { + IOMMUPRINotify notify; +} IOMMUPRINotifier; + +#define PCI_PRI_PRGI_MASK 0x1ffU =20 /** * struct PCIIOMMUOps: callbacks structure for specific IOMMU handlers @@ -536,6 +558,72 @@ typedef struct PCIIOMMUOps { IOMMUTLBEntry *result, size_t result_length, uint32_t *err_count); + /** + * @pri_register_notifier: setup the PRI completion callback. + * + * Callback required if devices are allowed to use the page request + * interface. + * + * @bus: the #PCIBus of the PCI device. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number of the PCI device. + * + * @pasid: the pasid of the address space to track. + * + * @notifier: the notifier to register. + */ + void (*pri_register_notifier)(PCIBus *bus, void *opaque, int devfn, + uint32_t pasid, IOMMUPRINotifier *notifi= er); + /** + * @pri_unregister_notifier: remove the PRI completion callback. + * + * Callback required if devices are allowed to use the page request + * interface. + * + * @bus: the #PCIBus of the PCI device. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number of the PCI device. + * + * @pasid: the pasid of the address space to stop tracking. + */ + void (*pri_unregister_notifier)(PCIBus *bus, void *opaque, int devfn, + uint32_t pasid); + /** + * @pri_request_page: issue a PRI request. + * + * Callback required if devices are allowed to use the page request + * interface. + * + * @bus: the #PCIBus of the PCI device. + * + * @opaque: the data passed to pci_setup_iommu(). + * + * @devfn: device and function number of the PCI device. + * + * @pasid: the pasid of the address space to use for the request. + * + * @priv_req: privileged mode bit (PASID TLP). + * + * @exec_req: execute request bit (PASID TLP). + * + * @addr: untranslated address of the requested page. + * + * @lpig: last page in group. + * + * @prgi: page request group index. + * + * @is_read: request read access. + * + * @is_write: request write access. + */ + int (*pri_request_page)(PCIBus *bus, void *opaque, int devfn, + uint32_t pasid, bool priv_req, bool exec_req, + hwaddr addr, bool lpig, uint16_t prgi, bool is= _read, + bool is_write); } PCIIOMMUOps; =20 AddressSpace *pci_device_iommu_address_space(PCIDevice *dev); @@ -595,6 +683,48 @@ ssize_t pci_ats_request_translation(PCIDevice *dev, ui= nt32_t pasid, size_t result_length, uint32_t *err_count); =20 +/** + * pci_pri_request_page: perform a PRI request. + * + * Returns 0 if the PRI request has been sent to the guest OS, + * an error code otherwise. + * + * @dev: the PRI-capable PCI device. + * @pasid: the pasid of the address space in which the translation will be= done. + * @priv_req: privileged mode bit (PASID TLP). + * @exec_req: execute request bit (PASID TLP). + * @addr: untranslated address of the requested page. + * @lpig: last page in group. + * @prgi: page request group index. + * @is_read: request read access. + * @is_write: request write access. + */ +int pci_pri_request_page(PCIDevice *dev, uint32_t pasid, bool priv_req, + bool exec_req, hwaddr addr, bool lpig, + uint16_t prgi, bool is_read, bool is_write); + +/** + * pci_pri_register_notifier: register the PRI callback for a given address + * space. + * + * Returns 0 on success, an error code otherwise. + * + * @dev: the PRI-capable PCI device. + * @pasid: the pasid of the address space to track. + * @notifier: the notifier to register. + */ +int pci_pri_register_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUPRINotifier *notifier); + +/** + * pci_pri_unregister_notifier: remove the PRI callback from a given addre= ss + * space. + * + * @dev: the PRI-capable PCI device. + * @pasid: the pasid of the address space to stop tracking. + */ +void pci_pri_unregister_notifier(PCIDevice *dev, uint32_t pasid); + /** * pci_iommu_register_iotlb_notifier: register a notifier for changes to * IOMMU translation entries in a specific address space. diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 0c63cb4bbe..c6b5768f3a 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2987,6 +2987,72 @@ void pci_device_unset_iommu_device(PCIDevice *dev) } } =20 +int pci_pri_request_page(PCIDevice *dev, uint32_t pasid, bool priv_req, + bool exec_req, hwaddr addr, bool lpig, + uint16_t prgi, bool is_read, bool is_write) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + if (!dev->is_master || + ((pasid !=3D PCI_NO_PASID) && !pcie_pasid_enabled(dev))) { + return -EPERM; + } + + if (!pcie_pri_enabled(dev)) { + return -EPERM; + } + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->pri_request_page) { + return iommu_bus->iommu_ops->pri_request_page(bus, + iommu_bus->iommu_opaq= ue, + devfn, pasid, priv_re= q, + exec_req, addr, lpig,= prgi, + is_read, is_write); + } + + return -ENODEV; +} + +int pci_pri_register_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUPRINotifier *notifier) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + if (!dev->is_master || + ((pasid !=3D PCI_NO_PASID) && !pcie_pasid_enabled(dev))) { + return -EPERM; + } + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->pri_register_notifier) { + iommu_bus->iommu_ops->pri_register_notifier(bus, + iommu_bus->iommu_opaqu= e, + devfn, pasid, notifier= ); + return 0; + } + + return -ENODEV; +} + +void pci_pri_unregister_notifier(PCIDevice *dev, uint32_t pasid) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->pri_unregister_notifier) { + iommu_bus->iommu_ops->pri_unregister_notifier(bus, + iommu_bus->iommu_opa= que, + devfn, pasid); + } +} + ssize_t pci_ats_request_translation(PCIDevice *dev, uint32_t pasid, bool priv_req, bool exec_req, hwaddr addr, size_t length, --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791997; cv=none; d=zohomail.com; s=zohoarc; b=YWZnu0NTk8KTyh2UENDZEkAn80sgYyFwY+TIHhchAjRKDMpjFZL1iFbe5n86yBs1k7lKOMOG0K55j/eBO/VLunzYY7snVpq/xDkHM6eCm/NRob2JiXdUfdkNPescaJaLl8mcvIbQa7HGz/kQyFK6indKTGqj3QbYn4ofMDC58Zs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791997; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qQ5mn/pPFh+YZmi+IS0xHBlc0CO0vI6XdycBZ6UjxU8=; b=cavQORarLx82X6/q1NzRziV8F3PFfI7RBFU4XtFGTitdM7FaW3H+ZBPeSh20w/nYm4iq+wgVFnSvpoGFMvS8o7+Vt+isDkaxvvMZb058xqM+aFvIIlO4PtGI/CYkqfXi+Oyz4qphuttpyAGqw8XNdOLj9Pkkf73SEGsesXiYuww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791997781831.6391426730598; Sun, 1 Jun 2025 08:33:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZ1-00026w-3c; Sun, 01 Jun 2025 11:25:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYy-000265-Ip for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkYx-0004dX-0b for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:28 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-F7RybbWuOMWfxqSgQWGazA-1; Sun, 01 Jun 2025 11:25:25 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-451d2037f1eso4806005e9.0 for ; Sun, 01 Jun 2025 08:25:25 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4efe5b92bsm11592943f8f.9.2025.06.01.08.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791526; 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=qQ5mn/pPFh+YZmi+IS0xHBlc0CO0vI6XdycBZ6UjxU8=; b=Xue3aLxNtcMOiuPiqdsg0eAbG38FgX68C8YWyjM8mW0AgLrkIVQ1ihAOZcbVjc2nkdPl/1 /j6aV9fKXctXX7bwOhGww/8Wx7YmUumKnlUMKNIna7kFgcuSsnDetiXeaqLw6IKXivLEeC juoUcO+ocEi4bgCBOQ68Avn8UF4f5sI= X-MC-Unique: F7RybbWuOMWfxqSgQWGazA-1 X-Mimecast-MFC-AGG-ID: F7RybbWuOMWfxqSgQWGazA_1748791524 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791524; x=1749396324; 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=qQ5mn/pPFh+YZmi+IS0xHBlc0CO0vI6XdycBZ6UjxU8=; b=PcsWvfcv0WTgihp8Lnct7iV7IXxcfPA9Tk0qJlfu2kfDgYTee6Yx5qAPrSCDHG0cAo 8/pgt8vG90ExGhk+YlD9lkpHoNnlSYVyZUh06GWkajHSiqxxe045rxDPrNS7mApRPBux rrE8Q4+PBPipemYHSYNsr2HzPYfDf48QVA/LcrbX8TMpKRk0SXQYP5dVRd+QYgoFdy2/ eC8l+NLhI413w4Q9FXC3cMoKrPjBFQjgLh61/MmZSY9P24ux4alhRQwEYKJIWxGwRTs6 Ywi9fB4dM+atFpxKTCgP2e2OJFux4FH/8cgCE50MDMqZqspLusQPXTsG6VyBm95L96N+ m+wQ== X-Gm-Message-State: AOJu0YxUPlnwuJM5bdoV0fs7fV7ISgqierUnCY1L/bx4OOxWkRSsik0e E2ac0oa/eS6KGo1UxtoLdHKqjnSkigxr0fJ6wu4uUgG8wMkkUX1W4saIQExojYcD5zOqVfwI4E3 a0k9C/iyELovouwOx/BirxhVAUwm2Z4uszKBEzMl4naUbUePr8CHKuGVoF0H/vJC0BKI2F063ca 33uoILu1Qe2+vzsXA4pQRWcNgHcxL/5/7/jQ== X-Gm-Gg: ASbGnctpLsOnd1Z1K2rabDV0h3rP3RFqE/9qzIw9TFB0cvMpi+ivhp3Jq1j8tM5scJ+ HBXdWVM2VXaB25ggRNNAiAQHu8g58Lf32WcoAsXjYI7RJfAWQCQWT0QcbaWxDOirFir77x3U6Xl oRJ0OaSFzosiwzV+juiJ40JevPYzh49N5obQTJ4cDv+2gCbNH2RjmbVsH5GMtNxxmHnd2fH/eVZ JIz17Cz0bYuti8QzHOAE9B737rPKlgt4ysIDMEAejg4QxFsL5nELSr6ONpr1MuoPtt++NDVjjSu 19tfZw== X-Received: by 2002:a05:600c:35c2:b0:43d:82c:2b11 with SMTP id 5b1f17b1804b1-4511edf0aa8mr40353395e9.23.1748791523758; Sun, 01 Jun 2025 08:25:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlbannIW+eZkKcdo0t8CEhQuUXo62gtoqGtTVNmNEPeQwSrozs93k+XHDrQRxkDGo6bc2E8w== X-Received: by 2002:a05:600c:35c2:b0:43d:82c:2b11 with SMTP id 5b1f17b1804b1-4511edf0aa8mr40353175e9.23.1748791523355; Sun, 01 Jun 2025 08:25:23 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:21 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bibo Mao , Gerd Hoffmann , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: [PULL 15/31] uefi-test-tools:: Add LoongArch64 support Message-ID: <75d4680c55498d6cf4f89b31e52d97f90d7fc46e.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791999946116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bibo Mao Add support to build bios-tables-test iso image for LoongArch system. Signed-off-by: Bibo Mao Acked-by: Gerd Hoffmann Message-Id: <20250520130158.767083-2-maobibo@loongson.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/uefi-test-tools/Makefile | 5 +++-- .../UefiTestToolsPkg/UefiTestToolsPkg.dsc | 6 +++++- tests/uefi-test-tools/uefi-test-build.config | 10 ++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/uefi-test-tools/Makefile b/tests/uefi-test-tools/Makefile index f4eaebd8ff..8ee6fb3571 100644 --- a/tests/uefi-test-tools/Makefile +++ b/tests/uefi-test-tools/Makefile @@ -12,7 +12,7 @@ =20 edk2_dir :=3D ../../roms/edk2 images_dir :=3D ../data/uefi-boot-images -emulation_targets :=3D arm aarch64 i386 x86_64 riscv64 +emulation_targets :=3D arm aarch64 i386 x86_64 riscv64 loongarch64 uefi_binaries :=3D bios-tables-test intermediate_suffixes :=3D .efi .fat .iso.raw =20 @@ -56,7 +56,8 @@ Build/%.iso.raw: Build/%.fat # stripped from, the argument. map_arm_to_uefi =3D $(subst arm,ARM,$(1)) map_aarch64_to_uefi =3D $(subst aarch64,AA64,$(call map_arm_to_uefi,$(1))) -map_riscv64_to_uefi =3D $(subst riscv64,RISCV64,$(call map_aarch64_to_uefi= ,$(1))) +map_loongarch64_to_uefi =3D $(subst loongarch64,LOONGARCH64,$(call map_aar= ch64_to_uefi,$(1))) +map_riscv64_to_uefi =3D $(subst riscv64,RISCV64,$(call map_loongarch64_to_= uefi,$(1))) map_i386_to_uefi =3D $(subst i386,IA32,$(call map_riscv64_to_uefi,$(1))) map_x86_64_to_uefi =3D $(subst x86_64,X64,$(call map_i386_to_uefi,$(1))) map_to_uefi =3D $(subst .,,$(call map_x86_64_to_uefi,$(1))) diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc b/= tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc index 0902fd3c73..facf8df1fa 100644 --- a/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc +++ b/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc @@ -19,7 +19,7 @@ PLATFORM_VERSION =3D 0.1 PLATFORM_NAME =3D UefiTestTools SKUID_IDENTIFIER =3D DEFAULT - SUPPORTED_ARCHITECTURES =3D ARM|AARCH64|IA32|X64|RISCV64 + SUPPORTED_ARCHITECTURES =3D ARM|AARCH64|IA32|X64|RISCV64|LOONGARCH64 BUILD_TARGETS =3D DEBUG =20 [BuildOptions.IA32] @@ -65,6 +65,10 @@ [LibraryClasses.RISCV64] BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf =20 +[LibraryClasses.LOONGARCH64] + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + StackCheckLib|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf + [PcdsFixedAtBuild] gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F diff --git a/tests/uefi-test-tools/uefi-test-build.config b/tests/uefi-test= -tools/uefi-test-build.config index a4c61fc97a..8bf4826634 100644 --- a/tests/uefi-test-tools/uefi-test-build.config +++ b/tests/uefi-test-tools/uefi-test-build.config @@ -21,6 +21,16 @@ dest =3D ./Build arch =3D AARCH64 cpy1 =3D AARCH64/BiosTablesTest.efi bios-tables-test.aarch64.efi =20 +##########################################################################= ########## +# loongarch64 + +[build.loongarch64] +conf =3D UefiTestToolsPkg/UefiTestToolsPkg.dsc +plat =3D UefiTestTools +dest =3D ./Build +arch =3D LOONGARCH64 +cpy1 =3D LOONGARCH64/BiosTablesTest.efi bios-tables-test.loongarch64.efi + ##########################################################################= ########## # riscv64 =20 --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791586; cv=none; d=zohomail.com; s=zohoarc; b=anNNlYOHJTOjSBBn5qC55CVJRAaUMnMlsygna+ii5IKiejZh/HgTfIE/Rwbfmx0q2Ec1kMM8GFLJ26HRXNRG2RFCmdIcNpzz41q7qkd0hfPP5m07hALcIzHRZMwAhJhwLrdW78Zn+U2nObouOrZpcP2o0pjrRlDneSyKQeUd9Tc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791586; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gQRWf5Ul3qPwNaJtVxpKZm3Q2OWK1fGLw32r1f6wfNc=; b=fI3z8bB+uCcQpjjsm4PgXrf1++vgsScQDr0z4DWozo9BaOrx3NCWQl2P96z8uybaZ7uoIwO2ffncg/Q/vsFZure/zeLuRxHHoEUHr6EqN4WZPFLIhwm8aJH+8d5jLhaETvMxnFQlLSigbq6JFUhGfHlCT6CFxrOKqiOZd1yvVhw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791586634300.1912686041917; Sun, 1 Jun 2025 08:26:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZ6-0002FW-6E; Sun, 01 Jun 2025 11:25:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZ3-0002BN-HZ for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZ1-0004dv-0Z for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:33 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-48-Ei3gKRa9NiOv9Ci4NBxQYw-1; Sun, 01 Jun 2025 11:25:29 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3a5058f9ef4so127840f8f.2 for ; Sun, 01 Jun 2025 08:25:29 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f00971d9sm11994837f8f.61.2025.06.01.08.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791530; 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=gQRWf5Ul3qPwNaJtVxpKZm3Q2OWK1fGLw32r1f6wfNc=; b=GOsB7Mg5+8m5cz0L3vtltjsQj44QuM1ybQH1T0gGysL11JvRe1kjebauHtId6qs3GyxMal ydZ1xRMjOKCeLPsJbgW33ym6ZUJ2rJXrOmvC4EvkfjPMzsZcjVhccBNZfu/etGhpSGfWyq W663ehKhWcqRyZhHb6sqmHXE86Wcw1A= X-MC-Unique: Ei3gKRa9NiOv9Ci4NBxQYw-1 X-Mimecast-MFC-AGG-ID: Ei3gKRa9NiOv9Ci4NBxQYw_1748791528 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791527; x=1749396327; 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=gQRWf5Ul3qPwNaJtVxpKZm3Q2OWK1fGLw32r1f6wfNc=; b=uNV6IHk3c+3SE0QT0ruquXaXsq33Ol3G/2Ik1nbMEysCLAnHFAkJbklzSvwsieIStM JQlapp/YgsTP0Es4+OqV65m1xBoA40rKvx0IuqYYLnEM/UwyIGHVNpRwmn3ToMC3UWKq 9D6TRIoUXttmRcxvx0oPxv70nQQO5BHymG58YsfogOGEh3eJWSjfLpGXsRB0ZDEp/nIZ Z1L8wabvYVqv/dANzmWbRqVXctxKAZIACk1/Lcivk08Om4sYRS3K7aSn1ynWvKPK2/GG tEnkRmJElPnjIPdKc4Uerj3yq6vjFO6eLM5GcOQwil7CTPTySEbmP+HQowsC7KYgJ+Qh Z/vQ== X-Gm-Message-State: AOJu0YyF9K/PTIEI3Gol1YoXuulP5DMmeDzhafEmVwZi+B00ylQgaLuP DEkAuVWz6HYFSV9citE57bWKoNGuNgDFWh5RJ+IUcpfstfodjUnMVvYUeX1iDmvvPUsyvweANeC i5Ll+U3yRYvWhvoi1arOwiWV3ZjAn7ZSo0L5I3s8JtQZJ4jDR4TDGCbXMgkokOjI7I4iYUT/U+o B9+ch8jZWs/wH3ur4JKmFfsyoqOYut799I+w== X-Gm-Gg: ASbGnctwk8EOU4D1rwzDl6BrlruQr/SIdOmEgoLmNv9hWNMT+aiCc7MWer8lMqi7JCQ WN4SjwCu90KQWPgqRXvfiYzShgD2I+qfRR1MeNpoyEqwqm/USou5X5DOU1sgFxq27i0jgQs/RtT esNq9n8/CGCvLuhMM75O5roqyQMmXv62fngx7CPLV8JRU1sv2peac9uZb5lsmSvUL23nnJullKB IQR7nHRvRXPVWQnzVKM7ETCG+UMK5svL9LZKja7aB11VcGKu1BjDmSGi98DUv9mwnBWsOoMyQJo Qa3LuQ== X-Received: by 2002:a05:6000:1788:b0:3a4:edf5:b942 with SMTP id ffacd0b85a97d-3a4f7a7d77emr8203903f8f.57.1748791527113; Sun, 01 Jun 2025 08:25:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElMhrqt7VRUby1hRbAFXBiLlWDV8xe+ITxpVUtDEi17M593cYxhE+R8g/SayV/14us8F1xrA== X-Received: by 2002:a05:6000:1788:b0:3a4:edf5:b942 with SMTP id ffacd0b85a97d-3a4f7a7d77emr8203879f8f.57.1748791526528; Sun, 01 Jun 2025 08:25:26 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:23 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bibo Mao , Gerd Hoffmann Subject: [PULL 16/31] tests/data/uefi-boot-images: Add ISO image for LoongArch system Message-ID: <0265723eba8a612d8a94d190cef988cf8d616862.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791587555116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bibo Mao To test ACPI tables, edk2 needs to be booted with a disk image having EFI partition. This image is created using UefiTestToolsPkg. The image is generated with the following command: make -f tests/uefi-test-tools/Makefile Signed-off-by: Bibo Mao Acked-by: Gerd Hoffmann Message-Id: <20250520130158.767083-3-maobibo@loongson.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- .../bios-tables-test.loongarch64.iso.qcow2 | Bin 0 -> 12800 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/data/uefi-boot-images/bios-tables-test.loongarch6= 4.iso.qcow2 diff --git a/tests/data/uefi-boot-images/bios-tables-test.loongarch64.iso.q= cow2 b/tests/data/uefi-boot-images/bios-tables-test.loongarch64.iso.qcow2 new file mode 100644 index 0000000000000000000000000000000000000000..18daee0c52fcc703a0645dbcdc5= 98aa1f101d96b GIT binary patch literal 12800 zcmeHtbx<7dw(a2V0}KRrXMkYAWpEoHKnNtby9Rf64elC9fM6j&u)&=3DWEO>Btg3hhq zA?H=3DSbL+f&{(A4$eP?}Ly?X7ncGcI_RlB;Y8Y-uF2LJ$&0RKBM{w7fa|6av;x3r8 z#K|!XzV|yF;FIh^0b&XoA=3DBYotgafZ2BSMi(UkN`h7yJ#hcb6{A`}UM7C~e|94Jf~ z{-U_#D6$BE_V{7U5HLREFn{E;p>}_&>}PD}*gCIN2CjQJbtTEy$_Ypq6$o@B7K7!4 zEYr1R)y|8&kEDri*GJo9M7haGdR9PGNl27)iK5TyD0xY^ZREYVL+PO#&SLa|x%dOzftr-QAHNfhY8*D})+(UBX9eD?ksPO2kyuCYc6h+X|0HL^{ zVuxS=3D0H#iVyGgf8DEcYh8TP3zIt%POx1HpnHtgxmdfEf-30DSEEXaz++>Tz?{g$6~1B?UzV zRR*o0(T4yMQIK%3vr4h`uakMtW89TBW0ZlwMG6`0I3N)Cd*d21TMd1o(M{PD<|ruA z^D5}eEOl&N4zURP&FxzSIg2_({LRhxEDUT6o7?Xhm^Mq;O3X+s_gPtxH%gdD%Gu1e zh|5U|2g)}$NP*gH3|plqF2ul65>lkhG|c(RG)%@DOh$-g<^^m-6h%x-4CM`1I8+h? z-4F$EcS?<{M+BOC1`;9#-)~!jQ0OrL|D>usG{QZ@smRF%)mSw$a>DsZ*vN<}%@-I{ zm0gYqL@yZP24AC; zF9a_F|3nDCRkirvWB6tC=3D_Ac z5{(Ht4jUNQ?adm+7=3D@ka^vWo-ASnoGBGVgEDSR`C-`u^3T{Jl@{I7m){rAA1`B(MN zcJs%d`akx~|D?eTPt5Z~ z|BX;O)~?nA2BNH*ZuiT9!A53H*o6#8c!4ndD0H6At)L*<3dlMROEx3#XCy)ydDJ??G)Xo=3D>*+7mdS8=3D|8y_f<;IGRqRaW?5ej?j~uhMXf+1fciT#(H9gm#Oh zy&PC(SkDdGM0>N*e)P+`kJwioAp$)75Sh*Vwc~(a(2Q||X@iMpbl~vPzL!4QgKxj> z#dXlKdW93$GpuJ*a}=3D-KLJ zF^S!`pr#`|whAlex?_*teJI6>k)a|{gn|Z(;M%0m(Q*N2!@Gb%1Bc9;VZANO=3DyhFH-^}y7g69rqr@h}8=3D(+RA`=3DeS zg7Wh{R6<4P(t^@3gcx9Yx=3D$jn1YMYZDNuVFHt&nBzjQQma3|_Yp(o`HwZ=3Dn0`+O6| z@q+%{;*6u_o(uN)Wp=3DDcd<46$SRIE!7Q$Q2*#bww(hI8KF5IhANlTv5%(mw1S4UXw zK94z@sH`v9$O%y7wEgI9B>m50gltu3?!t9v!lk~f!O31<2T9MzzCx}}_oe4FT~DId zQJ{LgLHpdj^|P&l~j;$(n*7+rYN^+0#`LFD$08Q zd?~nteihxm4cbQ(MA-{*~QGjSAnzG#j(ND?#Fx&ee19|fAhT=3D zAI4^XxwzT>R?+f#Jk_KQWeO=3D^e+S<-0X`0)gRz*pUXPpwE(#XPAu6$nb8k>gS=3D6VN zK9%ye$a%_Ze+)qq5)%HbDwvEA*Fibd8{7ecqCEG0ilVBr1()YAivLoyFh~4+~2P z=3DugEWOanX>Pve5AIDt>+BbqFWDT-@Us_4yb!vp0ii`z7BGUZBookm(bz6+cDMz}WP z+wo0ycFMn@qx>zgYEsWr`^ewwUbdEFI1Rd|V0hRk*j=3DeAsdu%5YJ0f1UPO)$vTwuASKHz}C_XM8(BtZ`)ogd+^{|qluQ8l_KZ7s| zbiCd^$=3DhzaIkbL}nP(6ucrt%cD}FmaHb5hb&)?O6lO&C?X?nAgaDR@n?*ko+$GEOJ zHa_lYc>Pwg<+4cJ)z?oKw`(}Wjb+@&A{(JCmg4xcDJ-g8Ptk}6 zdS6KGXqDrg1kK#$?RUfE0DxcoxDp~1*w@jbR=3DOc=3D6KXA3Fi&}kpuemT-5s_n8pu0? z)Nrbv4GlF=3D(I9BRaM1#8h%6TL;-iX5DZP63v%y7}l9)D8pJHq+=3DlK2`9(OGlK17s> zjLMi;KY2fdCEQZ`Ja`u?xY7`ZQU1*3%~^C}n~j2l@*p;isd9c=3DU}G@tC;{605l!{< z6G+EVB`P!K>3oE^u7}d05dCFKI>i8t*Y{m@7Q%v#u*p4+N41>Q)R5mDIVT*J z9r8JEaxW`oOokNiwncN@3xYHVMI5} zQ2xrMH-lKJIuzzn9QwJG5KqNl)soLs(T-#z|K! z=3DBrA*Mze?hZPMf}wc;aT(h0W(_P!i+XsFeiHX+7}al*M#Zw#jXfmyDXQ}9uM z6*eS|U$=3DDlDKafi2Qzq8qLyd>ASl@6bk6I}VtEAo(P1d%CtXeunr9?43{BdbW=3DMT? zyXk5d<=3DfU`Xsxyt!wL4O55WcnI=3DXS)`nwZ3v4JiEds9jk5^`NEm^yl@Ifkst^OPQ% zWXU?>>1&K>{iRg<;nc(DT21VlO{66pnyfego0|^*;jr))o=3DX)O2evY*O7TO5UV?@n z+P;ldzq2%bA0VeV6TW;CZA2^%R4S1#VnWB-Y>{9I7}}<~Lh09MD+VE(L|!7z)qUj< zCv~~c9m^D_5eAA07*50V=3D2lqkDX-S4@hc1zM`yrI^^E6Plvk>(%na^J^jU||KCKlH zX>&g8F*C8@ocR<9>`_UK+n)z^o6HYl1*u#f_YXQ!YBE#|#g z+t0?5L!Y*v`<6mtkb7wM_Wjs?!6S-lVx6rP6c`cEQd1W~mYi6w?))yq{y3zdLTG0_ zjmd47M#zALQeSgtN)6N6zHqk54U@$U3@NI5vXTXYR)qDsVfbPu@Dga!QrnqvPzL zN>*Jhv6?N}m3C14cLj)$7OY?Rse&$kD+@SE1W7TbXrC*x>e6Tsl7i-1HVgYZ%~>9x z7e>!SFB~Jz70+DFyEbs>EsfhhJ)R3D;8~yX)|^-PeRab1H@2*$)Au>BbGyJ^5v5GlJNKPl zPEk4E_js4tUE$@xuH}0^ztmshS&hE%%D{FLzX5BYdb`%SJXZhnM()E<_lS(x4)fYO zqKw^+}kE1M!!j3I2(AucDb!dpQ8FQpn>E}Q0_PI=3D_^$4%L{HYcCdbzn9ltyi9I z{3TY^xglSN;IR5D%j?}@cainmv7dzEL-3Xrp=3D&RBNB`!YQAdwkYWt)*YIyF=3DZ3W~3K_>@3HS!P8`F`!*aEy z9F?l=3D(#lfe2(;s)Z+FWNN3>U|++9jYJ8oq>@eso17TkSZn%kS6Jl+~9t41+@Z#+c2 zub2rFl_i~vJknIQAr>r+skqh?g<}Ofj=3Drt@^r>HB#>h6Wc1xK3;vL_{@6&U?@9u`t z5g{PCW{V=3DuBtLw^e#c19p<(DfeSAwR2#D@^WOiG`_adfw%VcONeu_?#{AfD0hV5(@ zbomW~$^s6y=3DqGzWjuuO52=3DPz$9hD!lu0d#al=3D`AGP)8u#(I^zZO_sa%c{=3D$A1ra5# zmz`T$K2pq4Sxv|i6W-zU_A=3D$+XjHf(%;$EziZ}Zt!&Swq1Y<6wp*#ch`D0>-s+}#Y zX@Sx*=3DGP=3D#gsiq*cF1muBJ;)DuZ6;S62$(pduVA%t?GzU_H}oFJHdU5m=3D8v`UdJ1SB?mp<|NlThFqyB>u@y z{1ZtbR|e?f-ixVONBL=3Dv@2W=3Dcwt+ra-ZYVHy~JA-p<*2Glg0{1%8=3DL|_d97vcNoiK z!m7dLV1C`CNGeOprbted58XLpT^0g{AV-w)awpEXRK8+>XD`|9!1EIK5A++zdvDjd z;?$Adq9k_7rQ}Cl&rcK#CduweU~FWG zl>q!}GYZ1FeG}cC@HY)+3BZ#h3X7?g*IgWTrFxHsbuXRfvUY3Tk80zpd)y|UnN4BB zEzZ1xMtX>++T^z8o4$~puJn9jpW0p&q_8oaxvgcM2q_|MEcw;Z8_jHrOX5*L z;sJ)QY<|)Wm1ceC6w-rHx&>1W{n{(Fw@RZeBwwoW{>AHDP0`#>pQ2ef^H;Xt(Q^GNKJNl?GYIkXyj(m?o!K9DE;h| z`fj1@DW;B=3DuP6MNtb#lvk!l?RQEWJ!6i*g=3DeXa*54yb}uFvNV~3v5;zjP}RbrMX3W z%6wC9qM8q6A6?Cwpi|Ghd{Oo2#@rkbL|Xd9<%!n?YsWVx_OoMGDKXMH(AioGymu2A z*Xlc&8WV3`*VxDm3L;~~5-V_&)i>g0rquA(SfnQKQiEa}G`d`1Rdh9%j8W@nKya^6 zZaio-HRU6YnOZKtKktOGxB)`OWBzn@7}wl4)LpPh__=3DEiwWUNS1@22+_q9CQYuwA=3D zTWzn6aAPVlzM)@_nh!q-cHbCNxvUmOeA*=3D$DNK|~f|#DZ)HqLjNo6p>x{;wli$aTz zyb%830q3t5(brI5e}^y+YY<`ZXb%gnwOkk$2xHC!cDH+(i&VOS_L|06(zA6oSW zYK282721?Sc26406?XS-UjM7kB(2d7uvVFk?VZmjE?nv(r*W~B^Oo`tII~LO?^D;z zSDacLe)Ea?62*tHcRl{roqo_bY*4bn+Z!hZYC1MmToR+S&a-m4X(W1fMIcj2D0_qO zOLS?(LZ(BU8wNtmkYCydKNnzm9)1GmA;@}`l_VN8#4FPa%CjfWlYyQ4!}xd;#9CR0 z4Dmli`mWxzNW`D(O6qJ4xm({h%*N%nFU^UM$XJ56Y?hI7hK+2>vD#jaujvjYiq&yT zn^$^|&w9OBK@!eJ7N5fGw`6If5=3DbRPQ?Xw z3%4BLr?VyVu=3D{P6#11F62|H(#Hb)E5Mhw1YUK9?y&HCUUVrzAx$+u-rbS^@9Zo|6u zUh>WCGfH zSn-j7XIn+EHRl&dQm3$?@=3D)1pl;R05Vw!lV_qr@ZZDN}Uw_0vIxYKXz#OBP(%^=3DZ} zrY6P2ClS3M!3C3u6)VXbG&N#59#CQqlPF0ca(^#JQ33_D$4bNF!a+-=3Dm|~0)=3DS}_9 zJbV=3DpP{UIE$(I$)&BnYYoElTwpZ9lzxVcR}S;B_((?f>JVIMe=3D8Vn6X*Wa`#G3cz2 zI%_*Ng%f=3DC2yW+|0}VQr4W@i~LltQEO?$2_18F?ve8hq4^iGDvG9%MPymfz@<9N0d zX9QW9-set+El&tfNi$zXGq>KeuwFwq-<4zu|I${QKIQh3-8aCL>9&75qT*_k$CaBr zn9c%sio9L%0cFNIs|A7cs~yH(e6CCs9%Dz9Gu2u#$+e$-WJDHx>tKAZ?pv>Sx2r>$ z|IJHBd9US_e6*rg>M`XNAFA@lUr7=3D>-uJ865r&B!%FG zSaKV5j>z8a_2k98%Lv~NT4L+Kt6IHigqJ;ij6EArCQ zPQRVFuYJaDmS@T-n`+||+q`pMZ%D~1PTgd*at;yS+?X3u^IL5Ee4iFhsmy$k!68u1 zVJG7^slj4%;-l2&u%Fo2H^NbH%$99HNj%arK~QrC6+378fz5uHQM)a93 za0OjtwbC^e=3DrRTQGr`Xa6=3Ddijvxe|&9Ysr2%bOnpCEXm60^TdiHq7oxi#H1b(k$;r z5guKyQatf^P8c%MTP<=3D=3DMZdcSH*%oQkQ3YGylAT}-P zv41cd`lh&eOy59!6_*w`f0i4MmY?iWhAdBEk=3D1tp{94ULF9?49I&Kjhn2js4brdk* zU@c75RVri0JQGEJnmH%$n>r(Cn8c$%0mTo8=3DQ2M7w!1p(sw)g6frKHrvRLDLxptUR z7cSXOgxGb2y)u!Cn4B9+FG&RSU$dk~7m*;)nxz!H)B{7N97v^C1wxUl7KaZE-pDh4)g6~uc;JbeL7xIToYcGgr9UCGT77_C=3D1rOc(ZX&MeX2L&K ze`HGv4WX&o{Vg!Wf3!`9^=3DOuIH|tdJ_U!Q|?M9JWLo-XXiwyWx3NeU-ndfH!R%Vr0 zl*_Fj(~h|ggiffjP`%-rZzjRYk@3N}6O%oa|MD|`zZX)>jCR;3_{0Ia>&Mul{o~7R zl5<^*5R9!3qpRpBmD&|E(tb){6=3D5&mv#ODLdE&;iWy5%Zc!&74Sp~6g;H{Z~E_l6s zO=3D9;aDEigD87pM|^44V{ssD;ZbN=3D*-XQflS=3D$P^cm!0n@I{|zY=3DOrYL3C6v3gS!Yj z-ttAOl~Ct(m5#nZG)P@dN4{N$=3DUb-~-6=3Drl5IkQb^}mk>E{m~RWbjGgkckJy?&0y+ zDMfSHXJ|t2$DA+-^JArb--}Pb!8<3X$`cgh=3Dv}6Kev5+#M<9kuSrJJA{q8L5=3DkT-U z4;&6k1@IGL#pozuyxqa2?_q|8G@921Xm#2@4MZ<$XJXJwtuZbbfT4LX=3D}U&jrJY_K z)86{&U}9GELTg&8h3Wu2>c^3Q<58c0_3P6{TA{!=3D8xN0^Hk@ZN-U`XKj!LasE%(Ge zp8T`Q5$gwdL~^Vp_dgSf~x`uR2K{ z&m*0!`e*o9Q=3DIaBdRLntW~e@J=3D+>mD=3DjQWI;Q<`1Gy<$l0<@Hz%Niaw2ZqIpSLyGR zu0#4s<2!y2)Z*HkKp!hZoMEn)f|^FqxNh2&Y^o>zU^7b<%DwN9&|1kLqP1}bf>OU zc{kQ~fsBePB(tXN%J?e zJ@VwblhE;!&v?uAXoyC=3DJEt+`ZFFc|BQ(3$mNr9Q=3DE1B#nbcSoLtHwvwwOPIr8y4p zW60s-J0NOaLCx2P0Ph)EN4w^f7g)tcvp?1$hD(imA9eyp@!8FlL#P@uE57;eYwb;< zDeC%P&_1jj*(!{OaK{BoC>v)qeJr!=3D@@b;+)N1#V@+NQFUo>eMMdjn1N?C;phO{WY zz;&>J<-E&y7YhQB4pWm2m1qd`?r$v@k`*oR1|Q{_1bZyr1@!xbcyKf(@1p;v`~EvP z|1)ZrmiUPh$>(3cHV!t}Cvc+2aHy8~DAlJh+u2u^T|3&w2Yhh7hc5fDUHsLbjiws~ zA;t72l-xhO#6H!>W`+zzEdX*di)!pIJS-M5dL+#1va3^%+he<=3DijZ%x_zW02PvEz3 zBdT;%rgmQxEPqsJIE8;Wy1xKw+%*;@$OVXNlT%M@E;PH->Euw1E|b?ytLh(zT6P{L zQ6wB>vl*0u71KvFdDASNu3+`GLsj! z@tk5>ujy6d+9LU@aG%zo+cb~?`34!q#NpjIUfu9nI{-;2FN3VX=3D(J=3D!UM%nNbpQ@( zro>ta4NRg18~2*|!9yI&g?Xa=3Dt_jey8IF$xc$uiq(qjzjr>=3DS6VeRohkR$A%*2F!k zv0!NY@#gZ)G*f{7s{`=3Db71dU#Ms!Hgfg04|cGP^+Xmjhc!cW{(0o}vX`;nENpWpBN zJI1$fzTqhWPa_(f-Pgj41ur1<)_%BC-k)_su)lX2YhgDJCyUE@Ue!BUOx54@{bFA z@Akt3m(1{_R#AV1qxRlL7_+VNX2x8!(nda*KMs4!-9$Dj1i(}jx%?k~g+IsEMgB&z znV!P;Q;m;-TeLv5bNgABZG>3*9wK)h&@A?yJIqyc<+k{aFT1xtEjiXX%Y7MnP=3DVQ~ ziKEYV)je_CzhKU8Ba4%=3DJnl=3D;{5YevxqZ2odijq9$Z%^0bU^2eb+t!EAGzc>W4pS% z%CEq^_Du|u(zL_guK6vl&F?JK<-Ra=3DXzxNWL&vhJ*I9$Di5ro6^JH$uZ7i?#wHH)^ zBUIu!*;PV(#6zJ5c)BnK=3D4Nt(WUrxY8w$q1YU?n$qG1pNdituE*)OCG>*dw#Q=3Dlbc6rR>=3Dlb6qB6T$wX`zoFT*wg1%?$y9Ta zY=3D3P`D^rTyb40^Oan5-e`!+?`eBjd57g{)1CjfCYVVg5TE=3D~OPxk=3DnlCW&>k?A5FipfVDy2Kfb(w;$sA zEEg8-)VI}lE>uqawTmkrnA9M>B~jKpaNXurK|m&B&zMrAO(WOr>F4^7F0F%tWF{Wp zbS~yHzkUBb?7o3TMUf4^k^TWX3PpjT2eatC@~yj!H{C z#F0|66v@cQ5ze8mG=3Dx}^_i;70Kf27NW3NdVtA!Cn^-Q{&e;3j)sTICud$l3NlGzg1 zFGq55Vt{MaHh7Eay#J!%R`J#06@1#OUawKpPb--JVtR3=3D^N9NM>`8nNe<<@qal5+Q zm<*^KNo7|~CCY%>o(QfU@nUqo(9I`uO<-NZuXMvU94~vaJE3VW6*_ZD)AY@{AfKXi zx>^51htxICIYO?~vhj*#J8RS4Qt5hM!VlrQ6Pv2CGAHI(wbIMlx|b7?>UaujQJ%xq z3aZW=3D&TOM2icx5oznOH*w$iu4x6GNg%S%w-1I@Qe?@G2x-?NfnElJbAsZ@Kt{K*niqwkiqXM{k=3D7`5t7jwxGz*ON9Q8sS3R06gU4S7xe!fbu z0H)HY>d1()BIlGcYSb_vm`4cA3%*A~^rKnH?<(x-ipoa-xH_#{0)p_8jiQa?fbLeP zEDwk_M|dm`0HwE5_2Z~YJ{nPKiQy9>46Mc114Uo#c_jfN7T}~$5hnH7LbQ2kG(Npz|Gu9*pRMCA*)Wo@F zN$1KSZF6g(3j_LG7KnSVzy4gwAIjroEZJCu#jht&EI+6=3D`LpFkK z^XwQ5`s|fHNz|A)?9dIyhdi*>bBJL2)gdz%Dtru8V4KkqRg@PJp!}(Q?-!DoJW<^e z^J0WF zw@M|p@dxB*_7SpS`?aGa>H2)$cvJI38f2mGxT6o>O^T+QXEVz!us506{{D=3D%@6TC1 zdh=3DTh8G{@fJ(G@z49#fV?U$z!aTO*R<~EIEDi7sA2=3D83Yimm|_;AS4p&Y^45wlGd2 z3FMAdmQa85{d{=3D;r%6k)Vpbg9*MvuasSyp%@53rHi`F;$ZC&?=3DxDSUAWo-BDZ$}gD z974*m#=3D&17q~4NFcI20-%${adUb|g;h4pJ;zBP06^>umWlt3uc}Bk|Ev>Z9{7O^ipy=3D=3Dk{(?j6L_38Dst0%V0 z6_`)zB``7f({XC%TZ-h2)D(SeLb>f=3DRVkur<-x%qA+?~OLIefpY63m_IyvLGKJpNL z5?hLychwkrM0HHYs(o3({KU58Gj7$HwHAF@D7HG)^R*WJSxB~O)h)GKeOYL>fWzKG zLP<#gWResDU1V_pLZE*RPX^=3DTSeEFb9U@uihTw?MX3pbTGbsWsK{!ZRT1ie#N)e(e fqbxrjXli0%Y;L+OnVdF~{p|9t0PX+k-y#12+ZssB literal 0 HcmV?d00001 --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791632; cv=none; d=zohomail.com; s=zohoarc; b=I46HvvY4W4UGBpMRNqJDJbzH0Vtz5Uv0+7OglmfrAg9iGUvzqgA8DjZ2+fryVJKMlz7IhLKg8QFeMY6lkI6fBUpiE5bf93vj3aOCK1V4TuTtCKoIdsFHcDrECdfolkJheBCKpUXUYiqB7EcdGuSLg5XZae7TK7YH9tcN9Q6uGeI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791632; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mGe6QEKbqDO2iJtSQF2boocqAH94qpLOcY8tzlF//aY=; b=Ojj8rH0dkZ3PkECRoZkq/6BkAiqG6nRr2LfvuF6rw0TlTwEp/cMVdNu2Sc5tSSO+hMlCbahfe7Ymt9RDvzrhzdJTe3YvHLxjrem9GvPIQsJLlQFTwNF3qmhP8jV/P64UvZIe+crefs/ccl5uscbLmtExDpv1eRH2fsjFYbeGzHs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791632906762.3539647086088; Sun, 1 Jun 2025 08:27:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZ6-0002Ff-8N; Sun, 01 Jun 2025 11:25:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZ4-0002E8-Kk for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZ2-0004e1-VQ for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:34 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-fUI3D8OOPuC4w92wrnIkMQ-1; Sun, 01 Jun 2025 11:25:31 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3a50049f8eeso321495f8f.3 for ; Sun, 01 Jun 2025 08:25:30 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4efe5b8f0sm11574063f8f.6.2025.06.01.08.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791532; 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=mGe6QEKbqDO2iJtSQF2boocqAH94qpLOcY8tzlF//aY=; b=EFlNeGQjn32hGKmQdZkCXNYeQXEgum+IbZy2RHVou3z+6cOfTfhrvthPqrvr6tCR5U6SJf EGT5YFzmTwgOLezM1B5cTQfdliga/+dOxqHGvwWdXI3i3TVwXU4vN/u/7Dhmaduiu7kCiX ZkWAhOBrKrwjN02JDGLdjSe30cSer8o= X-MC-Unique: fUI3D8OOPuC4w92wrnIkMQ-1 X-Mimecast-MFC-AGG-ID: fUI3D8OOPuC4w92wrnIkMQ_1748791530 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791529; x=1749396329; 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=mGe6QEKbqDO2iJtSQF2boocqAH94qpLOcY8tzlF//aY=; b=QNhfUfXp3Wfx3wMfykK8Sqcwn4uW0zRdxvHhgRmgUPkcP2ufTQxiE+Jnsgn7FfIgKY 2WEDIJra5tpnSU+7k50myp8GIfjj7t1OtsHVr/Kmsw3paea+qh3x8ID/Lu8kYiHCBejm PrBoxZ0cg3zt7axQSyxSiJBh1wf0jK/DYW/hMQ1eoZswd7qz7cKvnfoVW4CAlXr0fMW6 YAE4rFIOclhEWYnrrgpe2GDctXZX0tyK+Q9kEWixOjtjG6aAJ1yJmoMOG035ut2zhzZI 0YwBUMuMxWG2k8AnP0UedWcnLjUbCaLHHyVFuUHULUz7cUJXxhz6hba+y2j2a+INMH7J 4byQ== X-Gm-Message-State: AOJu0YwBE5VcSNG26lN53Jf7SGQcPwMuLE+3uL8p87uWo1bhGxzZaoc5 ud4qcw4qansIlGaMS6uJTvJ3qgowX+ji7aXhtNnynv44FDDOIXjww/7zq4M4aYMzQQ6gI8nYjz1 ZNEcoGXFcQ3J9bSeEOg2/E3b5XbO6zyq1YfO950FGLtpeK789MzKzg0Dx/by4jImWceZ1UBSYTB yWYE/EroNYY7+OP1oRYtk6SN0n5EbaO+M9jA== X-Gm-Gg: ASbGncsorOG1JHsyc9y/etGy6hMusE3aV6QvOabBRqgDVwWNwzcvfrIwK8e+a2CiJPK oZxxtkxFXoopv70RgSmyJ/u0kJFyWtnIMFANI1Yl6zWJTA1lXBiwHl8ENgoSmFcPHseIx7+n/kO 0srAYrWCddwDLuZLP4ldPX58WtAfsOV5y+6RoStkeSECFm1S9/wa42x0SkZ1OFoFdy23Z40Bcd9 GnDoHOFrY9o9uMILVs9EDbEK6D90sbZQobCc0J54svKo/ZbR+DqcCtg7fUtOhQkLauRBGbgS34K OfbAU/MaOmLFFSG7 X-Received: by 2002:a05:6000:2507:b0:3a4:dbdf:7147 with SMTP id ffacd0b85a97d-3a4f89e8c67mr7235622f8f.54.1748791529535; Sun, 01 Jun 2025 08:25:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHELRmD7pW2SQCqIwkNVv6whO4B7jLZm4NU5mjpjD+MfuyDgTNGGB5Sk3/QBB/A6cNT4ggjGA== X-Received: by 2002:a05:6000:2507:b0:3a4:dbdf:7147 with SMTP id ffacd0b85a97d-3a4f89e8c67mr7235602f8f.54.1748791529109; Sun, 01 Jun 2025 08:25:29 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:26 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bibo Mao , Igor Mammedov , Ani Sinha Subject: [PULL 17/31] tests/qtest/bios-tables-test: Use MiB macro rather hardcode value Message-ID: <82acc8c83f93814bb01669412a0a226c39fa8d77.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791633916116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bibo Mao Replace 1024 * 1024 with MiB macro. Signed-off-by: Bibo Mao Message-Id: <20250520130158.767083-4-maobibo@loongson.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 0a333ec435..0b2bdf9d0d 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1622,7 +1622,7 @@ static void test_acpi_aarch64_virt_tcg_memhp(void) .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 256ULL * 1024 * 1024, + .scan_len =3D 256ULL * MiB, }; =20 data.variant =3D ".memhp"; @@ -1717,7 +1717,7 @@ static void test_acpi_riscv64_virt_tcg_numamem(void) .uefi_fl2 =3D "pc-bios/edk2-riscv-vars.fd", .cd =3D "tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.= qcow2", .ram_start =3D 0x80000000ULL, - .scan_len =3D 128ULL * 1024 * 1024, + .scan_len =3D 128ULL * MiB, }; =20 data.variant =3D ".numamem"; @@ -1743,7 +1743,7 @@ static void test_acpi_aarch64_virt_tcg_numamem(void) .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, + .scan_len =3D 128ULL * MiB, }; =20 data.variant =3D ".numamem"; @@ -1765,7 +1765,7 @@ static void test_acpi_aarch64_virt_tcg_pxb(void) .uefi_fl1 =3D "pc-bios/edk2-aarch64-code.fd", .uefi_fl2 =3D "pc-bios/edk2-arm-vars.fd", .ram_start =3D 0x40000000ULL, - .scan_len =3D 128ULL * 1024 * 1024, + .scan_len =3D 128ULL * MiB, }; /* * While using -cdrom, the cdrom would auto plugged into pxb-pcie, @@ -1841,7 +1841,7 @@ static void test_acpi_aarch64_virt_tcg_acpi_hmat(void) .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, + .scan_len =3D 128ULL * MiB, }; =20 data.variant =3D ".acpihmatvirt"; @@ -2095,7 +2095,7 @@ static void test_acpi_riscv64_virt_tcg(void) .uefi_fl2 =3D "pc-bios/edk2-riscv-vars.fd", .cd =3D "tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.= qcow2", .ram_start =3D 0x80000000ULL, - .scan_len =3D 128ULL * 1024 * 1024, + .scan_len =3D 128ULL * MiB, }; =20 /* @@ -2117,7 +2117,7 @@ static void test_acpi_aarch64_virt_tcg(void) .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, + .scan_len =3D 128ULL * MiB, }; =20 data.smbios_cpu_max_speed =3D 2900; @@ -2138,7 +2138,7 @@ static void test_acpi_aarch64_virt_tcg_topology(void) .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, + .scan_len =3D 128ULL * MiB, }; =20 test_acpi_one("-cpu cortex-a57 " @@ -2223,7 +2223,7 @@ static void test_acpi_aarch64_virt_viot(void) .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, + .scan_len =3D 128ULL * MiB, }; =20 test_acpi_one("-cpu cortex-a57 " @@ -2407,7 +2407,7 @@ static void test_acpi_aarch64_virt_oem_fields(void) .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, + .scan_len =3D 128ULL * MiB, }; char *args; =20 --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791884; cv=none; d=zohomail.com; s=zohoarc; b=mtkDJ9jgp9B7hn9C06+xB+y/GMyCyzWyaLIN2TEWMk16wJiE5voph1zmZEOov5r09W8Qe+waGpMwlGuUoFeftClxgzzdO0VfOZJa7JE36Xe+9VK5prSd/SDbk3vNOuVkk8zc4xsYBmqMNnGFmHQF625AiREHXXGYAJO3O75wjck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791884; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=406buaJv8mgg7FCF8JFusePlvpZgWOp9GQT5SL3Z3sQ=; b=ICFIc+cOXtuXqVepGjUCkQIwI1oCoFq5w22TRc/CEer6mh0EWtKrK5k8gYuBT5/1+1ohyaYpNf0YJ5FVw8cIu6gOPP73LBaxvgyEx/sv0hS+6psPYDNPR5+nRXk1uGUoIJ8+vIQ7CPWOJSNBSqgRtJSWkMU4jV5CXI6RS8jkCyU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791884277431.47070251806235; Sun, 1 Jun 2025 08:31:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZ8-0002HS-D2; Sun, 01 Jun 2025 11:25:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZ7-0002H9-1T for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZ5-0004eS-Ie for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:36 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-192-fWm_WLvWNaWIqwegeNGMIw-1; Sun, 01 Jun 2025 11:25:34 -0400 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3a503f28b09so190232f8f.0 for ; Sun, 01 Jun 2025 08:25:33 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f0097813sm11929263f8f.72.2025.06.01.08.25.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791535; 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=406buaJv8mgg7FCF8JFusePlvpZgWOp9GQT5SL3Z3sQ=; b=IsESnY0+UmHfQbOhBiC2ySvdQMaQsq9M8K4gZaMiOel1ZHAq9OdPJmlYPHM9IHeEw/AOSH Gyd7SqSEy9szhB5hRA9/RSfn7AylXfn46MzkDBPVlF2TeEtB05z8YSmWs9sLKp23EiQql+ C+kxaBumCPrYif1C3zpujAHuIzXE0/Q= X-MC-Unique: fWm_WLvWNaWIqwegeNGMIw-1 X-Mimecast-MFC-AGG-ID: fWm_WLvWNaWIqwegeNGMIw_1748791533 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791532; x=1749396332; 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=406buaJv8mgg7FCF8JFusePlvpZgWOp9GQT5SL3Z3sQ=; b=JtoeByshDdtvKEQcijzFX1qcheLGA3XojQ39U+PITz9TWBzO3CZqTryB2xCP5YqaLw 1uxfD0FEkpmEPnYFkf8/Vo8teB3qrPdyfdzhV/Mp9s2bQMDAoqelXjnFhdaSHaveuhRl +r4H/XjPAN42xkgVy5z+D4fEUajhfbG4VQGwZxNihBn4r21J9S1Wi2GZPyBujRruWA/O 5DEvJp8jIGwGIHi7vpioaECXQ6NFSWGnD7Gyg3iZT1cUjJBeR4oAsY3QTiqPNy2xp8fq TAYF1c2KpfIxij9zmVs3CivwLy0nTVt04tKiWMscoH7gzhmwKZMy18IJ5AVOdMpK7KK3 im2w== X-Gm-Message-State: AOJu0YzRtSN04YjJBtcRGm74aKmBFM4I1zA4w1OpYTTjQuJdXHshtnSN 5M86Cbfc6wJzSDtsq9R4JeEZF42s7XhTbkPRgjXBu9PcjYYlEdSgnsTtIMM0TYNVo1caC4mDwWy pIhCWYqyRReEB08H/LLpntDXTnl40HpmFYUCW2r9bLMzQqYJb7s+sOuoZD/qEGFzxLuAStXnK+X ZBymikHK4VItuoe6GT9thGbOPF8NvIvTzpmA== X-Gm-Gg: ASbGncvGtfWI4cfPdF6xOvv78Ab1hxh+H77AZyf61VeFG96Kf2Oh3cUZMrckeIIuqFS 457IUBJYOEz2AyVdKI7T0V3x++S0ngPjBj5p5JLpc8udw/dYyeWtCiY5xq2awzmQJ/cBqeqsUfe dO2rt0eeJkM94Io7CjEB8VoEtLkiDOqUKjoP1AcXdgBHw+oLSy7cazkH99su7jxoDN0UA2g9MSO I3QnLQP5y6i5VMTIEjE2UrYe58F3m4y2scrVyOLMW+xOSq9TSfZ3jxBgegc349EddkFjND0jsl2 UA/xBGElVi3vOkI4 X-Received: by 2002:a05:6000:230b:b0:3a4:d915:d652 with SMTP id ffacd0b85a97d-3a4eedd4eefmr10326820f8f.29.1748791532274; Sun, 01 Jun 2025 08:25:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG47DOQmrpjqaXWX/LPuKSMJ/BU8irFFKeS0BEwRXrFJfNb9ShpPMLXjINuUlu68WWlaPLkxQ== X-Received: by 2002:a05:6000:230b:b0:3a4:d915:d652 with SMTP id ffacd0b85a97d-3a4eedd4eefmr10326800f8f.29.1748791531784; Sun, 01 Jun 2025 08:25:31 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:29 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bibo Mao , Igor Mammedov , Ani Sinha Subject: [PULL 18/31] tests/acpi: Add empty ACPI data files for LoongArch Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791884637116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bibo Mao Add empty acpi table for LoongArch virt machine, it is only empty file and there is no data in these files. Signed-off-by: Bibo Mao Message-Id: <20250520130158.767083-5-maobibo@loongson.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 8 ++++++++ tests/data/acpi/loongarch64/virt/APIC | 0 tests/data/acpi/loongarch64/virt/DSDT | 0 tests/data/acpi/loongarch64/virt/FACP | 0 tests/data/acpi/loongarch64/virt/MCFG | 0 tests/data/acpi/loongarch64/virt/PPTT | 0 tests/data/acpi/loongarch64/virt/SLIT | 0 tests/data/acpi/loongarch64/virt/SPCR | 0 tests/data/acpi/loongarch64/virt/SRAT | 0 9 files changed, 8 insertions(+) create mode 100644 tests/data/acpi/loongarch64/virt/APIC create mode 100644 tests/data/acpi/loongarch64/virt/DSDT create mode 100644 tests/data/acpi/loongarch64/virt/FACP create mode 100644 tests/data/acpi/loongarch64/virt/MCFG create mode 100644 tests/data/acpi/loongarch64/virt/PPTT create mode 100644 tests/data/acpi/loongarch64/virt/SLIT create mode 100644 tests/data/acpi/loongarch64/virt/SPCR create mode 100644 tests/data/acpi/loongarch64/virt/SRAT diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..bad1380eec 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,9 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/loongarch64/virt/APIC", +"tests/data/acpi/loongarch64/virt/DSDT", +"tests/data/acpi/loongarch64/virt/FACP", +"tests/data/acpi/loongarch64/virt/MCFG", +"tests/data/acpi/loongarch64/virt/PPTT", +"tests/data/acpi/loongarch64/virt/SLIT", +"tests/data/acpi/loongarch64/virt/SPCR", +"tests/data/acpi/loongarch64/virt/SRAT", diff --git a/tests/data/acpi/loongarch64/virt/APIC b/tests/data/acpi/loonga= rch64/virt/APIC new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/loongarch64/virt/DSDT b/tests/data/acpi/loonga= rch64/virt/DSDT new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/loongarch64/virt/FACP b/tests/data/acpi/loonga= rch64/virt/FACP new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/loongarch64/virt/MCFG b/tests/data/acpi/loonga= rch64/virt/MCFG new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/loongarch64/virt/PPTT b/tests/data/acpi/loonga= rch64/virt/PPTT new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/loongarch64/virt/SLIT b/tests/data/acpi/loonga= rch64/virt/SLIT new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/loongarch64/virt/SPCR b/tests/data/acpi/loonga= rch64/virt/SPCR new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/data/acpi/loongarch64/virt/SRAT b/tests/data/acpi/loonga= rch64/virt/SRAT new file mode 100644 index 0000000000..e69de29bb2 --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791622; cv=none; d=zohomail.com; s=zohoarc; b=QIh/FaYtEHcl8rCQHM7YMTiEw56juXnofJ221j/DOXzBO2mNgQ/7lnndYoWSSoXWCrw+PXNP2hDuGRW61pB5jWnb1hKB9EjEqqBSBe9RTESU0fEH6sC4iUZZMsTQ43qJ3ANCiadWZvOzLARtjT1+Sa4fc4S2bIBkC7kzCDfKWaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791622; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZhAj20XZvrF3oiCRDGg3TLM+ez1BRti6haDYRLcshk0=; b=VNXARyhwn1XIJvzAiczugAh8Gz5KJCktgEH45mdJzSYsXv0fE5yHqwn3a+y01z27EkeFidN+n4Do6y+2GaHwFasmO6+B8eC18+XUH/uXaKLEAPj/Y2bvC9FG2/gdFL2HVP0APu2qURnwma5vUFifZL1gUkc4PHazoDDlqknqbAo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791622923476.812524190182; Sun, 1 Jun 2025 08:27:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZA-0002L4-TK; Sun, 01 Jun 2025 11:25:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZ9-0002Jr-K9 for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZ7-0004ei-Vx for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:39 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-687-BwOT61UlPemRkWDDe9Qn4w-1; Sun, 01 Jun 2025 11:25:36 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-43f251dc364so19858125e9.2 for ; Sun, 01 Jun 2025 08:25:36 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450dc818f27sm74271845e9.18.2025.06.01.08.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791537; 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=ZhAj20XZvrF3oiCRDGg3TLM+ez1BRti6haDYRLcshk0=; b=JCAX2PaOF/I20U0anATpndciHxvseC5Ay18hkuiQQz1WG0py0UzF0hrwks13ECjn0U3tuP B+yAnaWSG0Iu7+o1rEZoHhilZdyTAIqLvD9zWzuF1tFiM1DnjDAMDlIA0PzX2N8HmtISvg NSX6JpVpwWWlm9yqh9WtmERCmUrwZs4= X-MC-Unique: BwOT61UlPemRkWDDe9Qn4w-1 X-Mimecast-MFC-AGG-ID: BwOT61UlPemRkWDDe9Qn4w_1748791535 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791535; x=1749396335; 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=ZhAj20XZvrF3oiCRDGg3TLM+ez1BRti6haDYRLcshk0=; b=jS+akDjLw8GVPPvJnByGeOo7RpD+aLvXyss1DsaShGfwwgamoJ5H/HX9jOtppX6ZZr ZzA+QNgj9azgfxjBAx4ZxIlV6lyZdNr6if2BTaLcUDv9hKjXvBDgP549oDMyekqpCqHT vzACLJvlLFqKwFQwdPGl6ngVPwYBYfvJ83dkYKlWBBbiBWvS0HRYy7skFGu2HbYGNasX C/iKwqVdE27wyrW7ZXQ5HRxSyyRs6D9QdEOurb7BJrWDdTZbjhZl4ZCh6cN0/ULXFTwA IYL29E/Rr2AR0gzKfr1Lfe6pMAVlpWrqJVD08UBBUS8vZgAnFFRFsJcGn2WT700+i0lW SzqA== X-Gm-Message-State: AOJu0Ywz+Ck5XbGlvcy2qO5ungt8/uCdJ5/hhIJSDqBn6bO1Qc+tZj+9 BJxeshHbsS8i30tkFdT/0v4YXK4lKZTjo56tkyVtviRA37gPZd/tETqyjD1IMRWgM54FEUyt82N ES3u8MyopUJt4I5ZKsXt3xRzXK2QEHWQGxGsndoT3bpVowLE7MFTLNW8XXxS+mg7/hOE1MH0xCt FfENlg8mReESnYWxWe6jCYmGRh1QmKhh5TiA== X-Gm-Gg: ASbGncv0XAhQYrO5juKSHEAiHCGgQxJ5JIwtPEo0rDW3nX0YxH+WdQQDHtJi1TgMXCz 9vNdE/+xq+CxkGnWG4ouN6OHAzwAwrdiS3qnSCHA0Zge4xyL+DwNiSf9gk6gd2tvpVE6Kybca+B 92nBYYIOZbPAO3R16cbTV18VcniQcQytXJLzKTsrUxPVtmgBVGsKA5T0D9zLFSk8knfv0AMx5lr FA2o4txTWUfFygBtlQwY5e7l/UH0ALbT/BJItLq9nSu83rHryIQtgEOJJrIdGLIdb/4GZEvIcnM eFOyeQ== X-Received: by 2002:a05:600c:5494:b0:442:cab1:e092 with SMTP id 5b1f17b1804b1-4511ecc2522mr38168935e9.11.1748791534864; Sun, 01 Jun 2025 08:25:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGe8Rtv2C5Xtb4hTznxvLVojM37voBHAmtZcvuYVqI6ZOXLRnIZlLC/LzEH2W4voF3PPoNnMA== X-Received: by 2002:a05:600c:5494:b0:442:cab1:e092 with SMTP id 5b1f17b1804b1-4511ecc2522mr38168625e9.11.1748791534418; Sun, 01 Jun 2025 08:25:34 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:32 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bibo Mao , Igor Mammedov , Ani Sinha , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Subject: [PULL 19/31] tests/qtest/bios-tables-test: Add basic testing for LoongArch Message-ID: <16736bf01b79ef411dbab75289979e283153ea23.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791623906116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bibo Mao Add basic ACPI table test case for LoongArch, including cpu topology, numa memory, memory hotplug and oem-id test cases. Signed-off-by: Bibo Mao Message-Id: <20250520130158.767083-6-maobibo@loongson.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 79 ++++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 1 + 2 files changed, 80 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 0b2bdf9d0d..d057cd90db 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -2420,6 +2420,74 @@ static void test_acpi_aarch64_virt_oem_fields(void) g_free(args); } =20 +#define LOONGARCH64_INIT_TEST_DATA(data) \ + test_data data =3D { \ + .machine =3D "virt", \ + .arch =3D "loongarch64", \ + .tcg_only =3D true, \ + .uefi_fl1 =3D "pc-bios/edk2-loongarch64-code.fd", \ + .uefi_fl2 =3D "pc-bios/edk2-loongarch64-vars.fd", \ + .cd =3D "tests/data/uefi-boot-images/" \ + "bios-tables-test.loongarch64.iso.qcow2", \ + .ram_start =3D 0, \ + .scan_len =3D 128ULL * MiB, \ + } + +static void test_acpi_loongarch64_virt(void) +{ + LOONGARCH64_INIT_TEST_DATA(data); + + test_acpi_one("-cpu la464 ", &data); + free_test_data(&data); +} + +static void test_acpi_loongarch64_virt_topology(void) +{ + LOONGARCH64_INIT_TEST_DATA(data); + + data.variant =3D ".topology"; + test_acpi_one("-cpu la464 -smp sockets=3D1,cores=3D4,threads=3D2", &da= ta); + free_test_data(&data); +} + +static void test_acpi_loongarch64_virt_numamem(void) +{ + LOONGARCH64_INIT_TEST_DATA(data); + + data.variant =3D ".numamem"; + test_acpi_one(" -cpu la464 -m 128" + " -object memory-backend-ram,id=3Dram0,size=3D64M" + " -object memory-backend-ram,id=3Dram1,size=3D64M" + " -numa node,memdev=3Dram0 -numa node,memdev=3Dram1" + " -numa dist,src=3D0,dst=3D1,val=3D21", + &data); + free_test_data(&data); +} + +static void test_acpi_loongarch64_virt_memhp(void) +{ + LOONGARCH64_INIT_TEST_DATA(data); + + data.variant =3D ".memhp"; + test_acpi_one(" -cpu la464 -m 128,slots=3D2,maxmem=3D256M" + " -object memory-backend-ram,id=3Dram0,size=3D128M", + &data); + free_test_data(&data); +} + +static void test_acpi_loongarch64_virt_oem_fields(void) +{ + LOONGARCH64_INIT_TEST_DATA(data); + char *args; + + args =3D test_acpi_create_args(&data, "-cpu la464 "OEM_TEST_ARGS); + data.qts =3D qtest_init(args); + test_acpi_load_tables(&data); + test_oem_fields(&data); + qtest_quit(data.qts); + free_test_data(&data); + g_free(args); +} =20 int main(int argc, char *argv[]) { @@ -2593,6 +2661,17 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/virt/numamem", test_acpi_riscv64_virt_tcg_numamem); } + } else if (strcmp(arch, "loongarch64") =3D=3D 0) { + if (has_tcg) { + qtest_add_func("acpi/virt", test_acpi_loongarch64_virt); + qtest_add_func("acpi/virt/topology", + test_acpi_loongarch64_virt_topology); + qtest_add_func("acpi/virt/numamem", + test_acpi_loongarch64_virt_numamem); + qtest_add_func("acpi/virt/memhp", test_acpi_loongarch64_virt_m= emhp); + qtest_add_func("acpi/virt/oem-fields", + test_acpi_loongarch64_virt_oem_fields); + } } ret =3D g_test_run(); boot_sector_cleanup(disk); diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 43e5a86699..395ccc0d4c 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -148,6 +148,7 @@ qtests_hppa =3D \ =20 qtests_loongarch64 =3D qtests_filter + \ (config_all_devices.has_key('CONFIG_LOONGARCH_VIRT') ? ['numa-test'] : [= ]) + \ + (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \ ['boot-serial-test', 'cpu-plug-test'] =20 --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791719; cv=none; d=zohomail.com; s=zohoarc; b=l330JUgOZRt1J3dEexjwYyP5fxbX/C3lyWsGySwSK9RhHwoMv/wLb0QSwivz1r4aV1A9ZFTpmHu8p2c5FatEwMOfeO5H7GBJ4XYPwtKKWQRxsAWchDHYo9gIyvLAJEjXAZPeK2ZRNFfqCASLK/5g9cPm0vhu+DUipkIcFauYKrA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791719; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VCcFzUnshNhYktTkop8VCX4UTK6/NnsYDFGziFmlv1w=; b=DNPzaFmxeyi1d1CTbsMxmNj7Ry7x5LmpT0IllwQVFKMTyQRIL17nK8V9hw4itulanPmARFe0f55FimeqBW1n7ZrV+++8qsrKCpoyzNdO3NZyV7SVxSt6GFqj71d2xsfzaV2zposfXTR1WGD8uII/++E6OmlL5bn/pHgpRYE3xBw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791719305286.7633997109614; Sun, 1 Jun 2025 08:28:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZF-0002MA-Fb; Sun, 01 Jun 2025 11:25:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZE-0002Lq-8z for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZC-0004eu-Rc for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:44 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-297-H8j0_FqxMMimrJH5NPm0ng-1; Sun, 01 Jun 2025 11:25:39 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4517abcba41so6827645e9.0 for ; Sun, 01 Jun 2025 08:25:38 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7f9efa3sm87656715e9.9.2025.06.01.08.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791542; 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=VCcFzUnshNhYktTkop8VCX4UTK6/NnsYDFGziFmlv1w=; b=NLBnEUmffBG0Qj63PJ9TLgT/rS9+RSF7a1WjqLW9RoINWJKVdV5cO1TP2UecT+ZklNrCXh EKWaKDPk7ijnHB4PwYIqRJJYgGZiZ8OqrdGFP/1dMkJhTruD3acXFvxJL4932eHZx+KXFe i3DmDwLG2gNYOdoKEik8LEDs4TZXUTE= X-MC-Unique: H8j0_FqxMMimrJH5NPm0ng-1 X-Mimecast-MFC-AGG-ID: H8j0_FqxMMimrJH5NPm0ng_1748791538 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791537; x=1749396337; 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=VCcFzUnshNhYktTkop8VCX4UTK6/NnsYDFGziFmlv1w=; b=JD9DF9h+gFzSFQSeiMjvYewvx57+OO21GDp4hIluDiVVwxEEITaeBoAGB2/R1wj1G5 qljt5ZQFySPHpMTkWojzANXVDmTeZu0M56DkExxQKPsjWWxm3p8aorIsbXTfoJODuGv4 1jK+yv7BHUncO3bNAlao+QQn9LmX+EwJzOiJz1wPFV46zl3pJZiHHq8Rix+0Tvva1q32 lqSfbVYvs+6PCtVXLrsdckoR8lM53r6Pjrn1Abx3XluqKMvqRVQcRczpwxNzeiaQuknn E6UOj3CplNlbyf1DMQJl8BskLBZ924v+/FEZNdAdDAahBJXqPMngGOigaz8cmV7wIPhx b68A== X-Gm-Message-State: AOJu0Yx9wIO234ZfHNt+BhY92zjpCe1Ov2p4pfL/9ANQ/53Kt6IFz6cz LjK/2oqU2i6b/CwRumhkmRJw0M2cnhtC3NL4XNkymz7Dnm3aFTCw5GzH8Mluip23iX1gO8IqGYf pmcadzuJm7252B9BV48acdBUAmAgSSnWWOoC59aFi1rWoxe1JseqgzkKuRWeGwhCfrGqocm9Rt3 QoW2s4hQ6jw8csoaDvIBbf99jRV36uPkxY9w== X-Gm-Gg: ASbGncuCFsMvZnBi8irdJ4XyyeINwc0jIzdbphLX7/FYScC0CMloV8rUZgUm+RJ1JPV uIX19O4Okj+uFldrta3wpEqaEZx7ZwtfThd+9pK1DTwJz21ZCTH3CKUVPRp4ugC02uGh4btFqI4 ygYxm99lkwMyft/nAXeprsCvYdWzwESslWtCApmAY8yG/ER18aCuLYANAFFcewsqwNVMslpNSu9 uiQ1TCQzAHmiN9c4hdRTCDDadLr2UfcBFfR3dwdRGfK3fysv6JPoxRHpRWv0AJxVUiipOBdO9hn z8Vvag== X-Received: by 2002:a05:600c:4fc8:b0:43c:ea1a:720a with SMTP id 5b1f17b1804b1-450d882b1ebmr66486755e9.1.1748791537450; Sun, 01 Jun 2025 08:25:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0JqPlPg8/OWHDaMlBOn7ob7cLeFFcYuoKjJfKUzk6TIBFkIvM7dWfMpLlJsQbDL+imYemaA== X-Received: by 2002:a05:600c:4fc8:b0:43c:ea1a:720a with SMTP id 5b1f17b1804b1-450d882b1ebmr66486575e9.1.1748791537009; Sun, 01 Jun 2025 08:25:37 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:34 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bibo Mao , Igor Mammedov , Ani Sinha Subject: [PULL 20/31] rebuild-expected-aml.sh: Add support for LoongArch Message-ID: <8e35af507ad97a43a350be4805ade2dea9c2a251.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791720587116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bibo Mao Update the list of supported architectures to include LoongArch. Signed-off-by: Bibo Mao Message-Id: <20250520130158.767083-7-maobibo@loongson.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/data/acpi/rebuild-expected-aml.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/acpi/rebuild-expected-aml.sh b/tests/data/acpi/rebu= ild-expected-aml.sh index c1092fb8ba..cbf9ffe0dd 100755 --- a/tests/data/acpi/rebuild-expected-aml.sh +++ b/tests/data/acpi/rebuild-expected-aml.sh @@ -12,7 +12,7 @@ # This work is licensed under the terms of the GNU GPLv2. # See the COPYING.LIB file in the top-level directory. =20 -qemu_arches=3D"x86_64 aarch64 riscv64" +qemu_arches=3D"x86_64 aarch64 riscv64 loongarch64" =20 if [ ! -e "tests/qtest/bios-tables-test" ]; then echo "Test: bios-tables-test is required! Run make check before this s= cript." @@ -37,7 +37,7 @@ if [ -z "$qemu_bins" ]; then echo "Only the following architectures are currently supported: $qemu_= arches" echo "None of these configured!" echo "To fix, run configure \ - --target-list=3Dx86_64-softmmu,aarch64-softmmu,riscv64-softmmu" + --target-list=3Dx86_64-softmmu,aarch64-softmmu,riscv64-softmmu,lo= ongarch64-softmmu" exit 1; fi =20 --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748792043; cv=none; d=zohomail.com; s=zohoarc; b=m3bz+ltPY6R9iOiz4OohubkBMwZHE4BSUIk0ODZtlnhc7QBTQeCapGH++3ryGYulhJeOvIhu+hbR3XqrA0Xo1GbSv/x3+BXE0Ro4K6+91vsWW38QlPoKQfA390ubWHqsWazSVouiWgfaGL1cXieFNSCfV5dXX9wUCzDiChax/KU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748792043; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Wf6Ybrgglog++IqUHvtdyMxVa/45A9n1FMD5TI8tZuk=; b=Mb3uiGsM1xYrSLVvdJX2ePB//5f8a6LOXi3kzwLY4G6Pq1YOGZs4tI2FrZE3lqMmT5AGFfnEv/CjinAWoVV/cIWlPgFOQGZtxiS5OJ/N8S33GHZIR4rk3cPgYWvTJ5QWnZCIZEnmt13pBdpnZqrd2/fXSN+ti/H9FheXHGb5lSU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748792043265604.1239490696674; Sun, 1 Jun 2025 08:34:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZI-0002RX-2Z; Sun, 01 Jun 2025 11:25:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZG-0002MT-Bi for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZD-0004f0-Mw for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:46 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-264-6xOEaojTPVi8OM6qikio5g-1; Sun, 01 Jun 2025 11:25:41 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4517abcba41so6827775e9.0 for ; Sun, 01 Jun 2025 08:25:41 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d8000f3esm88952865e9.23.2025.06.01.08.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791543; 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=Wf6Ybrgglog++IqUHvtdyMxVa/45A9n1FMD5TI8tZuk=; b=JRCiO6Of1s1+uUwWYU10x172e5AwdPW22Por+PrS4NzT8J4UjNXzWRrHk3uIQ0md86NkCR ctk5KZXZlKY1LtbXIYZGrgwgsQbJnNxJqWC12s6Ot7wReCExxNjsCsg5NP7QDDrVG5plAq 3OXt1rvbapGLUTI3dGeT+FjkpPc8rdg= X-MC-Unique: 6xOEaojTPVi8OM6qikio5g-1 X-Mimecast-MFC-AGG-ID: 6xOEaojTPVi8OM6qikio5g_1748791541 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791540; x=1749396340; 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=Wf6Ybrgglog++IqUHvtdyMxVa/45A9n1FMD5TI8tZuk=; b=lqzEPigd9QB9AHgh1lshsvSNcM+pS0/HAzizopLqnR4k6Yda+l03NeScJ4cfcVPLlW Jc9XppVEWk34Qy+xqRS5FCP+0dBdQMOcqOQCVdg1vyM9U83R8QPuJHdsb2H1riHb2gII wKhl88bvvUq2X9OAgqvTfg1yb3DyOC2rT6J8eB7A+Cw7Jx2VZmjT5omshcFSNi7GS7d3 EvOMH19C6vzLk52X0tdFasJduBgHAjgVIvQoVhvQHtwh3tgnymNjWPRehSPYWhs/YtXA L0ZT8uGsQfvu9heupg36SLAq1gk2HPB5SxhAEEhGFBGFyN0K1dMz55saiVx4lezFYnUa oAhg== X-Gm-Message-State: AOJu0Yx0NN+Sl55/lAcX9QYeBQxRJ10AxLC25ZmQdvfpYEvtMAaLQhjD T3DL4AfoPKUT79Ha/+VVJzLKvDy5Ge4FxMmd78d65nQn6BaY38O63FEacFxIXX5JzRmqZALPsYm l5zjBGu6+cpGVnuJYFFa+uTgeaWL9BTUI913leJWhwpUXWGPb+juaffCmvFtJ1cqf/TmnbXRCU9 nnAsP2agLWdFOIB3243Vbu+e3DEN6zOvqniQ== X-Gm-Gg: ASbGncsHwY5lWYba/5vnQEWyla9qcILjfL2UpxbGUtwQ8JvmBqhwScx04qsodOqqTb/ Ms0DTyVfQ4crHSk74l0TB8SXMF/lPLMq8eW9XaEoOmTofUw4kMhirPgpTB/Oo1Cj3XJEaiwLfKw EEWnZK9jDPi/4FhdYS3kHOjAMe84gozNTj4UUuTe1NfgPafN+qQH4aBFyTs//6jXiFQFdZWzI6a pPBrJZ8YZ2JQUjCai2QO2rP8W0LYO5+3RFgImj+vfn6EJHoN31Bf3hNU5zXi8s3OYBLf5CfUug9 Q4x5vg== X-Received: by 2002:a05:600c:a00a:b0:442:dc6f:2f11 with SMTP id 5b1f17b1804b1-450d887db6dmr67019925e9.25.1748791539813; Sun, 01 Jun 2025 08:25:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNEbgRAFsvpSjFzDv06aViamXn8Of5KAncRiHkwqoyUgr/OfXK414SvKksDMS+um3Qf2B2Tg== X-Received: by 2002:a05:600c:a00a:b0:442:dc6f:2f11 with SMTP id 5b1f17b1804b1-450d887db6dmr67019755e9.25.1748791539240; Sun, 01 Jun 2025 08:25:39 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:37 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bibo Mao Subject: [PULL 21/31] tests/acpi: Fill acpi table data for LoongArch Message-ID: <28d0418c7f3d795a5f96be51d899b65f1c589256.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748792044133116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bibo Mao The acpi table data is filled for LoongArch virt machine with the following command: tests/data/acpi/rebuild-expected-aml.sh Signed-off-by: Bibo Mao Message-Id: <20250520130806.767181-1-maobibo@loongson.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/data/acpi/loongarch64/virt/APIC | Bin 0 -> 108 bytes tests/data/acpi/loongarch64/virt/APIC.topology | Bin 0 -> 213 bytes tests/data/acpi/loongarch64/virt/DSDT | Bin 0 -> 4641 bytes tests/data/acpi/loongarch64/virt/DSDT.memhp | Bin 0 -> 5862 bytes tests/data/acpi/loongarch64/virt/DSDT.numamem | Bin 0 -> 4647 bytes tests/data/acpi/loongarch64/virt/DSDT.topology | Bin 0 -> 5352 bytes tests/data/acpi/loongarch64/virt/FACP | Bin 0 -> 268 bytes tests/data/acpi/loongarch64/virt/MCFG | Bin 0 -> 60 bytes tests/data/acpi/loongarch64/virt/PPTT | Bin 0 -> 76 bytes tests/data/acpi/loongarch64/virt/PPTT.topology | Bin 0 -> 296 bytes tests/data/acpi/loongarch64/virt/SLIT.numamem | Bin 0 -> 48 bytes tests/data/acpi/loongarch64/virt/SPCR | Bin 0 -> 80 bytes tests/data/acpi/loongarch64/virt/SRAT | Bin 0 -> 104 bytes tests/data/acpi/loongarch64/virt/SRAT.memhp | Bin 0 -> 144 bytes tests/data/acpi/loongarch64/virt/SRAT.numamem | Bin 0 -> 144 bytes tests/data/acpi/loongarch64/virt/SRAT.topology | Bin 0 -> 216 bytes 16 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/data/acpi/loongarch64/virt/APIC.topology create mode 100644 tests/data/acpi/loongarch64/virt/DSDT.memhp create mode 100644 tests/data/acpi/loongarch64/virt/DSDT.numamem create mode 100644 tests/data/acpi/loongarch64/virt/DSDT.topology create mode 100644 tests/data/acpi/loongarch64/virt/PPTT.topology create mode 100644 tests/data/acpi/loongarch64/virt/SLIT.numamem create mode 100644 tests/data/acpi/loongarch64/virt/SRAT.memhp create mode 100644 tests/data/acpi/loongarch64/virt/SRAT.numamem create mode 100644 tests/data/acpi/loongarch64/virt/SRAT.topology diff --git a/tests/data/acpi/loongarch64/virt/APIC b/tests/data/acpi/loonga= rch64/virt/APIC index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3477789f422cad54f16734b3ec9= ad1ff5135165d 100644 GIT binary patch literal 108 zcmZ<^@N~{$U|?YU>g4b25v<@85#X$#prF9Wz`y`vgJ=3D){(SrOi9+)e_%gD^||35@t fRG5*0;e$Si|RJ=3Dh@82cM-U``N$nIN$RE*n4{9 z+ta7loZa0G(5$XfPi?WH@dm(n$-&Mcm)wgUw|LxLdY>gI0TLdT zJCE~y^ZmS;UCdCo^!9570QQgSs#vzv>TgV;s;bHW0PpcTC%9u(9ee+BN~|_C$yu)H z8MA3>7qk*c&RR_e$q}N$BuBKY{6+rG!7l-1lny^H*oz|GJdgR`qfgM|voT1qDgf+) z|~RHx#x)!OzJzG`AjOL2e|7ET?&1D^v%a4t6Rr{u>MXFWNeua;0 z@EBLLGDwbPEP>=3DytIbgzt#&J4GVB`jm0F;T!B82F5+5o<2l1gY>>Br#r9c_?mEkCfp)z!k7%IcA311nSPx#7k zlqBIy63!&$O!~@jlrh3NMmWbP=3DNRQ2C!FJibDVOHQ%;F+N`zCQoD$_s5zZ9hOi|7h z<>Z8u6HZP!Ips_f&NSgnQ_eKylnJLyIAzKyQ_c+G%n;5D<;+mdEaA)&&Mf83QqBp& zIYBrlDCY#_%n{BU;mlFa9OcXt&OG7FQ_ei)ED+8D;Ve+j0_B_}oRfrel5$Q`PK9tP zgj1oM3gtXSI8PDIQ8IHxJ+H07KjoHK-ThH}nO&RN1a zOE_mK=3DPczsO*l^z&eN3hH03-)IL{EyGnDfT<(wm&bA)q_a?VlCdBQnQIOi$nJmow~ zIL{K!vy}5J|z7+;7u7*-Ng$p;&qVwyuZbM zhY5$hOM|J;`(ZynoWmbo?2Pfl?Z0LHI1W-e+*Zyzy46SwUh~~Nd;4GCSrZ% zG5eKh3{w3YaF~xXh8M8+8;O=3D-MK(D?TfqHE%gUFzcBDQk*1_|fN#y??-6=3Dbq8VGR~HUrM35rmazmfKsLt{_PsPVg<%Fufu(zY1)>uoD^2OlCob9u#pa3d!Bne8nTSK3!TAK zKN>`*E}!Vw=3DSZ}E`LLrj66pNLC1z2%v7#Nxrz}n5Tu8^*ltj~5FT^}a7%TNc%yXgZ zvTKix$^JFw!Znw5T-b1-_jr;2x!+-ry3B=3D++l`JmWQztwLmx~&ibnKGyZdC2ec0dN zUcbjZmtA|}zS?1+lIq|Ty4?rpZv%EVT-JG|15Ph?Fjne4*y*{fv(t59^YO(;n;Y&Q zhQdwg;*@on+qFwaU6aDqn%2%H>fd>^*+adtQV;b!{sZDxs6GHTo9N-VTmQitJeJigbue7$m1rY3I{i z!q*7?yP;&ARjZvw0Jy$&Ls5gV@TG#QDV%bAWUy`T&*Hn_<*8d}A{fZtFD=3D%?_glT$ xTGh1Dh0$3JUqiv;4FGchz;**kaI~e8;J=3D!el6hZ}%U#8@;032Jp5RFU_&)^=3DBs~BC literal 0 HcmV?d00001 diff --git a/tests/data/acpi/loongarch64/virt/DSDT.memhp b/tests/data/acpi/= loongarch64/virt/DSDT.memhp new file mode 100644 index 0000000000000000000000000000000000000000..f19eae7d00f9c0eefc9e92de2c8= a24863bf309d6 GIT binary patch literal 5862 zcmcJT-)|dP701uDon$|x%g%w_L)P*&RtE#Fp0Khi>&vV&x7Cd+VW}2@EP4X&L zeblO1+EuLtl6R}BgXD2uW|GHkr*K_<^WbX$Squ$6pR>iE>JmGfg%tpbBu6~5zaBnIYv42gfmY#^OQ4BISYidKsXDOvp_kEgtJIEiR;hdnH6O?n3a844=3DNy<4%Ij0Ec6ycnr zoKuu@ns81N&S}ayO*zjK&hv!xJmox3IWG{-3xx9m<-9;SX9(vE;hdqIGnDfp;k-yV zFH+8nl=3DBkdyhJ!JQO--0bCz(<63$u5IU92-S&uK2p_>H&HM~aGhUD+QHwpf`dK-}=3DK_2U~KA>#K7ITe8IU)p;K~mSI2HvI4#0TxzFEr{&8&FT4epxmDG)5?+>WRrS#&Blz9ZzgQ;OQczlV&#;Xp$O7c@ za>{+0!7eu(!&H@8$}?`)(?0eZor(671_O5I8%dljEvJ`ouB<}EI<=3D3l1sP|g$Yz8@nUbE$d`}DOVA|3N3 zg}q>^!d|GT!ZxvGR#aiFd8+&L@-g2s+>nLgcuZ7l4imPx&4jV+G54u@%rhylq+-Rm zt%?~rYCzFqi$~(4lq#8iE7OZn?+HrRl??1O(V9xW*V_| zLX_7c-}9opR`GFpFbEqaCh~EaFaR4SCfPF`ZWrTYJxPMN_cBhiuD8}JM*c!Y?pNkQb=3DlG<=3D7E6o~MN;Ff; z3ha$-6;O<#vI01^&_iv)z4XGm%0CeVNPwJj%PmEFaC+#a_oBxw9(R}CX9-Gyl!xWc z<9y$IKW}CiGt@1;eW3ur-mR{QWlOETZwggaRR#cfkKZ}L9joft2dgQu*3cwpxu$2# zrm0=3DjN+3DwH60{JhzgS&(X#TF`K8031IQ>Hetuv-6!GRo%>N#Jf*y~@AjPTxum_T( zTY8}!%TMy0@>lO~U)=3DhA$@-s#=3D?c(-?} zyZ4I6(g_~X-6%`=3DFMnYg%L}3T<(;6wQ{E&+_!+F<{IL2Ev6&W6GFgwJa8-imaGXDkhOs z@12m!kBw5TpsUElj#A;oMs2lD$mPdqu1Nh~=3D8Dr?)(N@%*eF-EZ;D!^S{3abd}M>i zxT2Loax7yBB&S+!j_PQ&TlpfNGeJNNdZ2;^D(KLI-@rC>p$9N}?#)(vvVNEE7t)Ee z=3DK;a;7LJ zC!Cyca>~gmXPR)P31^yerYWaPIAy{qQ%;$3W(a47aAqiHhH_>JXO?hgDQA{)P7uxs z!Z|@XCn#r*aOMbSj&kNGXP$8831^;i<|$`^a25z>fpQio=3DOp2rB%G6!bCPl@gi|4$ z3guKN=3DNZCzhH##toM$NK6ycmAoKuu@igHd9&S}CqO*yA2=3DM3STA)GUmbB1!x63$t| zIZHWbDd$2ZX*+8Z3|ZZ{P;p zZv4IcpW@t=3DKW^NseErMsKRn#w388N+9PV&Q=3Do@7h8<+=3Dg%9!dtUU(6&gWS{pHv26m z9QG~^rk?i0ettNIKf2f%<3~Gx&iZj2q;#~Syy56pBQbc*ck|ub-~Q9O_(|i*^uHRj z--yN_)xQZx`8Z>E0sEklXc<;ylOwbR+@G|pe3@&<>Z4*EJkPrjEe`Hz{QB4jtJ1YM z@z}Fu=3D#IY&t_ZWHX(ik&t=3DII-k}*8@j5d~WwlplQy>GOPC6EEKIi9c|q_HUs%c!f$ zFC61)JLO`dGsyMtcR21*9-14iD&HT>U_b&cU3)7Y4lOLv%r!6j2e5j|_hhyVYv@U? ze8em zeRpBSG=3DH;+W|K-@v=3D@IB8}R-OcqlYY+g6s7!fIDi_Ui#Q(xGe5b8kdLmQi=3D1Gnnc} zgXq-d6CL{kiPl$-I!Ysf&i}W>EGjovv}5^{rD>cC=3D>(gSXc`-Zm?sHirCx}6E_7XX z{kbvOzs_8^?y`;xn=3DbU8FY-V1JM3APxzKUD(GiDi(ST^^gUM&nh+b)TKObbD^f$TJ z?{Uv%*FSe(?J!VDb#MyZ?j!WK3A>vv>%7tdrx!aIEA<}i_FUH4?Ygk_{PMG{P50BG za0|LPWnJcW?b31Aq;R#SwY!D-OV74?s5e&Xp`OQoMBHjz-Q7A~_lhLethRhY-H$I1 zVn#G{cl(tBxjYt)V3(WGfL>`Ib6_7d6Sz{NZvpM?;FzSyj@7P6N4SJRavGI(KFuY3 zjo`lU5j!ta&G727Y0GI;+wiif(11^;W|Jb~g%=3D?mD?i!v5FFJ+s1Wy9Me*tZa BB|QKD literal 0 HcmV?d00001 diff --git a/tests/data/acpi/loongarch64/virt/DSDT.topology b/tests/data/ac= pi/loongarch64/virt/DSDT.topology new file mode 100644 index 0000000000000000000000000000000000000000..8bbcd7dabc8b66f5e921807adca= 01bcc6a11c835 GIT binary patch literal 5352 zcmb`L-*4O2701sdDT%uJVM%8EBe7!@duV~78)enW3UolEOWKwr*_tTF+Zc?p6?Jx8 zBwSJt@QPuM2V||WhowUH(ibgr|A}Eh3-oDkecP};qm5 zs&Cfy6}`)5-*s!g}1T8N{wLMIb;{+G>L8#39ms@KZgToLkD1Z-q#z=3D>FQ&Cl1nIw zejo6^0k6%fx?X@>660LL@&p~Zs_R9_rIcj9&j51@!yaZWLoV(8HpnZEx|pf^W2Hgn z^00@Q!BEM|)cs5e2ARPu@*p#CAP+Kwp|Y1*@H1sEGnhpgWCjkDL1r*i@iGJRikBJ8 z5+R%s!Wp5Q5ic{CB}zD>gfmJxqm(m7IAeq}Mmb}YQze`#;Z!N7N;%_%Gfp_;lrv5_ zIpO4llT%JkITM64K{ykXGeJ3%gfmGvlaw<_Ia7o)ML1KGGetSmgfmSz)08t!Ij0Ec z6ycnroKuuDLpU>pGebEulru{>vxGBCIkS{AM>unYGe$QO;|WbAfO!5Y7e4xj;D=3D3Fji=3DT%??fl=3DC{_ zyiPc;Q_ky@bBS;+5zZybxfF0}Nk^1RaGnH!ytj?sjPM`7p8^R(0KWo&6Zp+6u%sO9 zpZlKxz%7`APXXwTdk_bJe!q{2;mR_XYQt#n`FX6G5`LKJy zeu;vE(S_d3huvVD7tY|1E)K@{`QabZUK}SWoF8hhJBC$LdarnHKEL^we^@KOs6Ctg zx;ForsP*FA`*5C>8N&nEr!}QvTA@vj(3f$4(y+2cu3xB69_!HW_g@Vc2X{1HeeBcQ z>fP_)W6zptINmO}B`A40{504(TJCDI;qF%l2*CET(PvgLrAf3Tgbqw}N zyZ_j+6yLL0%Z8X5K!n z{KRu7>f4^XpklhW*+jDu&5VlX>W`!z@9x7>q3ikqHW@Yx2fajhpG(+Y_S!PGi(Xs7 z_8VS1g6$Qr9mVzyuN}ko%>!*cBCKX9Zhy-!B~}b8(eJza;gDrkU1;@Yy5S(wyL_r; zze=3DLj+vhEg% z=3DE6OfwOrVBq4Q#m|E}9&&)Zyeq2;#2Qx4$50Z}u0)6c^ZqttAF+)F>}?(%-O!}~6~ z_pv)ZpqD4*!FA!b-$#SHaJ1{P*4O}CGdRH9sCM9}lb+=3DDhQ zgEn*9cHyFHQn|{eb+m{1Z$97aV7|Fg4f47CUy>WOJ4bsL3tv*jmeov7DE!6sLClDn z;U0_?$mLQvf_7Cpcr$z)%o=3DHk9ti(b}j180$j(=3D+FETqZ?s_UrgKg@cUzQ7-swA9ET zKHCl*O42|#In?EnHZ`=3D%rIE7#Xgj7X6JiX2`fiN$~Pt|M~QMYq#TWoD@Vi1(UJ1aiOMme91AJOV&lrO zuySnw;J%jkS2x}p@d6fHWbn$5efxACZ)x7l_@+?k!e83BbPnKQWME+Ra`Jcf2v%^42yj+VP*7lGU|;~TK{QnXivR-y2Lpo~1D^oMTqmj; RP9)%9V32{@4`Rzg*#Io}2LS*8 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/loongarch64/virt/MCFG b/tests/data/acpi/loonga= rch64/virt/MCFG index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5f93b05abe1669fe4239edbba8a= af4fe666f5b95 100644 GIT binary patch literal 60 tcmeZuc5}C3U|?XJk60A<&MXaFUp2LS*8 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/loongarch64/virt/PPTT b/tests/data/acpi/loonga= rch64/virt/PPTT index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7a1258ecf123555b24462c98ccb= b76b4ac1d0c2b 100644 GIT binary patch literal 76 zcmWFt2nq3FU|?Wc;pFe^5v<@85#X$#prF9Wz`y`vgJ=3Dd31_m&V3`7_hxEL51RFK2~ DqXGv3 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/loongarch64/virt/PPTT.topology b/tests/data/ac= pi/loongarch64/virt/PPTT.topology new file mode 100644 index 0000000000000000000000000000000000000000..4017e2927c15c08c7e1a7e4d7eb= 10f416b63d69e GIT binary patch literal 296 zcmZ{dyA6Oa3`8IQjw%DVpkM@Q($EnJ3U;7nFa~1?WFW{w!p+%Fcjpl1xlJHl`_T`R z^h@v}A_<_oDh@8SoO2;dSGC2MkwuvS(5#pDG+#ti`g literal 0 HcmV?d00001 diff --git a/tests/data/acpi/loongarch64/virt/SRAT b/tests/data/acpi/loonga= rch64/virt/SRAT index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ff234ce45cbdd32f57fc0668aba= 135992e5ca887 100644 GIT binary patch literal 104 zcmWFzatz5}U|?We=3Dj89~5v<@85#X$#prF9Wz`y`vgJ=3D+j0|8V%qXt|C1~_00WPJc=3D C#|Hrb literal 0 HcmV?d00001 diff --git a/tests/data/acpi/loongarch64/virt/SRAT.memhp b/tests/data/acpi/= loongarch64/virt/SRAT.memhp new file mode 100644 index 0000000000000000000000000000000000000000..525321890138de509ceaf9723f0= a4565048e823f GIT binary patch literal 144 zcmWFzatxWkz`(%h<>c?|5v<@85#X$#prF9Wz`y`vgJ=3D+j0|8V%qXt|C1~_00WPM2L PVDd1Uff=3DTOfq?-4Y8D3p literal 0 HcmV?d00001 diff --git a/tests/data/acpi/loongarch64/virt/SRAT.numamem b/tests/data/acp= i/loongarch64/virt/SRAT.numamem new file mode 100644 index 0000000000000000000000000000000000000000..2972a9abdcface5b943078d61b4= 946da80176ea2 GIT binary patch literal 144 zcmWFzatxWkz`(#5?&R<65v<@85#X$#prF9Wz`y`vgJ=3D+j0|8V%qXt|C23TMWWPOYp Ma2`w^Mx&?$0B=3DJF0RR91 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/loongarch64/virt/SRAT.topology b/tests/data/ac= pi/loongarch64/virt/SRAT.topology new file mode 100644 index 0000000000000000000000000000000000000000..75e0703ae0d3348919e2b583d1b= 4f4b8bb3ef65d GIT binary patch literal 216 zcmWFzatyh_z`($`+R5M9BUr&HBEVTeK|z6$fq? (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791719384871.5674479771399; Sun, 1 Jun 2025 08:28:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZJ-0002X2-Uw; Sun, 01 Jun 2025 11:25:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZH-0002Me-9d for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZF-0004fA-O1 for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:47 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-221-m5Lhv1iNMHi0GNosMX81VQ-1; Sun, 01 Jun 2025 11:25:44 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-43eed325461so22432445e9.3 for ; Sun, 01 Jun 2025 08:25:43 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f00972f3sm11975637f8f.69.2025.06.01.08.25.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791545; 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=X1R8EGI8kUf6+QvZ144Y6v9Xkzk62rtpVvSzTNxcczo=; b=aa9SfcAOq7eFGcy15TNI+Bn2yA6XDhGkfvd0/MMQzb41ZyhrXrOIwbxaP1axaEqjTDMu7w FxyzPDPV6zML+x8IZiQqWVyTbgdmXiUMWXZBkCs2Am9nJDeMEriNo6gchcTAhzhdmw0DLS 8vBSqd/TJ2D0hw/D1TzJUbXll7t4Wtg= X-MC-Unique: m5Lhv1iNMHi0GNosMX81VQ-1 X-Mimecast-MFC-AGG-ID: m5Lhv1iNMHi0GNosMX81VQ_1748791543 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791542; x=1749396342; 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=X1R8EGI8kUf6+QvZ144Y6v9Xkzk62rtpVvSzTNxcczo=; b=hvdRuVJgGoN7Rn37y/OV2cnT24uz+hhHsJNiry8CDfzWbFZUIPW9HsqOl3jiwa6Gbm XE3UgE86NCBx+2VaRqPxUcJIdPOckz+SEAVn8BbcTUM3Cn25DRO3nT4XaiVM5bI/keqp t8tsOm+J236lElprp+2CjKL00XaFuVnDz+1UhLWDzdbTkE4k7BJwz+vTRMj0z9ZCoykU Yg19GsbU23eabG9pcsICpMPLYVuPWupScrkhZ70wsry/RjUGWmIF4hFnA5Gt0+BXXtxa XBNN8JlStIf2BpO3yaO0Rb3IMiopD0w3VuE4ItPfKaaBt9vaqXVdDGOw76Rk6tWujpLb b3GQ== X-Gm-Message-State: AOJu0YwvvyBElrlKzD+hnY0iHcy/5A9c7iVt1qNfreUMo5MKbyQcz+Lz EG9R901y4/YKBQ+AJqSrV0qvWQ8/ky5KV12mxfSGX/L4O8ymHYd2x9VAQKpqgbod9bziN/sfVcy /4L9PkdpetXopMna6XS4LmPU+DSAAQcrNyfIascdWy15a2QD4HQ0Ef0mMNo4do+WWFHZK9FwNu7 nvtz9F2KB07VgEwLcbvOvx5kQ7CYBn+niIZw== X-Gm-Gg: ASbGncsBnffXr0HJcY91zGLkNk7NLEesrvJiBQnJih/US18CNCr+8IW4usJjEgs7EFd ioDQUlwDYExD7gl83U5mOL72ZMs8KoU7aN/1I0BmhA/sWUquB8REP+JPbAK4RlueGRsu3gvI+Lb WFnN42g+j8GjeQj0dQasZ8aixdDL+BQRDAHW1qVDMxikpyasbqmuJ+RmgHFRo/4wsq8DSSkekhn 5ywh4pGerDEh1AeG1jiY3hiaj+f2JYRkrUQOPbPYPq8onJgdSB4EvWSqMCdODLNPMCuKEp/crdZ pErVYA== X-Received: by 2002:a05:6000:2081:b0:3a4:ddde:13e4 with SMTP id ffacd0b85a97d-3a4f89e24cdmr7322676f8f.58.1748791542156; Sun, 01 Jun 2025 08:25:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbn7SNkqkwQkezZ6BMt+88VKRXG8VoV605MoI+hrbiIw77ASu2786aHzCTSinvh8ZyhvDjsA== X-Received: by 2002:a05:6000:2081:b0:3a4:ddde:13e4 with SMTP id ffacd0b85a97d-3a4f89e24cdmr7322650f8f.58.1748791541655; Sun, 01 Jun 2025 08:25:41 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:39 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bibo Mao , Igor Mammedov , Ani Sinha Subject: [PULL 22/31] tests/acpi: Remove stale allowed tables Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_SUBJ_WIPE_DEBT=1.004 autolearn=no 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: 1748791720578116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bibo Mao Remove stale allowed tables for LoongArch virt machine. Signed-off-by: Bibo Mao Message-Id: <20250520130806.767181-2-maobibo@loongson.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index bad1380eec..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,9 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/loongarch64/virt/APIC", -"tests/data/acpi/loongarch64/virt/DSDT", -"tests/data/acpi/loongarch64/virt/FACP", -"tests/data/acpi/loongarch64/virt/MCFG", -"tests/data/acpi/loongarch64/virt/PPTT", -"tests/data/acpi/loongarch64/virt/SLIT", -"tests/data/acpi/loongarch64/virt/SPCR", -"tests/data/acpi/loongarch64/virt/SRAT", --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791718; cv=none; d=zohomail.com; s=zohoarc; b=CkyQs8uvE5Ala/tcf2VtSonZUsgClS6cmDeCy7p5gqHg+7/sgnBt/5+LuMUd5s3rtlPnmhtQ69pmLnlX0wavryxtpKTYC8r4Vi/ma133tnLXrCZ4AOQtdKR5c8QNMf8yzubNbNaMQ/m7UXKp0b4ki4dz2OivWVhpSkmZ+LgS26w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791718; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ds1bRuEkiJDFHQgBvKVW02NaDKRDGpXfpkGE2xqPN+s=; b=aJj6YYEgoQ3VOtEULt7xwJ2S5MmUeW0Sx7H10lHXWp3a6WCD1A4a2LhbMrK1DGgi3+FHntrnSErzGtDDE9q+T6m0pPQV3vqK+NrgpaRXqt4zsB676vWlbfM4q4FB9Xg5YQOTLUulzEeMvZiLmDzsW8z4NdIt6LooZdHdRDOTPkA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791718782610.8646820281136; Sun, 1 Jun 2025 08:28:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZM-0002i6-87; Sun, 01 Jun 2025 11:25:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZJ-0002YC-Mw for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZH-0004fS-SQ for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:49 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-5oYnwjaiPvG-XYypH1OsLw-1; Sun, 01 Jun 2025 11:25:46 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-450cb902173so16116365e9.1 for ; Sun, 01 Jun 2025 08:25:46 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7fa2442sm90047815e9.9.2025.06.01.08.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791547; 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=Ds1bRuEkiJDFHQgBvKVW02NaDKRDGpXfpkGE2xqPN+s=; b=DK1igBdU8rAga6BM5/iE0ejHB9WoW5ZHBzwymsubudiLd7OUqRxYmW4lzAlBy34128S+Nk yalmivG/uC2OPEVS43X1SIwTTd5FRVQtB+umwP/xm6tYV6mukEBco0aeDYM2J/glMhobvD Lpsj8a6i2KtcuzM6ombgO05DPUdaN7Q= X-MC-Unique: 5oYnwjaiPvG-XYypH1OsLw-1 X-Mimecast-MFC-AGG-ID: 5oYnwjaiPvG-XYypH1OsLw_1748791545 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791545; x=1749396345; 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=Ds1bRuEkiJDFHQgBvKVW02NaDKRDGpXfpkGE2xqPN+s=; b=G7hDUtB0OYIy5h9oeAYpg0EVx9e8fE8PaOJ0jtsAagirO8MybjNYdOSJ4cCL6aq7g7 hj2+gNZ8Ff86nf5b1BHQlxMdxaWX+RrG1YSG6T00wKdbATQzj9vXdKilux3HJq/2BtCj nWIz+WVZ8mqWmT0Se5vDjAuTaRO4ChyNHCJiNdSzJW2Z/LFQrKMIr7Ip6JmxaHga6cUy JqWzqOHm6L9iYU6ga6+QobHEHnCH45TbDTIpTzubXIxEjsIVdRUC9iAd+NRwRrK9E6bV cnA0Z6CdH1gBbCTquszpnS4Db72GF6MKaA14XSQnnpOV13Z8U8SaXU5LH7jvYXg24Wd7 kxZw== X-Gm-Message-State: AOJu0Yzok8HfICpmrECgYDTtdOvvtl4MZQF0pfE0i+QwBTlYY0ykCpSV HrUbKrhGh2YIb3vOz4Nq/V/h2L3fipH5lD6CrAMG8NPa2sQO82d4jzL0LqZBK5ez2JrH3Qw98Yy VX5u1Pwou97tMV9EWmI3OFu/rMGn9GAVuzRUe3bY2PTN8HegQN5/W9S3yMjJ+JYwETZpBGqKurS HYOpRl38XUCjv2scWohrTPUpITsG4tGe8dQg== X-Gm-Gg: ASbGncvmFy25ftw7sf7pvZyJhp61BGwVRcQzQrgz7gKZp9CJx5WlVOVkTHU2zJsC2OV x6bxvv64jEVl4CnYRhJknISXTs4z7/yOx5ZDlTkMa5aClbrMFaHYT0YN/rf/nPlzQ7eYjuKdamy mUvAIrdSDwQSsd1ghbTk9TuVgggQYvlGAYg6gjKPll8K8mTsvDgenXFwGrW64mj/xuWEGTQTtUJ tRhV/M12cfhl9rbQTfLCRGdLRYCN40z2Z2o7/xsOFw/f074+5itPHpC+3szvx6GMhD2MdoEUJh/ +fcOlw== X-Received: by 2002:a05:6000:310d:b0:3a4:d719:5be0 with SMTP id ffacd0b85a97d-3a4eed91301mr11558961f8f.2.1748791544752; Sun, 01 Jun 2025 08:25:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWhMl6G+vbhiNftOiQZ/OlcUza2hJxsqcICcLQSeyJSaqQTnvFnhLFajYUaA+crQIR1PuXLw== X-Received: by 2002:a05:6000:310d:b0:3a4:d719:5be0 with SMTP id ffacd0b85a97d-3a4eed91301mr11558939f8f.2.1748791544322; Sun, 01 Jun 2025 08:25:44 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:41 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Huaitong Han , Zhiyuan Yuan , Jidong Xia , Marcel Apfelbaum Subject: [PULL 23/31] vhost: Don't set vring call if guest notifier is unused Message-ID: <51ee7357e9e6e017fc25837743bef0a18aeafbe6.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791721217116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Huaitong Han The vring call fd is set even when the guest does not use MSI-X (e.g., in t= he case of virtio PMD), leading to unnecessary CPU overhead for processing interrupts. The commit 96a3d98d2c("vhost: don't set vring call if no vector") optimized= the case where MSI-X is enabled but the queue vector is unset. However, there's= an additional case where the guest uses INTx and the INTx_DISABLED bit in the = PCI config is set, meaning that no interrupt notifier will actually be used. In such cases, the vring call fd should also be cleared to avoid redundant interrupt handling. Fixes: 96a3d98d2c("vhost: don't set vring call if no vector") Reported-by: Zhiyuan Yuan Signed-off-by: Jidong Xia Signed-off-by: Huaitong Han Message-Id: <20250522100548.212740-1-hanht2@chinatelecom.cn> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pci.h | 1 + hw/pci/pci.c | 2 +- hw/virtio/virtio-pci.c | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index a6854dad2b..35d59d7672 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -983,6 +983,7 @@ void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_d= ev); =20 qemu_irq pci_allocate_irq(PCIDevice *pci_dev); void pci_set_irq(PCIDevice *pci_dev, int level); +int pci_irq_disabled(PCIDevice *d); =20 static inline void pci_irq_assert(PCIDevice *pci_dev) { diff --git a/hw/pci/pci.c b/hw/pci/pci.c index c6b5768f3a..9b4bf48439 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1730,7 +1730,7 @@ static void pci_update_mappings(PCIDevice *d) pci_update_vga(d); } =20 -static inline int pci_irq_disabled(PCIDevice *d) +int pci_irq_disabled(PCIDevice *d) { return pci_get_word(d->config + PCI_COMMAND) & PCI_COMMAND_INTX_DISABL= E; } diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 9b48aa8c3e..7e309d1d49 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1215,7 +1215,12 @@ static int virtio_pci_set_guest_notifier(DeviceState= *d, int n, bool assign, static bool virtio_pci_query_guest_notifiers(DeviceState *d) { VirtIOPCIProxy *proxy =3D to_virtio_pci_proxy(d); - return msix_enabled(&proxy->pci_dev); + + if (msix_enabled(&proxy->pci_dev)) { + return true; + } else { + return pci_irq_disabled(&proxy->pci_dev); + } } =20 static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool a= ssign) --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748792001; cv=none; d=zohomail.com; s=zohoarc; b=dPfwGPJ6jg/nL/HH339HM7Ib9ZKN3Woqd2e94cyAIQ4+F4FyvwqX153lxS7ULpqn5YSimeJcKMgYauRhRE30o71Nx4mMH68rA6g4uqj82aVObCg01Z8o3fh3DT4PfxpPqiskgN6x2+b6wt9R56yAnEQiEqkyFyuhUxfcwAxC5Qo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748792001; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6dAlrl0LtxfLCgi64pVTEp018uC/mUt8mFKXJwY2ZbY=; b=RS2Y+Vk2VMHxCMWaNIb+mZCoerfiSeuGXsluVXcSEJlLoQMD0RqqTA8rCYvdDFN454ORZ6QucaYGA7OYTEtoGICmy74svwixzUPXtARnZIPgYw1rPyKtqYRvuHd4c1aGSi4Oh4P34QNLdULfNDUXXvg9dqI526OsL0qY8j53goQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748792001844113.38166701632713; Sun, 1 Jun 2025 08:33:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZO-0002rr-Nb; Sun, 01 Jun 2025 11:25:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZN-0002l0-BY for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZL-0004fl-NY for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:53 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-80-mEFfjfG_PIi4Fs1IRjcHXA-1; Sun, 01 Jun 2025 11:25:49 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-445135eb689so17895465e9.2 for ; Sun, 01 Jun 2025 08:25:49 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7f92585sm92452755e9.5.2025.06.01.08.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791551; 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=6dAlrl0LtxfLCgi64pVTEp018uC/mUt8mFKXJwY2ZbY=; b=gbJN+zEZRFgg7oUtdT0QXDXkE+KJnKN6up/FQF+Mg8YzPbThwSTu7W1fYfjq1sSqy2pdBq Me69TmMxdaI4biqwWcuRG6cK8epxNjaXtMpOaCOfkSF9a9Mf4sfd1OdFwXOv0GNhiA3wH1 jyoCKScuWmPmG7BJR/83Dt7Q4lRi0jY= X-MC-Unique: mEFfjfG_PIi4Fs1IRjcHXA-1 X-Mimecast-MFC-AGG-ID: mEFfjfG_PIi4Fs1IRjcHXA_1748791549 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791548; x=1749396348; 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=6dAlrl0LtxfLCgi64pVTEp018uC/mUt8mFKXJwY2ZbY=; b=DGqedluLjAxx+PdN/hbT5dX3nQdBTPXkFQK78S8Dhvx0q6bK98V+KyAhkJ4mxeG40E fByQWRuD2nwwNClyRzEH+/MkLbYdBZCJ4jU6bvU1slXnGcMCTcpGjhHSW7+5O4fNP8Ln GBUYK0SOJIq99mr0vgbCkq6/NQlrUc567czEVvTBZZYswX4ED9k6O5XdNyrcyc3F+1up n7ie7wtBqlEBnW0IFh407eMS8Rgl8lNyCaPv1UEddAUC0xCi44j8WAxIivDsdCuV118H I4YQq6rlRL1MoG9ACfBKGk02fOPU2fiMxC96Focb7TlRO+jiR2emRT90b6HUB1cc1LuI nU2w== X-Gm-Message-State: AOJu0Yy9cPFrElWn0pe9m7/tAO9WKb0akQqBM/u0emtzlH1tUNAIbqdu e8nGc4rxOzXp7skNd1nfGwNY0TO3MeSg7iRE7iBjkXSzfpx2HhSb1D5HMSHSsGCsR/XWsjzLaHp FvVIZUIAch59E35BZRgmxhVSJ6SICAn+cpSm64GM9zJebRDVt+Ekcd9oofcV5El8PHAE5PDLeXK sC/wRNR5s2xFf60qQimntvaTewqTJX8G0VKQ== X-Gm-Gg: ASbGnctVVC/XrSLBFDE/6R6jzej3xm1hyQBzb7VMtMeoyKfft4GcvQmMvW4ZP2/WzX0 qmcqKn9b438BG95B8QKd4xv+1I3sLNXXBhu+GM+kr0NpoD/d0v5U//I0n2w8m0QjFUPVJX/6Zr7 stPO3ngexX8X6mLsa9XvXbm/r/JamMqgUHKkiE2mFzaBdobsA09yz+seZfaS0rAUc6bc/fXxTNb FT0YMg3l86nZhUrfRM+Zqf2PsRznY37daybhO9aSR2j9s7KJ9z5+EFtbLSLmH9vqk5b04XIqiTA YFLq5w== X-Received: by 2002:a05:6000:1447:b0:3a4:f722:f00b with SMTP id ffacd0b85a97d-3a4f7a02565mr8143396f8f.11.1748791548144; Sun, 01 Jun 2025 08:25:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKrecldD8gO1vYtpqEneN8pyJrS7ibr/3skTLCJo76l3qH38tE1b2Dky2bAOOFlgbrXleMVA== X-Received: by 2002:a05:6000:1447:b0:3a4:f722:f00b with SMTP id ffacd0b85a97d-3a4f7a02565mr8143369f8f.11.1748791547674; Sun, 01 Jun 2025 08:25:47 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:44 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Lei Yang , Si-Wei Liu , Jason Wang , Jonah Palmer Subject: [PULL 24/31] vdpa: check for iova tree initialized at net_client_start Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748792003890116600 From: Eugenio P=C3=A9rez To map the guest memory while it is migrating we need to create the iova_tree, as long as the destination uses x-svq=3Don. Checking to not override it. The function vhost_vdpa_net_client_stop clear it if the device is stopped. If the guest starts the device again, the iova tree is recreated by vhost_vdpa_net_data_start_first or vhost_vdpa_net_cvq_start if needed, so old behavior is kept. Tested-by: Lei Yang Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eugenio P=C3=A9rez Signed-off-by: Jonah Palmer Message-Id: <20250522145839.59974-2-jonah.palmer@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 7ca8b46eee..decb826868 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -366,7 +366,9 @@ static void vhost_vdpa_net_data_start_first(VhostVDPASt= ate *s) =20 migration_add_notifier(&s->migration_state, vdpa_net_migration_state_notifier); - if (v->shadow_vqs_enabled) { + + /* iova_tree may be initialized by vhost_vdpa_net_load_setup */ + if (v->shadow_vqs_enabled && !v->shared->iova_tree) { v->shared->iova_tree =3D vhost_iova_tree_new(v->shared->iova_range= .first, v->shared->iova_range.l= ast); } --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791624; cv=none; d=zohomail.com; s=zohoarc; b=SSpWDUhaRrT5c61etufbUm4kqKygVUKLNAkXcWrw78LrRmexDlf6xdCEnVjEHRh7ajRX88dpyC6F5TU889Q/7IB+BXRnH9Q21oycrj8rja11kVOsi72TMDUzKivloUVZO9Rg5+cjWiP8PQ19Y2ay+B/+Mcjiql0JeJeZr4Sz8tU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791624; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=04O3W6vzLxgn86PWEaMIddUURG4vqFHvy1Jt5dN9Jtg=; b=j85MjM3ZgQl+lh8B32lOLAa/EkaouRx8nw47JTwhkclmWjN62fSapSO5yLMZC3AgVruNL921+imbmRvMfR3eevyFPipby8JAt5iWWBlUp9wDpWsxzayYmEHnhDQ7HEl8zbCU8ksKoHdJcgdu4MaseW1ovayy9qYpcGWpmxEcjpI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791624757962.8196082619858; Sun, 1 Jun 2025 08:27:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZQ-0002yT-K3; Sun, 01 Jun 2025 11:25:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZP-0002uR-6K for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZN-0004fu-Hv for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:54 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-7r6fcW3qOPGxjXzNM_xdkg-1; Sun, 01 Jun 2025 11:25:52 -0400 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3a4e713e05bso1680199f8f.3 for ; Sun, 01 Jun 2025 08:25:51 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4efe5b7bbsm11636706f8f.4.2025.06.01.08.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791552; 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=04O3W6vzLxgn86PWEaMIddUURG4vqFHvy1Jt5dN9Jtg=; b=fRWAtpwrmVt5LPLt76lTuTInfhseKboqctZ0Hib82QlTS3sxMaICmgR+dicCeQCPFSYB0u VlxE+Fftt01z97uy9oSk1E3XO18LlWUgHObTpr4SgiZk6lG6f7lpfjEpA6hBkR6wzgEy1H uNANIKCBt42pBJnJ7BMw9+3cEnEtG3s= X-MC-Unique: 7r6fcW3qOPGxjXzNM_xdkg-1 X-Mimecast-MFC-AGG-ID: 7r6fcW3qOPGxjXzNM_xdkg_1748791551 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791550; x=1749396350; 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=04O3W6vzLxgn86PWEaMIddUURG4vqFHvy1Jt5dN9Jtg=; b=ObdKZC4jodS44XQkzDSOc+CfZLmcsYG4csMVkpivdACvrTgB72K/kPhmBAzbUPjimS AL3jSzxzDMTRp91l7197xtDEnSlG8avrX74dwTR15rDCkyHsKQSlFuNBL/Q4gqqT2jo2 3FSfO4oyH3ndTSPzZZrmBDMRLwVoKh8u575+axv5rea8Ezr5Zc5zQuDanH5xNy3iSl+p 5oXDUkXpPmanw4KL4HvoNE2i+OFuE0cc9GDNqNhhLTvk3Uc9VCNrqo7Zh7yIEaVrwNsx oAomTXAwdgnOV+0FSU6ENxzp8/0mVz9BPLjmIJRA6XWjSt/vMVt39/EJ9lMUbaaOXv+D w0Ag== X-Gm-Message-State: AOJu0Yyo5vMhbJUv14I9h4hoT+eb0Qb/Tnzo+u90wBuAbcZRwHCsfC1J 6EZ3wjn1Ll30t5zprST4ENTFXsWP2TMupj++9F24zuukQcH2OGPaTJGi2ONdGHutO5OmFh9sKyp POanBhW7GYr9V1UAxo6IyHrimCPU5beGfHgQ5APZeCaP/RMgw/p+0Igt8mAuHjeOXTjFeLGpj3p hDtVOeQFh89lerz9e9ysE2bBXjO3tN8OOn7A== X-Gm-Gg: ASbGnctSi73GWShUqB0+sKecs0YrZ8EF6zg+dd8+fS7GYHk9pFc3hFOff3d04fM2FGn WuZUFCWplKSe0g44xKs0UrSqKNXssuFPtANKRAonh+vGsk7JP/B+G/pRHE/t1LNvTv3b20WYfHp RUffPav5duKmM5uwpNT5Sx5PZFJiXYz2nJx/ZiuyLEOPO3uLzDdx1oHBJLmevlziLWIldVIoKaz hIKJXU+3bBZE5DwdgIScw1KzVQtP5nRQDeV/QvbSbkEYMG2VUuvQfoJPx8pIM6By6eufVFC987H AzWB7Q== X-Received: by 2002:a05:6000:2204:b0:3a4:ea7e:4634 with SMTP id ffacd0b85a97d-3a4fe1618afmr3969459f8f.10.1748791550487; Sun, 01 Jun 2025 08:25:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEqcpc2e6YmT+xlb9gBQzAxXyWTH0o5j2OoJWb/2hnmDyfjqmHI3LrQBmWE+L58VPUHcoXrg== X-Received: by 2002:a05:6000:2204:b0:3a4:ea7e:4634 with SMTP id ffacd0b85a97d-3a4fe1618afmr3969438f8f.10.1748791550086; Sun, 01 Jun 2025 08:25:50 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:47 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Lei Yang , Si-Wei Liu , Jason Wang , Jonah Palmer , Stefano Garzarella Subject: [PULL 25/31] vdpa: reorder vhost_vdpa_set_backend_cap Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791625559116600 From: Eugenio P=C3=A9rez It will be used directly by vhost_vdpa_init. Tested-by: Lei Yang Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eugenio P=C3=A9rez Signed-off-by: Jonah Palmer Message-Id: <20250522145839.59974-3-jonah.palmer@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-vdpa.c | 60 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 1ab2c11fa8..6b242ca56a 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -594,6 +594,36 @@ static void vhost_vdpa_init_svq(struct vhost_dev *hdev= , struct vhost_vdpa *v) v->shadow_vqs =3D g_steal_pointer(&shadow_vqs); } =20 +static int vhost_vdpa_set_backend_cap(struct vhost_dev *dev) +{ + struct vhost_vdpa *v =3D dev->opaque; + + uint64_t features; + uint64_t f =3D 0x1ULL << VHOST_BACKEND_F_IOTLB_MSG_V2 | + 0x1ULL << VHOST_BACKEND_F_IOTLB_BATCH | + 0x1ULL << VHOST_BACKEND_F_IOTLB_ASID | + 0x1ULL << VHOST_BACKEND_F_SUSPEND; + int r; + + if (vhost_vdpa_call(dev, VHOST_GET_BACKEND_FEATURES, &features)) { + return -EFAULT; + } + + features &=3D f; + + if (vhost_vdpa_first_dev(dev)) { + r =3D vhost_vdpa_call(dev, VHOST_SET_BACKEND_FEATURES, &features); + if (r) { + return -EFAULT; + } + } + + dev->backend_cap =3D features; + v->shared->backend_cap =3D features; + + return 0; +} + static int vhost_vdpa_init(struct vhost_dev *dev, void *opaque, Error **er= rp) { struct vhost_vdpa *v =3D opaque; @@ -841,36 +871,6 @@ static int vhost_vdpa_set_features(struct vhost_dev *d= ev, return vhost_vdpa_add_status(dev, VIRTIO_CONFIG_S_FEATURES_OK); } =20 -static int vhost_vdpa_set_backend_cap(struct vhost_dev *dev) -{ - struct vhost_vdpa *v =3D dev->opaque; - - uint64_t features; - uint64_t f =3D 0x1ULL << VHOST_BACKEND_F_IOTLB_MSG_V2 | - 0x1ULL << VHOST_BACKEND_F_IOTLB_BATCH | - 0x1ULL << VHOST_BACKEND_F_IOTLB_ASID | - 0x1ULL << VHOST_BACKEND_F_SUSPEND; - int r; - - if (vhost_vdpa_call(dev, VHOST_GET_BACKEND_FEATURES, &features)) { - return -EFAULT; - } - - features &=3D f; - - if (vhost_vdpa_first_dev(dev)) { - r =3D vhost_vdpa_call(dev, VHOST_SET_BACKEND_FEATURES, &features); - if (r) { - return -EFAULT; - } - } - - dev->backend_cap =3D features; - v->shared->backend_cap =3D features; - - return 0; -} - static int vhost_vdpa_get_device_id(struct vhost_dev *dev, uint32_t *device_id) { --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791696; cv=none; d=zohomail.com; s=zohoarc; b=UAH0sS7FbdjfHONy3jra2XsnLOu+Nd/RaBjRMotl5E4EYkZtcxitoBkiRJ0kW2bUAhLxG/QHivKsYzTYjkQlT2KCxWHd9aBo/LJfygc6+EKB6XETxbMFbMTEujf6tdiLlDlpePX+1zt33NW3Md5cNFM1sWtGovHdJIrhIAiY9Bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791696; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dOzRFXQKwYUGhNGpKvBwxp6FWf6JjZqCT1oic4AmAzI=; b=a9HIwoJqmeiKZHB1OO1oCxovaWbRu43cjxXhdugDbjhc2/YVvmw1REaMGRwxuTvMT/UvaUlm13BOfIGoe8Q3wAA/Bj0vRjOlT6Q19UcuOHeKnxAO7FjJYbiYapmohFzp+IOpwT1jZRSZUdE7qbj5XVd67kso39iOYQp+V7x3W5I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791696238987.2704400839267; Sun, 1 Jun 2025 08:28:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZU-0003Da-1G; Sun, 01 Jun 2025 11:26:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZR-00032A-Sn for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZQ-0004gB-8j for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:25:57 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-270-0tasNZvWNtKVheB_K8WGfg-1; Sun, 01 Jun 2025 11:25:54 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-43eed325461so22432985e9.3 for ; Sun, 01 Jun 2025 08:25:54 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7fc1b60sm89962615e9.34.2025.06.01.08.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791555; 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=dOzRFXQKwYUGhNGpKvBwxp6FWf6JjZqCT1oic4AmAzI=; b=De0reKEKZJ0h9/Wn+WR4CFvRXx+ZA2aOKX5U2abinZBNAqTR3D5O3geO62asZvhYb8NoaR ipUwO8qdwnX7c2qPiJW7daKIfKfH1fDPsW9uYHz0N6I6OvahqjA7oKubSe+sfis4tPLYW3 /M6X7cSAFtETqnA+fIme0sCypkSmjXY= X-MC-Unique: 0tasNZvWNtKVheB_K8WGfg-1 X-Mimecast-MFC-AGG-ID: 0tasNZvWNtKVheB_K8WGfg_1748791554 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791553; x=1749396353; 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=dOzRFXQKwYUGhNGpKvBwxp6FWf6JjZqCT1oic4AmAzI=; b=Vy4W5rUymHbD0ZpwqZ4pbnz+mYXZhciOo0E5cWjukYQRZysIpNGwY0/NR1jprmM4BQ khh9YGZ42wfi0EtyokLu+1ZlpEe8ebqYEGHPl8f6A+3G9XJWcF/KYJR4k8ZiiNUJCObq ODnL1Miw5ExcijSHdR1OMHrpHmijMrJBfSdSrlYLnao3NjKTYbHLqPIE4fZb4w6iSI78 /ikcd5knPBiR3Al6UVdAlqB6jeTsMcPR9OVk9d+NGHkkOVYmLJ6h+ubWkjmExHKtxGMD RjjznmE7kAU9XE90+8cGNXGCA73H3jQFOXPgC62cvCaacjhnCpSj8YH0gP7GweZ2JrV0 UC+w== X-Gm-Message-State: AOJu0YxOQ2BkWZH1wPJD7LbXHn97Ze1ZYqxYs3490+Bh6+JBgRMWloBp Z8GiKbuaW2HwMVUIPXWpFQwzS5yveHYVd9x2+YoKrEOk/kwAyVAGn1PAelLVl3gAYIGMsMTCA30 qmEvGb+fTlz3gL/yfowHjMoVYus/s4Tybmm30m/9lwvy6r2lTaof6T7DKdrdbXRqOEPGneG+ALg VuycN9cJDfrBMZglOwjBHA5BI8MusjXFrlIw== X-Gm-Gg: ASbGncuTahkB0zqzphlblNmMXUwj/sLvPMmXgEPAw/1RsUaQo4B/YoDInIp+CL1HjUm QX01qHi5CHWKB9QehCsb90JfbpahoqnVNYkPCNRnPigJuI88bJHLicNYZOW6D65p3Lfu2rbwxVf RyCGCc6e1oumR2W3/MAcGkz7tccVP9GlPHwAC9SL/JZhcbqXgKSn4hgEAO0u/AOdIeV63MtlWyF p/9iiI68cSoPkHvIKHTg0O+kOW91E2clS91szFOaUJT+8bACAv8BZSNURDb94Ar7NaiPU3nIA7q 7YovJw6UPLZfXkHK X-Received: by 2002:a5d:588d:0:b0:3a4:c9d4:2fb2 with SMTP id ffacd0b85a97d-3a4f89dccf0mr7208668f8f.46.1748791553042; Sun, 01 Jun 2025 08:25:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHL+yn40MFveH2hya/kju2NBRF+i59FVk6IRpq/5D5RN8Lbq7r18bLSWIay3oTzgyFRkdH/FA== X-Received: by 2002:a5d:588d:0:b0:3a4:c9d4:2fb2 with SMTP id ffacd0b85a97d-3a4f89dccf0mr7208647f8f.46.1748791552539; Sun, 01 Jun 2025 08:25:52 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:50 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Lei Yang , Si-Wei Liu , Jason Wang , Jonah Palmer , Stefano Garzarella Subject: [PULL 26/31] vdpa: set backend capabilities at vhost_vdpa_init Message-ID: <8f0b6836a0d8dc7d2159d61bc35a42d7c9a9e22a.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791698360116600 From: Eugenio P=C3=A9rez The backend does not reset them until the vdpa file descriptor is closed so there is no harm in doing it only once. This allows the destination of a live migration to premap memory in batches, using VHOST_BACKEND_F_IOTLB_BATCH. Tested-by: Lei Yang Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eugenio P=C3=A9rez Signed-off-by: Jonah Palmer Message-Id: <20250522145839.59974-4-jonah.palmer@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-vdpa.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 6b242ca56a..e9826ede2c 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -634,6 +634,12 @@ static int vhost_vdpa_init(struct vhost_dev *dev, void= *opaque, Error **errp) v->dev =3D dev; dev->opaque =3D opaque ; v->shared->listener =3D vhost_vdpa_memory_listener; + + ret =3D vhost_vdpa_set_backend_cap(dev); + if (unlikely(ret !=3D 0)) { + return ret; + } + vhost_vdpa_init_svq(dev, v); =20 error_propagate(&dev->migration_blocker, v->migration_blocker); @@ -1563,7 +1569,6 @@ const VhostOps vdpa_ops =3D { .vhost_set_vring_kick =3D vhost_vdpa_set_vring_kick, .vhost_set_vring_call =3D vhost_vdpa_set_vring_call, .vhost_get_features =3D vhost_vdpa_get_features, - .vhost_set_backend_cap =3D vhost_vdpa_set_backend_cap, .vhost_set_owner =3D vhost_vdpa_set_owner, .vhost_set_vring_endian =3D NULL, .vhost_backend_memslots_limit =3D vhost_vdpa_memslots_limit, --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791696; cv=none; d=zohomail.com; s=zohoarc; b=HbdeMvlJOXqc+vxLLTcUlpq20Vvk50QysaeV+3ijjxUwqAjj1nqsalQmgsodJiKbXm8F9bUWuNWhKVmCLs3/Ikji7y4F5l6LwAAWAtwN2/sSOyS8b+WQDFvp1T4lBgNOAmg65hqNMxhljfeo8VU/yhDKXJ50mvrFTd60+Eabo4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791696; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iOHxmu/DSPgZPvZMkn1J47zj3LBk3Nk/LBdtFk70RKE=; b=M7UxXk30+sbojzElqyQZCrSX5GLlzWBeUhXXuB7BCQN6zofgTxIrlWoQbXfyhAPrmUYtgp6dhhozuxk3BkIbnl5doL3zOChdHfdIVXK0oslHrJvXqTmgJwHXRgKMBJXI4dSXLBW+3dqpMLFVuz3oh9jFwR7mtUWpjJ9wbvl9eBk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791696237619.1904323988086; Sun, 1 Jun 2025 08:28:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZW-0003Fp-D1; Sun, 01 Jun 2025 11:26:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZU-0003E9-GD for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZS-0004gS-SK for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:00 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-378-kPSueeaGOluutR4w9XKBbA-1; Sun, 01 Jun 2025 11:25:57 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4517abcba41so6828425e9.0 for ; Sun, 01 Jun 2025 08:25:56 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d8000d5dsm89010975e9.26.2025.06.01.08.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791558; 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=iOHxmu/DSPgZPvZMkn1J47zj3LBk3Nk/LBdtFk70RKE=; b=Draeg9yfhThKQqPJqdTGD2tf7gRaEzzLNibAH/st97Wta4S19IFUQQApullfyWBp5cXVEk dcpdztvKLVgznlo2Zizzrb0CRTSAH0VDiRjxyckFkUAzjGVGtikM6Ln+Oz4l4TkRVwhLkN JLzBAcGIfTJaNBZ6bB82ez7brgC3YG0= X-MC-Unique: kPSueeaGOluutR4w9XKBbA-1 X-Mimecast-MFC-AGG-ID: kPSueeaGOluutR4w9XKBbA_1748791556 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791555; x=1749396355; 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=iOHxmu/DSPgZPvZMkn1J47zj3LBk3Nk/LBdtFk70RKE=; b=nP46atqxKorbX2ZFzzxBEi9lIxy3MS9hiAV7c8IlChhOSpsgXeGpdFY09kib5loa4e wzAS7C+xO82+Jdmg7pazWHYPdEuBXA6d+tIaUXNdorsRjG9aUOHBOSxnI+Cbtb65krwW OkeSHSaedfA++dtVQvoMERM3Cor9VqpyxZPppSaY+UfhaXMJg/HpGOKHIyHOsxUHc+G0 klwmFfVRoOjhrhr3x+5VmcaY9F4xEsYM9bnlGsM4/Ekl5eIKS8kp5j8DM8qIVL0MxHkV 9hwfIpcZqv1J0CP8J09SDDFFMMpVfUjX9UNmESnMBSFKu41oeLC3XTCAXRMYUB2Bj2gf b9OQ== X-Gm-Message-State: AOJu0YxE3OWYWo9f4lnR0ZAWyIbJ5wMBHlVf0YirYkLeQjcEDwImF6kx qq9/eqrpJoY6f+UpO/muyXuCbQOdI62MYTF5c0+3Hfe7b82dLzbH+toj8H0bFapXUivO/CW3Ikk HM6oJdjptcv7jw3mq803r7e+TqOhFAlwlt/S3+rRitRyHxYccmJC2HcL23vXVznpQyKdOMxBN+G qnzfOP0edtXV5peLtUA34dJXaiJgxBMn7MCQ== X-Gm-Gg: ASbGnctR68u2rCHNvfjCshaYNf0honSpJYZZja4wWMyFwk98hNE3XwQ9G3rQ8k0w/bZ KjynSAneug8/HuB3DA85QW1fOMS1ZUSUKUe5vbXyVxb/unyXSoPaEkXL93qu6Lkh+SIE6PSjhkE NLVtHxOGzO3FejaADXN3Do6tfwLw36B3NB5mnXcQ4gObSY3NWI9KI5TUBuf/py+mg9wXt23JzlW jzN38cA4obH6oh5/Jw2J14UGfXng/GrxDF/1o19qIFo7ZBkxd/aJENc6ikzOGjnr9Wcdzr78tc5 I0VSQMa6MJBubgXS X-Received: by 2002:a05:600c:5291:b0:440:54ef:dfdc with SMTP id 5b1f17b1804b1-450d8843256mr85184065e9.8.1748791555502; Sun, 01 Jun 2025 08:25:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgwoMPhijx7k/O/1H2zVl2GQJiQ25zWQ01e0OwzVFk+07yM+J+49MrKylbR9R30LuiL+rSVg== X-Received: by 2002:a05:600c:5291:b0:440:54ef:dfdc with SMTP id 5b1f17b1804b1-450d8843256mr85183855e9.8.1748791555098; Sun, 01 Jun 2025 08:25:55 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:52 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Lei Yang , Si-Wei Liu , Jason Wang , Jonah Palmer , Stefano Garzarella Subject: [PULL 27/31] vdpa: add listener_registered Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791698372116600 From: Eugenio P=C3=A9rez Check if the listener has been registered or not, so it needs to be registered again at start. Tested-by: Lei Yang Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eugenio P=C3=A9rez Signed-off-by: Jonah Palmer Message-Id: <20250522145839.59974-5-jonah.palmer@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost-vdpa.h | 6 ++++++ hw/virtio/vhost-vdpa.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h index 0a9575b469..221840987e 100644 --- a/include/hw/virtio/vhost-vdpa.h +++ b/include/hw/virtio/vhost-vdpa.h @@ -51,6 +51,12 @@ typedef struct vhost_vdpa_shared { =20 bool iotlb_batch_begin_sent; =20 + /* + * The memory listener has been registered, so DMA maps have been sent= to + * the device. + */ + bool listener_registered; + /* Vdpa must send shadow addresses as IOTLB key for data queues, not G= PA */ bool shadow_data; =20 diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index e9826ede2c..450f68f117 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -1379,7 +1379,10 @@ static int vhost_vdpa_dev_start(struct vhost_dev *de= v, bool started) "IOMMU and try again"); return -1; } - memory_listener_register(&v->shared->listener, dev->vdev->dma_as); + if (!v->shared->listener_registered) { + memory_listener_register(&v->shared->listener, dev->vdev->dma_= as); + v->shared->listener_registered =3D true; + } =20 return vhost_vdpa_add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK); } @@ -1399,6 +1402,8 @@ static void vhost_vdpa_reset_status(struct vhost_dev = *dev) vhost_vdpa_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER); memory_listener_unregister(&v->shared->listener); + v->shared->listener_registered =3D false; + } =20 static int vhost_vdpa_set_log_base(struct vhost_dev *dev, uint64_t base, --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791607; cv=none; d=zohomail.com; s=zohoarc; b=CBclCDHvCvO2hVwc4Z1EYi5jsms49pLrvSnEfS07QDeTv3LUv82E8a9kGSkeOuB23IER0vMJ/rtVhz/cHb0ZjZEOlilI7ggARpB94vVBAUPIGIiwqG7zwom1IJwilnyzx+9QkrcBuPmFi0Op0A92e1BV9XaPBPO9z4D62MXN/hI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791607; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IAQySewBx8SloVNKOXAdxhJJVB1Xqg1y29AdslpVETY=; b=NTt8+aBaXSzAWGNtbuSDj6/CtH6zn+Iod0JipaLHFh78Q202gSgX/+9I4nd7Tv2ADRNpzuJP+xhz0La1yzEtzLF5oraBXIAX1jfBfzrHcrDAYTG6VO3aQ1m06Vle7WpZL+QlFwYLqo6Rx8nDX0hEwXEDeTtz30jtYaGK4BfyOsM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791607581402.8269628367201; Sun, 1 Jun 2025 08:26:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkZs-0003cs-Lx; Sun, 01 Jun 2025 11:26:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZX-0003HM-EV for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZW-0004gs-0o for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:03 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-76-FvOkRplJP3alXuX75Wgqyw-1; Sun, 01 Jun 2025 11:26:00 -0400 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3a4f7f1b932so1836294f8f.2 for ; Sun, 01 Jun 2025 08:26:00 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7f8f188sm89607355e9.3.2025.06.01.08.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791561; 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=IAQySewBx8SloVNKOXAdxhJJVB1Xqg1y29AdslpVETY=; b=B5QiWHdgFgmxubefF5ciq0Mvyc9Gr96AX73+VO0S8fWjGhAgJ6+ErJxSNyLk8ufWMfaxGk +ltSWxkgwU5uQ7s0BP39eEcH1FYw70nGD8retr1qJiQPjCIikc5urUbJL8azNRvBWhTK+b GYq99xfbqA823V6Dv2i2iT8l0AuROxk= X-MC-Unique: FvOkRplJP3alXuX75Wgqyw-1 X-Mimecast-MFC-AGG-ID: FvOkRplJP3alXuX75Wgqyw_1748791559 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791559; x=1749396359; 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=IAQySewBx8SloVNKOXAdxhJJVB1Xqg1y29AdslpVETY=; b=iZjeKTMguOTEiwSjFhfilOc9vO4aO4LcTBNs8uS6YQquDi1dw5aUM+c8pxeI4earcq 7jukwTrdn5iEXNTRUfX2fKqy5Jir6qRtHYSOo5sOJK9gjBbs5a15oMc+rL1pqVp7RUwH A0XfSWj3wk1EcrofsA54jWlRDTWuBm5pe+el4d0ssbJXiU5trM3ouNMuL41CTMM2yGKa 0SNK/EQqRwVdJMcJfsV7kCK7Wbtvl1sVK7PWXUUumCt9Z1xYVMuj6mZ09R8QWIgDSPTL JbeaoLhTVXo/f3S6SsSipecXzK1FtnewQYpba9oI4G+MO0ut9yg0C/U3+4cFrpshixnB S0kg== X-Gm-Message-State: AOJu0YwAPea7T+VIifH5VuXJJStbB2ahEbbScrtIkLZKbe4nCXhbwd/F LyDePFRq6nqHxrwoef8UzdZ1Tip8ZvUXCp2YJSZvlHGIGY08b2CvkzwcK5b9+pgClX/Fym9riJe veTjQbU0vvRtPiJEl37WvkEKRTUa8O8diNtA6UrA9TnIhQK/ROuiNhKGSeVzhHVN7kjHK+jqfhl g5Zp/UqkwcLmDGlI77+EbX0joX0p5qYSoOjQ== X-Gm-Gg: ASbGncuM804/TO716UPe/hK07HodOWL0gulBUoaemWEm8fuDGWZ+SaTn/zS9TmiytTn Yvgfhe7Q/RY4irZH/zCw1+C8fKcn0+p/kvQwxceJlV7jsP2nTb9dZz2dYPy+Z/MK9ijezVuOYTa PvDjSAVlfgX5mH+WtHNUDNwdeD3DH8uLTBs8o6jfxRbYlB2yBBosLLai5QAv/tjThmwCAy22lh2 Nkjv59FesdgcPzbFKGRFGrB/v6aRN3L0+KdK5lVvJaeTW4S1aC7cLFLj+upVtcBuCZWZWIgvpOT dxDykw== X-Received: by 2002:a05:6000:220d:b0:3a3:4baa:3f3d with SMTP id ffacd0b85a97d-3a4fe154f5bmr3345749f8f.6.1748791558964; Sun, 01 Jun 2025 08:25:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhNPdPvfIEFhKvRLZWGylYG9MfuTqUug660UFI2s8TsbqTM4TXdNswoR4+vV/eGNsbwakL8A== X-Received: by 2002:a05:6000:220d:b0:3a3:4baa:3f3d with SMTP id ffacd0b85a97d-3a4fe154f5bmr3345727f8f.6.1748791558536; Sun, 01 Jun 2025 08:25:58 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:55 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Lei Yang , Si-Wei Liu , Jason Wang , Jonah Palmer , Stefano Garzarella Subject: [PULL 28/31] vdpa: reorder listener assignment Message-ID: <0e8b3b44e9dfa8f2b05313b9d19eb1fb622945b8.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791609357116600 From: Eugenio P=C3=A9rez Since commit f6fe3e333f ("vdpa: move memory listener to vhost_vdpa_shared") this piece of code repeatedly assign shared->listener members. This was not a problem as it was not used until device start. However next patches move the listener registration to this vhost_vdpa_init function. When the listener is registered it is added to an embedded linked list, so setting its members again will cause memory corruption to the linked list node. Do the right thing and only set it in the first vdpa device. Tested-by: Lei Yang Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eugenio P=C3=A9rez Signed-off-by: Jonah Palmer Message-Id: <20250522145839.59974-6-jonah.palmer@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 450f68f117..de834f2ebd 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -633,7 +633,6 @@ static int vhost_vdpa_init(struct vhost_dev *dev, void = *opaque, Error **errp) =20 v->dev =3D dev; dev->opaque =3D opaque ; - v->shared->listener =3D vhost_vdpa_memory_listener; =20 ret =3D vhost_vdpa_set_backend_cap(dev); if (unlikely(ret !=3D 0)) { @@ -675,6 +674,7 @@ static int vhost_vdpa_init(struct vhost_dev *dev, void = *opaque, Error **errp) vhost_vdpa_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER); =20 + v->shared->listener =3D vhost_vdpa_memory_listener; return 0; } =20 --=20 MST From nobody Sat Feb 7 13:50:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791997; cv=none; d=zohomail.com; s=zohoarc; b=kq4Yld8JVrdUoTCxDZfc5k+9/iTkPNasFacIsWpnqluWPCwBVbfZZnDFZOOtND44IAIT78sGyGrNOgfX+QkNOhwPDA79IOCl1Z7YZ2sxlFTdQKglAuCNydw4N7FUJy+TYHGemOURiNUZ3AvmKjZ6f0mmaB/1DwzdWDalWwFy/qA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791997; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kwblXR8nhghJfmmOV1A/vOPLGOORroiZAipr6mzYif0=; b=k+ih4hMmx+eS1Qty3eXODskznbjgCoMo9SYwBG4RGeyNtLNUKE23FT34Vuwy6LCd9LGvr1on73+Fpt2xpdr3j5Y7yVMTQvWoPP28CKUrajSiiSLSSG8+f1WDoUycJpYGv+bfa530acE7ejP+XG/o8hl8BnjGil3UaZRsNh+Lc+w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791997533507.3905286845445; Sun, 1 Jun 2025 08:33:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLka1-0003rZ-49; Sun, 01 Jun 2025 11:26:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZe-0003KT-G8 for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZb-0004hA-N8 for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:09 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-126-7O6_xdQTM1eSza8wc0hF8Q-1; Sun, 01 Jun 2025 11:26:05 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3a4eb6fcd88so2219833f8f.1 for ; Sun, 01 Jun 2025 08:26:05 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-450d7f8eceasm88604985e9.7.2025.06.01.08.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791567; 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=kwblXR8nhghJfmmOV1A/vOPLGOORroiZAipr6mzYif0=; b=KUEHHVZ4FYNMNDja1MmcOyuvBOB6AQVoErniTopqZf+QJr1REg/YXsXYqSHwxYYX6eyLwr TpvnBJ/pH0X5pKHx5+zBMTKtH2nEoJZyXk76ks1JI481/RrbLp8GXmFGzA0tF8D9vqmnR9 ow/235jeBNbQg25bLqYle8KyBvI9xMY= X-MC-Unique: 7O6_xdQTM1eSza8wc0hF8Q-1 X-Mimecast-MFC-AGG-ID: 7O6_xdQTM1eSza8wc0hF8Q_1748791564 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791564; x=1749396364; 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=kwblXR8nhghJfmmOV1A/vOPLGOORroiZAipr6mzYif0=; b=G2kJCvcyVTdXTX5nr/40Z8LFrnzZpDyyBOqW+SMh4Kw/NqmoJFRb8aLbyVC7LElk8b VeU7bIlNibrnW+BabkYXh2T2z6FjV9+Y9y7/XTKp/f5Va394XklcNgQi8VFHo9ZySyzB Y7k0veaxEcaVE0jgf39bWo3mw/oXbmbJbhXbGGAP+4K5h4eEmCi2fL20mCDPeCGGdrai d34XDEI4LUipaZVHAA10EKFlwN0YrhVAAZ4Ks+lilkLmL2OXKRnm4MAiE55NREiCCl21 wdu3rV338yrfW3Vvy/hgGmhrAfIbkXH3nT2bt7W4QMkpZuVlAWgX+fHby+65j6hVvpuW T0wg== X-Gm-Message-State: AOJu0Yz0y8UfuKEDYo7arScZBIZ2nxIal437FPWGj+Jt0Vnr0NdHZWno A8epxCVATbsheeatNz0DnMM8UI5oT+aLmbuQstY1PSHgyR0kmG2YnnyAB++0wesDcgeLoVqkes1 3o+ZXZVKcZbrWiPFr3ifmnW7p7H2G/ESBvgcEtPi5z9L8oU6I2v2/EY6s1iNEXQKAztVXacKBnf 1ER0EfgdcSrNB+LB4UAWf2Z5N1h18ir9vEpw== X-Gm-Gg: ASbGncvayxOhAk3M1aujvVVM0L+Jco6j8IylmS9zmBp69luDqWvCnGCcA0j/4cTqLAE iA0SGCUXqsjoa/PLpI2YqDG7N189r8E4XfFnw/kgnjAQXkLQ1WjZ8rv+si91oLM2KmTwDcwhe3q 0wWqp+EUj6X/Ve6xj6Y6csHbyuEc8BPZtCYRS8/kCKEdjiBgsmIgJX9uL6/r+8bLo9c3zKJvYbq DaY6VMoG0aHx31Y7YvMCVfHuQgml3genR4pYGazTi7WT4l1ksWbJOlVOLA0E/eCUHxpf+a4gS+k rI17ww== X-Received: by 2002:a05:6000:2008:b0:3a4:cfbf:51ae with SMTP id ffacd0b85a97d-3a4fe154ecfmr3770229f8f.4.1748791563636; Sun, 01 Jun 2025 08:26:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3ajmpWOSOacybeulf9x/QRFjv7ffKxo4Z/GkRUc0eVlAlutWA6CAJnwlIR4yXAqKz8FO9ZQ== X-Received: by 2002:a05:6000:2008:b0:3a4:cfbf:51ae with SMTP id ffacd0b85a97d-3a4fe154ecfmr3770204f8f.4.1748791563126; Sun, 01 Jun 2025 08:26:03 -0700 (PDT) Date: Sun, 1 Jun 2025 11:25:58 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Lei Yang , Si-Wei Liu , Jason Wang , Jonah Palmer , Stefano Garzarella Subject: [PULL 29/31] vdpa: move iova_tree allocation to net_vhost_vdpa_init Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791997953116600 From: Eugenio P=C3=A9rez As we are moving to keep the mapping through all the vdpa device life instead of resetting it at VirtIO reset, we need to move all its dependencies to the initialization too. In particular devices with x-svq=3Don need a valid iova_tree from the beginning. Simplify the code also consolidating the two creation points: the first data vq in case of SVQ active and CVQ start in case only CVQ uses it. Tested-by: Lei Yang Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Suggested-by: Si-Wei Liu Signed-off-by: Eugenio P=C3=A9rez Signed-off-by: Jonah Palmer Message-Id: <20250522145839.59974-7-jonah.palmer@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost-vdpa.h | 16 ++++++++++++++- net/vhost-vdpa.c | 36 +++------------------------------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h index 221840987e..449bf5c840 100644 --- a/include/hw/virtio/vhost-vdpa.h +++ b/include/hw/virtio/vhost-vdpa.h @@ -43,7 +43,21 @@ typedef struct vhost_vdpa_shared { struct vhost_vdpa_iova_range iova_range; QLIST_HEAD(, vdpa_iommu) iommu_list; =20 - /* IOVA mapping used by the Shadow Virtqueue */ + /* + * IOVA mapping used by the Shadow Virtqueue + * + * It is shared among all ASID for simplicity, whether CVQ shares ASID= with + * guest or not: + * - Memory listener need access to guest's memory addresses allocated= in + * the IOVA tree. + * - There should be plenty of IOVA address space for both ASID not to + * worry about collisions between them. Guest's translations are st= ill + * validated with virtio virtqueue_pop so there is no risk for the g= uest + * to access memory that it shouldn't. + * + * To allocate a iova tree per ASID is doable but it complicates the c= ode + * and it is not worth it for the moment. + */ VhostIOVATree *iova_tree; =20 /* Copy of backend features */ diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index decb826868..58d738945d 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -235,6 +235,7 @@ static void vhost_vdpa_cleanup(NetClientState *nc) return; } qemu_close(s->vhost_vdpa.shared->device_fd); + g_clear_pointer(&s->vhost_vdpa.shared->iova_tree, vhost_iova_tree_dele= te); g_free(s->vhost_vdpa.shared); } =20 @@ -362,16 +363,8 @@ static int vdpa_net_migration_state_notifier(NotifierW= ithReturn *notifier, =20 static void vhost_vdpa_net_data_start_first(VhostVDPAState *s) { - struct vhost_vdpa *v =3D &s->vhost_vdpa; - migration_add_notifier(&s->migration_state, vdpa_net_migration_state_notifier); - - /* iova_tree may be initialized by vhost_vdpa_net_load_setup */ - if (v->shadow_vqs_enabled && !v->shared->iova_tree) { - v->shared->iova_tree =3D vhost_iova_tree_new(v->shared->iova_range= .first, - v->shared->iova_range.l= ast); - } } =20 static int vhost_vdpa_net_data_start(NetClientState *nc) @@ -418,19 +411,12 @@ static int vhost_vdpa_net_data_load(NetClientState *n= c) static void vhost_vdpa_net_client_stop(NetClientState *nc) { VhostVDPAState *s =3D DO_UPCAST(VhostVDPAState, nc, nc); - struct vhost_dev *dev; =20 assert(nc->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_VDPA); =20 if (s->vhost_vdpa.index =3D=3D 0) { migration_remove_notifier(&s->migration_state); } - - dev =3D s->vhost_vdpa.dev; - if (dev->vq_index + dev->nvqs =3D=3D dev->vq_index_end) { - g_clear_pointer(&s->vhost_vdpa.shared->iova_tree, - vhost_iova_tree_delete); - } } =20 static NetClientInfo net_vhost_vdpa_info =3D { @@ -602,24 +588,6 @@ out: return 0; } =20 - /* - * If other vhost_vdpa already have an iova_tree, reuse it for simplic= ity, - * whether CVQ shares ASID with guest or not, because: - * - Memory listener need access to guest's memory addresses allocated= in - * the IOVA tree. - * - There should be plenty of IOVA address space for both ASID not to - * worry about collisions between them. Guest's translations are st= ill - * validated with virtio virtqueue_pop so there is no risk for the g= uest - * to access memory that it shouldn't. - * - * To allocate a iova tree per ASID is doable but it complicates the c= ode - * and it is not worth it for the moment. - */ - if (!v->shared->iova_tree) { - v->shared->iova_tree =3D vhost_iova_tree_new(v->shared->iova_range= .first, - v->shared->iova_range.l= ast); - } - r =3D vhost_vdpa_cvq_map_buf(&s->vhost_vdpa, s->cvq_cmd_out_buffer, vhost_vdpa_net_cvq_cmd_page_len(), false); if (unlikely(r < 0)) { @@ -1728,6 +1696,8 @@ static NetClientState *net_vhost_vdpa_init(NetClientS= tate *peer, s->vhost_vdpa.shared->device_fd =3D vdpa_device_fd; s->vhost_vdpa.shared->iova_range =3D iova_range; s->vhost_vdpa.shared->shadow_data =3D svq; + s->vhost_vdpa.shared->iova_tree =3D vhost_iova_tree_new(iova_range= .first, + iova_range.l= ast); } else if (!is_datapath) { s->cvq_cmd_out_buffer =3D mmap(NULL, vhost_vdpa_net_cvq_cmd_page_l= en(), PROT_READ | PROT_WRITE, --=20 MST From nobody Sat Feb 7 13:50:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791611; cv=none; d=zohomail.com; s=zohoarc; b=ZiiIJsjz2rMTL7X375yEUkdbyxGaVxdHkUq9e2hdMCwDgMQVuKloapsiAoYF/otgbtrtZdEFxDjPRDUeRohpYME+pKYRzlBP6mYQ0e0j9ZS/UaISXtoN7robpN4qXuWgQ0izLFJGWUfLTPPIWZxDxhiDwVZ58CtiOhkamxnwheI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791611; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZPyR+kdxKaWeyjstcc9d1CRAs5zwrN33s5qY/Fih3ks=; b=B5Ja+JItNyhIbNEMF0If2d9rzPAJxX+JeoMovdx5NHK+TwfYgcM7VOkHf0L8HLBWJvwggwAaqFu2QiNoMTp5Z4wvmD0lG0mownNO5AttfR6DlzQq04Vydc6qpWN+zGUCeZW0Zy47q20xsF/W/Ek6YvJ1SYTsPqYORJT+INlNQkw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791610946657.2604007632548; Sun, 1 Jun 2025 08:26:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLka7-0003vx-2x; Sun, 01 Jun 2025 11:26:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZg-0003QM-6H for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZe-0004hV-Al for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:11 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-634-PRVdb3RzORWXUubz01mI3g-1; Sun, 01 Jun 2025 11:26:08 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3a4f7ebfd00so1054622f8f.2 for ; Sun, 01 Jun 2025 08:26:08 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f0097539sm12029877f8f.63.2025.06.01.08.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791569; 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=ZPyR+kdxKaWeyjstcc9d1CRAs5zwrN33s5qY/Fih3ks=; b=h0EZ0lVr/fBGUO+6c7iHGqGG+3R5qUhkC1LrwateAQGHdjROVuNG3FQfCrfFPAc9YuNO3/ ztIzfwke704P+psRmgkAVX+7v3oZMoP2raAmpZ8xNqou0OpQLEuIQ4p12LFSlhHWXFILAr +LydfxB3hBeIXv7nV/DBto/rh1cvHe0= X-MC-Unique: PRVdb3RzORWXUubz01mI3g-1 X-Mimecast-MFC-AGG-ID: PRVdb3RzORWXUubz01mI3g_1748791567 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791566; x=1749396366; 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=ZPyR+kdxKaWeyjstcc9d1CRAs5zwrN33s5qY/Fih3ks=; b=svQQnxv6BCUWZJf7V8+yAA05e755uyRpclSJ6vYj+SyMRRrErpm/yt98M/nqvRMwbB K7l4CPDFgSXE0d+/nfCoSx+7Ny5rc763ATM8+i3UWxIB6sNbGbJqCcnaqLCxBAQpXlyt bDllhECj3DcFlGHLGrYEdVM0i8lERq3sKvfm55ahWCo8qXSr0C/sRIg31/EHldLM1Qtb ar2fEgQHFEoXO8wTF0nLNw5c5nNCHooKc0R2oeGkRNJ2pfguCaP2gDMca59jxvAEJt87 7MIxQL/cgCbmbce7pSDEogNhjBtoES0YLdvT3wARMXBwlX/sK+ZVEuey4kbsHHWngwx0 zG1w== X-Gm-Message-State: AOJu0YyCAcCWOgj5o3cEGOONaQ5rIFudCTo+kdEp6dEGEPb3DqQN1C6w zbf5GiN9X6u4VC6bf7mGLv9YH6EdOflQNycbhoRBoHb8VVB+Uwc/rn7SbEq8NRyTuBN/dPFuZsx i3pOAAYkM7aZ5d+h9IE1f+qWtQGl89/i6fAO8/Sve8EQQ/y6wvicrLtFyljztqlK4pHtmy/mLYk KN8i00xigqGgUkoHyxdBNBN6fx0gEUZ39Krg== X-Gm-Gg: ASbGnctd3hf5dd/3/U9dnLyK77Kf99n7AFo+RoQxO+PA0m+rsiqIR4yhuFpbCSRFQwC B0/siby3//UVsXrdkw/vBRf5CIXCFbAHBB3Cm9MrcfraOJgSs27CVhtoDCVjPJVLx+sUalmi8dR RxnaBhVZ93tcPXe0BbFEP6WzXMZYQUz/yzHgj7mOqW0il396t3Q4T0WkpY57ABj6IBy8UIG1LFQ pXa6pGJ4hCDztxyoM6vXi38ZmJwKwHcQyBkEw5jaX55vBD46y4VV4HbfLLMUqvtZbzQ3W8O1djL 4PXwKw== X-Received: by 2002:a05:6000:26d3:b0:3a3:621a:d3c5 with SMTP id ffacd0b85a97d-3a4f7a4c833mr7455792f8f.19.1748791566341; Sun, 01 Jun 2025 08:26:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH34UJRUQ84l+D6D73hUS5iIPauyby9ho/o1kVsDEUbWM6KWIm47qz09GbGf3m7rMBUqaF6lQ== X-Received: by 2002:a05:6000:26d3:b0:3a3:621a:d3c5 with SMTP id ffacd0b85a97d-3a4f7a4c833mr7455766f8f.19.1748791565812; Sun, 01 Jun 2025 08:26:05 -0700 (PDT) Date: Sun, 1 Jun 2025 11:26:03 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eugenio =?utf-8?B?UMOpcmV6?= , Lei Yang , Si-Wei Liu , Jason Wang , Jonah Palmer , Stefano Garzarella Subject: [PULL 30/31] vdpa: move memory listener register to vhost_vdpa_init Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791613387116600 From: Eugenio P=C3=A9rez Current memory operations like pinning may take a lot of time at the destination. Currently they are done after the source of the migration is stopped, and before the workload is resumed at the destination. This is a period where neigher traffic can flow, nor the VM workload can continue (downtime). We can do better as we know the memory layout of the guest RAM at the destination from the moment that all devices are initializaed. So moving that operation allows QEMU to communicate the kernel the maps while the workload is still running in the source, so Linux can start mapping them. As a small drawback, there is a time in the initialization where QEMU cannot respond to QMP etc. By some testing, this time is about 0.2seconds. This may be further reduced (or increased) depending on the vdpa driver and the platform hardware, and it is dominated by the cost of memory pinning. This matches the time that we move out of the called downtime window. The downtime is measured as the elapsed trace time between the last vhost_vdpa_suspend on the source and the last vhost_vdpa_set_vring_enable_o= ne on the destination. In other words, from "guest CPUs freeze" to the instant the final Rx/Tx queue-pair is able to start moving data. Using ConnectX-6 Dx (MLX5) NICs in vhost-vDPA mode with 8 queue-pairs, the series reduces guest-visible downtime during back-to-back live migrations by more than half: - 39G VM: 4.72s -> 2.09s (-2.63s, ~56% improvement) - 128G VM: 14.72s -> 5.83s (-8.89s, ~60% improvement) Tested-by: Lei Yang Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eugenio P=C3=A9rez Signed-off-by: Jonah Palmer Message-Id: <20250522145839.59974-8-jonah.palmer@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-vdpa.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index de834f2ebd..e20da95f30 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -894,8 +894,14 @@ static int vhost_vdpa_reset_device(struct vhost_dev *d= ev) =20 ret =3D vhost_vdpa_call(dev, VHOST_VDPA_SET_STATUS, &status); trace_vhost_vdpa_reset_device(dev); + if (ret) { + return ret; + } + + memory_listener_unregister(&v->shared->listener); + v->shared->listener_registered =3D false; v->suspended =3D false; - return ret; + return 0; } =20 static int vhost_vdpa_get_vq_index(struct vhost_dev *dev, int idx) @@ -1379,6 +1385,11 @@ static int vhost_vdpa_dev_start(struct vhost_dev *de= v, bool started) "IOMMU and try again"); return -1; } + if (v->shared->listener_registered && + dev->vdev->dma_as !=3D v->shared->listener.address_space) { + memory_listener_unregister(&v->shared->listener); + v->shared->listener_registered =3D false; + } if (!v->shared->listener_registered) { memory_listener_register(&v->shared->listener, dev->vdev->dma_= as); v->shared->listener_registered =3D true; @@ -1392,8 +1403,6 @@ static int vhost_vdpa_dev_start(struct vhost_dev *dev= , bool started) =20 static void vhost_vdpa_reset_status(struct vhost_dev *dev) { - struct vhost_vdpa *v =3D dev->opaque; - if (!vhost_vdpa_last_dev(dev)) { return; } @@ -1401,9 +1410,6 @@ static void vhost_vdpa_reset_status(struct vhost_dev = *dev) vhost_vdpa_reset_device(dev); vhost_vdpa_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER); - memory_listener_unregister(&v->shared->listener); - v->shared->listener_registered =3D false; - } =20 static int vhost_vdpa_set_log_base(struct vhost_dev *dev, uint64_t base, @@ -1537,12 +1543,27 @@ static int vhost_vdpa_get_features(struct vhost_dev= *dev, =20 static int vhost_vdpa_set_owner(struct vhost_dev *dev) { + int r; + struct vhost_vdpa *v; + if (!vhost_vdpa_first_dev(dev)) { return 0; } =20 trace_vhost_vdpa_set_owner(dev); - return vhost_vdpa_call(dev, VHOST_SET_OWNER, NULL); + r =3D vhost_vdpa_call(dev, VHOST_SET_OWNER, NULL); + if (unlikely(r < 0)) { + return r; + } + + /* + * Being optimistic and listening address space memory. If the device + * uses vIOMMU, it is changed at vhost_vdpa_dev_start. + */ + v =3D dev->opaque; + memory_listener_register(&v->shared->listener, &address_space_memory); + v->shared->listener_registered =3D true; + return 0; } =20 static int vhost_vdpa_vq_get_addr(struct vhost_dev *dev, --=20 MST From nobody Sat Feb 7 13:50:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1748791785; cv=none; d=zohomail.com; s=zohoarc; b=Ua7ITI9GxcPYWRuZQroJK5+ToLuKv+hJ3ez3gPIeL+MQwbNT7ImuZC0y1InOyRr8LHjcz5eVODqqApN9/W0tCm9jWa6IP0ZfRp7fMthLwJEjgPHwdn2D0rq/sz8XpKvI49xQiUtP6eI4Y5mwRCktklj3ly/bjlXoKGp89k99Jac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748791785; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4TjJ1BjUENeOU9LZAYs1WRacDJvsrt+ES/22xQa6J1E=; b=HIM+3fEQw9961V0wc4sgq5rIRgbS7LpjMIcRwPF0K2m9AciXNFzxTY8MGyQZBPY7MMaU/1jtwBL05ftzqTniy3wTvLC3V+NhDIwty/GtQ0+4Qx7SNbvLW2PG2hjpw0MS5pjLu6Rm2QgWUe04k/j0mnj81RqagSQOh64j73A3oiA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1748791785453907.3701001566743; Sun, 1 Jun 2025 08:29:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLkaN-0004Gp-0l; Sun, 01 Jun 2025 11:26:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZj-0003TY-8u for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLkZh-0004ho-GL for qemu-devel@nongnu.org; Sun, 01 Jun 2025 11:26:15 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-391-sa57sDyGPrmro-2dBqdIpw-1; Sun, 01 Jun 2025 11:26:10 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-3a4f6e0c285so1597975f8f.0 for ; Sun, 01 Jun 2025 08:26:10 -0700 (PDT) Received: from redhat.com ([2a0d:6fc0:1517:1000:ea83:8e5f:3302:3575]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4f00a13fasm11894616f8f.98.2025.06.01.08.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jun 2025 08:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748791572; 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=4TjJ1BjUENeOU9LZAYs1WRacDJvsrt+ES/22xQa6J1E=; b=h44AnyVLZnxQ3Me55VdwjENr4F+nSJr1k3XpyphuszMc7m4j/JDUIfmOEvhxG/ACEUtW6b xuEMqMRXSIsOQf6D0lP5/JT3I43yaWlKzDY8UoSBvjUfIECBEQDGTDJosuud3DpScn/UBI 9/2yz9KPU2IBCh4OhHs+sFFid7at4i8= X-MC-Unique: sa57sDyGPrmro-2dBqdIpw-1 X-Mimecast-MFC-AGG-ID: sa57sDyGPrmro-2dBqdIpw_1748791569 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748791569; x=1749396369; 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=4TjJ1BjUENeOU9LZAYs1WRacDJvsrt+ES/22xQa6J1E=; b=Auso8JQZH6+ZZAGYTttbk2TJe3dLR/WHoXab6q6G8ow/a5/oa89DsrscItgcvBrjy4 Ks7RblB4KnllUiunoMC5vznjQ8q7LmJG0xStlPLwMUVZfAYILTUGapugZ8HGbXxg09AR W1mx/3CV880IVlr4pEr663eBk5h2ljpB2eFcPAH2Up5qqEx9ygGE5LppY9ZNtJpZQmtJ jWHTuwRSzkdHCOB/sVFJyUWSbC09m6Y4I8OkOAAKMAd0LLCeIt7D0HoGCedmL9MxQYP0 tZmZ4aSq/o7QyfCdTGkq5ILoI+gBnB3Xz0zhiwi3L7YkEPqu7FtGkDfQy1XA5Uv9wX8/ nnqg== X-Gm-Message-State: AOJu0Ywq4stDjWHiLE5R7wuuNl23za6UHkOZLnoOhapyjkmRyQruLLli cBt0LJPJzZjiPu4enrHkn/JxDhKx3IXAXtwNDyi53B3PHcaO8R5nHjy2LXKP5NeoRHaAva0+cqs 2gJNbJpm9gy4o+5dRQo6U/73Uk23pktpSH4Oq5vIHIjzhLfZZHE4Z0IuLOyz9hBkhQ1QDiO3IaV Qt+Ax/n3boclUM1eD1ICz4rN6mBPX2iiVt4w== X-Gm-Gg: ASbGncuq40vo7zHvRobkd2YMVFMgaxL7ah3m3a0Vf37t/EKaImy3CkKvxlJjVK+VVb6 ge/UFrBPH8O6hf0TxVuYcg5AgfSwF5lQwoyE94IQsZ2cej1eUsR0NKUy+D5gnmmKKn+QoUnZ9om fe3X6QIai3qNE4each5HAxKZnhDOqNrjOli615cemSV5gmUothZu46SfYTq+DpGSwmRn7gbASNz FyL39+H67EEqO3lF5dAn/tIYaYRMS+Ni3TQ9cikhR3FVqzXi1jcggn5HXjP6C8Ha50BBE636qXb xzZTkQ== X-Received: by 2002:a05:6000:144e:b0:3a4:d6ed:8e2e with SMTP id ffacd0b85a97d-3a4fe395675mr4347568f8f.41.1748791568730; Sun, 01 Jun 2025 08:26:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESnHibAtNr3A74JoQfn32vkr5JAQNcwmgVwhVqOkHIod5U8ozRD6lrXbgDHvT2OUuutzSV8A== X-Received: by 2002:a05:6000:144e:b0:3a4:d6ed:8e2e with SMTP id ffacd0b85a97d-3a4fe395675mr4347547f8f.41.1748791568297; Sun, 01 Jun 2025 08:26:08 -0700 (PDT) Date: Sun, 1 Jun 2025 11:26:06 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , Mark Cave-Ayland , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 31/31] hw/i386/pc_piix: Fix RTC ISA IRQ wiring of isapc machine Message-ID: <1c5771c092742b729e2a640be184a0f48c0b2cdb.1748791463.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.071, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1748791787509116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bernhard Beschow Commit 56b1f50e3c10 ("hw/i386/pc: Wire RTC ISA IRQs in south bridges") attempted to refactor RTC IRQ wiring which was previously done in pc_basic_device_init() but forgot about the isapc machine. Fix this by wiring in the code section dedicated exclusively to the isapc machine. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2961 Fixes: 56b1f50e3c10 ("hw/i386/pc: Wire RTC ISA IRQs in south bridges") cc: qemu-stable Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Message-Id: <20250526203820.1853-1-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/pc_piix.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 0dce512f18..6b6359ef65 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -285,6 +285,8 @@ static void pc_init1(MachineState *machine, const char = *pci_type) pcms->idebus[0] =3D qdev_get_child_bus(dev, "ide.0"); pcms->idebus[1] =3D qdev_get_child_bus(dev, "ide.1"); } else { + uint32_t irq; + isa_bus =3D isa_bus_new(NULL, system_memory, system_io, &error_abort); isa_bus_register_input_irqs(isa_bus, x86ms->gsi); @@ -292,6 +294,9 @@ static void pc_init1(MachineState *machine, const char = *pci_type) x86ms->rtc =3D isa_new(TYPE_MC146818_RTC); qdev_prop_set_int32(DEVICE(x86ms->rtc), "base_year", 2000); isa_realize_and_unref(x86ms->rtc, isa_bus, &error_fatal); + irq =3D object_property_get_uint(OBJECT(x86ms->rtc), "irq", + &error_fatal); + isa_connect_gpio_out(ISA_DEVICE(x86ms->rtc), 0, irq); =20 i8257_dma_init(OBJECT(machine), isa_bus, 0); pcms->hpet_enabled =3D false; --=20 MST