From nobody Sat Feb 7 19:46: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=1762699022; cv=none; d=zohomail.com; s=zohoarc; b=TFdglVQrYZzIQcuS3Tnvl9AwBFqTv6F7yfbUbX5BoUZxUqIpeoNWNzKNEqKuHgkJ2YkzEstjwxn4U6PwO6QtK0jH9iGVeywRoiJsa+/C2XWvfx1FiEUd9ZERRBh8aOd0oMoMdTpjijT30PLhSok+H1Z8NEM25K+X6BVyc6VxFyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762699022; 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=kLrQ88WZDwAcR3Mzm912ehvptStqn0wqkOuGdl4uI/M=; b=goEOxKD2+5paEdiZf364OZS8yEHzx6Q5vO+OdTPgAH7HitVMZE3PrxxM8OYXYNburCcq5wd7sOpfis2FepAqzpXq9fanezBl2RnNoO7TU8w6obqDXDgXmbloAgo3SPNnX6WBI1sGdpJUyKE8J0rx/+7pFzHbvYIT6jUrNSXp/vk= 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 1762699022961959.7925436417006; Sun, 9 Nov 2025 06:37:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6Vi-00027Z-SU; Sun, 09 Nov 2025 09:35:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vg-000278-KO for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vf-0001ls-7w for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:16 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-156-23kI1nTcNb2WzY1Cfeu55Q-1; Sun, 09 Nov 2025 09:35:13 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-47113538d8cso12068755e9.1 for ; Sun, 09 Nov 2025 06:35:13 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4776bd084d4sm191347015e9.14.2025.11.09.06.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698914; 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=kLrQ88WZDwAcR3Mzm912ehvptStqn0wqkOuGdl4uI/M=; b=YeVItanOk0TF4hK8sdOhusgeoaaH+yJEOHOAbGbTRM4z4EQzIldzAwH1uDaqGgvMRV9CU7 dcwg+Y0HqjSqt0XeSdtrmAKMZsuakbYAOyFoWTlbRVb0Pe5SaQH1O4+N+bGIenKr5vcwEo XYp70qZlqOh33eFyblhVTi02xrBoAqU= X-MC-Unique: 23kI1nTcNb2WzY1Cfeu55Q-1 X-Mimecast-MFC-AGG-ID: 23kI1nTcNb2WzY1Cfeu55Q_1762698912 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698912; x=1763303712; darn=nongnu.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=kLrQ88WZDwAcR3Mzm912ehvptStqn0wqkOuGdl4uI/M=; b=tE6l6g3n16QU4YHIqdMGpiSRCWwmRXYfOll5IZ0/k7XwZ28sfI2t8aAZdoGl8rms0H kuuwCc3jQsCpnovMXfeYU5lBOKz6L22fd8tXZuLvLOxhZGp6MOG8QFeXQtGXbvl/8wEO lswvnLjABfCmVavA6fzl8RNMpKenRBsmsP5cEeAz/Tt6yCPFB4AW3inrA6Y2wveujySY z2g9eYxptFI+hlh9QLmgKCLBnJwT9pqM2X+9Psjp6GlMVihqSHwBHnq3co5DDGartLIM PDacRbu+9Zt8ILIbcPMdV46YySeyPfTzwNb22e8CuptvQtVui6lY2u3grjcHX2+42/UV MoVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698912; x=1763303712; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kLrQ88WZDwAcR3Mzm912ehvptStqn0wqkOuGdl4uI/M=; b=v5dJ+xKazGi85zDGPHi+IMWAw9RB1aag0jC5L2/UVgVSY5gAw+4hlyi1OYE02D7bUX icQsLkmwDEMJWqVCTRoouKpjrxKktPQpr9ocd0bQHEM4qf7ytbYmQcFHDporbsoMtCal Zl+PFN2jfiGkr7oyvwCyA1/AjEsUzcsDAobWdkD4jqBfudNvnkQi8Nt+jVblUDs8bIXL 4FVdRXqUCvlC0kx16vPR4HIRG/j5uEShbterKBxUrcnW96E068hYG0IT0OrP2GKsA26e ZY2YY0h+hkZeWRyginsjgiULcLHasoGnsRbKI65VGvksPeq929RHYB0RosoryZWvvXJP WoHw== X-Gm-Message-State: AOJu0Yzo81CvgNbCU71EWJzhQ7xwtJw27ekIGFoX5/utuBmEbj9o5rjk YE9cc/CBzgnIACNqEwGWSF8grlLU/gpqliODhPylrNMAq1HuJ39zB9nwwb7W1F0vguouiAz+e6w BPGFVO2dvw3VXu56YJdxxA2cJwsaPRhugXFFkASAcdcQe/4v8O/dwYhHCBbSphYtDNTR883wFl8 fuU6oimBWZHKo+L6CT1FphDbmyhYu4z5XcqQ== X-Gm-Gg: ASbGncubbFl/J9/v1/fwLBOos2br7ceO1xvuNCds0ZojoJHhUAM/+RrYJJk3wpQ5gP8 HxHPbb0FHLGiKNHInsCyZyecTA2dZeWwRKrox3+jBGTAYZaNURC8PTNFOWn8YOL7O+ios7ybfxb 0NijTknS72o/HBR6v5981qcgvB4HG01mdO/c1F1wuMRxzLb5A/n96N/D6zQzB5wFkfxnaQ/CayL SFApDlyX3JZ2NQ4hAChLp+1Fpipfs/iHfNi3sBN9TMi8nBArUPAXTZcmnlIPrVcHsJLW37JPHGA B2o7cmQQsRNy3EGpVm+Zm+WtqhNQ74bHjrpL5ETpxHH3QhvcnISjR64qt+gRb+rkPD0= X-Received: by 2002:a05:600c:5486:b0:477:be4:7a52 with SMTP id 5b1f17b1804b1-477732ab255mr33995855e9.39.1762698911764; Sun, 09 Nov 2025 06:35:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjnHZTt4hD/6t+a2dD4hhT+lY3dZX9tHEO+UR855BggP0AohsVGR3ab/BM2Hg3UM1UUGGVIg== X-Received: by 2002:a05:600c:5486:b0:477:be4:7a52 with SMTP id 5b1f17b1804b1-477732ab255mr33995605e9.39.1762698911216; Sun, 09 Nov 2025 06:35:11 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:09 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alejandro Jimenez , =?utf-8?Q?C=C3=A9dric?= Le Goater , Sairaj Kodilkar , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Thomas Huth , Pierrick Bouvier , Richard Henderson Subject: [PULL 01/14] MAINTAINERS: Update entry for AMD-Vi Emulation Message-ID: <0f1f73bb37bb9e93d108e044224ecad9e4ecb3a5.1762698873.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699023301158500 From: Alejandro Jimenez Add myself as maintainer and Sairaj Kodilkar as reviewer. Reviewed-by: C=C3=A9dric Le Goater Acked-by: Sairaj Kodilkar Signed-off-by: Alejandro Jimenez Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251103203209.645434-2-alejandro.j.jimenez@oracle.com> --- MAINTAINERS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index be6efff80c..9cb181e1da 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3933,8 +3933,10 @@ F: tests/functional/x86_64/test_intel_iommu.py F: tests/qtest/intel-iommu-test.c =20 AMD-Vi Emulation -S: Orphan -F: hw/i386/amd_iommu.? +M: Alejandro Jimenez +R: Sairaj Kodilkar +S: Supported +F: hw/i386/amd_iommu* =20 OpenSBI Firmware L: qemu-riscv@nongnu.org --=20 MST From nobody Sat Feb 7 19:46: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=1762698965; cv=none; d=zohomail.com; s=zohoarc; b=GVn/0+NlA9erfgDH4RsKSrTPdJE7iiTxG7Lp8IrsO84M1HKRgP/I7cLo9zPIE5Jc/+LwF0jjpBGoakdnWEkJkNThHGjQugmHcOll6RNRH8KojTYwEu74BuYFUYPTcodsJb1sToBhYseMggDAr3zHghYvWHX3TzfQZQIbfsF4sk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762698965; 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=S4RPxn+BrMAAyfaECnJprzVKGlgFZx0NU1mbO1FNzso=; b=JgshT9uUf4e8PPP3b6cfCWvddPX0in+e9VzSIN0iUW+uCLlMzBBhR9X/8qpIUIDVh7uQuWmgJVljlUhAXcJw5i6sKpeVL3geBQX4bWYrjEzLgQEZZvS8MlXInl7FVTLQzCSBK4bLNNqbM0FbH9BQ/v+DAHF/Q3Cfph8POI//Xbw= 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 1762698965316270.26598777086747; Sun, 9 Nov 2025 06:36:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6Vm-00028q-Nq; Sun, 09 Nov 2025 09:35:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vk-00028E-GL for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vi-0001mG-EU for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:20 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-437-TEPwiV8MOhCm3dZ9hKL_Fg-1; Sun, 09 Nov 2025 09:35:16 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4775e54a70aso22330125e9.0 for ; Sun, 09 Nov 2025 06:35:16 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47763e16db8sm87314415e9.1.2025.11.09.06.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698917; 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=S4RPxn+BrMAAyfaECnJprzVKGlgFZx0NU1mbO1FNzso=; b=Y6HjARGB2qiYbaoVBR13YevUtT+5CkY7dNlpUbGXhKBs6PWVWhgkErrPKqDrh5Rb6kjK+z nFK7h9mD7dhz3tzSDe5grdbKE3zKVBPanz/lmpI+t2rYP7lrHUJG9mY0RqrjzRKKwlEazc AnLJcN782i1/rXHpwUgcMgSG6h8SJGM= X-MC-Unique: TEPwiV8MOhCm3dZ9hKL_Fg-1 X-Mimecast-MFC-AGG-ID: TEPwiV8MOhCm3dZ9hKL_Fg_1762698915 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698915; x=1763303715; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=S4RPxn+BrMAAyfaECnJprzVKGlgFZx0NU1mbO1FNzso=; b=BxXsDuofmqstRccb3Zy0P7cywuWuMyB4rVyPvlhF7XKgp66yJMhg7b/Ia2/DUQ/UVz jRgb/XSbRGoz7/TdioXr62JdnyzPCrEbuUOpKR9Fi+wkf+EYsGmEb31ixvWCEirQ9ho3 ZFSYca9lhJCuLs+IgG71x6IxATeMTZd2QQLIteHCgdgepa1KBaWZ04FB7LBRrHhEeTGj +80ObWuGx1UmkuxY82f8SmNxhKhf0wLFpqL/uxO6RnQI112nG8BwpIBFArd0/klKXhJD 9eutSDK5GbYB8RZ0IkI3BphkJ4fgHudAsAGy0StYf0/wQFsJlL0gtFO9YDODwjZfIcWp 1cvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698915; x=1763303715; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S4RPxn+BrMAAyfaECnJprzVKGlgFZx0NU1mbO1FNzso=; b=KU1bAANQZNFkH5H5n7LJGtZm5mdKgIrVN3Q3RRKr0NdpS5JvnZY8Ugv8NlHCgAFBzT cX113FzzhYrPOZsAQpatzBvG3L95M9w+RAv3mKrzHfmIiz4+bmLVVJ6UNxLwHEgM7a7X 1b/VIdNzQ7Swf3++w5JGWTdRjU6kOFSCnH9Z2FLjBKAEgquaH30qtLt309k1fv0yYfzk +T8ldGksUhLFrJWnYYFqGsJoZoLLvF024a4p38EWfLAMOmwPH80S6QdZZUKH7mniVt8Y k/uh20KuPClZUmbTrVGUK4bALbTwz3aLGpz5NGub9L95PhuvDQw8ajg3TydFe6eGQ7js OLnA== X-Gm-Message-State: AOJu0YzxBhEIJkXbwS7m7qDzy1/MktNV+QXJ7RDMXAowO9BWAfs6WMPs DEu7N0M+ZF+CgDmzEuP7/DNPqpN2qCltoi5qn3gA1raaIG3ZHpoWXkvIhQkcXut6siC5x1alRqz Wr8LQBmvsMwALlQkdsPWiaJtSypo2JdVcIK2PnsXgTII/YyyrO+35UUq5H6FgJZrW34BOW8HQtU PqbXjr2AE9FKR2BNDKORH2n8rTHUdpOzzAPA== X-Gm-Gg: ASbGncvNmp4Jm02njTBbw3IrN9D3E/l04LXvC8dRqIInlU5TqPKZnllYqFvYLUicTJL 8bn7aVXNhQ+35Rdls70iTaakJeFJU27O3AwaYTTv8JafwEhDHPaTTQD9vbIK47P3AN0RoVG9JR/ 2C9lsy1sr1nepof5noVaQ/N7oz7wINU9P2v/vhLyxNsvmE93n2ZQ0WolSDQeHwJ/JCpiNZJvoDI vd4FdqQBQLwa+gZ/k4zL/UtGf2osUvHmyAodlIPtY/tBv2PyGf7mXGBIMKNrRgyHe0EgPgiUQFh C81xO/PPulsuyVvBKJu+KI2VssDF+EbmSHG7ePKXJyxw0wFTxLFpqKYmgbgw3WdTYp0= X-Received: by 2002:a05:600c:1987:b0:477:1bb6:17de with SMTP id 5b1f17b1804b1-47773290dcamr50103005e9.30.1762698914855; Sun, 09 Nov 2025 06:35:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFumogiHNZKFZIdVCHqsXBUzsWfcc20UY1bCk26tCrWvtDbc1S3VjsmneaAOxOOi5njERyTLA== X-Received: by 2002:a05:600c:1987:b0:477:1bb6:17de with SMTP id 5b1f17b1804b1-47773290dcamr50102675e9.30.1762698914218; Sun, 09 Nov 2025 06:35:14 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:11 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Sairaj Kodilkar , Alexey Kardashevskiy , Vasant Hegde , Alejandro Jimenez , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 02/14] amd_iommu: Fix handling of devices on buses != 0 Message-ID: <27d6a0ec0beec45c35a70cd5f12c4530725dda2a.1762698873.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762698967210158500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sairaj Kodilkar The AMD IOMMU is set up at boot time and uses PCI bus numbers + devfn for indexing into the DTE. The problem is that before the guest starts, all PCI bus numbers are 0 as no PCI discovery has happened yet (BIOS and/or kernel will do that later), so relying on the bus number is wrong. The immediate effect is that emulated devices cannot do DMA when placed on a bus other than 0. Replace the static address_space array with a hash table keyed by devfn and PCIBus*, since these values do not change after the guest boots. Co-developed-by: Alexey Kardashevskiy Signed-off-by: Alexey Kardashevskiy Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde Reviewed-by: Alejandro Jimenez Tested-by: Alejandro Jimenez Signed-off-by: Alejandro Jimenez Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251103203209.645434-3-alejandro.j.jimenez@oracle.com> --- hw/i386/amd_iommu.h | 2 +- hw/i386/amd_iommu.c | 134 ++++++++++++++++++++++++++------------------ 2 files changed, 79 insertions(+), 57 deletions(-) diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index daf82fc85f..38471b95d1 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -408,7 +408,7 @@ struct AMDVIState { bool mmio_enabled; =20 /* for each served device */ - AMDVIAddressSpace **address_spaces[PCI_BUS_MAX]; + GHashTable *address_spaces; =20 /* list of address spaces with registered notifiers */ QLIST_HEAD(, AMDVIAddressSpace) amdvi_as_with_notifiers; diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 378e0cb55e..5c5cfd4989 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -59,7 +59,7 @@ const char *amdvi_mmio_high[] =3D { }; =20 struct AMDVIAddressSpace { - uint8_t bus_num; /* bus number */ + PCIBus *bus; /* PCIBus (for bus number) */ uint8_t devfn; /* device function */ AMDVIState *iommu_state; /* AMDVI - one per machine */ MemoryRegion root; /* AMDVI Root memory map region */ @@ -101,6 +101,11 @@ typedef enum AMDVIFaultReason { AMDVI_FR_PT_ENTRY_INV, /* Failure to read PTE from guest memory */ } AMDVIFaultReason; =20 +typedef struct AMDVIAsKey { + PCIBus *bus; + uint8_t devfn; +} AMDVIAsKey; + uint64_t amdvi_extended_feature_register(AMDVIState *s) { uint64_t feature =3D AMDVI_DEFAULT_EXT_FEATURES; @@ -382,6 +387,44 @@ static guint amdvi_uint64_hash(gconstpointer v) return (guint)*(const uint64_t *)v; } =20 +static gboolean amdvi_as_equal(gconstpointer v1, gconstpointer v2) +{ + const AMDVIAsKey *key1 =3D v1; + const AMDVIAsKey *key2 =3D v2; + + return key1->bus =3D=3D key2->bus && key1->devfn =3D=3D key2->devfn; +} + +static guint amdvi_as_hash(gconstpointer v) +{ + const AMDVIAsKey *key =3D v; + guint bus =3D (guint)(uintptr_t)key->bus; + + return (guint)(bus << 8 | (guint)key->devfn); +} + +static AMDVIAddressSpace *amdvi_as_lookup(AMDVIState *s, PCIBus *bus, + uint8_t devfn) +{ + const AMDVIAsKey key =3D { .bus =3D bus, .devfn =3D devfn }; + return g_hash_table_lookup(s->address_spaces, &key); +} + +static gboolean amdvi_find_as_by_devid(gpointer key, gpointer value, + gpointer user_data) +{ + const AMDVIAsKey *as =3D key; + const uint16_t *devidp =3D user_data; + + return *devidp =3D=3D PCI_BUILD_BDF(pci_bus_num(as->bus), as->devfn); +} + +static AMDVIAddressSpace *amdvi_get_as_by_devid(AMDVIState *s, uint16_t de= vid) +{ + return g_hash_table_find(s->address_spaces, + amdvi_find_as_by_devid, &devid); +} + static AMDVIIOTLBEntry *amdvi_iotlb_lookup(AMDVIState *s, hwaddr addr, uint64_t devid) { @@ -551,7 +594,7 @@ static inline uint64_t amdvi_get_pte_entry(AMDVIState *= s, uint64_t pte_addr, =20 static int amdvi_as_to_dte(AMDVIAddressSpace *as, uint64_t *dte) { - uint16_t devid =3D PCI_BUILD_BDF(as->bus_num, as->devfn); + uint16_t devid =3D PCI_BUILD_BDF(pci_bus_num(as->bus), as->devfn); AMDVIState *s =3D as->iommu_state; =20 if (!amdvi_get_dte(s, devid, dte)) { @@ -1011,25 +1054,15 @@ static void amdvi_switch_address_space(AMDVIAddress= Space *amdvi_as) */ static void amdvi_reset_address_translation_all(AMDVIState *s) { - AMDVIAddressSpace **iommu_as; + AMDVIAddressSpace *iommu_as; + GHashTableIter as_it; =20 - for (int bus_num =3D 0; bus_num < PCI_BUS_MAX; bus_num++) { + g_hash_table_iter_init(&as_it, s->address_spaces); =20 - /* Nothing to do if there are no devices on the current bus */ - if (!s->address_spaces[bus_num]) { - continue; - } - iommu_as =3D s->address_spaces[bus_num]; - - for (int devfn =3D 0; devfn < PCI_DEVFN_MAX; devfn++) { - - if (!iommu_as[devfn]) { - continue; - } - /* Use passthrough as default mode after reset */ - iommu_as[devfn]->addr_translation =3D false; - amdvi_switch_address_space(iommu_as[devfn]); - } + while (g_hash_table_iter_next(&as_it, NULL, (void **)&iommu_as)) { + /* Use passthrough as default mode after reset */ + iommu_as->addr_translation =3D false; + amdvi_switch_address_space(iommu_as); } } =20 @@ -1089,27 +1122,15 @@ static void enable_nodma_mode(AMDVIAddressSpace *as) */ static void amdvi_update_addr_translation_mode(AMDVIState *s, uint16_t dev= id) { - uint8_t bus_num, devfn, dte_mode; + uint8_t dte_mode; AMDVIAddressSpace *as; uint64_t dte[4] =3D { 0 }; int ret; =20 - /* - * Convert the devid encoded in the command to a bus and devfn in - * order to retrieve the corresponding address space. - */ - bus_num =3D PCI_BUS_NUM(devid); - devfn =3D devid & 0xff; - - /* - * The main buffer of size (AMDVIAddressSpace *) * (PCI_BUS_MAX) has a= lready - * been allocated within AMDVIState, but must be careful to not access - * unallocated devfn. - */ - if (!s->address_spaces[bus_num] || !s->address_spaces[bus_num][devfn])= { + as =3D amdvi_get_as_by_devid(s, devid); + if (!as) { return; } - as =3D s->address_spaces[bus_num][devfn]; =20 ret =3D amdvi_as_to_dte(as, dte); =20 @@ -1783,7 +1804,7 @@ static void amdvi_do_translate(AMDVIAddressSpace *as,= hwaddr addr, bool is_write, IOMMUTLBEntry *ret) { AMDVIState *s =3D as->iommu_state; - uint16_t devid =3D PCI_BUILD_BDF(as->bus_num, as->devfn); + uint16_t devid =3D PCI_BUILD_BDF(pci_bus_num(as->bus), as->devfn); AMDVIIOTLBEntry *iotlb_entry =3D amdvi_iotlb_lookup(s, addr, devid); uint64_t entry[4]; int dte_ret; @@ -1858,7 +1879,7 @@ static IOMMUTLBEntry amdvi_translate(IOMMUMemoryRegio= n *iommu, hwaddr addr, } =20 amdvi_do_translate(as, addr, flag & IOMMU_WO, &ret); - trace_amdvi_translation_result(as->bus_num, PCI_SLOT(as->devfn), + trace_amdvi_translation_result(pci_bus_num(as->bus), PCI_SLOT(as->devf= n), PCI_FUNC(as->devfn), addr, ret.translated_addr); return ret; } @@ -2222,30 +2243,28 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *b= us, void *opaque, int devfn) { char name[128]; AMDVIState *s =3D opaque; - AMDVIAddressSpace **iommu_as, *amdvi_dev_as; - int bus_num =3D pci_bus_num(bus); + AMDVIAddressSpace *amdvi_dev_as; + AMDVIAsKey *key; =20 - iommu_as =3D s->address_spaces[bus_num]; + amdvi_dev_as =3D amdvi_as_lookup(s, bus, devfn); =20 /* allocate memory during the first run */ - if (!iommu_as) { - iommu_as =3D g_new0(AMDVIAddressSpace *, PCI_DEVFN_MAX); - s->address_spaces[bus_num] =3D iommu_as; - } - - /* set up AMD-Vi region */ - if (!iommu_as[devfn]) { + if (!amdvi_dev_as) { snprintf(name, sizeof(name), "amd_iommu_devfn_%d", devfn); =20 - iommu_as[devfn] =3D g_new0(AMDVIAddressSpace, 1); - iommu_as[devfn]->bus_num =3D (uint8_t)bus_num; - iommu_as[devfn]->devfn =3D (uint8_t)devfn; - iommu_as[devfn]->iommu_state =3D s; - iommu_as[devfn]->notifier_flags =3D IOMMU_NOTIFIER_NONE; - iommu_as[devfn]->iova_tree =3D iova_tree_new(); - iommu_as[devfn]->addr_translation =3D false; + amdvi_dev_as =3D g_new0(AMDVIAddressSpace, 1); + key =3D g_new0(AMDVIAsKey, 1); =20 - amdvi_dev_as =3D iommu_as[devfn]; + amdvi_dev_as->bus =3D bus; + amdvi_dev_as->devfn =3D (uint8_t)devfn; + amdvi_dev_as->iommu_state =3D s; + amdvi_dev_as->notifier_flags =3D IOMMU_NOTIFIER_NONE; + amdvi_dev_as->iova_tree =3D iova_tree_new(); + amdvi_dev_as->addr_translation =3D false; + key->bus =3D bus; + key->devfn =3D devfn; + + g_hash_table_insert(s->address_spaces, key, amdvi_dev_as); =20 /* * Memory region relationships looks like (Address range shows @@ -2288,7 +2307,7 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bus= , void *opaque, int devfn) =20 amdvi_switch_address_space(amdvi_dev_as); } - return &iommu_as[devfn]->as; + return &amdvi_dev_as->as; } =20 static const PCIIOMMUOps amdvi_iommu_ops =3D { @@ -2329,7 +2348,7 @@ static int amdvi_iommu_notify_flag_changed(IOMMUMemor= yRegion *iommu, if (!s->dma_remap && (new & IOMMU_NOTIFIER_MAP)) { error_setg_errno(errp, ENOTSUP, "device %02x.%02x.%x requires dma-remap=3D1", - as->bus_num, PCI_SLOT(as->devfn), PCI_FUNC(as->devfn)); + pci_bus_num(as->bus), PCI_SLOT(as->devfn), PCI_FUNC(as->devfn)= ); return -ENOTSUP; } =20 @@ -2510,6 +2529,9 @@ static void amdvi_sysbus_realize(DeviceState *dev, Er= ror **errp) s->iotlb =3D g_hash_table_new_full(amdvi_uint64_hash, amdvi_uint64_equal, g_free, g_free); =20 + s->address_spaces =3D g_hash_table_new_full(amdvi_as_hash, + amdvi_as_equal, g_free, g_free); + /* set up MMIO */ memory_region_init_io(&s->mr_mmio, OBJECT(s), &mmio_mem_ops, s, "amdvi-mmio", AMDVI_MMIO_SIZE); --=20 MST From nobody Sat Feb 7 19:46: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=1762699002; cv=none; d=zohomail.com; s=zohoarc; b=lfs3kZMjJQeAnVr18N42r+kp3LJWbvQSjG0E0zDDc18CrBVZ9Ct4JL1HPyxsRfZN7RUOoXS8qkKf8bdlYHkzbQSiBtjjzT97NFo2myDLlfBED0cOfBf+sD5L20goBsKCRnbjnqYWc3s9TPGZu/qMN2XXXdcT162dHImUlGUYaGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762699002; 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=xlzluGzx7auUP3YqO2kjwqtM8LvQRyJhDsEvxP82Pm4=; b=W1peNaD0JffxmHIXir7dhMZNUwbyWfAvFlkz3tuGpswS+6jKcFX+4h71QtVBgZsKrgaAm1lUIZGv7pAOshIA9rZGb6LyToBTeUDVL9QML/ZJYbrHngNMa+Dn0qY2aJve1vUegrX5ourARfiKj3gMENqCjC8Sk2YnlRLhgbB2kvQ= 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 1762699002190295.4440415465508; Sun, 9 Nov 2025 06:36:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6Vo-00029L-H0; Sun, 09 Nov 2025 09:35:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vm-00028s-Tp for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vl-0001mU-3H for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:22 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-N-mDW7oZM3qgmlw61mP4NQ-1; Sun, 09 Nov 2025 09:35:18 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-46e47d14dceso10618805e9.2 for ; Sun, 09 Nov 2025 06:35:18 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b2fb308f5sm8657371f8f.42.2025.11.09.06.35.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698919; 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=xlzluGzx7auUP3YqO2kjwqtM8LvQRyJhDsEvxP82Pm4=; b=bjvJkMbLc8ML7HxpCq2Zx4TQpUarmYusjPhj2SDETyAk0Fctnx+Ze6Ygiukn4K56zbX/QO Jpfr+No4VFdIUApI9cAFCqTTBS6jjaVR5TiMM1IOWXtsgfeHpWGtQKrJGA+AQZUDsfc9aA h0qX57W43L3NgGd9Z1f1YXEczJFGr8M= X-MC-Unique: N-mDW7oZM3qgmlw61mP4NQ-1 X-Mimecast-MFC-AGG-ID: N-mDW7oZM3qgmlw61mP4NQ_1762698917 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698917; x=1763303717; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xlzluGzx7auUP3YqO2kjwqtM8LvQRyJhDsEvxP82Pm4=; b=RSpccAueORIK4s9ZkD/sxHzbzaOzqcx4yk5EfJ8zmSPyRq4yLph/eTc5loWtAzs0G7 wPjJ1vzoPXr5DywM1cP9Kn/WRc4uOqHyJC842YCf8Kz6HgoGRfvTuuHHrO0iRlqNdjg5 8NdrssCHbyV+rGKxcmqYLikkSL56rvTNUaF/g4gAVdjDN0fh3iQ7e+DwKd4mMEcJCwtS XeoevO6SZCn2vHaOEXoZQ8XMFf/KVR8RXCH2ch1sTQCcxDFzCcDZDeJPMlciEZAoSYiw sBx1MuCRDdRLxoq8NiwqU0Um76HordAVIZt8hXbvnyhsXAnRn9YEA4ZXyANwvXhwx2FT BcaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698917; x=1763303717; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xlzluGzx7auUP3YqO2kjwqtM8LvQRyJhDsEvxP82Pm4=; b=IqCd1zBZ6wcofHGQkda5Wq55+E49Sgl8gj4L+tdSxJK1BATi51lKGJl9ViIuQKIG7d XxHf1bkJ5Ur4ImbBCLmTP4+1L+OjkouhQMN6qXLmh8wLD8Pa8XE2k8dIn5rkaiK7U4Ao Gem4k9YKSEwXPtAjDHl576MGu0c93N7JdjG9mJ3ig0sBNrDAWzREIKZJHEwFO9itzZzN 8JkWDYWbXtLgN6ss+COOQQPebKahnheCzFwjHs/uTPNYKtr4pnTOpZ+G5nY0UT2EJp6A K3YTSuDo7weWYg2w6/FKs1zp+Xg2m7vRDDNzKEVlzaX44uO+Kil/QqBPlmr3UkvlKrMt VMOA== X-Gm-Message-State: AOJu0YzrxR22toSIOGVQq8NNMTl50O0cZeAfJe8tm5wYnjNxpy3P+CsI bN5+Qd5qMz0IaMSTyJk7CJfYhuvByaihlh5hbEbEQVTsnGD8QyUxIvRoGn3eW4YEaqMKq6rpFUf zbv/BY+cREUPeA/kpfGyTXUUJIE2uSFQRukQKhjt2C3mWuorkwtpUyxFp+dGzfLCc649YcOFWFE a11+Qpk+YLY/XPqbJ3SzYwC6K/hFlLBeiHbw== X-Gm-Gg: ASbGncu0LjcN/12QtkWPHjpJq2RDreIJLbCa3arIesPucXAZM//VKOjGI9wNZqkWm4i 8Y4v3BEPbcpWe5km0+tm19fhDjZEQl8rU0U6hXHzS32ivWye1yYME8GvTAYVAgJP2W6V9Cb0soh SdDfM277NT+ViW9eX3yrjt7rvxS5P5nTaML//+39B4r4901CU3LFqBG4ph7y1kBWJkd0ub0QqqK I2BYUck7QnLiJ2JY36a91A9KlIieBvoAW/ub7CSh3Z6K2Lw4fhZjKrfeuSyApIuBTExbeE6jFA1 H64eNUg6NCzqng2bsI9/fjsV1Xnnsbq3IpcKn2UmVL8YB7hte5Uhr0fA3VjVQpz73rA= X-Received: by 2002:a05:600c:45cf:b0:477:7b16:5fa6 with SMTP id 5b1f17b1804b1-4777b16628emr10215185e9.3.1762698916875; Sun, 09 Nov 2025 06:35:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyb/lF3WWnMNiqHos/VZyw7RvULl6ERJhsA2N1X8NB+2c1XkxHtR+PwxPWbgyQwUZrTQPMMA== X-Received: by 2002:a05:600c:45cf:b0:477:7b16:5fa6 with SMTP id 5b1f17b1804b1-4777b16628emr10214945e9.3.1762698916348; Sun, 09 Nov 2025 06:35:16 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:14 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Sairaj Kodilkar , Vasant Hegde , Alejandro Jimenez , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 03/14] amd_iommu: Support 64-bit address for IOTLB lookup Message-ID: <637dc49a3ae6b72cdb6415dcdcdb22ff770f2c8d.1762698873.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699003086158500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sairaj Kodilkar The physical AMD IOMMU supports up to 64 bits of IOVA. When a device tries to read or write from a given DMA address, the IOMMU translates the address using the I/O page tables assigned to that device. Since the emulated IOMMU uses per-device page tables, an ideal cache tag would need to be 68 bits (64-bit address - 12-bit page alignment + 16-bit device ID). The current software IOTLB implementation uses a GLib hash table with a 64-bit key to hash both the IOVA and device ID, which limits the IOVA to 60 bits. This causes a failure while setting up the device when a guest is booted with "iommu.forcedac=3D1", which forces the use of DMA addresses at = the top of the 64-bit address space. To address this issue, construct the 64-bit hash key using the upper 52 bits of IOVA (GFN) and lower 12 bits of the device ID to avoid truncation as much as possible (reducing hash collisions). Fixes: d29a09ca6842 ("hw/i386: Introduce AMD IOMMU") Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde Reviewed-by: Alejandro Jimenez Tested-by: Alejandro Jimenez Signed-off-by: Alejandro Jimenez Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251103203209.645434-4-alejandro.j.jimenez@oracle.com> --- hw/i386/amd_iommu.h | 4 ++-- hw/i386/amd_iommu.c | 57 ++++++++++++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index 38471b95d1..302ccca512 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -220,8 +220,8 @@ #define PAGE_SIZE_PTE_COUNT(pgsz) (1ULL << ((ctz64(pgsz) - 12) % 9)) =20 /* IOTLB */ -#define AMDVI_IOTLB_MAX_SIZE 1024 -#define AMDVI_DEVID_SHIFT 36 +#define AMDVI_IOTLB_MAX_SIZE 1024 +#define AMDVI_GET_IOTLB_GFN(addr) (addr >> AMDVI_PAGE_SHIFT_4K) =20 /* default extended feature */ #define AMDVI_DEFAULT_EXT_FEATURES \ diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 5c5cfd4989..d689a06eca 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -106,6 +106,11 @@ typedef struct AMDVIAsKey { uint8_t devfn; } AMDVIAsKey; =20 +typedef struct AMDVIIOTLBKey { + uint64_t gfn; + uint16_t devid; +} AMDVIIOTLBKey; + uint64_t amdvi_extended_feature_register(AMDVIState *s) { uint64_t feature =3D AMDVI_DEFAULT_EXT_FEATURES; @@ -377,16 +382,6 @@ static void amdvi_log_pagetab_error(AMDVIState *s, uin= t16_t devid, PCI_STATUS_SIG_TARGET_ABORT); } =20 -static gboolean amdvi_uint64_equal(gconstpointer v1, gconstpointer v2) -{ - return *((const uint64_t *)v1) =3D=3D *((const uint64_t *)v2); -} - -static guint amdvi_uint64_hash(gconstpointer v) -{ - return (guint)*(const uint64_t *)v; -} - static gboolean amdvi_as_equal(gconstpointer v1, gconstpointer v2) { const AMDVIAsKey *key1 =3D v1; @@ -425,11 +420,30 @@ static AMDVIAddressSpace *amdvi_get_as_by_devid(AMDVI= State *s, uint16_t devid) amdvi_find_as_by_devid, &devid); } =20 +static gboolean amdvi_iotlb_equal(gconstpointer v1, gconstpointer v2) +{ + const AMDVIIOTLBKey *key1 =3D v1; + const AMDVIIOTLBKey *key2 =3D v2; + + return key1->devid =3D=3D key2->devid && key1->gfn =3D=3D key2->gfn; +} + +static guint amdvi_iotlb_hash(gconstpointer v) +{ + const AMDVIIOTLBKey *key =3D v; + /* Use GPA and DEVID to find the bucket */ + return (guint)(key->gfn << AMDVI_PAGE_SHIFT_4K | + (key->devid & ~AMDVI_PAGE_MASK_4K)); +} + + static AMDVIIOTLBEntry *amdvi_iotlb_lookup(AMDVIState *s, hwaddr addr, uint64_t devid) { - uint64_t key =3D (addr >> AMDVI_PAGE_SHIFT_4K) | - ((uint64_t)(devid) << AMDVI_DEVID_SHIFT); + AMDVIIOTLBKey key =3D { + .gfn =3D AMDVI_GET_IOTLB_GFN(addr), + .devid =3D devid, + }; return g_hash_table_lookup(s->iotlb, &key); } =20 @@ -451,8 +465,10 @@ static gboolean amdvi_iotlb_remove_by_devid(gpointer k= ey, gpointer value, static void amdvi_iotlb_remove_page(AMDVIState *s, hwaddr addr, uint64_t devid) { - uint64_t key =3D (addr >> AMDVI_PAGE_SHIFT_4K) | - ((uint64_t)(devid) << AMDVI_DEVID_SHIFT); + AMDVIIOTLBKey key =3D { + .gfn =3D AMDVI_GET_IOTLB_GFN(addr), + .devid =3D devid, + }; g_hash_table_remove(s->iotlb, &key); } =20 @@ -463,8 +479,10 @@ static void amdvi_update_iotlb(AMDVIState *s, uint16_t= devid, /* don't cache erroneous translations */ if (to_cache.perm !=3D IOMMU_NONE) { AMDVIIOTLBEntry *entry =3D g_new(AMDVIIOTLBEntry, 1); - uint64_t *key =3D g_new(uint64_t, 1); - uint64_t gfn =3D gpa >> AMDVI_PAGE_SHIFT_4K; + AMDVIIOTLBKey *key =3D g_new(AMDVIIOTLBKey, 1); + + key->gfn =3D AMDVI_GET_IOTLB_GFN(gpa); + key->devid =3D devid; =20 trace_amdvi_cache_update(domid, PCI_BUS_NUM(devid), PCI_SLOT(devid= ), PCI_FUNC(devid), gpa, to_cache.translated_addr); @@ -477,7 +495,8 @@ static void amdvi_update_iotlb(AMDVIState *s, uint16_t = devid, entry->perms =3D to_cache.perm; entry->translated_addr =3D to_cache.translated_addr; entry->page_mask =3D to_cache.addr_mask; - *key =3D gfn | ((uint64_t)(devid) << AMDVI_DEVID_SHIFT); + entry->devid =3D devid; + g_hash_table_replace(s->iotlb, key, entry); } } @@ -2526,8 +2545,8 @@ static void amdvi_sysbus_realize(DeviceState *dev, Er= ror **errp) } } =20 - s->iotlb =3D g_hash_table_new_full(amdvi_uint64_hash, - amdvi_uint64_equal, g_free, g_free); + s->iotlb =3D g_hash_table_new_full(amdvi_iotlb_hash, + amdvi_iotlb_equal, g_free, g_free); =20 s->address_spaces =3D g_hash_table_new_full(amdvi_as_hash, amdvi_as_equal, g_free, g_free); --=20 MST From nobody Sat Feb 7 19:46: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=1762699036; cv=none; d=zohomail.com; s=zohoarc; b=Qh7HASUvM2WV1ZPbdG7SKyeTyePdrYmyZ/XaNTN2n0xm49ZdrvPy01yK89Qp/JdKFmIJmQWWpqhoH/sjxhkO8i/07iaC8YjItotsSzXIeqKNFGf+VQwof9wbLC9phD59jqfcplAn5kj5haiPyQ4346xY3ti9F26m0M37HOIzGCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762699036; 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=Pt3iK4k3XJgwCHPG4a0Z+4Zt+KSBFtaVquZ5c/VlL5E=; b=G7ToXRWd/RXpT7EOH3pNA2eP7poKREMVkC+ZJSmPjy4U+GnOiVm3tCDeeM90hZx8ZoRW8c5BkWKESzJfflSzwEsxD2EGbV/wEuPylr+fAqRgKXAzYuSpE3ioXWGn9y9hbYWUxM0D3LjJrMbDETUv8ZSjdIRJr6EX2B/iIa4tx7o= 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 1762699036720201.96826827612892; Sun, 9 Nov 2025 06:37:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6Vq-00029w-4N; Sun, 09 Nov 2025 09:35:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vo-00029W-KP for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vn-0001mk-4B for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:24 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-278-HkSkFu0dNEaiUcDlO8PR6Q-1; Sun, 09 Nov 2025 09:35:20 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-47496b3c1dcso16572265e9.3 for ; Sun, 09 Nov 2025 06:35:20 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47763e170ecsm87914155e9.2.2025.11.09.06.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698922; 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=Pt3iK4k3XJgwCHPG4a0Z+4Zt+KSBFtaVquZ5c/VlL5E=; b=Pn9bypKN+a2LRKgC707sxRkzon6RFXNcytj1ERGntXBSTzhzWCwGPfcpL6PP38NybTdyE1 V3wtWj8X02esZRnOuG5mLmWfulkRL9TCfLL8bKID/EDFwnpSPA2hBMUA5Ik3HGpoiykb+a P4I1XGoDP2km9KP3LUczyhnmi347RXw= X-MC-Unique: HkSkFu0dNEaiUcDlO8PR6Q-1 X-Mimecast-MFC-AGG-ID: HkSkFu0dNEaiUcDlO8PR6Q_1762698919 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698919; x=1763303719; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Pt3iK4k3XJgwCHPG4a0Z+4Zt+KSBFtaVquZ5c/VlL5E=; b=JVdMkAIPsOD03kq3A1MRvLaUphwQvFa/C9mAnVwphC00Bgnj4ZZNsfkbD2OcMZ6wgx LExaTax1AWERKdZpcI8RxETOfuoZGMgKb6ZFSJP8snFheCzvJgrQly1SKQrEhdg3+F0k KTJvIzi3wJURs5xUYBRHV4Q57shgcp3Gs818NF6FbIwQajTBzGLh+oC1Wa8yFrJBrXfd vd3rQt+BDSCw0S2UotT3bL121iavhDyCmfgaAFmJgl3K1Vb8uPUNoLnPKWsW8j4tbaPI Gr97QxJpO1DjLZ3ZmI6Tyah+KhmBLfPncT3J0AX9Y8NbJXOcLf27GMUZGgZnwsGDB29j AZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698919; x=1763303719; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pt3iK4k3XJgwCHPG4a0Z+4Zt+KSBFtaVquZ5c/VlL5E=; b=P+UI/LeobP0lkJ+vOmkAHew4RB7ELTxUpy/tIP3J2JvivefosyU8zpIsOZkBPMPqYJ 9/PLpxhx5KFSFgBIr8VgE3V110gg+gx2balX/g7RUFnkraJ4tnhpy1mZ4VcgK6khUTh2 P50NQcCD2yVFW1DujKPqYOdAnOG4/EiflHNKxadwVy9FM1XAtKKH705P3GlFc7a8+KOE Y/Ug275YdeMCdF6cxbMv068GbeyLjbVJFEl6MNWMthf1LzTYGcHjkFO1QRa4be7R1OQU 0hI9Fa0m3vb2ph/f93sIPpeA0QArpDaOOLq9d0ckHjlaam8N9rw6YS6bW1CMawZUCAxn bfYg== X-Gm-Message-State: AOJu0Ywy9cS7kNmf0lcaA/IUyVS9TywgDC1VqvJcMutyh5LyG3YnjpLe ZHJUkYHFz84q3btL0ohiGFPk69zfGOGsAZxjRVhAKe34fMCRfXu7BaFVJdgn1qsY4YOZNP460Ri n1rJja5nxUhKL3GxfJ6JIGrWPtR+5t7pUuSfXnJkaAGK1fK/JC7+ZxFvXV7Sx/jmpZ73Jb24ka7 D9QlUYhiLe3ERP4xvnl/ePuc9SwBCtiFWI4g== X-Gm-Gg: ASbGncsgXR7DEo2Ld40NBkall/Zse4A99ebbV3b+BY5CkmiPEcsZjIL8jFWmrJOSwZc lpAsYzpyu6ArWO1SBbofPBXurDIas/U0baHv/Cf1ekJyz0iNRGpiKnf4ZKmIS83oGd/M6LE6KbB 93fjoQsIipRwdocu2aTviBd/N6Fg9YvGSQIod5X0fKB/Dzwv+cmec4eMEcA/dbXHKTCmcMqHTfp O2Nl1nSPWgV0yibm1rReIoF/MKJyeffyyn0xluP+3uWNQSxlaVWBP8n1yP+++73Nm+JrtDXEqDX W5Qar8XQe0oYw1tk+bJHOmIAZGY99y4k6zkCNBVPMz0i6MiG2UXga/nzAdQPkZ+pAS8= X-Received: by 2002:a05:600c:468e:b0:477:63b5:7148 with SMTP id 5b1f17b1804b1-477732298bbmr41798115e9.6.1762698918990; Sun, 09 Nov 2025 06:35:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVd3ngk0MBEx6uqvnrG/1n3mpzGOuiPvXoHFf2jzbyDF+3R4HArGNg6Pv6SIanSiXG3yBsEg== X-Received: by 2002:a05:600c:468e:b0:477:63b5:7148 with SMTP id 5b1f17b1804b1-477732298bbmr41797785e9.6.1762698918244; Sun, 09 Nov 2025 06:35:18 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:16 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Albert Esteve , qemu-stable@nongnu.org, Stefano Garzarella Subject: [PULL 04/14] vhost-user: fix shared object lookup handler logic 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699037540158500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Albert Esteve Refactor backend_read() function and add a reply_ack variable to have the option for handlers to force tweak whether they should send a reply or not without depending on VHOST_USER_NEED_REPLY_MASK flag. This fixes an issue with vhost_user_backend_handle_shared_object_lookup() logic, as the error path was not closing the backend channel correctly. So, we can remove the reply call from within the handler, make sure it returns early on errors as other handlers do and set the reply_ack variable on backend_read() to true to ensure that it will send a response, thus keeping the original intent. Fixes: 1609476662 ("vhost-user: add shared_object msg") Cc: qemu-stable@nongnu.org Signed-off-by: Albert Esteve Reviewed-by: Stefano Garzarella Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251017072011.1874874-2-aesteve@redhat.com> --- hw/virtio/vhost-user.c | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index aac98f898a..4b0fae12ae 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1668,14 +1668,6 @@ static bool vhost_user_send_resp(QIOChannel *ioc, Vh= ostUserHeader *hdr, return !qio_channel_writev_all(ioc, iov, ARRAY_SIZE(iov), errp); } =20 -static bool -vhost_user_backend_send_dmabuf_fd(QIOChannel *ioc, VhostUserHeader *hdr, - VhostUserPayload *payload, Error **errp) -{ - hdr->size =3D sizeof(payload->u64); - return vhost_user_send_resp(ioc, hdr, payload, errp); -} - int vhost_user_get_shared_object(struct vhost_dev *dev, unsigned char *uui= d, int *dmabuf_fd) { @@ -1716,19 +1708,15 @@ int vhost_user_get_shared_object(struct vhost_dev *= dev, unsigned char *uuid, =20 static int vhost_user_backend_handle_shared_object_lookup(struct vhost_user *u, - QIOChannel *ioc, - VhostUserHeader *hdr, - VhostUserPayload *payload) + VhostUserShared *object) { QemuUUID uuid; CharFrontend *chr =3D u->user->chr; - Error *local_err =3D NULL; int dmabuf_fd =3D -1; int fd_num =3D 0; =20 - memcpy(uuid.data, payload->object.uuid, sizeof(payload->object.uuid)); + memcpy(uuid.data, object->uuid, sizeof(object->uuid)); =20 - payload->u64 =3D 0; switch (virtio_object_type(&uuid)) { case TYPE_DMABUF: dmabuf_fd =3D virtio_lookup_dmabuf(&uuid); @@ -1737,18 +1725,16 @@ vhost_user_backend_handle_shared_object_lookup(stru= ct vhost_user *u, { struct vhost_dev *dev =3D virtio_lookup_vhost_device(&uuid); if (dev =3D=3D NULL) { - payload->u64 =3D -EINVAL; - break; + return -EINVAL; } int ret =3D vhost_user_get_shared_object(dev, uuid.data, &dmabuf_f= d); if (ret < 0) { - payload->u64 =3D ret; + return ret; } break; } case TYPE_INVALID: - payload->u64 =3D -EINVAL; - break; + return -EINVAL; } =20 if (dmabuf_fd !=3D -1) { @@ -1757,11 +1743,6 @@ vhost_user_backend_handle_shared_object_lookup(struc= t vhost_user *u, =20 if (qemu_chr_fe_set_msgfds(chr, &dmabuf_fd, fd_num) < 0) { error_report("Failed to set msg fds."); - payload->u64 =3D -EINVAL; - } - - if (!vhost_user_backend_send_dmabuf_fd(ioc, hdr, payload, &local_err))= { - error_report_err(local_err); return -EINVAL; } =20 @@ -1790,6 +1771,7 @@ static gboolean backend_read(QIOChannel *ioc, GIOCond= ition condition, struct iovec iov; g_autofree int *fd =3D NULL; size_t fdsize =3D 0; + bool reply_ack; int i; =20 /* Read header */ @@ -1808,6 +1790,8 @@ static gboolean backend_read(QIOChannel *ioc, GIOCond= ition condition, goto err; } =20 + reply_ack =3D hdr.flags & VHOST_USER_NEED_REPLY_MASK; + /* Read payload */ if (qio_channel_read_all(ioc, (char *) &payload, hdr.size, &local_err)= ) { error_report_err(local_err); @@ -1833,8 +1817,10 @@ static gboolean backend_read(QIOChannel *ioc, GIOCon= dition condition, &payload.obje= ct); break; case VHOST_USER_BACKEND_SHARED_OBJECT_LOOKUP: - ret =3D vhost_user_backend_handle_shared_object_lookup(dev->opaque= , ioc, - &hdr, &payloa= d); + /* The backend always expects a response */ + reply_ack =3D true; + ret =3D vhost_user_backend_handle_shared_object_lookup(dev->opaque, + &payload.obje= ct); break; default: error_report("Received unexpected msg type: %d.", hdr.request); @@ -1845,7 +1831,7 @@ static gboolean backend_read(QIOChannel *ioc, GIOCond= ition condition, * REPLY_ACK feature handling. Other reply types has to be managed * directly in their request handlers. */ - if (hdr.flags & VHOST_USER_NEED_REPLY_MASK) { + if (reply_ack) { payload.u64 =3D !!ret; hdr.size =3D sizeof(payload.u64); =20 --=20 MST From nobody Sat Feb 7 19:46: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=1762699000; cv=none; d=zohomail.com; s=zohoarc; b=nZVEGZGLSykfHQT/Rf5ynf5nFC3ayZm3zMMf5ISAL1rL/SOxRh/2THF6eqMDQhCgzyKSVkKaZX+Slfvr60cn7QmuRtiLbLA//uK3n/ZsgZPdFSJ0lAvkPX/vTk65A5/2AuATx10a1F10ZBIy136N92cZF5YWs6y8mHdYc1Be2D4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762699000; 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=neawIxqIKpZCZv4T6g2O2IpqcqSPVDqavtFhhFYVqyc=; b=Z1CF2vLfnrbuFdYDd/w1cZVUoJ/m3wFfVFFghwcmyq3vrJCPSFPFFH+0fQ0wDkbl95xdiuEgHW3/Ks8Rc1rwMMn5t+djiGtGd48VuKbZ+Xflg7O7dAX8V3kJaLznnW9Pmnt3FUPptoVRRiWyS/feX9aYkZFrfXpybb8n6nSAEJk= 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 1762699000487800.8919943488077; Sun, 9 Nov 2025 06:36:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6Vs-0002Az-EH; Sun, 09 Nov 2025 09:35:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vq-0002AC-RA for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vo-0001n6-T6 for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:26 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-575-FIEDj8mFP2SpXgSvWMXJTw-1; Sun, 09 Nov 2025 09:35:22 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-47496b3c1dcso16572395e9.3 for ; Sun, 09 Nov 2025 06:35:22 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47763eb362bsm92032695e9.4.2025.11.09.06.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698924; 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=neawIxqIKpZCZv4T6g2O2IpqcqSPVDqavtFhhFYVqyc=; b=LEoRTnlmCUA+HTR9v+8TdgClPfmb9jOzUA2GjlqnfLxdCFxXNN9dwKqTVATk9oaesjQLUs yQb9pdutmRUGjtFCfT9AizFXw4GRDMiUON6597TpPU41PfKNc9WDcsUq3TOpk+HPXQAuoC K2FN3cSmFOr0kQmPp76ZZS43cJ/gIns= X-MC-Unique: FIEDj8mFP2SpXgSvWMXJTw-1 X-Mimecast-MFC-AGG-ID: FIEDj8mFP2SpXgSvWMXJTw_1762698921 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698921; x=1763303721; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=neawIxqIKpZCZv4T6g2O2IpqcqSPVDqavtFhhFYVqyc=; b=MTvgCOkJUfjhkcg1vFWfPRXWNcKcS+oCg8gHWLLyReD8J3VvHn1gYgYYVBjMoI/vMW 7UEp4zM2TrCr7AxPsM647VqvhlyjHjNecl1lyBCFsPj2w02xi4RztpWD8CY1CKPAVYqg srDb3pA4jUXVqhAmrzCNbemTm/jGSadgbqNhSl1fKisezIwBY0sZXDwPLp+wZ7TYzkkj VtxDoBJwe5oR/DIYeYosMX83nXfiaYPSc6i0KKdlHX/NAORp/c6fBJYn9HN1gR64QdXk nXsoB/PoYb/SMefHIdux7HyNF6QnT6h8a8khVP/Z65N2lb2kB+teDYu3q1SSufuJhVhD 5D7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698921; x=1763303721; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=neawIxqIKpZCZv4T6g2O2IpqcqSPVDqavtFhhFYVqyc=; b=jmC6jMXT64spqHBIxRnJeM1yrTphCjbmFA+Qh5U6CDEwr7w2sePf9Q1eTZ5XqmwtxA Pl+N7JKUaN9ajz1xFGeNP85hZUoR585kX1jW1CJd07WXkzVNUktOHLF1Va+umF9rOjR6 RtmW5ESrJx54709NFbDOUiTfNazTzlJMv+CyuZ5JQYc8Ek1VbR0NWck304qgGg+MueMN WmKHiH1bWras/UCs+/1ZOwBdjx97b8WCV2dqcxVtt2XZIYKDH4df/fJKEIkCynAYh0+d YO/KDprDxOjtyJzh4obORVxJxw/Sq/Pdm+99GgDEkeQ9BjVFkgjiFDy8M94l6RSeepcI JNDA== X-Gm-Message-State: AOJu0Yw3U2MsfUxGZ5xnIryMGrZlHVOlP9XNRs677aO96NmbX868XeVw a2hslz6THrQElaiJKCdA8ZMywk3hxBhE1orYF4vfQg+xOwOxqFRvF4bRFr3KaLhUbrCy8G5nEEA XsUYEh8tJ4jJaEzF5AIy9vopo6teEJUZQO0U0Sx8UoIV70kaUTyHVJa5c1qdQUXs3YON111/O23 WTE7F8aZYQjgDF8Wu5j1pJzpMcqIFfMdRqcQ== X-Gm-Gg: ASbGncu59p/OwwmH/G8eH0QQs8DqlyMLcoYgYEva7jEhgL2xmwvs2u61N7VGMSjxS4S /VEFiTYzY0AdhJHuyUenU1+XICe8ePcBVO6I52goArYl2+M4U1FtTOCfrEQYawwwzwxBN5khXga cADGfJMARqtg6i8/XlTurM9r4mhW/YztJ3YlrYCtAWCX5gy/TLjhcTR8k5Ovl4826+8pUPA70Qi YBxHoIik2M0Fc6l0qE2tz1++XC72vdm8JTtZEz1OHzSIpPzit+YDr5ThUTJm9H2blSNPP8dYymw Pe7+RAE3xgTVuIJOQ2ZyXumz32rVq9h3dHWN/A3R9nH93bC8Cm3vB5QQbWNesmGZx8U= X-Received: by 2002:a05:600c:4f94:b0:475:df09:c253 with SMTP id 5b1f17b1804b1-47773288f90mr44101955e9.38.1762698921110; Sun, 09 Nov 2025 06:35:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhpywO/HYewXtqgXyaRCEk5w8awAay0sJMHsVAgpxwREAHRbSdNt6JknID3L7S4/1zQ4RNkQ== X-Received: by 2002:a05:600c:4f94:b0:475:df09:c253 with SMTP id 5b1f17b1804b1-47773288f90mr44101675e9.38.1762698920551; Sun, 09 Nov 2025 06:35:20 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:18 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhenzhong Duan , Yi Liu , Jason Wang , =?utf-8?Q?Cl=C3=A9ment?= Mathieu--Drif , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 05/14] intel_iommu: Handle PASID cache invalidation Message-ID: <43b8c4339709efef153cb2cf21d23d1791890d60.1762698873.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699001323158501 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zhenzhong Duan Adds a new entry VTDPASIDCacheEntry in VTDAddressSpace to cache the pasid entry and track PASID usage and future PASID tagged DMA address translation support in vIOMMU. When guest triggers pasid cache invalidation, QEMU will capture it and update or invalidate pasid cache. vIOMMU emulator could figure out the reason by fetching latest guest pasid entry in memory and compare it with cached PASID entry if it's valid. Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan Reviewed-by: Yi Liu Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251017093602.525338-2-zhenzhong.duan@intel.com> --- hw/i386/intel_iommu_internal.h | 17 ++++ include/hw/i386/intel_iommu.h | 6 ++ hw/i386/intel_iommu.c | 141 ++++++++++++++++++++++++++++++--- hw/i386/trace-events | 3 + 4 files changed, 157 insertions(+), 10 deletions(-) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index 0f6a1237e4..75bafdf0cd 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -316,6 +316,8 @@ typedef enum VTDFaultReason { * request while disabled */ VTD_FR_IR_SID_ERR =3D 0x26, /* Invalid Source-ID */ =20 + VTD_FR_RTADDR_INV_TTM =3D 0x31, /* Invalid TTM in RTADDR */ + VTD_FR_SM_PRE_ABS =3D 0x47, /* SCT.8 : PRE bit in a present SM CE is= 0 */ =20 /* PASID directory entry access failure */ @@ -517,6 +519,15 @@ typedef union VTDPRDesc VTDPRDesc; #define VTD_INV_DESC_PIOTLB_RSVD_VAL0 0xfff000000000f1c0ULL #define VTD_INV_DESC_PIOTLB_RSVD_VAL1 0xf80ULL =20 +/* PASID-cache Invalidate Descriptor (pc_inv_dsc) fields */ +#define VTD_INV_DESC_PASIDC_G(x) extract64((x)->val[0], 4, 2) +#define VTD_INV_DESC_PASIDC_G_DSI 0 +#define VTD_INV_DESC_PASIDC_G_PASID_SI 1 +#define VTD_INV_DESC_PASIDC_G_GLOBAL 3 +#define VTD_INV_DESC_PASIDC_DID(x) extract64((x)->val[0], 16, 16) +#define VTD_INV_DESC_PASIDC_PASID(x) extract64((x)->val[0], 32, 20) +#define VTD_INV_DESC_PASIDC_RSVD_VAL0 0xfff000000000f1c0ULL + /* Page Request Descriptor */ /* For the low 64-bit of 128-bit */ #define VTD_PRD_TYPE (1ULL) @@ -603,6 +614,12 @@ typedef struct VTDRootEntry VTDRootEntry; #define VTD_SM_CONTEXT_ENTRY_RSVD_VAL1 0xffffffffffe00000ULL #define VTD_SM_CONTEXT_ENTRY_PRE 0x10ULL =20 +typedef struct VTDPASIDCacheInfo { + uint8_t type; + uint16_t did; + uint32_t pasid; +} VTDPASIDCacheInfo; + /* PASID Table Related Definitions */ #define VTD_PASID_DIR_BASE_ADDR_MASK (~0xfffULL) #define VTD_PASID_TABLE_BASE_ADDR_MASK (~0xfffULL) diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h index b2f1ef9595..ca7f7bb661 100644 --- a/include/hw/i386/intel_iommu.h +++ b/include/hw/i386/intel_iommu.h @@ -95,6 +95,11 @@ struct VTDPASIDEntry { uint64_t val[8]; }; =20 +typedef struct VTDPASIDCacheEntry { + struct VTDPASIDEntry pasid_entry; + bool valid; +} VTDPASIDCacheEntry; + struct VTDAddressSpace { PCIBus *bus; uint8_t devfn; @@ -107,6 +112,7 @@ struct VTDAddressSpace { MemoryRegion iommu_ir_fault; /* Interrupt region for catching fault */ IntelIOMMUState *iommu_state; VTDContextCacheEntry context_cache_entry; + VTDPASIDCacheEntry pasid_cache_entry; QLIST_ENTRY(VTDAddressSpace) next; /* Superset of notifier flags that this address space has */ IOMMUNotifierFlag notifier_flags; diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 6a168d5107..c47f13b659 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3051,6 +3051,130 @@ static bool vtd_process_piotlb_desc(IntelIOMMUState= *s, return true; } =20 +static inline int vtd_dev_get_pe_from_pasid(VTDAddressSpace *vtd_as, + VTDPASIDEntry *pe) +{ + IntelIOMMUState *s =3D vtd_as->iommu_state; + VTDContextEntry ce; + int ret; + + if (!s->root_scalable) { + return -VTD_FR_RTADDR_INV_TTM; + } + + ret =3D vtd_dev_to_context_entry(s, pci_bus_num(vtd_as->bus), vtd_as->= devfn, + &ce); + if (ret) { + return ret; + } + + return vtd_ce_get_rid2pasid_entry(s, &ce, pe, vtd_as->pasid); +} + +/* Update or invalidate pasid cache based on the pasid entry in guest memo= ry. */ +static void vtd_pasid_cache_sync_locked(gpointer key, gpointer value, + gpointer user_data) +{ + VTDPASIDCacheInfo *pc_info =3D user_data; + VTDAddressSpace *vtd_as =3D value; + VTDPASIDCacheEntry *pc_entry =3D &vtd_as->pasid_cache_entry; + VTDPASIDEntry pe; + uint16_t did; + + if (vtd_dev_get_pe_from_pasid(vtd_as, &pe)) { + /* + * No valid pasid entry in guest memory. e.g. pasid entry was modi= fied + * to be either all-zero or non-present. Either case means existing + * pasid cache should be invalidated. + */ + pc_entry->valid =3D false; + return; + } + + /* + * VTD_INV_DESC_PASIDC_G_DSI and VTD_INV_DESC_PASIDC_G_PASID_SI require + * DID check. If DID doesn't match the value in cache or memory, then + * it's not a pasid entry we want to invalidate. + */ + switch (pc_info->type) { + case VTD_INV_DESC_PASIDC_G_PASID_SI: + if (pc_info->pasid !=3D vtd_as->pasid) { + return; + } + /* Fall through */ + case VTD_INV_DESC_PASIDC_G_DSI: + if (pc_entry->valid) { + did =3D VTD_SM_PASID_ENTRY_DID(pc_entry->pasid_entry.val[1]); + } else { + did =3D VTD_SM_PASID_ENTRY_DID(pe.val[1]); + } + if (pc_info->did !=3D did) { + return; + } + } + + pc_entry->pasid_entry =3D pe; + pc_entry->valid =3D true; +} + +static void vtd_pasid_cache_sync(IntelIOMMUState *s, VTDPASIDCacheInfo *pc= _info) +{ + if (!s->root_scalable || !s->dmar_enabled) { + return; + } + + vtd_iommu_lock(s); + g_hash_table_foreach(s->vtd_address_spaces, vtd_pasid_cache_sync_locke= d, + pc_info); + vtd_iommu_unlock(s); +} + +static bool vtd_process_pasid_desc(IntelIOMMUState *s, + VTDInvDesc *inv_desc) +{ + uint16_t did; + uint32_t pasid; + VTDPASIDCacheInfo pc_info =3D {}; + uint64_t mask[4] =3D {VTD_INV_DESC_PASIDC_RSVD_VAL0, VTD_INV_DESC_ALL_= ONE, + VTD_INV_DESC_ALL_ONE, VTD_INV_DESC_ALL_ONE}; + + if (!vtd_inv_desc_reserved_check(s, inv_desc, mask, true, + __func__, "pasid cache inv")) { + return false; + } + + did =3D VTD_INV_DESC_PASIDC_DID(inv_desc); + pasid =3D VTD_INV_DESC_PASIDC_PASID(inv_desc); + pc_info.type =3D VTD_INV_DESC_PASIDC_G(inv_desc); + + switch (pc_info.type) { + case VTD_INV_DESC_PASIDC_G_DSI: + trace_vtd_inv_desc_pasid_cache_dsi(did); + pc_info.did =3D did; + break; + + case VTD_INV_DESC_PASIDC_G_PASID_SI: + /* PASID selective implies a DID selective */ + trace_vtd_inv_desc_pasid_cache_psi(did, pasid); + pc_info.did =3D did; + pc_info.pasid =3D pasid ?: PCI_NO_PASID; + break; + + case VTD_INV_DESC_PASIDC_G_GLOBAL: + trace_vtd_inv_desc_pasid_cache_gsi(); + break; + + default: + error_report_once("invalid granularity field in PASID-cache invali= date " + "descriptor, hi: 0x%"PRIx64" lo: 0x%" PRIx64, + inv_desc->val[1], inv_desc->val[0]); + return false; + } + + vtd_pasid_cache_sync(s, &pc_info); + return true; +} + static bool vtd_process_inv_iec_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc) { @@ -3266,6 +3390,13 @@ static bool vtd_process_inv_desc(IntelIOMMUState *s) } break; =20 + case VTD_INV_DESC_PC: + trace_vtd_inv_desc("pasid-cache", inv_desc.val[1], inv_desc.val[0]= ); + if (!vtd_process_pasid_desc(s, &inv_desc)) { + return false; + } + break; + case VTD_INV_DESC_PIOTLB: trace_vtd_inv_desc("p-iotlb", inv_desc.val[1], inv_desc.val[0]); if (!vtd_process_piotlb_desc(s, &inv_desc)) { @@ -3308,16 +3439,6 @@ static bool vtd_process_inv_desc(IntelIOMMUState *s) } break; =20 - /* - * TODO: the entity of below two cases will be implemented in future s= eries. - * To make guest (which integrates scalable mode support patch set in - * iommu driver) work, just return true is enough so far. - */ - case VTD_INV_DESC_PC: - if (s->scalable_mode) { - break; - } - /* fallthrough */ default: error_report_once("%s: invalid inv desc: hi=3D%"PRIx64", lo=3D%"PR= Ix64 " (unknown type)", __func__, inv_desc.hi, diff --git a/hw/i386/trace-events b/hw/i386/trace-events index ac9e1a10aa..298addb24d 100644 --- a/hw/i386/trace-events +++ b/hw/i386/trace-events @@ -24,6 +24,9 @@ vtd_inv_qi_head(uint16_t head) "read head %d" vtd_inv_qi_tail(uint16_t head) "write tail %d" vtd_inv_qi_fetch(void) "" vtd_context_cache_reset(void) "" +vtd_inv_desc_pasid_cache_gsi(void) "" +vtd_inv_desc_pasid_cache_dsi(uint16_t domain) "Domain selective PC invalid= ation domain 0x%"PRIx16 +vtd_inv_desc_pasid_cache_psi(uint16_t domain, uint32_t pasid) "PASID selec= tive PC invalidation domain 0x%"PRIx16" pasid 0x%"PRIx32 vtd_re_not_present(uint8_t bus) "Root entry bus %"PRIu8" not present" vtd_ce_not_present(uint8_t bus, uint8_t devfn) "Context entry bus %"PRIu8"= devfn %"PRIu8" not present" vtd_iotlb_page_hit(uint16_t sid, uint64_t addr, uint64_t slpte, uint16_t d= omain) "IOTLB page hit sid 0x%"PRIx16" iova 0x%"PRIx64" slpte 0x%"PRIx64" d= omain 0x%"PRIx16 --=20 MST From nobody Sat Feb 7 19:46: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=1762699030; cv=none; d=zohomail.com; s=zohoarc; b=mzsQbBT4Y2AI0U/FTB0h7Ub4mbDJiIyecS5vmxDsGwidUjuM+8aB1WhUbaavNvy6+ywuuw/IjuhKNvQhnRP8bE+YJDa4n1pf3PVDbHDox5AjvazTznTGhMa8WvgLQ5IDz6sSKNrC+kI3NHm50/zscgJ6+J0Ywvg3hcxDnwzSK8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762699030; 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=SwqTfvgEpRHDMwJR5147QuaByS8jiQ7jRhJSWfgblyQ=; b=O+MQnByVwv5T7x0g3buJoAGw8446C5zrraFh9rC28xTRaSsY+kJWTy60OysCGFp0hcL2EdKbGRNqOVWdqXlZhroYM06F2WJCDVuvB9xJl+Lf4fOnNiVD+9nQykLYZucWaVOItE1VxKG4V3n6S6PxGfiZsTbbuvMr5stRWL5sHMQ= 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 1762699030629601.9210365850485; Sun, 9 Nov 2025 06:37:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6Vu-0002C8-2P; Sun, 09 Nov 2025 09:35:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vs-0002Au-8H for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vq-0001nM-Pw for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:28 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-149-HkOEZI1sOnOc7KxgFu8MMQ-1; Sun, 09 Nov 2025 09:35:24 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-429cbed2b8fso1057364f8f.1 for ; Sun, 09 Nov 2025 06:35:24 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac679e06csm16596490f8f.47.2025.11.09.06.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698926; 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=SwqTfvgEpRHDMwJR5147QuaByS8jiQ7jRhJSWfgblyQ=; b=KC8v33fEljvoHRzYnl8sR7/3kIItCFvxWkJNsSOd+0bInNYbNPkpgCb5VRE6oO5t5qnju0 6d0R/tv4A/WnoYiPcBI1TI0BZhpOcwQKNC2FTtqFGoNA8l2LugogPZr7z8MlCt8yS1Yxya jpfu42ixrl+i8JvNLlnCR5R7arsuJCw= X-MC-Unique: HkOEZI1sOnOc7KxgFu8MMQ-1 X-Mimecast-MFC-AGG-ID: HkOEZI1sOnOc7KxgFu8MMQ_1762698924 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698923; x=1763303723; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=SwqTfvgEpRHDMwJR5147QuaByS8jiQ7jRhJSWfgblyQ=; b=ZCz4m2SdAhy1Ws3Jeavhwa4bgLTF/tYlIZpufpR287aP5C4RFWPBScUWpLnVPuIW7x E/VhymiMBnyGpV4I/DNFutx7w65D2e7NpjAAviPtyV+041QZNvmOhWe28kHZdcUOIX5P D5JdR4GarzPDSknC7eOskONCu/PCdQFHS4fySN5B5C7p8phkQ0TSS+sWP3Hi4yOixlNs XW6YmSKt671i3efNwrBhJyTEIzXUb1Hy1uRcCX46LbswNaSas5i6NneyIJZB6gdHdCf3 JnyejXDL8k1gqg5BewAhUqq5Er6utlgmr8TCwLU6kRuWZZCbPD+XsxsedQzjiByjsVdp 7lYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698923; x=1763303723; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SwqTfvgEpRHDMwJR5147QuaByS8jiQ7jRhJSWfgblyQ=; b=W0YLtBwjycCW0NfPWE9XRgsHszNy0rWg6u0EQEEvVcWWD215+QAxSILsHwsxErrVVn uLDhaucLyhtOIrPbitiManA3f5gee7NlTIfoYgILYg91BBOFuikXV2lLrpNzohYpH+XN ImF8hcZp4UpmUGDZrPCsFPfHEqpTTGmNzMXzNGWyeNgu7DTFSDvKhJEdwcoYqWrhliGh Hj8SzTb5gvIyohBYv5d97FRpjBVhe6+2EXSb4fFE+kZe6+SBQkZcmJA0eJx7lqCNn7XE eylIJPAXzKEcaLKBjjAfkTLMEtwFK2yipWRJpSp66uZ0XbSz1ZJ3vudDi2/TU6an5Dq9 YQzQ== X-Gm-Message-State: AOJu0YwCHZ8D+MG0574qGDQQeUegyqBbueh0o5EQl7c7w0JMDlqdWgnt pveJ2sYWXJ4hVbjyp1MfAEnXp/H2Hlw1ViZcC7f9RoEMuzl//GObSmeUjyQ2KMIgkEjX6IGhk0/ xMU+Cb9i6tuwq9O53QwmG+JGg3KEhqB8doqaqpVQx+e6QAI+mHl8/9CMCkX1EhKe2xNHhI3Wl5f aexUohjY+ghnhhoIa1jIYsny5Shjc5faXKeQ== X-Gm-Gg: ASbGncu5BVPMrWhWfBBY5Jb1M1iV/AxH66AU+Fxu9POENNJmvd8t9aSx/Uzjs5c3Y+o nEFgdSiwOJlc+qDj7dDDwPTHSkUfLnuHKIo0BkotZX6HrH3HuSae2gDbQz04LT6KojXnKfsFwDq d7ObH1NxxwRhU/ycKQC8iid5kA174flxDwmho4/dSeqVc8Gz5Gnba/m9vFxjCtKOCa/A/LfbbR8 yMDvup0b/Vt6S2S6281KwJd0HvQABb6BQDUEkGWCXRL+/dp5TB7ecx4t8hmT3kR4sJqwUkA0NUq 8swjlS924ArpeIU73KcbS3WsFQp96ZXhjonUolIaBhtK4vQOowvoDIlJip+0iqTFR6o= X-Received: by 2002:a05:6000:2107:b0:429:bc93:9d8a with SMTP id ffacd0b85a97d-42b2dc228d1mr3146178f8f.37.1762698923281; Sun, 09 Nov 2025 06:35:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2u1X9//ApsXxZgattmDR31jenRuZ8vL9TchcfugbkS/zdpgIuI7TFE/Mh9Cm4y9u6LlUR2g== X-Received: by 2002:a05:6000:2107:b0:429:bc93:9d8a with SMTP id ffacd0b85a97d-42b2dc228d1mr3146159f8f.37.1762698922706; Sun, 09 Nov 2025 06:35:22 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:20 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhenzhong Duan , Yi Liu , Jason Wang , =?utf-8?Q?Cl=C3=A9ment?= Mathieu--Drif , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 06/14] intel_iommu: Reset pasid cache when system level reset 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699031591158500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zhenzhong Duan Reset pasid cache when system level reset. Currently we don't have any device supporting PASID yet. So all are PASID_0, its vtd_as is allocated by PCI system and never removed, just mark pasid cache invalid. Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan Reviewed-by: Yi Liu Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251017093602.525338-3-zhenzhong.duan@intel.com> --- hw/i386/intel_iommu.c | 15 +++++++++++++++ hw/i386/trace-events | 1 + 2 files changed, 16 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index c47f13b659..cf0b62f29e 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -87,6 +87,20 @@ struct vtd_iotlb_key { static void vtd_address_space_refresh_all(IntelIOMMUState *s); static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n); =20 +static void vtd_pasid_cache_reset_locked(IntelIOMMUState *s) +{ + VTDAddressSpace *vtd_as; + GHashTableIter as_it; + + trace_vtd_pasid_cache_reset(); + + g_hash_table_iter_init(&as_it, s->vtd_address_spaces); + while (g_hash_table_iter_next(&as_it, NULL, (void **)&vtd_as)) { + VTDPASIDCacheEntry *pc_entry =3D &vtd_as->pasid_cache_entry; + pc_entry->valid =3D false; + } +} + static void vtd_define_quad(IntelIOMMUState *s, hwaddr addr, uint64_t val, uint64_t wmask, uint64_t w1cmask) { @@ -381,6 +395,7 @@ static void vtd_reset_caches(IntelIOMMUState *s) vtd_iommu_lock(s); vtd_reset_iotlb_locked(s); vtd_reset_context_cache_locked(s); + vtd_pasid_cache_reset_locked(s); vtd_iommu_unlock(s); } =20 diff --git a/hw/i386/trace-events b/hw/i386/trace-events index 298addb24d..b704f4f90c 100644 --- a/hw/i386/trace-events +++ b/hw/i386/trace-events @@ -24,6 +24,7 @@ vtd_inv_qi_head(uint16_t head) "read head %d" vtd_inv_qi_tail(uint16_t head) "write tail %d" vtd_inv_qi_fetch(void) "" vtd_context_cache_reset(void) "" +vtd_pasid_cache_reset(void) "" vtd_inv_desc_pasid_cache_gsi(void) "" vtd_inv_desc_pasid_cache_dsi(uint16_t domain) "Domain selective PC invalid= ation domain 0x%"PRIx16 vtd_inv_desc_pasid_cache_psi(uint16_t domain, uint32_t pasid) "PASID selec= tive PC invalidation domain 0x%"PRIx16" pasid 0x%"PRIx32 --=20 MST From nobody Sat Feb 7 19:46: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=1762698986; cv=none; d=zohomail.com; s=zohoarc; b=Z6VjRwiiSogXO1i9gN+rP0hNfFbZve15NYVIP6tEOWM9yya9ii8tk06UixNtuEB/3/iO+/81bsRzFRj4f0bqtL1PGsTlJkF0C4xQAcHzSIkOu1rMpmLQf90ru5mWdoIX7Oa7pqtkrcNx+/9hGGTsgJ4DnWxZLkOgHLbryzVZ/TI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762698986; 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=CWHbclnZjXpCqepcqPMo+sVS3js+OLhnZCkOniF4+6g=; b=ZvQ44a2ChNawhmbxEwwLbzIzDoQxf81c3Q4/iqplLoAdtHrd/EdeC8/SnIZ8+8eFTEgLi9XXkFByMIXizndb4SwvlcNQffehBjgbaZ5EoDPn8ONffConwUdMJkx7j/o1a8ZFh2ycNhFJu6u4H6CvJFH13hnas9+6D790bybBJeY= 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 1762698986449769.3505259804349; Sun, 9 Nov 2025 06:36:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6Vw-0002CU-IB; Sun, 09 Nov 2025 09:35:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vu-0002C9-FT for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vs-0001no-UA for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:30 -0500 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-398-syybwYipOnCd2ABNysUcPg-1; Sun, 09 Nov 2025 09:35:27 -0500 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3ecdb10a612so1226686f8f.2 for ; Sun, 09 Nov 2025 06:35:26 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b2dd927c9sm10139909f8f.27.2025.11.09.06.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698928; 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=CWHbclnZjXpCqepcqPMo+sVS3js+OLhnZCkOniF4+6g=; b=Xpy5MM80L0F3UAwd/07TZLaxbwbT6pMUpSb1Fr0auxV/94rJ5Vm5DFSHkruMIwAUDSpLGR OMWW496MJKcz+NeaLJcsmwbIhzpmqvhX5mVf6rKyr1siPHyKGqtTeUlV6U+vW7msfp73HM pWN593DDXDLuSPlHuV5jQjL4W0bLooM= X-MC-Unique: syybwYipOnCd2ABNysUcPg-1 X-Mimecast-MFC-AGG-ID: syybwYipOnCd2ABNysUcPg_1762698926 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698925; x=1763303725; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CWHbclnZjXpCqepcqPMo+sVS3js+OLhnZCkOniF4+6g=; b=lhe0VE1dqG6KjG305NkS5t46kD4hYoUwodqRQT3ZQFZwzKgUa2yEjoUysLPIc4hQ78 VH1S6I+w0abbX92p7S7vgyaeSE7khrxo4oQ0g581eyRDrQ5Z8Y9z69GpfBi68BTBYAcl ArlEp/kk7flDVi06rghD/5XyQynbEx95NuwXNlYlWEtDWnD93Irs6LS7TpGTy6yKD7Ii nn7mfH01s6J3qpn1LFezP2DDhuvXFAQwGRNA1DEcary46tfLOYQxsXz9MjE8sp7LB22Q cfSq9gIdZex1eFj4J84SnWwVtkGxGE5wr/CVGUIjgw6jVJUXWdKKOfrOcsIDhAr1g2UX 2ssw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698925; x=1763303725; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CWHbclnZjXpCqepcqPMo+sVS3js+OLhnZCkOniF4+6g=; b=qanL2Gm9U02/SUEzlxCkCfU2cTlcBkMkNr0D/88VU1lxvQ1rLjcELKnqMCHD8sdXHA XTc4AJ0ZbJZL9dh8JLPnF65JONR9/2q2JR5nNUxhVGSBpaGj63bMyZ9CgnS8tLRCPaU/ ZmsSTg0YHWFdMbBndAyiuxezVE1LuQfP8isLhfUjYMJFBExivT80BkOSdw4L+4alKNw+ ezNdTGF38RYVZZJfMOjPMD+1DLeA4cGtUfdF4j/GRLK9vyNfFavENQSm0fJr26Hlo7pN LFziujIc8F3HELsJnElF4rKkrwx9oNCxtJaxOex74W4rYpmbzyqJ4gDTmLQzWJbV+HsH LpqQ== X-Gm-Message-State: AOJu0Yy++slDhjHVJapLd6zRXs9BYXpyRL+L/iOzqfONgvvxtfMBWJby apIr6x4mNPQsD3nctKznN67L4Gtvwbz8dProPbeGU5OyuGM41I0BaaSZbSo6VhvcLuwBwCE++/J dy5+JoFVHe99Rz7hxtZBE31RwQOFz2k6Jvo0tYcOtBOI7zqf034cMLtux0Vei+3JRSgTvYn4MT/ /O5EqJRZWbwaorvXHapAEGFrny89tS1EQMZQ== X-Gm-Gg: ASbGncuLRQqIFnD3fkf9iE8l1rh+DpuXhJREJVg8WUQoNTuQpx6QsgSe49abhN/kZ+5 +QMbXar7JH+1eoJz7g+hq38fLz4xLM1wtFbf+QBGm8tsb2lottzHZX6e4dSoKmInzIXkDtyEcF5 +KRLBCyiJ0Th+u4B71pvnCuE2h0Dya+sxkyYdvxlTPX4b2FNGPsr/AuIyNbOn7FKNnxoFJVD1+X uD2nG+eUey8yZ9cNiIpvNpDiOYlYO/0/IAV91c9/THGrGMyt4h+8ODj3ZoIO7hFHLY9uvfuQAii Cp4kZgcsUxG+1XnKeIqJmg5tJWA8oq77X62K/2YR3Z/E2KJBTiZKRKgEVBDpTFUykmM= X-Received: by 2002:a05:6000:1a8d:b0:426:f10c:c512 with SMTP id ffacd0b85a97d-42b2dcb7e82mr4293363f8f.43.1762698925399; Sun, 09 Nov 2025 06:35:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyJQA33MPPPc3pBTqSi87TnHIlyDbsFjCaGZKiXheqlxK1CQY33YUh45BhHhv3MX35yWWYFg== X-Received: by 2002:a05:6000:1a8d:b0:426:f10c:c512 with SMTP id ffacd0b85a97d-42b2dcb7e82mr4293338f8f.43.1762698924957; Sun, 09 Nov 2025 06:35:24 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:22 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhenzhong Duan , Yi Liu , Jason Wang , =?utf-8?Q?Cl=C3=A9ment?= Mathieu--Drif , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 07/14] intel_iommu: Fix DMA failure when guest switches IOMMU domain 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762698987148158501 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zhenzhong Duan Kernel allows user to switch IOMMU domain, e.g., switch between DMA and identity domain. When this happen in IOMMU scalable mode, a pasid cache invalidation request is sent, this request is ignored by vIOMMU which leads to device binding to wrong address space, then DMA fails. This issue exists in scalable mode with both first stage and second stage translations, both emulated and passthrough devices. Take network device for example, below sequence trigger issue: 1. start a guest with iommu=3Dpt 2. echo 0000:01:00.0 > /sys/bus/pci/drivers/virtio-pci/unbind 3. echo DMA > /sys/kernel/iommu_groups/6/type 4. echo 0000:01:00.0 > /sys/bus/pci/drivers/virtio-pci/bind 5. Ping test Fix it by switching address space in invalidation handler. Fixes: 4a4f219e8a10 ("intel_iommu: add scalable-mode option to make scalabl= e mode work") Signed-off-by: Zhenzhong Duan Reviewed-by: Yi Liu Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251017093602.525338-4-zhenzhong.duan@intel.com> --- hw/i386/intel_iommu.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index cf0b62f29e..78b142ccea 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3086,6 +3086,11 @@ static inline int vtd_dev_get_pe_from_pasid(VTDAddre= ssSpace *vtd_as, return vtd_ce_get_rid2pasid_entry(s, &ce, pe, vtd_as->pasid); } =20 +static int vtd_pasid_entry_compare(VTDPASIDEntry *p1, VTDPASIDEntry *p2) +{ + return memcmp(p1, p2, sizeof(*p1)); +} + /* Update or invalidate pasid cache based on the pasid entry in guest memo= ry. */ static void vtd_pasid_cache_sync_locked(gpointer key, gpointer value, gpointer user_data) @@ -3094,15 +3099,28 @@ static void vtd_pasid_cache_sync_locked(gpointer ke= y, gpointer value, VTDAddressSpace *vtd_as =3D value; VTDPASIDCacheEntry *pc_entry =3D &vtd_as->pasid_cache_entry; VTDPASIDEntry pe; + IOMMUNotifier *n; uint16_t did; =20 if (vtd_dev_get_pe_from_pasid(vtd_as, &pe)) { + if (!pc_entry->valid) { + return; + } /* * No valid pasid entry in guest memory. e.g. pasid entry was modi= fied * to be either all-zero or non-present. Either case means existing * pasid cache should be invalidated. */ pc_entry->valid =3D false; + + /* + * When a pasid entry isn't valid any more, we should unmap all + * mappings in shadow pages instantly to ensure DMA security. + */ + IOMMU_NOTIFIER_FOREACH(n, &vtd_as->iommu) { + vtd_address_space_unmap(vtd_as, n); + } + vtd_switch_address_space(vtd_as); return; } =20 @@ -3128,8 +3146,15 @@ static void vtd_pasid_cache_sync_locked(gpointer key= , gpointer value, } } =20 - pc_entry->pasid_entry =3D pe; - pc_entry->valid =3D true; + if (!pc_entry->valid) { + pc_entry->pasid_entry =3D pe; + pc_entry->valid =3D true; + } else if (!vtd_pasid_entry_compare(&pe, &pc_entry->pasid_entry)) { + return; + } + + vtd_switch_address_space(vtd_as); + vtd_address_space_sync(vtd_as); } =20 static void vtd_pasid_cache_sync(IntelIOMMUState *s, VTDPASIDCacheInfo *pc= _info) --=20 MST From nobody Sat Feb 7 19:46: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=1762699025; cv=none; d=zohomail.com; s=zohoarc; b=BAAY+SQD5gHodBbeVzmUT9iIVv+B2V9K+oR4eZbmXF3j8hfchzZ/BI6kHSWtHRiXjgTZ5jLyNFgU6LExeSQ5+opLc32aC1HT+I0XA64tLxhJUK+eemUrciKInlfrmIWClXgUKvJLWQuokdxbY0Yi6MWCzPK4ZrjY+kptMm9ETDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762699025; 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=qEti7Ogz8rb9NG0Hkns7Wvi5D2MMh1SqCQoP/RLdhF4=; b=IUYdbOozP66ojKhHT7GCNe2hom0311v1H2EQ3G0o7lUJxZJfHcYYAYEumM4ln7yQirgz54sJwl405IUwXPpw9UAyZV8XHP/BCeFGib5N2AeFBGXWsq2UBDPO0rj2rUudfzG5zc+YVrldQFh1HC+xUj53PWQlZ61f9MS84FNZflo= 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 1762699025801364.31484355656517; Sun, 9 Nov 2025 06:37:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6Vy-0002DM-UM; Sun, 09 Nov 2025 09:35:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vx-0002Cw-Mu for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vw-0001oH-1D for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:33 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-110-BE_6j9uLO72nSS7-ut20Ng-1; Sun, 09 Nov 2025 09:35:29 -0500 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-429cbed2b8fso1057388f8f.1 for ; Sun, 09 Nov 2025 06:35:29 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b2f7a0512sm9050632f8f.18.2025.11.09.06.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698931; 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=qEti7Ogz8rb9NG0Hkns7Wvi5D2MMh1SqCQoP/RLdhF4=; b=UJ9hME6zcuV2+2b+P5UGmOdYgL2at2ZGJxl/5mgbc9PuZ1Gl7+DPjg7Vs05j8NFoqyAqM0 NuzUpRe1fPFf/SW6h3tANqAXlwOFlF8rcWTYJaLsyunyV8Ao2PW8b1EIgqjuMytc1b1/I5 oL45F4UbLcKYmVj6AGvcXjJ9QWfUNXo= X-MC-Unique: BE_6j9uLO72nSS7-ut20Ng-1 X-Mimecast-MFC-AGG-ID: BE_6j9uLO72nSS7-ut20Ng_1762698928 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698928; x=1763303728; darn=nongnu.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=qEti7Ogz8rb9NG0Hkns7Wvi5D2MMh1SqCQoP/RLdhF4=; b=Jo7jPyNN6bu88SYWpCXZRuDKs3pr5orA6GIIguJlgo+HG/8fQUktozJx6M6uc2ZOZZ zwd0i2ISRXmBXhX3QZU8Ab7x+ihHvyobvZxCkNCugt2tTd10jYvkq04jU3AHexhMafmc zgIqr6/7wsfWmkR7pLuOe+AEAjShEGdhKoxpcG6ed92gluxqSLsLrAW3JwicWbeZZIjQ +gEzOwf1PYJm5+RvBKfnXx0SFLZRS6268MsLH1dHM7QmUpXXuH1IUJWk1dQIXNCyyaJ0 mTUanjsvI+cb8wc9ij51eH5MiBe5Kx8HtJ286RL2a0Qd3QDJV3ihrzEC+8aqgn+acLsb T3cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698928; x=1763303728; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qEti7Ogz8rb9NG0Hkns7Wvi5D2MMh1SqCQoP/RLdhF4=; b=KjDh/wDAgJ8BFfHQZbQQyFmpZev5qR12CAje1X1o/PQ5zggZAGyZ8a9aL/rgWcWAN+ 85M5E1uFaG7GG1BERwObfbqXH/f0VG19uBRFGnG1iD9DGDdPVtZTAOVo9TXtGw7Ob1z6 TMaIVTG3XZM/LLj3ggts009ZtPwn2k5hE46VHM3cMmeB25rOFjuhqvtQUz+RE1qy4UMD HlM13MA0YYbMrsoZYbbHyt88gV5vGPz9Cpjoy7UANWApLCymTSxO+60VmUhH+pvmCRiL FfKT3i8h2LtNtxzXo0+fE0YJLyxA1MyUgslDC4WG8kSBLGndbvzLbt9YUBU5/ZXPnD/F xjsQ== X-Gm-Message-State: AOJu0YwBhAXwtRDr9PY7m/u7VAGXYRXo/BxvV237mDn2SDMmblnWAvH1 WLa4YqLXEv+SaWFpGTdsY1chikljNcQlpsnN3B40hKMChjzbCQNRw456tQK456zdZnRcoyZYbPs O62oV9Tmzf7+4yJbKO+8IpIMKvNTtSLRbyoWbsDAAlf82Yjrld6OzyQhZhRgnVG7CBmpVORHfRC iSRL3MhzkQJrxwfymoBLyTN0ucsepN8g3DXg== X-Gm-Gg: ASbGnctw8hoy5oa/GC+frhOSpprYbAqA1iGPB3AsxgRXRby55YLuOsXPH6awTHmBfdz pqTDSNJTMMxwlfdhPzjg9qBH6kD673Fx71OHNXcyAwc2Ozwz2tWyohIoWgcNTORsC/5O9lXl9D5 e/mWkNNZGsblmNOWq739YhHqzu+Gtsqsl4F/m+6F4P9O4d4NrQSjALZAM08J2QYhIXZEAW0FcGd bMfQsNSDQ8MHXDN+0dcuFzhBARX/2LursZeRdJhrVgoJLwf7wlwRs9QraYGkUimMQpzOadCiNeh 7VkrD4UsA94Zd59SI2wUVAOyvf2rylZjTyLZC4mfkSmapSVGMdRp0RrifjLxy7gIJRQ= X-Received: by 2002:a05:6000:2b05:b0:42b:3023:66be with SMTP id ffacd0b85a97d-42b30236929mr2584623f8f.32.1762698927536; Sun, 09 Nov 2025 06:35:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpjVxelPkLoe9A0H7b3V2vdn1iAiCkblwTe6HkdSI+gKgsH90Ujvlm6fNcM4uTvnOBQXp8OA== X-Received: by 2002:a05:6000:2b05:b0:42b:3023:66be with SMTP id ffacd0b85a97d-42b30236929mr2584603f8f.32.1762698927013; Sun, 09 Nov 2025 06:35:27 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:25 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , German Maglione , Hanna Czenczek , Eugenio =?utf-8?B?UMOpcmV6?= , Stefano Garzarella Subject: [PULL 08/14] vhost-user: make vhost_set_vring_file() synchronous Message-ID: <1ba9a5220325dd5260a0c37b6299ce38364a5120.1762698873.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699027476158500 From: German Maglione QEMU sends all of VHOST_USER_SET_VRING_KICK, _CALL, and _ERR without setting the NEED_REPLY flag, i.e. by the time the respective vhost_user_set_vring_*() function returns, it is completely up to chance whether the back-end has already processed the request and switched over to the new FD for interrupts. At least for vhost_user_set_vring_call(), that is a problem: It is called through vhost_virtqueue_mask(), which is generally used in the VirtioDeviceClass.guest_notifier_mask() implementation, which is in turn called by virtio_pci_one_vector_unmask(). The fact that we do not wait for the back-end to install the FD leads to a race there: Masking interrupts is implemented by redirecting interrupts to an internal event FD that is not connected to the guest. Unmasking then re-installs the guest-connected IRQ FD, then checks if there are pending interrupts left on the masked event FD, and if so, issues an interrupt to the guest. Because guest_notifier_mask() (through vhost_user_set_vring_call()) doesn't wait for the back-end to switch over to the actual IRQ FD, it's possible we check for pending interrupts while the back-end is still using the masked event FD, and then we will lose interrupts that occur before the back-end finally does switch over. Fix this by setting NEED_REPLY on those VHOST_USER_SET_VRING_* messages, so when we get that reply, we know that the back-end is now using the new FD. We have a few reports of a virtiofs mount hanging: - https://gitlab.com/virtio-fs/virtiofsd/-/issues/101 - https://gitlab.com/virtio-fs/virtiofsd/-/issues/133 - https://gitlab.com/virtio-fs/virtiofsd/-/issues/213 This is quite difficult bug to reproduce, even for the reporters. It only happens on production, every few weeks, and/or on 1 in 300 VMs. So, we are not 100% sure this fixes that issue. However, we think this is still a bug, and at least we have one report that claims this fixed the issue: https://gitlab.com/virtio-fs/virtiofsd/-/issues/133#note_2743209419 Fixes: 5f6f6664bf24 ("Add vhost-user as a vhost backend.") Signed-off-by: German Maglione Signed-off-by: Hanna Czenczek Reviewed-by: Eugenio P=C3=A9rez Reviewed-by: Stefano Garzarella Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251022162405.318672-1-gmaglione@redhat.com> --- hw/virtio/vhost-user.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 4b0fae12ae..63fa9a1b4b 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1327,8 +1327,11 @@ static int vhost_set_vring_file(struct vhost_dev *de= v, VhostUserRequest request, struct vhost_vring_file *file) { + int ret; int fds[VHOST_USER_MAX_RAM_SLOTS]; size_t fd_num =3D 0; + bool reply_supported =3D virtio_has_feature(dev->protocol_features, + VHOST_USER_PROTOCOL_F_REPLY_= ACK); VhostUserMsg msg =3D { .hdr.request =3D request, .hdr.flags =3D VHOST_USER_VERSION, @@ -1336,13 +1339,32 @@ static int vhost_set_vring_file(struct vhost_dev *d= ev, .hdr.size =3D sizeof(msg.payload.u64), }; =20 + if (reply_supported) { + msg.hdr.flags |=3D VHOST_USER_NEED_REPLY_MASK; + } + if (file->fd > 0) { fds[fd_num++] =3D file->fd; } else { msg.payload.u64 |=3D VHOST_USER_VRING_NOFD_MASK; } =20 - return vhost_user_write(dev, &msg, fds, fd_num); + ret =3D vhost_user_write(dev, &msg, fds, fd_num); + if (ret < 0) { + return ret; + } + + if (reply_supported) { + /* + * wait for the back-end's confirmation that the new FD is active, + * otherwise guest_notifier_mask() could check for pending interru= pts + * while the back-end is still using the masked event FD, losing + * interrupts that occur before the back-end installs the FD + */ + return process_message_reply(dev, &msg); + } + + return 0; } =20 static int vhost_user_set_vring_kick(struct vhost_dev *dev, --=20 MST From nobody Sat Feb 7 19:46: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=1762699049; cv=none; d=zohomail.com; s=zohoarc; b=RaO9jcwXIvKdWAKQwIkRyxQhqm6xRD10fudjEqleejGtbxTZ/9Ao/YbfhS9xwKvShq7DSHjn4z6TphfqC7pZAbouqQ9XkUpdeTxHxrYmiPHBD+b2Fpc017VXprhP8c3ihT3XDPHqn1h+3mHOPAAmBCHR43Fnpv0qBTYPCWS2g6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762699049; 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=wDQZ8/ZctjW7C+aZiLH0Gm46nUdO5UqyAPKuxlKrxtg=; b=ChGBS/ec/EfEFUChcdMnpe8YmefuaGP62CFb7jZJxQkBiTt4fG1GHrl5JTNHEATtXD44bGF3ORb8kjS7a5JCtGdrZlbVb/euD4Ldu1yLn2ui2/WuVq5SKkdeU7x1zNBh+FncZE3sZ/mQQRbGTfRYNJzGJNIY+7voCqF+4Akeys4= 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 1762699049476948.8767801714641; Sun, 9 Nov 2025 06:37:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6W1-0002Ek-AY; Sun, 09 Nov 2025 09:35:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vz-0002DN-5a for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vx-0001oU-QK for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:34 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-486-C5uNchdJO_6e3439a1NRjg-1; Sun, 09 Nov 2025 09:35:31 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4777b03b90fso1446355e9.1 for ; Sun, 09 Nov 2025 06:35:31 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477773f7749sm69323585e9.7.2025.11.09.06.35.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698933; 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=wDQZ8/ZctjW7C+aZiLH0Gm46nUdO5UqyAPKuxlKrxtg=; b=EvgYQxDqg3bZ1GqmjHz6vOmYhjphvyFju7nn4/NRP/AJbk4/pkFzgnkpfWebGOmEFKsSB8 7k1IB3oSrXRwNKhTbUjivOXaFSeWNgbzN584nO2AjFpXjDC+ZEKJmjA3jXebKJqGHbi/Cw jyLQW5o1SWisOHOPfbeJ3i6i7vtsX/o= X-MC-Unique: C5uNchdJO_6e3439a1NRjg-1 X-Mimecast-MFC-AGG-ID: C5uNchdJO_6e3439a1NRjg_1762698931 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698930; x=1763303730; darn=nongnu.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=wDQZ8/ZctjW7C+aZiLH0Gm46nUdO5UqyAPKuxlKrxtg=; b=ZyTOnGXaf/DSEK6woUfIAGsZ4XbclyufKiDMDp5ucA4drhMM/1QEzjVbmKJ62KOFSG 8w1Wiw05hw5LDYCN8E1PZQrdwoSLd9KRe0xOzWeZ37HN8CF0wft43pP2dvPzenSmLHHm IrnZEqDVm0ZBKyOGfYAHVqiPEyJYpyECwvjSmqN259uSSy2OqYR/PXmdA0VHE335BtHr fXX2JCTw27dxoiF8tcoL9bC5v4+Cnuk1W09Knmh+QL2u9krT5+myU8+ZC5qzT/Sj7xn7 f08QPuDau00CBu8IwpAd8FJdm0EV6+PYZXHS9u6KGblggQz2Pl7k7O7F/WWcl5ZtV8le l4dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698930; x=1763303730; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wDQZ8/ZctjW7C+aZiLH0Gm46nUdO5UqyAPKuxlKrxtg=; b=PtdmEFnKY4fSYcFHzpRqq83/aMbsyzWpscVV9eQL9vWP9Hy+P5gce8ihFE/79DOJXC NtY2gYj2ADB3NcdfmSglZRo/01gu2gtmQPcHcmr9oPSaRfTkrkZv9Dmr00jJbjp4d2jO WeI/XiQSZQKCPuz+epI8A2P+7VuP/uoQogghxS5nbDPnez9UdP64fxW82hHpVq3tkaXF mG/10PtfIFhT1T5qRfraQGxlNy1aYxI6vfJuoIq/d+239Nx7BAXhQD9HOV3fK04t12Ef K2Ya63bfdJSZ9WpO1+hm+Di0UEfKCPmQfRxNJTVbN0MFUC6geCmHnNVtziXyObxbicon TiBQ== X-Gm-Message-State: AOJu0Yzw/c7nODXGCpoC6NjSFYldn5t24BPFbkvk9KxJUQuZP2FXG6/J 20t4M/unwgwEdJknTAArKmoGc5ywMeaVSer+Up2By83aSZaxfq0Rp+hUlK04V2HMFv3Chflmoq4 Yk2lYAQI6otJFytgc0Rc91AdfAfc4jcqVCRfgp2PANvkF3ufwNyCoPfugijCrb8YYMW/D2KmUEn Q/9YvNeZ5TJEmfFIw412spK3MtU9sNtMBDTg== X-Gm-Gg: ASbGnctF6iN6HHvKwWszPgGeCXdN74OnlwcbMgUhraaCCdvXh/BUnTmJ/nUXtLySGkx oz1oOdrmvkPpAVkLmrmzcfqxIaSX01vkcHsAas2Tn+KgQYVhRC2oAAUGv2fjcisamzvYBhExB07 KVEUobg7EXxhvfLfYy2d9Qd+b2/XtF5ipKaC/g0tmuU2clfwCeHJEqnMCQEjKrS9mMI1AeJjAJ8 ZtyMojHculQQ5XrAhbSarkX9qVPjoSNYWf/at5oa3JQ5359uONS9HDt32ZlnTNVHa+i51frafml 4Tx8sCkClTalGdHh6ogilzxT6mX3MeRNyHgFCb4n3EmxOTVH+5kyjOWA3rdDXKy/QtA= X-Received: by 2002:a05:600c:4583:b0:471:14af:c715 with SMTP id 5b1f17b1804b1-47773229f38mr37995565e9.3.1762698930185; Sun, 09 Nov 2025 06:35:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYEchCI9I3AjX399478DwBenJprOjh5JRZkwcWbSaLXhNNHV4NNokF1arMA49X7j/0e2rEYA== X-Received: by 2002:a05:600c:4583:b0:471:14af:c715 with SMTP id 5b1f17b1804b1-47773229f38mr37995265e9.3.1762698929705; Sun, 09 Nov 2025 06:35:29 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:27 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Shameer Kolothum , Eric Auger , Igor Mammedov , Ani Sinha Subject: [PULL 09/14] tests/qtest/bios-tables-test: Prepare for _DSM change in the DSDT table Message-ID: <3e6ad83f209ea8cf497e5d160e44c1bc5e518f1a.1762698873.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699051779158500 From: Shameer Kolothum Subsequent patch will fix the GPEX _DSM method. Add the affected DSDT blobs to=C2=A0allowed-diff list for bios-table tests. Signed-off-by: Shameer Kolothum Reviewed-by: Eric Auger Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251022080639.243965-2-skolothumtho@nvidia.com> --- tests/qtest/bios-tables-test-allowed-diff.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..e2fce2e972 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,17 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/aarch64/virt/DSDT", +"tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt", +"tests/data/acpi/aarch64/virt/DSDT.memhp", +"tests/data/acpi/aarch64/virt/DSDT.pxb", +"tests/data/acpi/aarch64/virt/DSDT.topology", +"tests/data/acpi/aarch64/virt/DSDT.acpipcihp", +"tests/data/acpi/aarch64/virt/DSDT.hpoffacpiindex", +"tests/data/acpi/aarch64/virt/DSDT.viot", +"tests/data/acpi/aarch64/virt/DSDT.smmuv3-legacy", +"tests/data/acpi/aarch64/virt/DSDT.smmuv3-dev", +"tests/data/acpi/riscv64/virt/DSDT", +"tests/data/acpi/loongarch64/virt/DSDT", +"tests/data/acpi/loongarch64/virt/DSDT.topology", +"tests/data/acpi/loongarch64/virt/DSDT.numamem", +"tests/data/acpi/loongarch64/virt/DSDT.memhp", +"tests/data/acpi/x86/microvm/DSDT.pcie", --=20 MST From nobody Sat Feb 7 19:46: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=1762698999; cv=none; d=zohomail.com; s=zohoarc; b=TmDMe39y51y+fhowa82t45rQPsTIpqRuQjA32fjFa3qsNL9yoxDGIuci5qUyg8f1b0RamMoaln/1jv69a88Ew7JoVkQCM9QiB3YusSFGhM1ByOe151ma7Q43QahtHGXTZHE8pOM6SwKciqzGX2crT+AET18ab1wNbLb4jPVJ9UI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762698999; 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=e0/66sXsmsUJ5C1OsJfboRZvVx9JzW9VTegIObTcbHI=; b=mCO5X7wZ3l6KsdWkZzDTBe4ER1B5UIcqCiKAS44FGawFy2jTbHmQeTX8huUCdG1yIb6JD/iFmVlFiFtxm8PaxkczFx/fzmNst1kO6BZQywXIzSKl7E/+edWkC9hnP2McRjNWUIyYFPzzdDv+VPvicEIHEQ/wxXTJxCmbxA9xfds= 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 1762698999434662.1960517915521; Sun, 9 Nov 2025 06:36:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6W2-0002F6-Ul; Sun, 09 Nov 2025 09:35:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6W1-0002El-7M for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6Vz-0001ol-Pj for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:36 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-18-J97FPfSQNd-_od0YcfEg7A-1; Sun, 09 Nov 2025 09:35:33 -0500 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-42b2ad29140so855658f8f.0 for ; Sun, 09 Nov 2025 06:35:33 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b32c1ad2bsm5461214f8f.6.2025.11.09.06.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698935; 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=e0/66sXsmsUJ5C1OsJfboRZvVx9JzW9VTegIObTcbHI=; b=VxMjqQbh3K47pMYKYIbeJfKdyVww5QUs/YQh/8eSp9DCQl2TvNdsEJKRzSyNga59Wwam9d iRmoEvLAEw08WIhC+rqjh6daq9HcyfH2EVwVMUlZAserDcSCIdCSf6gveZscJKiyWarcoO nuV+skLxp+2Cq7zhu5pZ3jjdKHyer3k= X-MC-Unique: J97FPfSQNd-_od0YcfEg7A-1 X-Mimecast-MFC-AGG-ID: J97FPfSQNd-_od0YcfEg7A_1762698933 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698932; x=1763303732; darn=nongnu.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=e0/66sXsmsUJ5C1OsJfboRZvVx9JzW9VTegIObTcbHI=; b=q+OQtwGo2osDq0mWYNUtlxVmh7JKWTpriKcGG7A/LILPHcLhKl8DvAHKpL/dmu8b52 BK86JHfr2mZA+b9t7vtLkZprywxlftqUkAsyUUEqkVs4KaKR3tWa+4XfT/aqZgPfxz90 mxRgJZLNzTBNIMUE0jef/cTZk2kV3o/x3KXMhj4yK8WFothcyTSfkd2IXSbtukS4mAVg UozUIB4X2b7fdYIsvSMGA2UdDEDZjDUCXdKBSZfb+w7g4XVwCf6UoSIsdZsj/v3cnuF5 cKWr/WNdX5Tf3x7mpvFIj8YG/KlJZxNzcSMEzqLVnMmqbdB8Jx8apnLSHHNKbP+J/p5O 2kxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698932; x=1763303732; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=e0/66sXsmsUJ5C1OsJfboRZvVx9JzW9VTegIObTcbHI=; b=IetdLUOQTELNY3IR77IvD/vp4cLd5Q6HAhuU1aLHKH30dGFcuJMS5DzrbLZTl4eNbp onqPSYEHEVD9ZPhHIxYlsOh8E7WvGoaMcAtTysx7awV2dPJ17fs0OdIHtdTXb2Ouuy39 unfMlofsgim06R/VAfjyz7SPPQdxlNV8ue/+k0QHgvaSn6lhRqN9tIWLL5HMY129VFit cTYIqQRUo+DKaHpG7Qyu4mJMy/cUw3Cdy9xbiz9D+0bPyPHgYFIOiJ7D4sjmL6LGAkSI NBAYfYjtiaBO5IigSRSB/WMLEAhNwbIhB38mtj61tcY4OZ2z5vUPx0h9Z89Zu7tUKoDE CVlQ== X-Gm-Message-State: AOJu0YzwZYUIoDZjJeKg8XWuVk6w2E0O1S/Y7fn0zdd02g4fZixy7sPB 4J15AW9kHHHM8T1aCXON0IVQmVHCZDJzYHKiHk60tFtoKFRokI3X/35gFer0jSOOzOxYo0L/oyR OpEgHGreubqZRjBvSCP7JScfQ2J0IAgARX4v/epZRQ1XjLEMp2pErK4yl+1wjDgbz7Bjorr+gS9 YzDvGJfe8p7P+1gW2fO560jEauGGYSz+aSbQ== X-Gm-Gg: ASbGnctNNzN3lDp9kGvgY1QTDmESbhlYYyIfyxuyLhYDYml0+mqRGf45PkjREQvluzE FibZVcA+S4fRzq/IGG+u/pFKMYcUlEcGyD5Acncjn1TmYcVIfM/eg9/N7AHKcL6fLNAcwuKmXLa ivSdtanu5Ytqphr0Aofhoz8qdSGbHAtcxA0sQifXfVmRsAdIYZDBBnEm8BicWO8i8NlF2Ubsf2n WfhmYrcNEpGQ7V5npRXhBB8LCE8EIwJDgjw0gDA9SpTBWV25lKWs91lsLAT5wayZvgAyh4DBzq5 y/mfGgNrT103H1YaT/PjD99uGHUtoyjA0NnFkaoWPpFumA8gOp0hxL16wCJ60JZUnjw= X-Received: by 2002:a05:6000:2903:b0:3e7:6418:247b with SMTP id ffacd0b85a97d-42b2dbe4583mr4067484f8f.10.1762698932188; Sun, 09 Nov 2025 06:35:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IG16L4udtSGhwZaR52tIdTfsgtDPm8uZJlGLoLGLR1RK7hvxW1R+02gxdiSVC3RBJGyTdl2eQ== X-Received: by 2002:a05:6000:2903:b0:3e7:6418:247b with SMTP id ffacd0b85a97d-42b2dbe4583mr4067458f8f.10.1762698931659; Sun, 09 Nov 2025 06:35:31 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:29 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eric Auger , Shameer Kolothum , Zhangfei Gao , Jonathan Cameron , Igor Mammedov , Michael Tokarev Subject: [PULL 10/14] hw/pci-host/gpex-acpi: Fix _DSM function 0 support return value Message-ID: <325aa2d86a20786c308b0874d15a60d1b924bd0e.1762698873.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699001060158500 From: Eric Auger Currently, only function 0 is supported. According to the ACPI Specification, Revision 6.6, Section 9.1.1 =E2=80=9C_DSM (Device Specific Method)=E2=80=9D, bit 0 should be 0 to indicate that no other functions are supported beyond function 0. The resulting AML change looks like this: Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method { If ((Arg0 =3D=3D ToUUID ("e5c937d0-3553-4d7a-9117-ea4d19c3434d") { If ((Arg2 =3D=3D Zero)) { Return (Buffer (One) { - 0x01 // . + 0x00 // . }) } } } Fixes: 5b85eabe68f9 ("acpi: add acpi_dsdt_add_gpex") Signed-off-by: Eric Auger Signed-off-by: Shameer Kolothum Tested-by: Zhangfei Gao Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251022080639.243965-3-skolothumtho@nvidia.com> --- hw/pci-host/gpex-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/gpex-acpi.c b/hw/pci-host/gpex-acpi.c index 952a0ace19..4587baeb78 100644 --- a/hw/pci-host/gpex-acpi.c +++ b/hw/pci-host/gpex-acpi.c @@ -64,7 +64,7 @@ static Aml *build_pci_host_bridge_dsm_method(void) UUID =3D aml_touuid("E5C937D0-3553-4D7A-9117-EA4D19C3434D"); ifctx =3D aml_if(aml_equal(aml_arg(0), UUID)); ifctx1 =3D aml_if(aml_equal(aml_arg(2), aml_int(0))); - uint8_t byte_list[1] =3D {1}; + uint8_t byte_list[1] =3D {0}; buf =3D aml_buffer(1, byte_list); aml_append(ifctx1, aml_return(buf)); aml_append(ifctx, ifctx1); --=20 MST From nobody Sat Feb 7 19:46: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=1762699049; cv=none; d=zohomail.com; s=zohoarc; b=BhnRXpjc0kZ9cQSSTW/jctwotRZBClZorDZ7hud05TNMN6vXPjprZDW1+A2eBzwmtJNV/iCN8UY38dl6QbMyOaukL8FIRJlH6Kv0xUZhnmfqKl4AcBFccZaN1NzYRbTzA95aDKnacebWCBEHMjxh48DO6hNIGgw3+LmsJ+Rh1to= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762699049; 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=LFArUVOXUNIre6IYeQ7+Je+E4A2RV5Gu/4n3yh1Oct4=; b=NQzKBwckOtR/ySRKql9JiSpRzffIQyhtw/15Q+q0x/vv4LnaDit9aAa6+fWrUNQu8h55M7WVQvU8IQfE7heoYPQiQM62ah4zVSgArndaaOnzWsKMQ/TP4hiB3rCUBeU1xyS8yQkuEDOpJ4VLV02oDr1EI3ajRZ/X2AJk6TgRbbI= 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 1762699049540460.6200861534751; Sun, 9 Nov 2025 06:37:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6W5-0002FZ-DX; Sun, 09 Nov 2025 09:35:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6W3-0002FK-OJ for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6W1-0001ow-NN for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:39 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-671-CemaqsCpNjW33PppkWWxcg-1; Sun, 09 Nov 2025 09:35:35 -0500 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-42b2f79759bso913791f8f.2 for ; Sun, 09 Nov 2025 06:35:35 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42abe63ba87sm17792975f8f.14.2025.11.09.06.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698937; 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=LFArUVOXUNIre6IYeQ7+Je+E4A2RV5Gu/4n3yh1Oct4=; b=ZV1n1TgKrwplpa02y7XHbQdWZ99F01l/qEkcNNmIvzHot+xmmUGzYV0dpzgwNY1x7dUKcC XMTl/zgIF8ZrpzPIUVA05pr0vvcmQ2t4v4NJVhyvii3a93sPsQb/2R8n8EYZD6PTo/r82e BYmjtIEB68RJSzIMYMcFRCLxr50W9n4= X-MC-Unique: CemaqsCpNjW33PppkWWxcg-1 X-Mimecast-MFC-AGG-ID: CemaqsCpNjW33PppkWWxcg_1762698935 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698934; x=1763303734; darn=nongnu.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=LFArUVOXUNIre6IYeQ7+Je+E4A2RV5Gu/4n3yh1Oct4=; b=OTIZDAPrA3y+tW8TzfjYg6DyxHVqVD9xkJC51O+fEiPuyQG4AkTBIJeiZ78Z2itO9p IPkbtnAVLfMN35hNwQS0C6F9bdB9OkjVwqyz9DgOCANN9SGwC/t9w6gOA1QabLni9NIz 9iRv6tSYZzL6wUtlR2UgMVwk8PtEvq8OombHX2bLP9AlbOEbjh0Zs9p6rAYy+6cLwdwn C35KYN5Vh3XOGTyZgXx85mW9SzW5v0YaSYGz0Kpv08GwMfMXdaAJKo6lSbgjAhEhkf66 4TwPKsKSgjoKgKyHjHILWBi6ONtdrCxMqwgACknkMnTeC6azTYLe7+vKLZTNuQxhCMY4 FDMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698934; x=1763303734; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LFArUVOXUNIre6IYeQ7+Je+E4A2RV5Gu/4n3yh1Oct4=; b=dv7m5Ii3eR4u711p90zqbFmU3flgKHSwszrWtzKdsH3h4iDvYlHR1WxPivTb4lK+ud sEbL2Mgr4pUKB4Noi5BdB+ATqo8EaoVaZd/hGuEh9m5dUunXMG3QkkDhY5S2FOoBAVBF pAV2ujcx3rylFJ5b0PTZ0ACmi5EmttSswBzlBzabaQPx4RZpG5DU816Tyo1CUbAGGvwB vCKvqzx2lOVDtWUAv5cwpF6pPBrM5tiKujBCEayjGOUm0EYqJaSRnnMBxkiL9LJgrpM8 6jMWS8AMWb2UsHrSYaKa5hnb5ESCtCchoA2F6AwQ9XBTkIKFjC0MifUxverTt05vs9bc Ohug== X-Gm-Message-State: AOJu0YzHbLwRpxOkRGPO57nu2vbYBtOBahKsUKAC2WLhCBeCXnbxEQyP tdNOoOXrcs9TLF94C8HgPLMuTxeETNDy83lvjfQyoDSzeZVas8joKPizoYmDZZtQlZ+O0AkWUNM 62FLzI3bfF0Cxy4o1UHRY89Q8wgRrT4ncpSml8/IcPGinMWpKzXJGPegN5dMCVN8quqoq40Cah0 iXsSMD+e+2+LGpUEhP3+0IogAbpn3UPiXbkg== X-Gm-Gg: ASbGncugj6GlZSAPp9pVugt/FFx5KSE+cRrpNECcGiYHtFicxIgmrn4UhyL9Difi7SJ 4x7n0kdAu7jYcGVvzNzBOEt039nmQ6ir5QxVoBzPRSTfsWKyYVdy6lirEQG2SzaYqoyU3fgl5nW hJ69OW5V+RaBbYQvBotbURZ64D6Al+7BAyyHZ/hRdrRkq/0EKnFTMCE/vIu0fuyYwRfbCBBqRh8 Hir/4UopQYtRgOj9zdz6Lq7ZNU/qCqBqLycsft/R+AWj53CRVwwPcqTAfrlEDyHmD/c25a35aZ5 e/d3+2tdc3paPF1me0AsiGdWWnhAuNoA8mgLabgHrTbMgadlUAlMQwaiR0zz4JGfGrE= X-Received: by 2002:a05:6000:40c7:b0:42b:32d1:28c6 with SMTP id ffacd0b85a97d-42b32d12d9bmr2450897f8f.63.1762698934284; Sun, 09 Nov 2025 06:35:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHduG3Rx4z6ph5zvIZVWYZ38SsEo8IiAfIHPrfeENzG77p4XIkM5V4vVrDqLPaXkIvBYlB7Q== X-Received: by 2002:a05:6000:40c7:b0:42b:32d1:28c6 with SMTP id ffacd0b85a97d-42b32d12d9bmr2450862f8f.63.1762698933638; Sun, 09 Nov 2025 06:35:33 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:31 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Shameer Kolothum , Eric Auger , Igor Mammedov , Ani Sinha Subject: [PULL 11/14] tests/qtest/bios-tables-test: Update DSDT blobs after GPEX _DSM change 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699051752158500 From: Shameer Kolothum Update the reference DSDT blobs after GPEX _DSM change. This affects the aarch64 'virt', riscv64 "virt", loongarch64 "virt" and the x86 'microvm' machines. DSDT diff is the same for all the machines/tests: =C2=A0/* =C2=A0 * Intel ACPI Component Architecture =C2=A0 * AML/ASL+ Disassembler version 20230628 (64-bit version) =C2=A0 * Copyright (c) 2000 - 2023 Intel Corporation =C2=A0 * =C2=A0 * Disassembling to symbolic ASL+ operators =C2=A0 * - * Disassembly of tests/data/acpi/aarch64/virt/DSDT, Fri Oct 10 11:18:21 2= 025 + * Disassembly of /tmp/aml-E6V9D3, Fri Oct 10 11:18:21 2025 =C2=A0 * =C2=A0 * Original Table Header: =C2=A0 * =C2=A0 =C2=A0 Signature =C2=A0 =C2=A0 =C2=A0 =C2=A0"DSDT" =C2=A0 * =C2=A0 =C2=A0 Length =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x000014D9= (5337) =C2=A0 * =C2=A0 =C2=A0 Revision =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x02 - * =C2=A0 =C2=A0 Checksum =C2=A0 =C2=A0 =C2=A0 =C2=A0 0xA4 + * =C2=A0 =C2=A0 Checksum =C2=A0 =C2=A0 =C2=A0 =C2=A0 0xA5 =C2=A0 * =C2=A0 =C2=A0 OEM ID =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "BOCHS " =C2=A0 * =C2=A0 =C2=A0 OEM Table ID =C2=A0 =C2=A0 "BXPC =C2=A0 =C2=A0" =C2=A0 * =C2=A0 =C2=A0 OEM Revision =C2=A0 =C2=A0 0x00000001 (1) =C2=A0 * =C2=A0 =C2=A0 Compiler ID =C2=A0 =C2=A0 =C2=A0"BXPC" =C2=A0 * =C2=A0 =C2=A0 Compiler Version 0x00000001 (1) =C2=A0 */ =C2=A0DefinitionBlock ("", "DSDT", 2, "BOCHS ", "BXPC =C2=A0 =C2=A0", 0x000= 00001) =C2=A0{ =C2=A0 =C2=A0 =C2=A0Scope (\_SB) =C2=A0 =C2=A0 =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Device (C000) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Name (_HID, "ACPI0007" /* P= rocessor Device */) =C2=A0// _HID: Hardware ID =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Name (_UID, Zero) =C2=A0// = _UID: Unique ID =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} @@ -1822,33 +1822,33 @@ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Else =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0CDW1 |=3D 0x04 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Return (Arg3) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Method (_DSM, 4, NotSeriali= zed) =C2=A0// _DSM: Device-Specific Method =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0If ((Arg0 =3D= =3D ToUUID ("e5c937d0-3553-4d7a-9117-ea4d19c3434d") /* Device Labeling Inte= rface */)) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0If ((Arg2 =3D=3D Zero)) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0Return (Buffer (One) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0{ - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 0x01 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // . + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 0x00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // . =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0}) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0} =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Return (Buffe= r (One) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 0x00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 // . =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Device (RES0) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Name (_HID, "= PNP0C02" /* PNP Motherboard Resources */) =C2=A0// _HID: Hardware ID =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Name (_CRS, R= esourceTemplate () =C2=A0// _CRS: Current Resource Settings =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheab= le, ReadWrite, Signed-off-by: Shameer Kolothum Reviewed-by: Eric Auger Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251022080639.243965-4-skolothumtho@nvidia.com> --- tests/qtest/bios-tables-test-allowed-diff.h | 16 ---------------- tests/data/acpi/aarch64/virt/DSDT | Bin 5337 -> 5337 bytes .../data/acpi/aarch64/virt/DSDT.acpihmatvirt | Bin 5423 -> 5423 bytes tests/data/acpi/aarch64/virt/DSDT.acpipcihp | Bin 6246 -> 6246 bytes .../acpi/aarch64/virt/DSDT.hpoffacpiindex | Bin 5391 -> 5391 bytes tests/data/acpi/aarch64/virt/DSDT.memhp | Bin 6698 -> 6698 bytes tests/data/acpi/aarch64/virt/DSDT.pxb | Bin 7812 -> 7812 bytes tests/data/acpi/aarch64/virt/DSDT.smmuv3-dev | Bin 10274 -> 10274 bytes .../data/acpi/aarch64/virt/DSDT.smmuv3-legacy | Bin 10274 -> 10274 bytes tests/data/acpi/aarch64/virt/DSDT.topology | Bin 5539 -> 5539 bytes tests/data/acpi/aarch64/virt/DSDT.viot | Bin 5354 -> 5354 bytes tests/data/acpi/loongarch64/virt/DSDT | Bin 4603 -> 4603 bytes tests/data/acpi/loongarch64/virt/DSDT.memhp | Bin 5824 -> 5824 bytes tests/data/acpi/loongarch64/virt/DSDT.numamem | Bin 4609 -> 4609 bytes .../data/acpi/loongarch64/virt/DSDT.topology | Bin 4905 -> 4905 bytes tests/data/acpi/riscv64/virt/DSDT | Bin 3538 -> 3538 bytes tests/data/acpi/x86/microvm/DSDT.pcie | Bin 2985 -> 2985 bytes 17 files changed, 16 deletions(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index e2fce2e972..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,17 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/aarch64/virt/DSDT", -"tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt", -"tests/data/acpi/aarch64/virt/DSDT.memhp", -"tests/data/acpi/aarch64/virt/DSDT.pxb", -"tests/data/acpi/aarch64/virt/DSDT.topology", -"tests/data/acpi/aarch64/virt/DSDT.acpipcihp", -"tests/data/acpi/aarch64/virt/DSDT.hpoffacpiindex", -"tests/data/acpi/aarch64/virt/DSDT.viot", -"tests/data/acpi/aarch64/virt/DSDT.smmuv3-legacy", -"tests/data/acpi/aarch64/virt/DSDT.smmuv3-dev", -"tests/data/acpi/riscv64/virt/DSDT", -"tests/data/acpi/loongarch64/virt/DSDT", -"tests/data/acpi/loongarch64/virt/DSDT.topology", -"tests/data/acpi/loongarch64/virt/DSDT.numamem", -"tests/data/acpi/loongarch64/virt/DSDT.memhp", -"tests/data/acpi/x86/microvm/DSDT.pcie", diff --git a/tests/data/acpi/aarch64/virt/DSDT b/tests/data/acpi/aarch64/vi= rt/DSDT index 38f01adb61e6e4704821cee5e397888bb6b7e46d..35a862e44714d26ded01d40dc14= 7e76cc73a1c84 100644 GIT binary patch delta 26 icmcbqc~g_iCDeu3O33dtL7iC~z^4Z8`Aeu3O33dtL7iC~z^4`d0AB>ef3t>iv&CbHl*#KgY2MquK delta 26 hcmZ2wvdVGDP{3t>ja&CbHl*#KgS2MquK diff --git a/tests/data/acpi/aarch64/virt/DSDT.pxb b/tests/data/acpi/aarch6= 4/virt/DSDT.pxb index 71c632cedcca63a77a4cdde53d9bc392102687b6..f98dcbfc6b823bce6d5710e8056= a4e260fb92a02 100644 GIT binary patch delta 33 pcmZp%ZL#HY33dr-kz-(B65YtPONfzS^HCu#E=3DGpU7i6|D0sxh>2=3DD*^ delta 33 pcmZp%ZL#HY33dr-kz-(B65hzQONfzi^HCu#E=3DI=3D97i6|D0sxhu2=3DD*^ diff --git a/tests/data/acpi/aarch64/virt/DSDT.smmuv3-dev b/tests/data/acpi= /aarch64/virt/DSDT.smmuv3-dev index e8c2b376df7bddc2392945ea8cbb550b3d3b5e26..6c12a7aaf8a6315bac968a685f5= b6673e7248817 100644 GIT binary patch delta 55 zcmV-70LcHMP@+%@L{mgmA}9a=3D0;{nKx)K2Zv&9mO2@C+F5d#4LTY^ahOfZws5=3DyhD N9JL7n0JB{t#R0hw5ElRd delta 55 zcmV-70LcHMP@+%@L{mgmA}9a=3D0;sVHx)K2av&9mO2@Civ&CbHh83A%X2VVdH delta 26 hcmaE*`AU<^CDja&CbHh83A%R2VVdH diff --git a/tests/data/acpi/loongarch64/virt/DSDT b/tests/data/acpi/loonga= rch64/virt/DSDT index 55aa34f988d6ef69293e91c5fe45bee0a02bc5f1..09aa903c4e875f541223e36f59b= 28e101599df20 100644 GIT binary patch delta 26 icmeyZ{9BpJCDVb2A=3D=3D` delta 26 hcmZovX;k5I33dr#6k=3Ddte72EmG7lr;=3D6O8HtN>VV2A=3D=3D` diff --git a/tests/data/acpi/loongarch64/virt/DSDT.topology b/tests/data/ac= pi/loongarch64/virt/DSDT.topology index b2afebc938ce45d798c8aa5f45a463f1617e257e..7ab23f47cc82dd7bc1975e17893= a8cd61039e66d 100644 GIT binary patch delta 26 icmZ3fwo;ADCD (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 1762699007458697.1457434171907; Sun, 9 Nov 2025 06:36:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6W9-0002Hy-EJ; Sun, 09 Nov 2025 09:35:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6W6-0002G1-Mu for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6W5-0001pG-AV for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:42 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-reD1SJ-WPe-MHx8LEgprMA-1; Sun, 09 Nov 2025 09:35:39 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-47777158a85so10901395e9.3 for ; Sun, 09 Nov 2025 06:35:39 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477641b622asm90691765e9.4.2025.11.09.06.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698940; 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=ONThtaYMpfEDNo4b/8/a5deM0gkmLYr9IT8+NA0OabQ=; b=FToP/BR2gUjCJmXMFtIHdCPfPYNXbm/9G5vLa6JqgOI/xKGSJ1zt4n8oHHgvRpwBA503tb MLudtbYe7CD5G/K0hgmf8vf+Upl3segDDl3rbkzKSP32uxuFY5mwN9AjtP4r1PZa9Tiibm 0TX+Ug+SDD3HEfMFAa0Zqlgh2ywimWY= X-MC-Unique: reD1SJ-WPe-MHx8LEgprMA-1 X-Mimecast-MFC-AGG-ID: reD1SJ-WPe-MHx8LEgprMA_1762698938 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698938; x=1763303738; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ONThtaYMpfEDNo4b/8/a5deM0gkmLYr9IT8+NA0OabQ=; b=izXf7Fel77FTb4akKgiYqPzo67vBQ5NU50bkmCpLwfojDjusWvb2uQtzfhI2baohv3 SgMNIuDu9nxQJaspcBn8XJKEL/YkHHwC30zR+NFwIgylZgnpb6IkbpnvFUoLLRTtEjQ6 lAOK2BZgHu4Qp3L2fIVJCHqtr5uPmqSMLsIRsy3C+jqYA5lkmO2IEeM6wJYwz+Tp4azC Gl2pSn3pJLtNmltPO7G5rz9796m5GUaMdKGnfa+evjz99NxtZ6daoZirWlVFfMof02hE +ZpjewWiKgBg1zwJ1G7KD0xJK2NJeW2vLR60woTD1tbLwW9ih7wY3H7PvjdVYSkqmCyT PCLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698938; x=1763303738; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ONThtaYMpfEDNo4b/8/a5deM0gkmLYr9IT8+NA0OabQ=; b=pBotKNii5BBq4neDFlYDkN23D02NjowcbgIC5SYIbtJO+JEElo+7LzFUyPGlhC4bPE qTVKTGkC5tRiHcdW+NH/zDI4AGmFaCh0yLFIWhvIYNC3uxrW95Xih/4UbRJKENHoUk0f q5mytUIFzxpEqp7c3Dp9ndnejvrDyVVvSsL8zM0nNv4lCycUgj1+RuMQlTaPeYIcQDZG LY6OwXcIHD+U4h1S/nQpI4pcmElzbClJiTcyVTDXWpZVM18VyNe0B/U5HBeHAadkxuPc AtJ3hUJ6JQKNcv0azKwdGkhRZ5isVOAbcikuz81LCFARROt47I3jX/9hqs8SWo6fHGpd cHzA== X-Gm-Message-State: AOJu0YxJr1tVoMbFQAR/iMdLI7EaDpNJ4EVwzEQRmQ9Q5fn4t0KzMs+F EdxlsfmPlcYebuLZlseDWTmDKbXL87sIfcyv97NhTHh0ygVMN307qLtyJpzMvD10i/0YRo1Tr2L EWJgWxllPFaePdH9JLIZE2ZPVL9nfFiHduLvdrvQ93TWxVR4Ed1CzjeLxaNFAAOfX6y00G3L2nj KLJNM4ogdj/q+ufeAX7YuPggCY9uiy4a5ZwA== X-Gm-Gg: ASbGncsA2ksoC2Ss6XyM34Yw2jl3zqZl182y83NYPwIyIOz+Lb7TX8s4LnhVtravhet 3OW05DG5mmEY2qxH+qJrZBZmMG5jJPn3Celp5APpcbfrNHQTzqZPa7C+OBU96aAl63nBMECQaL6 C/1B5A321UjSHdxIXfizUhVogD3QA8Sl/aGppoqvmm6BNRIo69tP0OTr9bR2eB9/SFE9dxJebnb NaIPWmpAW82c4z3H06JuYKSwNK+rJopvADe0UNiyLXhaoAegsj2TyDvZi6rrowW1hty5OVPfhMZ +cPa2LpDjjGxURSaMqyDXUadq2vzupdXIuL3dSt5vvLosm+l6+9iN0r7AgWOs2ZaSsc= X-Received: by 2002:a05:600c:b86:b0:471:131f:85b7 with SMTP id 5b1f17b1804b1-47773236f9cmr44476565e9.15.1762698937872; Sun, 09 Nov 2025 06:35:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOlZrPkclZ2oUIzGWvQGRlGiYyVswgEkONUfufS1Ajv5GzdoYDMSHWWlw7jI4pLDAo3gkHpg== X-Received: by 2002:a05:600c:b86:b0:471:131f:85b7 with SMTP id 5b1f17b1804b1-47773236f9cmr44476315e9.15.1762698937266; Sun, 09 Nov 2025 06:35:37 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:33 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Paolo Abeni , Jason Wang , Lei Yang , Eduardo Habkost , Marcel Apfelbaum , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Yanan Wang , Zhao Liu Subject: [PULL 12/14] virtio-net: Advertise UDP tunnel GSO support by default Message-ID: <1c79ab6937ae938d3dfd4da1c01afc7eb599857e.1762698873.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762699009202158500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Paolo Abeni Allow bidirectional aggregated traffic for UDP encapsulated flows. Add the needed compatibility entries to avoid migration issues vs older QEMU instances. Signed-off-by: Paolo Abeni Acked-by: Jason Wang Tested-by: Lei Yang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <9c500fbcd2cf29afd1826b1ac906f9d5beac3601.1760104079.git.pabeni= @redhat.com> --- hw/core/machine.c | 4 ++++ hw/net/virtio-net.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 0580550e12..06e0c9a179 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -40,6 +40,10 @@ =20 GlobalProperty hw_compat_10_1[] =3D { { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, + { TYPE_VIRTIO_NET, "host_tunnel", "off" }, + { TYPE_VIRTIO_NET, "host_tunnel_csum", "off" }, + { TYPE_VIRTIO_NET, "guest_tunnel", "off" }, + { TYPE_VIRTIO_NET, "guest_tunnel_csum", "off" }, }; const size_t hw_compat_10_1_len =3D G_N_ELEMENTS(hw_compat_10_1); =20 diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 17ed0ef919..3b85560f6f 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -4299,19 +4299,19 @@ static const Property virtio_net_properties[] =3D { VIRTIO_DEFINE_PROP_FEATURE("host_tunnel", VirtIONet, host_features_ex, VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO, - false), + true), VIRTIO_DEFINE_PROP_FEATURE("host_tunnel_csum", VirtIONet, host_features_ex, VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO_CSUM, - false), + true), VIRTIO_DEFINE_PROP_FEATURE("guest_tunnel", VirtIONet, host_features_ex, VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO, - false), + true), VIRTIO_DEFINE_PROP_FEATURE("guest_tunnel_csum", VirtIONet, host_features_ex, VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM, - false), + true), }; =20 static void virtio_net_class_init(ObjectClass *klass, const void *data) --=20 MST From nobody Sat Feb 7 19:46: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=1762698986; cv=none; d=zohomail.com; s=zohoarc; b=bRDFuw/TSXGNI7j2lycGhFix0FfYa/xvm7+5g54ogwWAx2LUE5t38g6ZsVRLZLenxHip4RyJjRp0v3Aoy5CjI5r03wZlQZ826UZxUybla81dJO45foRo0Ni7rNXH2pWk4nsyMqQGuvm4iWdVoNrEkFsQpovoTWfT+YawioqN1Yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762698986; 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=/OeTxwvv54dni1NCLrJFSq1zlzTGsf0EcWk/x9CQJt8=; b=nXD7wdkPZqKCV7uoHCMzCkSKQV3PDU84I7tLYSB1/UtTrxrxN+e/reeMIUk2woBIi4J1VSP2l007mU1yEL1TGigfZIZltQ1BlDS7lc4piGOBCyEO+4299tbtNn6EhSO/2ACixbfC3EFFRHA/aDm3kgURmYgOj+mOjhcQWZ5o4H8= 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 1762698986771680.5439296892157; Sun, 9 Nov 2025 06:36:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6WB-0002J4-0l; Sun, 09 Nov 2025 09:35:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6W8-0002Hc-Qq for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6W7-0001pS-9W for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:44 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-135-L20qVr6PMDuBdNFFyfBJnQ-1; Sun, 09 Nov 2025 09:35:41 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4777b03b90fso1446705e9.1 for ; Sun, 09 Nov 2025 06:35:41 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47764152a13sm86982255e9.13.2025.11.09.06.35.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698942; 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=/OeTxwvv54dni1NCLrJFSq1zlzTGsf0EcWk/x9CQJt8=; b=VN8DUxXgpjQZ1HqX9cE5UooAjjeqY+cG+lLKcGMMyaaEho56PVqz7N8drpVrTguVB6A5IB 0eSod1sSmu3T4O6o5g6WQZnev5IrJTP95b0NekFnFDSM5bvTIZ3hdIRyzS0TVrnRqE5iBG tQvJ/ddUoe2SmAgYC2yKlHvkpXW7ON0= X-MC-Unique: L20qVr6PMDuBdNFFyfBJnQ-1 X-Mimecast-MFC-AGG-ID: L20qVr6PMDuBdNFFyfBJnQ_1762698940 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698940; x=1763303740; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/OeTxwvv54dni1NCLrJFSq1zlzTGsf0EcWk/x9CQJt8=; b=CNCX1zDLwK36xsUrc3Tz6Q6JL8lWyNJZuHDrOf87yeMb0b0RdWL/tUjulmY3UGG3fs WIiCNbGA6OpkKGdDavDn9OtxxcJ+kZFb9iB6JIzzwMFhMZ40pKKtfMoh+p8KTYM9XEsC JcejttzPfUolLeVyxLXSS0Ejfeh5aYpJzYtonSSvN1vGmC4CAlv9p1q+D0BzwIYdtVcH PI5DoHDkKfbVvX/pIQ/DTDikSA8gNi3NBcYnQuGUk3wriVF4HNCHUrb5VrKlnF/0FG6F heKlC2qk+6M2hR7C35v3F53PmUeJseUxP71o8ahqHW7sytRxJVniKd8SSE9XiHeqPak2 FU6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698940; x=1763303740; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/OeTxwvv54dni1NCLrJFSq1zlzTGsf0EcWk/x9CQJt8=; b=lItbMefxE8LdShei/eYK80OyhTtaIYqWAmPg/DYbOC3T6jNLOizE0lHrMfnEdM6Oaw D/5i2MOIsMjIQ0lW8/b9zePSvzf4GpkZrh7IXB/JDdYJDbswWiiRfT2acSD1VvMVHH4w QR/dAg5exZRowcQF0XcRCh/MZ23V3VfaxeDcKuUF4U6Ckci9+ULjKj2aYvF/TR57x+ay eLYk/oTQkOqwvoDLzdtzbQvMDn2DnaTdwN1vFKfVg3aL/MLdm5YVtW/BsY6j5RvFdpwg Ly87tQFG4+mk6uU2m7Gl4GFI7Kzl++V2XBucBBF5oliNi/D4OpUeqjMkShiOSBTGCd+i sSmw== X-Gm-Message-State: AOJu0YxrmKt40t0V4zp9rBqTlD8plCllEw5/LyI7zRzTU4hWdygcX0Bl Gi5mtFAmQUrLQOikbek+ZMigM/DD9ZntmUC1nfpP2EokLya54t9j7g+11vdC0QLtk/l/rsPCxix YDM70fGTY7QNcc1X6gKeE/boYdCBp+VI6709CSBzd3s6GoR5KABsTEeTj4scKsZblZGB6rbxVf0 kjAnsMUUD0LBnett1YXm1OuJhlHV+ybdSRkg== X-Gm-Gg: ASbGncv1Nv9+HYAeijOkFgEAOhlHdXikFbpXgYcJ1Z4j+cCGSCuk3hpI/iEFEvIQga7 AnIuxp2/podq2yzlYT5sd5PBuHx84hFYaug/h9DQtoGLwFfWwEa0IZqS5JFrbmQchDGIv2T4BTn mM9PswQxgXCLWSXqHoTMaBST+D7yZhy+yljqwL/q9DdvOO02qv6R0riKTDURPlY3cPdRVbhGVXk jTsFcx/zq/0YttPvc4bQiL7dsp9An7gbHtpsI5A3Q23a9emxlosDCM6V2d+Uh9uh5ql9hNB16ZF 2BghawQ7cvsQU5+nzr/IrEQ4LdSZJJ0XB6mu0M4U6B5WSYzJjMosLU96UQQcySyefrw= X-Received: by 2002:a05:600c:3b1f:b0:46f:b42e:e360 with SMTP id 5b1f17b1804b1-4777329c723mr45271015e9.40.1762698939808; Sun, 09 Nov 2025 06:35:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkuNGllf4/CT5cAuxcdY8M4gjWAC0Cof73QCIxwvY9xRnGWpVxzq9nZKAh3waEjNSoXnyd3A== X-Received: by 2002:a05:600c:3b1f:b0:46f:b42e:e360 with SMTP id 5b1f17b1804b1-4777329c723mr45270775e9.40.1762698939295; Sun, 09 Nov 2025 06:35:39 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:37 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 13/14] q35: increase default tseg size 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762698988836158500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Gerd Hoffmann With virtual machines becoming larger (more CPUs, more memory) the memory needed by the SMM code in OVMF to manage page tables and vcpu state grows too. Default SMM memory (aka TSEG) size is 16 MB, and this often is not enough. Bump it to 64 MB for new machine types. Signed-off-by: Gerd Hoffmann Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251106105640.1642109-1-kraxel@redhat.com> --- hw/i386/pc.c | 4 +++- hw/pci-host/q35.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 4d6bcbb846..f8b919cb6c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -81,7 +81,9 @@ { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }= ,\ { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, =20 -GlobalProperty pc_compat_10_1[] =3D {}; +GlobalProperty pc_compat_10_1[] =3D { + { "mch", "extended-tseg-mbytes", "16" }, +}; const size_t pc_compat_10_1_len =3D G_N_ELEMENTS(pc_compat_10_1); =20 GlobalProperty pc_compat_10_0[] =3D { diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 1951ae440c..a708758d36 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -663,7 +663,7 @@ static void mch_realize(PCIDevice *d, Error **errp) =20 static const Property mch_props[] =3D { DEFINE_PROP_UINT16("extended-tseg-mbytes", MCHPCIState, ext_tseg_mbyte= s, - 16), + 64), DEFINE_PROP_BOOL("smbase-smram", MCHPCIState, has_smram_at_smbase, tru= e), }; =20 --=20 MST From nobody Sat Feb 7 19:46: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=1762698986; cv=none; d=zohomail.com; s=zohoarc; b=LXCFHOlK1bAZcyNNNk79xQ9MR4WS1SUp2gu1ItS6jFi5nMhDqmFKHbdEbFa61tn6sbff+W7pSMarYPwxFHNHC9Ygmf7djJ27L38U4YataM/b9sYze5/fYykDvnQnNgbbJf0Tt5+6DLqGTRWMo/1iu0a2lyz6voK45ytkQWtXIwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762698986; 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=91i3UOyc3eezBkr70nZBeo508ef7mwoghfHMmpZOf8Q=; b=nc8PxSYz6uXV2uZospaNpZLtknrg/4B7EUkriF+s+tzhMtUvQOStLpBauLKGMSFy/MetSqLFZO95Dh/pSZgtbF5cHRNUDyrjTLBRrY+JYTQJgCUY5zighUn/MK1zCOGaql9FIAFdeb8yvFrgI8MvLyF7F8BBpa62lfQj0+mQcB8= 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 1762698986393865.3256905457762; Sun, 9 Nov 2025 06:36:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vI6WB-0002JJ-R3; Sun, 09 Nov 2025 09:35:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6WA-0002Iv-FS for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vI6W9-0001pm-1r for qemu-devel@nongnu.org; Sun, 09 Nov 2025 09:35:46 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-522-LwZLiGvqMGS61XFzcNncGQ-1; Sun, 09 Nov 2025 09:35:43 -0500 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-429c521cf2aso1515623f8f.3 for ; Sun, 09 Nov 2025 06:35:43 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:1536:2700:9203:49b4:a0d:b580]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b2f7a0512sm9051996f8f.18.2025.11.09.06.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 06:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762698944; 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=91i3UOyc3eezBkr70nZBeo508ef7mwoghfHMmpZOf8Q=; b=K22F+vu/OzNm+u6G6B8UQnwFaow627TYeIgFiLSPVI5fwhs74R3/luDiZWlujN5wPfTu8K v8hqYFlidl+ctz9flWIgdy84a4K4y958EEzSNmG/7Y5LfzcdNGhA47Fb/59PLg/F6glON/ KWST9H70iO94aS345u3UeW7jt6adJ+A= X-MC-Unique: LwZLiGvqMGS61XFzcNncGQ-1 X-Mimecast-MFC-AGG-ID: LwZLiGvqMGS61XFzcNncGQ_1762698942 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762698942; x=1763303742; darn=nongnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=91i3UOyc3eezBkr70nZBeo508ef7mwoghfHMmpZOf8Q=; b=CKamfHSHW8XHgQiscc6H+rNSMsWLwAZoH5igMCmbvxdUPfbdYDVQ+nT+csVNVDTvTi uJgNsBHt8qYJQhJQmBWfk0+GNlMk3YNOlO/Z1hx/et3wSbOg9sqoxvf4Vb390GXCE0AV OVfbGWpQDDe5OcFOafweiPmBzSVyQo5eMi+tT6iaZAwMpexZ7hyV/jtgv/JGiJgsnu94 VsOqA6oBLLmGlXDrOtr69+sIE5hHN0XjOcUmWmFLm3BVR5eELJilNgKj1f/7nn+vz7dG +wPnHFi3R+v1CxCJFQTtW8Dydp4nMdtqhNSpXmdB60q0fi/Y3b9uWbHSvfhpAU9Ol/9+ Aj8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762698942; x=1763303742; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=91i3UOyc3eezBkr70nZBeo508ef7mwoghfHMmpZOf8Q=; b=jh5kzzVjvzHt+QtB3K90WvdMWg1ZjwSqFVh172/lpUkDu1PLtS2gbX3C/uBi05WV3c gkHMn1fZQfcSMQTLNDQ5g11l7A1WkLpkpgY/+aIFdvrgPEbDZJTiMJOwLXVS3ogcSElm Id9mXgHuJmM86+Ik4SAp68U1CJVmVXVqd0hS0OwUhZC122n0QhHuPGE9UrVVONDx+czQ W6Od41XLr9/XRvstOtatAHQiCz3CW9bAbm/jZHSNuhMP4FFnYfrlrv+gMV6YFFlirnUZ hd+hFwGkqbVqstBavcX1iFk5bdXOEiK/d68lbHKAP3U3U4ejHQVU5WU6EilfoATBI2EB H/TQ== X-Gm-Message-State: AOJu0YzOFh7xSYL17JJ3h4vomlOszj9hZt5YMRj3BUegf+S0sl2P01cO iAwQuwWjUyBGuHj91QvZwvmQINWP/SrlwhZutm6PA/Ucmpd0r7pQ34+iizs2wryeAN9WIsFgp2W JNqTz64i3LNAzMUR4PYuRh3GEFV/wCIQeHRW+IIUrF6kGe6z3+4iOjatgnZLBSHT5bgsVtpDUYb fxHHQSasVt73CqAvf9/heuHumm6bkmgSDXTw== X-Gm-Gg: ASbGnctrbFg1axhpC+DHtGuS8QUuhO9eRqZlCUR28lofVvQ27iivbhS3Z6Pe67SH5Xj luXB4ZwquJpXVPGG/lu+kMoXwsofs6ISPysVVe7XR3PW1fxoOknivoE4KN2cRH9v90ylDV6MR2c F3G+/QnVWWaywaA55gJ5ctfJtSwInWAhxJbyg36pCjwRSahtmmh2BvzQK6yhFcdCwZHfCB/Cw88 tmzoEWybqN2lPmtxqXim1Q3fTFsXGmHAsaCYs5msMnQqF7FsbyYQsdOHRTthtcu0ZyCbSkQo+s1 5KtTL+1A+ZBCow1zchY6k+A9hsx57JG1mBgA7Sd0/RidixkvevPfWkhZ6t/3SsEkXeE= X-Received: by 2002:a05:6000:3108:b0:429:c4bb:fbc7 with SMTP id ffacd0b85a97d-42b2dc1e2f9mr3968901f8f.16.1762698941659; Sun, 09 Nov 2025 06:35:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEoqDzmGV6WXGm+1tuYHmCXemRc+5x+atrWLC4vOdFzBABDC0YzorwiF+LSsBUyvIK0r+18w== X-Received: by 2002:a05:6000:3108:b0:429:c4bb:fbc7 with SMTP id ffacd0b85a97d-42b2dc1e2f9mr3968879f8f.16.1762698941070; Sun, 09 Nov 2025 06:35:41 -0800 (PST) Date: Sun, 9 Nov 2025 09:35:39 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alyssa Ross , Stefano Garzarella Subject: [PULL 14/14] vhost-user.rst: clarify when FDs can be sent Message-ID: <97f24a0496be9e0a7216fea1fa0d54c1db9066e2.1762698873.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1762698987148158500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Alyssa Ross Previously the spec did not say where in a message the FDs should be sent. As I understand it, FDs transferred in ancillary data will always be received along with the first byte of the data they were sent with, so we should define which byte that is. Going by both libvhost-user in QEMU and the rust-vmm crate, that byte is the first byte of the message header. This is important to specify because it would make back-end implementation significantly more complicated if receiving file descriptors in the middle of a message had to be handled. Signed-off-by: Alyssa Ross Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20251106192105.3456755-1-hi@alyssa.is> --- docs/interop/vhost-user.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index 2e50f2ddfa..93a9c8df2b 100644 --- a/docs/interop/vhost-user.rst +++ b/docs/interop/vhost-user.rst @@ -411,6 +411,13 @@ in the ancillary data: * ``VHOST_USER_SET_INFLIGHT_FD`` (if ``VHOST_USER_PROTOCOL_F_INFLIGHT_SHMF= D``) * ``VHOST_USER_SET_DEVICE_STATE_FD`` =20 +When sending file descriptors in ancilliary data, *front-end* should +associate the ancilliary data with a ``sendmsg`` operation (or +equivalent) that sends bytes starting with the first byte of the +message header. *back-end* can therefore expect that file descriptors +will only be received in the first ``recvmsg`` operation for a message +header. + If *front-end* is unable to send the full message or receives a wrong reply it will close the connection. An optional reconnection mechanism can be implemented. --=20 MST