From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535697; cv=none; d=zohomail.com; s=zohoarc; b=Tj6l/MEngKsjowIxHiMK/Ba14kZU8To55T2VgXDzuAcYlu1l78xjO20zzos3SzaVwUGPCOVr/wIKvrsFma+8jIKUH/oJq6Hv+Q7EblG0DrX3xoiZW7QU5zZKEQzllfvJfjQcqKhW6kahEK9RGOz2ZSOQ6rHZh3RMv4PTVJeniOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535697; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UjeaXNVvmYuhlTP1mAa20WdTCtslkJfq6YEOWW1YjGU=; b=GZ9l6c+miceagD+zTV035OxiISoaSHYNNQIUKMl+RA+QlDjKp2Q1ChQIB22eekp9Bo+6eBYfOcm4fidfKmtbkV4wUJiIAKXp5U2wjQZ4Mdqt8TNQyXxh+BphP7P34DwV2k/HpgyhYA59gmvnKXB9ZoxjidZFOlVQbIuAMDaJi3w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15985356977601018.43732599088; Thu, 27 Aug 2020 06:41:37 -0700 (PDT) Received: from localhost ([::1]:46630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBI9o-0002QA-FI for importer@patchew.org; Thu, 27 Aug 2020 09:41:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI8d-0000bV-OB for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:23 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:53540 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI8b-0006Hx-Ec for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:23 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-124-D-pa-TN5Nfu5XotyH8B23w-1; Thu, 27 Aug 2020 09:40:17 -0400 Received: by mail-wm1-f72.google.com with SMTP id a5so2066948wmj.5 for ; Thu, 27 Aug 2020 06:40:17 -0700 (PDT) Received: from redhat.com (bzq-109-67-46-169.red.bezeqint.net. [109.67.46.169]) by smtp.gmail.com with ESMTPSA id b131sm5707539wmc.8.2020.08.27.06.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535619; 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=UjeaXNVvmYuhlTP1mAa20WdTCtslkJfq6YEOWW1YjGU=; b=iPa0CHuqIRiaDAwUKBznQj17sF+9iWFVLYzbkAjlRBR7l1LcpzaP7dBsF4r+SYC4XeXyaJ KJuA6tlbXleZ5CA9LjckIQqXUKSYkcEthw2QLI4Q3GFqa1/b9Edv9/Vl3sQVGoRBS4LuY1 Tbawo1CJxHJepxYV/JcX9v+9xnJ+LFM= X-MC-Unique: D-pa-TN5Nfu5XotyH8B23w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UjeaXNVvmYuhlTP1mAa20WdTCtslkJfq6YEOWW1YjGU=; b=mYkpbeS+GRfRPw9f4kuk8xLnsfezt00l2iC4WTWcxX8VL3qsqj7xOOWRMB/EvPIMcn kU7v85xrDSzk0aYNfs9JjdliOYuHKdBsBERPnqfaHsR8lrLXToYEoLHDHK1+uxURTrtV TH0y802f1XjmC+qIJZCN3F2LkZe3quz8aCJLbacZTxjLUvxNV1RRBQhURL8jP9VWa7t/ FLIAW575KaLpCRfLQRf3iXMk5BvF91SUEdSqCffBe/U0lHimUfD2HIgucvn1pto4apgG 6NEvAxfkJj9hnEY27cgf4NkfETfRIf/dl2okxB6kahKxLHGnUm65/vPfIrI06Tebl28s m/tQ== X-Gm-Message-State: AOAM5305aFua+p33XcbCkRpbL5wC2sbnVVGgzbBk1Vbxa4yIpC/WDwYC /GT6GRsQoBofkmQja+SS1naAOmr8AWac0oufy8nNY8d6JiAq38TzpVBKOQ3lpz3mEipjrE3F8mY vsgJavBwxDDkLsI4= X-Received: by 2002:a05:6000:1082:: with SMTP id y2mr1957833wrw.222.1598535616490; Thu, 27 Aug 2020 06:40:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVlUI38VXt7I+jkKAjEL3QG6KUquWhPKMA6QBeyxH8ufxkFDb9tyFAjsg8WElW2pA1QeJmKw== X-Received: by 2002:a05:6000:1082:: with SMTP id y2mr1957820wrw.222.1598535616272; Thu, 27 Aug 2020 06:40:16 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:14 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 01/13] acpi: allow DSDT changes Message-ID: <20200827133954.2118749-2-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=205.139.110.61; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 07:16:16 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We are updating all DSDTs with UID 0 for PCI Root. Allow changes. Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..ea46c3399e 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,22 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/DSDT.mmio64", +"tests/data/acpi/q35/DSDT.memhp", +"tests/data/acpi/q35/DSDT.tis", +"tests/data/acpi/q35/DSDT.acpihmat", +"tests/data/acpi/q35/DSDT.bridge", +"tests/data/acpi/q35/DSDT.ipmibt", +"tests/data/acpi/q35/DSDT.numamem", +"tests/data/acpi/q35/DSDT.dimmpxm", +"tests/data/acpi/q35/DSDT.cphp", +"tests/data/acpi/q35/DSDT", +"tests/data/acpi/pc/DSDT.memhp", +"tests/data/acpi/pc/DSDT.acpihmat", +"tests/data/acpi/pc/DSDT.bridge", +"tests/data/acpi/pc/DSDT.numamem", +"tests/data/acpi/pc/DSDT.ipmikcs", +"tests/data/acpi/pc/DSDT.dimmpxm", +"tests/data/acpi/pc/DSDT.cphp", +"tests/data/acpi/pc/DSDT", +"tests/data/acpi/virt/DSDT.memhp", +"tests/data/acpi/virt/DSDT.numamem", +"tests/data/acpi/virt/DSDT", --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535783; cv=none; d=zohomail.com; s=zohoarc; b=JxHAjMkuLSp2N/zpDw9qK+SrtwXaNoZ7gj15Q3jIXqz9EbfHbYbv3VCTFDwQkwyaUNk2RxtmDNfEBarX5l4kOcZj3rABxjj8MVUoWhx7drLTTMJOGu2W8hMu1/2O0gdVML7Xy9LXkrQeLFjJotZfxkAQjijRGMz72DSeBgQMLhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535783; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iI7KGtS7UrhW3zaOlauuOS3PfCI6dUBTbbFUZTldwKs=; b=eaa+QKr6W5ka9s75/pxiWVm9WAgNbQSJgSREJryxs6cx/oSldyVzwOjuwd3gHzFphRUSCAcXXway1DHyy8C9MRgpkK4bz1NIBVrl3MWTkXkQChlRJgbMj9ND7/rO5Q3VXeow3pRZSqyEuUkW1CyAxX+i0/CrCOBPa/RIsBpyC70= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598535783496689.6409270840855; Thu, 27 Aug 2020 06:43:03 -0700 (PDT) Received: from localhost ([::1]:55064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIBC-0005kq-6B for importer@patchew.org; Thu, 27 Aug 2020 09:43:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI8j-0000kj-5B for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:29 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:30926 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI8h-0006J4-1f for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:28 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-hVm6qeX9M_GMnJAkgWmDsQ-1; Thu, 27 Aug 2020 09:40:22 -0400 Received: by mail-wm1-f72.google.com with SMTP id b14so2073940wmj.3 for ; Thu, 27 Aug 2020 06:40:22 -0700 (PDT) Received: from redhat.com (bzq-109-67-46-169.red.bezeqint.net. [109.67.46.169]) by smtp.gmail.com with ESMTPSA id v29sm6028804wrv.51.2020.08.27.06.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535626; 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=iI7KGtS7UrhW3zaOlauuOS3PfCI6dUBTbbFUZTldwKs=; b=BRYBVcBCWF2moj1an/Nc+hYi5qKDkOce5cf67CPVMGUiRkUzfpyn4ahY/bXh1riAey6p3F XyhU68i3dCkdBpdP/QkEWZ1yCoxD1XtpyAygTGdMdquO4FGrzMncH9ncUMzKme847XM5Na +i1Snwz/z7bfM9AmI1q1iDxUJJNSlIM= X-MC-Unique: hVm6qeX9M_GMnJAkgWmDsQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=iI7KGtS7UrhW3zaOlauuOS3PfCI6dUBTbbFUZTldwKs=; b=Uwe8COkTLx7cZWqR505O9cvysNqB110J6+KYNdhe49VFf6TG5Q690Cc6gnlX71ntt9 1CqLmLUTm3NpoI/PEiKCyW+3ieKOCGFWMykspLtQ4ub4VVPp6Hy+VrLhLGpK2Nr7d+YJ rZxD9swCU3maRyyF9iRLMR1yJW7I1Hx6JWROuco4ybEgSqaVnA7o/kPiH5datQdPXYyF HMqLX0Add6b3d6XPhTgI/eIYo1sbRgq+CmAEqYl69ZOKV3kLN2VAMC1z8qJjVDi7lGOT g5y7dCtxLrJG64ieASuUdjMIAJO5IGAWFn/rqD7B5cA7QIM7LFSYMjLkQQPb2HxO2Vx0 xQgA== X-Gm-Message-State: AOAM531cUz3OJOhURkKA0617YMAmUzV7OhYLhd1CchDQTBQeB7ThapoA a6rpQgyamvfK9fkrgCiKJO5jdN9qBCPBI5UOagi1+fRS/0HLSiSLlCVhSV3mWa3Qrf+83sjtu/d TpKGnOrfx9eSYfGM= X-Received: by 2002:adf:b602:: with SMTP id f2mr19477386wre.186.1598535621000; Thu, 27 Aug 2020 06:40:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXYeS1He6uSI6CutcyKZVrLMH9s2dcUvmEka9mA+Zq4XB4pskjyKkBAgv+kfbWxW/vEEkfPQ== X-Received: by 2002:adf:b602:: with SMTP id f2mr19477361wre.186.1598535620658; Thu, 27 Aug 2020 06:40:20 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:16 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 02/13] i386/acpi: fix inconsistent QEMU/OVMF device paths Message-ID: <20200827133954.2118749-3-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=207.211.31.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 02:56:52 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Vitaly Cheptsov , qemu-stable@nongnu.org, Eduardo Habkost , Paolo Bonzini , Igor Mammedov , Laszlo Ersek , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" macOS uses ACPI UIDs to build the DevicePath for NVRAM boot options, while OVMF firmware gets them via an internal channel through QEMU. Due to a bug in QEMU ACPI currently UEFI firmware and ACPI have different values, and this makes the underlying operating system unable to report its boot option. The particular node in question is the primary PciRoot (PCI0 in ACPI), which for some reason gets assigned 1 in ACPI UID and 0 in the DevicePath. This is due to the _UID assigned to it by build_dsdt in hw/i386/acpi-build.c Which does not correspond to the primary PCI identifier given by pcibus_num in hw/pci/pci.c Reference with the device paths, OVMF startup logs, and ACPI table dumps (SysReport): https://github.com/acidanthera/bugtracker/issues/1050 In UEFI v2.8, section "10.4.2 Rules with ACPI _HID and _UID" ends with the paragraph, Root PCI bridges will use the plug and play ID of PNP0A03, This will be stored in the ACPI Device Path _HID field, or in the Expanded ACPI Device Path _CID field to match the ACPI name space. The _UID in the ACPI Device Path structure must match the _UID in the ACPI name space. (See especially the last sentence.) Considering *extra* root bridges / root buses (with bus number > 0), QEMU's ACPI generator actually does the right thing; since QEMU commit c96d9286a6d7 ("i386/acpi-build: more traditional _UID and _HID for PXB root buses", 2015-06-11). However, the _UID values for root bridge zero (on both i440fx and q35) have always been "wrong" (from UEFI perspective), going back in QEMU to commit 74523b850189 ("i386: add ACPI table files from seabios", 2013-10-14). Even in SeaBIOS, these _UID values have always been 1; see commit a4d357638c57 ("Port rombios32 code from bochs-bios.", 2008-03-08) for i440fx, and commit ecbe3fd61511 ("seabios: q35: add dsdt", 2012-12-01) for q35. Cc: qemu-stable@nongnu.org Suggested-by: Laszlo Ersek Tested-by: Vitaly Cheptsov Signed-off-by: Michael S. Tsirkin Reviewed-by: Laszlo Ersek --- hw/i386/acpi-build.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index b7bcbbbb2a..7a5a8b3521 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1497,7 +1497,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, dev =3D aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03"))); aml_append(dev, aml_name_decl("_ADR", aml_int(0))); - aml_append(dev, aml_name_decl("_UID", aml_int(1))); + aml_append(dev, aml_name_decl("_UID", aml_int(0))); aml_append(sb_scope, dev); aml_append(dsdt, sb_scope); =20 @@ -1512,7 +1512,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"))); aml_append(dev, aml_name_decl("_CID", aml_eisaid("PNP0A03"))); aml_append(dev, aml_name_decl("_ADR", aml_int(0))); - aml_append(dev, aml_name_decl("_UID", aml_int(1))); + aml_append(dev, aml_name_decl("_UID", aml_int(0))); aml_append(dev, build_q35_osc_method()); aml_append(sb_scope, dev); aml_append(dsdt, sb_scope); --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535704; cv=none; d=zohomail.com; s=zohoarc; b=gqdWGFfgfghuPvx6dT6beavfHgACbPMScxvIMYwFk+IW4laj3wuXCaEw5Jx2aKY6A8ohmHKvo/h4Q2DDqX3cCGsctW4zoSkrNOUfRc4grlXORDCTQcIUkyoHqzxqv5Oo46Ekjm7B5g1phHco587qPwSwTdKR3IKHOmmlNPDKSs0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535704; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O+Jdn5rlTkIqQs4IBOaacsbGO+yrRT0GNqOf9hAByzs=; b=E35DnMjWqTD74Qkwd8uQFPctYE6WrvCzwFtaXsXk6I0WcOfzTYjI79rA8mVl8YX2i3ZB/rLPYM1zRjzbXUYjwVI0y6acFN0GMRyNgy89JL7mZH0S5ZUtztDE5czbWT61kI6px1zSDTrkzKEzVr6BsmFqODMPqIGah7gGV+S2kAc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598535704898937.7058078023523; Thu, 27 Aug 2020 06:41:44 -0700 (PDT) Received: from localhost ([::1]:47400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBI9v-0002iv-Ei for importer@patchew.org; Thu, 27 Aug 2020 09:41:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI8n-0000tV-5y for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI8l-0006JJ-5b for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:32 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-U-ds8ZnrNc-TAe_YBezcgA-1; Thu, 27 Aug 2020 09:40:27 -0400 Received: by mail-wm1-f72.google.com with SMTP id c198so2144770wme.5 for ; Thu, 27 Aug 2020 06:40:27 -0700 (PDT) Received: from redhat.com ([192.117.173.58]) by smtp.gmail.com with ESMTPSA id c10sm5045320wmk.30.2020.08.27.06.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535630; 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=O+Jdn5rlTkIqQs4IBOaacsbGO+yrRT0GNqOf9hAByzs=; b=RrQ/m6/zE8GuypwEc+PAdt6ISnoHFrQg3POR6KMI4JMqvlZJVDHwPS3J6BUPp11B7Tuc6y iNu1qiBZuo255wTO2cHkt315OjHC1EYerkpXdY6jywNrN1oc+wUqq6LTQUBuGF+ESUXeO6 iHnwMLjKQ3Rns6mboi7jxmPaJXhTZLk= X-MC-Unique: U-ds8ZnrNc-TAe_YBezcgA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=O+Jdn5rlTkIqQs4IBOaacsbGO+yrRT0GNqOf9hAByzs=; b=Zn+a8IW1bOpb/G843Xo1yzUAg7jdRkqR6AWbxZiR1lh0td3DKK7cQ0pbQ1ADS88vPn MfYqUutkHR6RDQRx1UIeXrGXqcbhkTokpedQHUYYnHjeMqe7eBXqJkLTMZpkl/IPDCtG EX1tg82s41Yo3l9DhFlD9DlwcSflh5qsbh+Zs1S6fY8eX0WpAZqrlSA6j1FlY+cL+mwH 2bWCHFarGOx7cI1DC34fgHMMLvKQGqlFYYRbTXfG2+I2hqJhW/f8JqHivzZDTuugk6BK 3jBCkI7S8tAAoSwWtGRrRBQId5/s96+x6y1YC6Sf3a+P4vocOM50xasGt8JG8rNp3T+4 Fz3Q== X-Gm-Message-State: AOAM530Y3xw/ZSGGjd9slzqNu4ovRsmVGZHBsd8kkB/m+cA9BFjMdXpO smDAxmGgeWvg4Bzn78ToAzUyqlwjATX9aXy01GuLgTClBjq5kTwOF105FsGnMdbTWQRCFdc/WQs s8jQC5rVXaVN+alQ= X-Received: by 2002:adf:f58e:: with SMTP id f14mr13441169wro.251.1598535626064; Thu, 27 Aug 2020 06:40:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeO1yNHlhNkeNFLrV26p2lSO6onfx+3qz1X8T4LR9OMNB4I7I3jKaQ9XLpa0+nxIqwc2HH0g== X-Received: by 2002:adf:f58e:: with SMTP id f14mr13441156wro.251.1598535625877; Thu, 27 Aug 2020 06:40:25 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:21 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 03/13] arm/acpi: fix an out of spec _UID for PCI root Message-ID: <20200827133954.2118749-4-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 02:10:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Vitaly Cheptsov , qemu-stable@nongnu.org, Shannon Zhao , qemu-arm@nongnu.org, Igor Mammedov , Laszlo Ersek Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On ARM/virt machine type QEMU currently reports an incorrect _UID in ACPI. The particular node in question is the primary PciRoot (PCI0 in ACPI), which gets assigned PCI0 in ACPI UID and 0 in the DevicePath. This is due to the _UID assigned to it by build_dsdt in hw/arm/virt-acpi-build.c Which does not correspond to the primary PCI identifier given by pcibus_num in hw/pci/pci.c In UEFI v2.8, section "10.4.2 Rules with ACPI _HID and _UID" ends with the paragraph, Root PCI bridges will use the plug and play ID of PNP0A03, This will be stored in the ACPI Device Path _HID field, or in the Expanded ACPI Device Path _CID field to match the ACPI name space. The _UID in the ACPI Device Path structure must match the _UID in the ACPI name space. (See especially the last sentence.) A similar bug has been reported on i386, on that architecture it has been reported to confuse at least macOS which uses ACPI UIDs to build the DevicePath for NVRAM boot options, while OVMF firmware gets them via an internal channel through QEMU. When UEFI firmware and ACPI have different values, this makes the underlying operating system unable to report its boot option. Cc: qemu-stable@nongnu.org Reported-by: Vitaly Cheptsov Signed-off-by: Michael S. Tsirkin Reviewed-by: Laszlo Ersek --- hw/arm/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 91f0df7b13..0a482ff6f7 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -170,7 +170,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapE= ntry *memmap, aml_append(dev, aml_name_decl("_CID", aml_string("PNP0A03"))); aml_append(dev, aml_name_decl("_SEG", aml_int(0))); aml_append(dev, aml_name_decl("_BBN", aml_int(0))); - aml_append(dev, aml_name_decl("_UID", aml_string("PCI0"))); + aml_append(dev, aml_name_decl("_UID", aml_int(0))); aml_append(dev, aml_name_decl("_STR", aml_unicode("PCIe 0 Device"))); aml_append(dev, aml_name_decl("_CCA", aml_int(1))); =20 --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535820; cv=none; d=zohomail.com; s=zohoarc; b=lsQviXqUEqa6ZIB1lMlpRT+H+78CrWlHlqRNWlQuntzzgXR3Bxbj4H+QQc/g4Wt5NbQXgsETtrLULhvglzaXrW2ybQ2uvFEUQ8+Y1yS7jnnTUY/5NlUc7cDOEO7JGtAfpBS3BkY/VIWF/k6e8vcTtEFoMl86HyrrzThTdjrpkIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535820; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9MryNRxQ6ULiJofurlt8UiScI0QAkE96jDnD1eW9uNs=; b=k9hgtbmQYALqV4uude1PS3Y29CJu1bBDGak09oZ66yQN3cC6v722JhVysJ4wEe24JLoUkHJ2FOk3XlgMEFDPM7bveiTcxO1YVJ4AtZqdShTLN7bFRjzc0toReP/X4cM9F3l1orkCMB/XbMtHfWuKm1aQfpt08IK/2hHPfGZX6XU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598535820482308.80519217304436; Thu, 27 Aug 2020 06:43:40 -0700 (PDT) Received: from localhost ([::1]:57514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIBl-0006k6-6K for importer@patchew.org; Thu, 27 Aug 2020 09:43:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI8q-000111-7j for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:36 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:26029 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI8o-0006Jn-9L for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:35 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-39iPnWfVOf2GwUK1W_2Vtg-1; Thu, 27 Aug 2020 09:40:32 -0400 Received: by mail-wm1-f72.google.com with SMTP id p184so2145852wmp.7 for ; Thu, 27 Aug 2020 06:40:31 -0700 (PDT) Received: from redhat.com ([192.117.173.58]) by smtp.gmail.com with ESMTPSA id d10sm6344774wrg.3.2020.08.27.06.40.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535633; 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=9MryNRxQ6ULiJofurlt8UiScI0QAkE96jDnD1eW9uNs=; b=MKe1hnu1v4r/pvnN8D50hGg0WEKRyy7pT0R+gcpZ+YW+aXHgngvTVdcKfb5P2CqAJTn0g+ Ev+98LzZabqNW2x7KdHibFOpLcj5QVPvSE87TtfrQOaIdwjytiXA/ELrXw6XoS+Djhe3WB oqtZzBVbhWm0ND9mTJixcJjCR1UAPRM= X-MC-Unique: 39iPnWfVOf2GwUK1W_2Vtg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9MryNRxQ6ULiJofurlt8UiScI0QAkE96jDnD1eW9uNs=; b=XwpL10FP1lvXChYUs3Y3IN4VrDO9a6nyRqlGrN1+wMoJiJOi6/KsxjhOB1UNgJkdC7 a9h0jIciX4FGik6WHfa4swnAhq8tXDHOn/iZRbb5orn2ClbZubU94+1Xzy/PgokSrX4L pnj5DHQzYp8vOQaRNmZgeKPQ1mVz7yFlLvTaVRrE8SbY7cAIxdBcQax4erZOklPph17O kCpl2ulfALt70XKR5BcOXwWAMxaycypDtEMEeLRuLB3lsYrN+h0ohB0M3PE765a8U9D9 bCvfxlY1tvBAzilUyPrmnW/HtZkzAf5KJBwlsdTbB1VAEtiVfL1Z2CsyJu72PLbTzYP2 UWEA== X-Gm-Message-State: AOAM5323+I5Dd0MgaVeU0neycaC83Ptnu1CNL90ZFgGGNdbA61BZ5stn aR1pV35F/TyMUSocwWdOeKvKVV9KvNCjtjIkCll506ey41vEjtGHxtQTzYt7An/pDIjJsR9x3K+ 0FoROCo+oQRcB0eo= X-Received: by 2002:adf:f812:: with SMTP id s18mr21035837wrp.96.1598535630670; Thu, 27 Aug 2020 06:40:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqResxLo3RawtVvCSWJBwxtNx2KGjGYVdM/JalwNYFRdf0mTV2aa53HteXwYgm2v/CXOYO9Q== X-Received: by 2002:adf:f812:: with SMTP id s18mr21035825wrp.96.1598535630462; Thu, 27 Aug 2020 06:40:30 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:26 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 04/13] disassemble-aml: -o actually works Message-ID: <20200827133954.2118749-5-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=205.139.110.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 00:13:19 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Turns out that option was borken due to weird iasl command line handling. Fix it. Signed-off-by: Michael S. Tsirkin --- tests/data/acpi/disassemle-aml.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/data/acpi/disassemle-aml.sh b/tests/data/acpi/disassemle= -aml.sh index 1d8a4d0301..253b7620a0 100755 --- a/tests/data/acpi/disassemle-aml.sh +++ b/tests/data/acpi/disassemle-aml.sh @@ -42,11 +42,16 @@ do else extra=3D"" fi - asl=3D${aml}.dsl if [[ "${outdir}" ]]; then - asl=3D"${outdir}"/${machine}/${asl} + # iasl strips an extension from prefix if there. + # since we have some files with . in the name, the + # last component gets interpreted as an extension: + # add another extension to work around that. + prefix=3D"-p ${outdir}/${aml}.dsl" + else + prefix=3D"" fi - iasl -d -p ${asl} ${extra} ${aml} + iasl ${extra} ${prefix} -d ${aml} done done --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535793; cv=none; d=zohomail.com; s=zohoarc; b=dQbPUidP/DPBbdafCPWMuNePkCLq4H05nbTpWIis17xli8W6O1CCosyUHPOKG9gVjCYtGFngE8ufmtWyIoD3I74lxSxd7yC51Ndkg1clNssp5qH72aPXlh1cZsMU8UwvAWMIm4fWKa5GVOusJ4KumOdAvD6a15bEmpOiBw/Z74o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535793; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hb3d5Gp+QjFQPJjKtY1sbRQvW/6sObSlypIuoM9UNYY=; b=dTqOCIF3w/c0VzDbvfPcMsTwvEv5MwSRLEhe21O+90Xaz1rnRWP0i6JQX0MSzIMm+J2ahVKW0e9Xl/qKw4Kc+Lg9Ik5673FGu5HrlO8kLTWUnn0RhUnW4EGZ+xpvUwm1tdrdJlHa8TUXL/HAyg1UeiQScs0V9/2+Smtq9OgzYBU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598535793062473.9080420771203; Thu, 27 Aug 2020 06:43:13 -0700 (PDT) Received: from localhost ([::1]:55978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIBL-00067I-Np for importer@patchew.org; Thu, 27 Aug 2020 09:43:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI8w-0001Im-2z for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:42 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:36446 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI8s-0006KA-M1 for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:41 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-79-mDX-HXqmON-bLsPExGNwDA-1; Thu, 27 Aug 2020 09:40:35 -0400 Received: by mail-wm1-f70.google.com with SMTP id z25so2070213wmk.4 for ; Thu, 27 Aug 2020 06:40:35 -0700 (PDT) Received: from redhat.com (bzq-109-67-46-169.red.bezeqint.net. [109.67.46.169]) by smtp.gmail.com with ESMTPSA id 92sm6638312wra.19.2020.08.27.06.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535637; 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=hb3d5Gp+QjFQPJjKtY1sbRQvW/6sObSlypIuoM9UNYY=; b=LGkRak9+qjDl1gNtqq2W1IphVr+C9jwWSM4/55BbppJXakLvVcUUtzGS16+baSfrq15GQ3 zcU4eyEj5S1av7uPlw5lnFRPInxJMGFDksGggZpGlq3SkaF1M82u8YKMcJTmox8SWBhyUp 897RXREW3813qH3//Eaq3Fvcf9BZELM= X-MC-Unique: mDX-HXqmON-bLsPExGNwDA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hb3d5Gp+QjFQPJjKtY1sbRQvW/6sObSlypIuoM9UNYY=; b=VWLqBbuOLOr6SdKNEfw4xDE9wsJYR7EEnOxFkGVV0/v4oTj3zFJ6psu9G/GYAZ2oAl jrWadEUbAe8FnUz9C2Zn2B6udlfrOHInQ3yl83dXTtKsL8xORFYJnB3xU/Zbujs0CTHj Lq/TbB4/0QXoK9Bwz35VRzfiLwezq7Ul2psg2u6Gu2Ww2p6+hW3heA5pR8sQQ4qt6du4 JhkgyKh0PKFSbqg/+QXRS2j2pMDq8BjbrY9ukOf0aOSjyPMOQdHMMgYxW08cjg1+PRwd Fo5BrbzqcSQtms3LEMv+HeqoV76GK2mKan3za6TuL+MCzQg/DzOAp/oAIYUcRAwJlUag y7Ag== X-Gm-Message-State: AOAM5325t8Ng/UBL+sZwOxfzaDTOCFRbOgLxKY2HVHJhyoxJcrEZ472A QBzB4iXfcA49wJeQDSjvrv5EXUbSiwYWi9tvhbkhZ6flBGWsii7mSObl1JcvRCZAO4g61J+h8iP xUYQqbYk7xpnBXhM= X-Received: by 2002:a7b:c317:: with SMTP id k23mr11259961wmj.167.1598535633961; Thu, 27 Aug 2020 06:40:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwISVGmljPd/L8BFrP++CrroqrMdGATA1VvrUrhEWIaGwNwxMBl3tjXNn3TfYOtKg52nXuMfg== X-Received: by 2002:a7b:c317:: with SMTP id k23mr11259929wmj.167.1598535633335; Thu, 27 Aug 2020 06:40:33 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:31 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 05/13] acpi: update expected DSDT files with _UID changes Message-ID: <20200827133954.2118749-6-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=207.211.31.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 02:56:52 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" _UID of the PCI root has been changed to 0. Update expected files accordingly, and re-enable their testing. Full diff of changed files disassembly: diff -ru /tmp/old/tests/data/acpi/pc/DSDT.acpihmat.dsl /tmp/new/tests/data/= acpi/pc/DSDT.acpihmat.dsl --- /tmp/old/tests/data/acpi/pc/DSDT.acpihmat.dsl 2020-08-04 17:37:55.72779= 8633 -0400 +++ /tmp/new/tests/data/acpi/pc/DSDT.acpihmat.dsl 2020-08-04 17:42:57.25885= 9861 -0400 @@ -50,7 +50,7 @@ { Name (_HID, EisaId ("PNP0A03") /* PCI Bus */) // _HID: Hardwa= re ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID } } diff -ru /tmp/old/tests/data/acpi/pc/DSDT.bridge.dsl /tmp/new/tests/data/ac= pi/pc/DSDT.bridge.dsl --- /tmp/old/tests/data/acpi/pc/DSDT.bridge.dsl 2020-08-04 17:37:55.7377986= 01 -0400 +++ /tmp/new/tests/data/acpi/pc/DSDT.bridge.dsl 2020-08-04 17:42:57.2628598= 49 -0400 @@ -50,7 +50,7 @@ { Name (_HID, EisaId ("PNP0A03") /* PCI Bus */) // _HID: Hardwa= re ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID } } diff -ru /tmp/old/tests/data/acpi/pc/DSDT.cphp.dsl /tmp/new/tests/data/acpi= /pc/DSDT.cphp.dsl --- /tmp/old/tests/data/acpi/pc/DSDT.cphp.dsl 2020-08-04 17:37:55.745798576= -0400 +++ /tmp/new/tests/data/acpi/pc/DSDT.cphp.dsl 2020-08-04 17:42:57.265859839= -0400 @@ -50,7 +50,7 @@ { Name (_HID, EisaId ("PNP0A03") /* PCI Bus */) // _HID: Hardwa= re ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID } } diff -ru /tmp/old/tests/data/acpi/pc/DSDT.dimmpxm.dsl /tmp/new/tests/data/a= cpi/pc/DSDT.dimmpxm.dsl --- /tmp/old/tests/data/acpi/pc/DSDT.dimmpxm.dsl 2020-08-04 17:37:55.759798= 533 -0400 +++ /tmp/new/tests/data/acpi/pc/DSDT.dimmpxm.dsl 2020-08-04 17:42:57.268859= 830 -0400 @@ -52,7 +52,7 @@ { Name (_HID, EisaId ("PNP0A03") /* PCI Bus */) // _HID: Hardwa= re ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID } } diff -ru /tmp/old/tests/data/acpi/pc/DSDT.dsl /tmp/new/tests/data/acpi/pc/D= SDT.dsl --- /tmp/old/tests/data/acpi/pc/DSDT.dsl 2020-08-04 17:37:55.713798676 -0400 +++ /tmp/new/tests/data/acpi/pc/DSDT.dsl 2020-08-04 17:42:57.256859867 -0400 @@ -50,7 +50,7 @@ { Name (_HID, EisaId ("PNP0A03") /* PCI Bus */) // _HID: Hardwa= re ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID } } diff -ru /tmp/old/tests/data/acpi/pc/DSDT.ipmikcs.dsl /tmp/new/tests/data/a= cpi/pc/DSDT.ipmikcs.dsl --- /tmp/old/tests/data/acpi/pc/DSDT.ipmikcs.dsl 2020-08-04 17:37:55.765798= 514 -0400 +++ /tmp/new/tests/data/acpi/pc/DSDT.ipmikcs.dsl 2020-08-04 17:42:57.270859= 824 -0400 @@ -50,7 +50,7 @@ { Name (_HID, EisaId ("PNP0A03") /* PCI Bus */) // _HID: Hardwa= re ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID } } diff -ru /tmp/old/tests/data/acpi/pc/DSDT.memhp.dsl /tmp/new/tests/data/acp= i/pc/DSDT.memhp.dsl --- /tmp/old/tests/data/acpi/pc/DSDT.memhp.dsl 2020-08-04 17:37:55.77379848= 9 -0400 +++ /tmp/new/tests/data/acpi/pc/DSDT.memhp.dsl 2020-08-04 17:42:57.27385981= 4 -0400 @@ -50,7 +50,7 @@ { Name (_HID, EisaId ("PNP0A03") /* PCI Bus */) // _HID: Hardwa= re ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID } } diff -ru /tmp/old/tests/data/acpi/pc/DSDT.numamem.dsl /tmp/new/tests/data/a= cpi/pc/DSDT.numamem.dsl --- /tmp/old/tests/data/acpi/pc/DSDT.numamem.dsl 2020-08-04 17:37:55.782798= 461 -0400 +++ /tmp/new/tests/data/acpi/pc/DSDT.numamem.dsl 2020-08-04 17:42:57.276859= 805 -0400 @@ -50,7 +50,7 @@ { Name (_HID, EisaId ("PNP0A03") /* PCI Bus */) // _HID: Hardwa= re ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID } } diff -ru /tmp/old/tests/data/acpi/q35/DSDT.acpihmat.dsl /tmp/new/tests/data= /acpi/q35/DSDT.acpihmat.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.acpihmat.dsl 2020-08-04 17:37:55.9117= 98060 -0400 +++ /tmp/new/tests/data/acpi/q35/DSDT.acpihmat.dsl 2020-08-04 17:42:57.3278= 59646 -0400 @@ -51,7 +51,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/q35/DSDT.bridge.dsl /tmp/new/tests/data/a= cpi/q35/DSDT.bridge.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.bridge.dsl 2020-08-04 17:37:55.920798= 032 -0400 +++ /tmp/new/tests/data/acpi/q35/DSDT.bridge.dsl 2020-08-04 17:42:57.331859= 634 -0400 @@ -51,7 +51,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/q35/DSDT.cphp.dsl /tmp/new/tests/data/acp= i/q35/DSDT.cphp.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.cphp.dsl 2020-08-04 17:37:55.93079800= 1 -0400 +++ /tmp/new/tests/data/acpi/q35/DSDT.cphp.dsl 2020-08-04 17:42:57.33685961= 8 -0400 @@ -51,7 +51,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/q35/DSDT.dimmpxm.dsl /tmp/new/tests/data/= acpi/q35/DSDT.dimmpxm.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.dimmpxm.dsl 2020-08-04 17:37:55.94279= 7963 -0400 +++ /tmp/new/tests/data/acpi/q35/DSDT.dimmpxm.dsl 2020-08-04 17:42:57.34085= 9606 -0400 @@ -53,7 +53,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/q35/DSDT.dsl /tmp/new/tests/data/acpi/q35= /DSDT.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.dsl 2020-08-04 17:37:55.898798100 -04= 00 +++ /tmp/new/tests/data/acpi/q35/DSDT.dsl 2020-08-04 17:42:57.323859659 -04= 00 @@ -51,7 +51,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/q35/DSDT.ipmibt.dsl /tmp/new/tests/data/a= cpi/q35/DSDT.ipmibt.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.ipmibt.dsl 2020-08-04 17:37:55.952797= 932 -0400 +++ /tmp/new/tests/data/acpi/q35/DSDT.ipmibt.dsl 2020-08-04 17:42:57.344859= 593 -0400 @@ -51,7 +51,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/q35/DSDT.memhp.dsl /tmp/new/tests/data/ac= pi/q35/DSDT.memhp.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.memhp.dsl 2020-08-04 17:37:55.9627979= 01 -0400 +++ /tmp/new/tests/data/acpi/q35/DSDT.memhp.dsl 2020-08-04 17:42:57.3488595= 81 -0400 @@ -51,7 +51,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/q35/DSDT.mmio64.dsl /tmp/new/tests/data/a= cpi/q35/DSDT.mmio64.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.mmio64.dsl 2020-08-04 17:37:55.972797= 870 -0400 +++ /tmp/new/tests/data/acpi/q35/DSDT.mmio64.dsl 2020-08-04 17:42:57.351859= 572 -0400 @@ -51,7 +51,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/q35/DSDT.numamem.dsl /tmp/new/tests/data/= acpi/q35/DSDT.numamem.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.numamem.dsl 2020-08-04 17:37:55.98379= 7836 -0400 +++ /tmp/new/tests/data/acpi/q35/DSDT.numamem.dsl 2020-08-04 17:42:57.35485= 9562 -0400 @@ -51,7 +51,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/q35/DSDT.tis.dsl /tmp/new/tests/data/acpi= /q35/DSDT.tis.dsl --- /tmp/old/tests/data/acpi/q35/DSDT.tis.dsl 2020-08-04 17:37:55.993797804= -0400 +++ /tmp/new/tests/data/acpi/q35/DSDT.tis.dsl 2020-08-04 17:42:57.358859550= -0400 @@ -51,7 +51,7 @@ Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID= : Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compat= ible ID Name (_ADR, Zero) // _ADR: Address - Name (_UID, One) // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Method (_OSC, 4, NotSerialized) // _OSC: Operating System Cap= abilities { CreateDWordField (Arg3, Zero, CDW1) diff -ru /tmp/old/tests/data/acpi/virt/DSDT.dsl /tmp/new/tests/data/acpi/vi= rt/DSDT.dsl --- /tmp/old/tests/data/acpi/virt/DSDT.dsl 2020-08-04 17:37:56.121797406 -0= 400 +++ /tmp/new/tests/data/acpi/virt/DSDT.dsl 2020-08-04 17:42:57.408859394 -0= 400 @@ -641,7 +641,7 @@ Name (_CID, "PNP0A03" /* PCI Bus */) // _CID: Compatible ID Name (_SEG, Zero) // _SEG: PCI Segment Name (_BBN, Zero) // _BBN: BIOS Bus Number - Name (_UID, "PCI0") // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Name (_STR, Unicode ("PCIe 0 Device")) // _STR: Description S= tring Name (_CCA, One) // _CCA: Cache Coherency Attribute Name (_PRT, Package (0x80) // _PRT: PCI Routing Table diff -ru /tmp/old/tests/data/acpi/virt/DSDT.memhp.dsl /tmp/new/tests/data/a= cpi/virt/DSDT.memhp.dsl --- /tmp/old/tests/data/acpi/virt/DSDT.memhp.dsl 2020-08-04 17:37:56.129797= 381 -0400 +++ /tmp/new/tests/data/acpi/virt/DSDT.memhp.dsl 2020-08-04 17:42:57.411859= 385 -0400 @@ -643,7 +643,7 @@ Name (_CID, "PNP0A03" /* PCI Bus */) // _CID: Compatible ID Name (_SEG, Zero) // _SEG: PCI Segment Name (_BBN, Zero) // _BBN: BIOS Bus Number - Name (_UID, "PCI0") // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Name (_STR, Unicode ("PCIe 0 Device")) // _STR: Description S= tring Name (_CCA, One) // _CCA: Cache Coherency Attribute Name (_PRT, Package (0x80) // _PRT: PCI Routing Table diff -ru /tmp/old/tests/data/acpi/virt/DSDT.numamem.dsl /tmp/new/tests/data= /acpi/virt/DSDT.numamem.dsl --- /tmp/old/tests/data/acpi/virt/DSDT.numamem.dsl 2020-08-04 17:37:56.1417= 97343 -0400 +++ /tmp/new/tests/data/acpi/virt/DSDT.numamem.dsl 2020-08-04 17:42:57.4138= 59379 -0400 @@ -641,7 +641,7 @@ Name (_CID, "PNP0A03" /* PCI Bus */) // _CID: Compatible ID Name (_SEG, Zero) // _SEG: PCI Segment Name (_BBN, Zero) // _BBN: BIOS Bus Number - Name (_UID, "PCI0") // _UID: Unique ID + Name (_UID, Zero) // _UID: Unique ID Name (_STR, Unicode ("PCIe 0 Device")) // _STR: Description S= tring Name (_CCA, One) // _CCA: Cache Coherency Attribute Name (_PRT, Package (0x80) // _PRT: PCI Routing Table Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 21 -------------------- tests/data/acpi/pc/DSDT | Bin 4934 -> 4934 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 6258 -> 6258 bytes tests/data/acpi/pc/DSDT.bridge | Bin 6793 -> 6793 bytes tests/data/acpi/pc/DSDT.cphp | Bin 5397 -> 5397 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 6587 -> 6587 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 5006 -> 5006 bytes tests/data/acpi/pc/DSDT.memhp | Bin 6293 -> 6293 bytes tests/data/acpi/pc/DSDT.numamem | Bin 4940 -> 4940 bytes tests/data/acpi/q35/DSDT | Bin 7678 -> 7678 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9002 -> 9002 bytes tests/data/acpi/q35/DSDT.bridge | Bin 7695 -> 7695 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8141 -> 8141 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 9331 -> 9331 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 7753 -> 7753 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9037 -> 9037 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 8808 -> 8808 bytes tests/data/acpi/q35/DSDT.numamem | Bin 7684 -> 7684 bytes tests/data/acpi/q35/DSDT.tis | Bin 8283 -> 8283 bytes tests/data/acpi/virt/DSDT | Bin 5205 -> 5200 bytes tests/data/acpi/virt/DSDT.memhp | Bin 6566 -> 6561 bytes tests/data/acpi/virt/DSDT.numamem | Bin 5205 -> 5200 bytes 22 files changed, 21 deletions(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index ea46c3399e..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,22 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/q35/DSDT.mmio64", -"tests/data/acpi/q35/DSDT.memhp", -"tests/data/acpi/q35/DSDT.tis", -"tests/data/acpi/q35/DSDT.acpihmat", -"tests/data/acpi/q35/DSDT.bridge", -"tests/data/acpi/q35/DSDT.ipmibt", -"tests/data/acpi/q35/DSDT.numamem", -"tests/data/acpi/q35/DSDT.dimmpxm", -"tests/data/acpi/q35/DSDT.cphp", -"tests/data/acpi/q35/DSDT", -"tests/data/acpi/pc/DSDT.memhp", -"tests/data/acpi/pc/DSDT.acpihmat", -"tests/data/acpi/pc/DSDT.bridge", -"tests/data/acpi/pc/DSDT.numamem", -"tests/data/acpi/pc/DSDT.ipmikcs", -"tests/data/acpi/pc/DSDT.dimmpxm", -"tests/data/acpi/pc/DSDT.cphp", -"tests/data/acpi/pc/DSDT", -"tests/data/acpi/virt/DSDT.memhp", -"tests/data/acpi/virt/DSDT.numamem", -"tests/data/acpi/virt/DSDT", diff --git a/tests/data/acpi/pc/DSDT b/tests/data/acpi/pc/DSDT index 6d0aaf729ac7d64cf966621adf276534de5cc555..b121bb5bc124be522e233516efb= 17cdc94de5a75 100644 GIT binary patch delta 24 gcmX@6c1(@SCDZZv2P+*8zaNUi4VmAWZZv3DX@8zbY!i4VmAW;+M- diff --git a/tests/data/acpi/pc/DSDT.bridge b/tests/data/acpi/pc/DSDT.bridge index 623c4c03585c47d4d28adc611823b7cce8f4a5c7..7b6c7a47875fc73b03fbe888078= 90f3867ddba1a 100644 GIT binary patch delta 24 fcmeA)?KI_b33dtTlwx3DlX7;txpxP_YKs delta 24 fcmeA)?KI_b33dtTlwx3DlvF;txpxP^<>n diff --git a/tests/data/acpi/pc/DSDT.cphp b/tests/data/acpi/pc/DSDT.cphp index e0a43ccdadae150c0f39599c85e4e21ed8fff2a4..c0e8aa5b32d84f39e5d6c9a5024= 505f818707c12 100644 GIT binary patch delta 24 fcmbQLHC2ntCDlX7;$I;EQV9nQ delta 24 fcmeBE?^EY;33dtT6J}sw44%l<#>lvF;$I;EQUnJL diff --git a/tests/data/acpi/pc/DSDT.memhp b/tests/data/acpi/pc/DSDT.memhp index 9a9418f4bde5fb18883c244ea956122e371ff01a..4026772906e910af514beb76de6= e4cca0bc2171b 100644 GIT binary patch delta 24 gcmbPgIMtBLCDXC$dNY09SGbrT_o{ delta 24 ecmbPgIMtBLCD4}M8zaNUiMxdWS$hW=3D delta 24 fcmX@3c1DfMCD@kU8zbY!iMxdWS#}2* diff --git a/tests/data/acpi/q35/DSDT b/tests/data/acpi/q35/DSDT index e63676d7a63afec714debeb465ee478ea4714337..bba8884073a27427b88ac0d733c= 9c87330a59366 100644 GIT binary patch delta 24 gcmexo{m+`qCD9^r>33dtLmt$aH^q$ByiIHLB+#*>3P7elD delta 24 fcmeCT>9^r>33dtLmt$aH^qR;uiIH*R+#*>3P6`H8 diff --git a/tests/data/acpi/q35/DSDT.cphp b/tests/data/acpi/q35/DSDT.cphp index d9bb414e9bf15d9b9149f38c9bb5d8b993f88650..57d859cef9fa16a8f125c4b3386= 11c8472699f38 100644 GIT binary patch delta 24 gcmX?Wf7YJMCD^$s{jB1 delta 24 gcmezD@!5mRCD#xs{jB1 diff --git a/tests/data/acpi/q35/DSDT.ipmibt b/tests/data/acpi/q35/DSDT.ipm= ibt index e8dea1ea42af765babcb747af998b0d912abdcbd..5cd11de6a8fe47324e5f922823a= 22746882f19f5 100644 GIT binary patch delta 24 gcmX?UbJB*(CDcGiu{CDcGiu{CD)f;Bu0jfb5AP*0A?Ns-T(jq delta 24 gcmaFi^1_A7CDDNRqX{K(cjp`Ddj82msIE^-!bKc_u0L51dc>n+a delta 42 ycmcbhaaDuMCDET2!X{H9}jp`DdjP8>iIE`3&1Drh#HWzW;;{pKve+zj4 diff --git a/tests/data/acpi/virt/DSDT.memhp b/tests/data/acpi/virt/DSDT.me= mhp index 4cb81f692d73526542493a0c4da9c9793cc8366e..545a18c3657781d350a006adfa5= e58fa63e63922 100644 GIT binary patch delta 36 scmZ2xywI4-CD*8`UK^8Qmv4a2m1l1~_{fY%b!|7XSe2n+jC` diff --git a/tests/data/acpi/virt/DSDT.numamem b/tests/data/acpi/virt/DSDT.= numamem index e669508d175f1e3ddf355f8a9b0d419266cac8aa..9b002836f35fd03afeab9e827fd= de3134d26ed2e 100644 GIT binary patch delta 36 scmcbraY2L2CDDNRqX{K(cjp`Ddj82msIE^-!bKc_u0L51dc>n+a delta 42 ycmcbhaaDuMCDET2!X{H9}jp`DdjP8>iIE`3&1Drh#HWzW;;{pKve+zj4 --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535896; cv=none; d=zohomail.com; s=zohoarc; b=EgZjXvOl1VlhN3i6gQF6D0K5lXYB/jA4YThRwbvvncE1zAV9CZmTNCwuzea5tUrspYchiHgSNvvDO+7ul+CAh81Z4CF+opobLQ7/QhywU6JNJhu10CSo5VwcidwyhHme7MgufJT06v2gw7nR1/+g5CPuq08pdMvyB6KzJOxOeU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535896; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=goMO8hb7iY4YjGLokxDYf+btfPCSDsgCnFQDuyULhx0=; b=hc3e7lfZma5KfU4NkKN9fOBTEWrFvqoeTVMLHkhsU/VYHKK12B5G4qWHV3sDuS+QJPoFewliHDPzh9rIdjmxNQmCv2GmH9vn+tvkyJrULqwmIK6njWO2rkqWShDGZx6e7a8AF/cwIJ0MnXzddgeE1WbkPXzPvwseCmwVANoYLAs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598535896856690.4019111124005; Thu, 27 Aug 2020 06:44:56 -0700 (PDT) Received: from localhost ([::1]:35710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBID1-0000tG-KU for importer@patchew.org; Thu, 27 Aug 2020 09:44:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI8y-0001P9-6d for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:44 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:27677 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI8v-0006KN-KE for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:43 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-339-HgJGUKZsPXSb-mq4mf0amw-1; Thu, 27 Aug 2020 09:40:38 -0400 Received: by mail-wm1-f72.google.com with SMTP id b73so2081055wmb.0 for ; Thu, 27 Aug 2020 06:40:38 -0700 (PDT) Received: from redhat.com (bzq-109-67-46-169.red.bezeqint.net. [109.67.46.169]) by smtp.gmail.com with ESMTPSA id s8sm4646372wmc.1.2020.08.27.06.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535640; 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=goMO8hb7iY4YjGLokxDYf+btfPCSDsgCnFQDuyULhx0=; b=W5Bp028bkTE6dj7sZ5S3oCp4tXR8G3lnW8PSPZ4dDAHCcFvH2Xy+H6zSv65pXnJldAQS/2 2ElvcL56Dss1zgxfQopEgmQ972e4UpajZeLypxpqco4uyIEX3qiETaQwm1prIIuRSdoRLs FJYvHL+cAzA8iKzUYeHITnjMBDi22bA= X-MC-Unique: HgJGUKZsPXSb-mq4mf0amw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=goMO8hb7iY4YjGLokxDYf+btfPCSDsgCnFQDuyULhx0=; b=K+bOf+ICgkaB/pwnNU4YFKJSiNoWIaxlE8frfUOuoVt9eCCKR7/ZVu5JJzNM6CXurH meLf9qpYIsZgwwzX50kJUmLHsif/349lX4iYwR94gA/HtuULklnyZZhFli4nxPShDZuz S6ypndIzEny54MLzttZ+X6aG7EDRqRpUn/saftBi+0p+sY/1TfKss3JgL52OoLgNNTrr ZrwU4G522nSngtaUdXWn4iVhela48JQoJIT52D4EH9TBbpwZw3oWqoyLEpkb4iFxc/Jp /9ZgAaiAiXu4zTZIHFNwd/8IGWZzQnjUCkcd7WeyzKLvKg7cga5n05JSq+dKMO0kzS88 Lbjg== X-Gm-Message-State: AOAM531M+G9xb0uTgFRRBcUUc6pmImMQoI5xmN1dOtOZzwak1XOlhddg /bDahlDV6XN/YJ6Eg4GscmoP750HdRUcU+piYhVx0/zixGx/USmp3FMalxY9d4eeT+ce9KARWD2 1HotfAOzkkzZDhvA= X-Received: by 2002:adf:c50d:: with SMTP id q13mr12622125wrf.175.1598535637108; Thu, 27 Aug 2020 06:40:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydCjQonxJ7Xx7koQmhScRTLdx7rtcQiU85MMZWlCaU2cpHPsFJUpJbRD+nw9YmMBJnZPJ9aA== X-Received: by 2002:adf:c50d:: with SMTP id q13mr12622098wrf.175.1598535636841; Thu, 27 Aug 2020 06:40:36 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:34 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 06/13] Introduce a new flag for i440fx to disable PCI hotplug on the root bus Message-ID: <20200827133954.2118749-7-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 00:53:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic , Ani Sinha , Igor Mammedov , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ani Sinha We introduce a new global flag 'acpi-root-pci-hotplug' for i440fx with which we can turn on or off PCI device hotplug on the root bus. This flag can be used to prevent all PCI devices from getting hotplugged or unplugged from t= he root PCI bus. This feature is targetted mostly towards Windows VMs. It is useful in cases where some hypervisor admins want to deploy guest VMs in a way so that the users of the guest OSes are not able to hot-eject certain PCI devices from the Windows system tray. Laine has explained the use case here in detail: https://www.redhat.com/archives/libvir-list/2020-February/msg00110.html Julia has resolved this issue for PCIE buses with the following commit: 530a0963184e57e71a5b538 ("pcie_root_port: Add hotplug disabling option") This commit attempts to introduce similar behavior for PCI root buses used = in i440fx machine types (although in this case, we do not have a per-slot capability to turn hotplug on or off). Usage: -global PIIX4_PM.acpi-root-pci-hotplug=3Doff By default, this option is enabled which means that hotplug is turned on for the PCI root bus. The previously existing flag 'acpi-pci-hotplug-with-bridge-support' for PCI= -PCI bridges remain as is and can be used along with this new flag to control PCI hotplug on PCI bridges. This change has been tested using a Windows 2012R2 server guest image and a= lso with a Windows 2019 server guest image on a Ubuntu 18.04 host using the lat= est master qemu from upstream. Signed-off-by: Ani Sinha Message-Id: <20200821165403.26589-1-ani@anisinha.ca> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Igor Mammedov Reviewed-by: Igor Mammedov --- include/hw/acpi/pcihp.h | 2 +- hw/acpi/pcihp.c | 23 ++++++++++++++++++++++- hw/acpi/piix4.c | 5 ++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h index 8bc4a4c01d..02f4665767 100644 --- a/include/hw/acpi/pcihp.h +++ b/include/hw/acpi/pcihp.h @@ -67,7 +67,7 @@ void acpi_pcihp_device_unplug_request_cb(HotplugHandler *= hotplug_dev, Error **errp); =20 /* Called on reset */ -void acpi_pcihp_reset(AcpiPciHpState *s); +void acpi_pcihp_reset(AcpiPciHpState *s, bool acpihp_root_off); =20 extern const VMStateDescription vmstate_acpi_pcihp_pci_status; =20 diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 9e31ab2da4..39b1f74442 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -104,6 +104,24 @@ static void acpi_set_pci_info(void) } } =20 +static void acpi_pcihp_disable_root_bus(void) +{ + static bool root_hp_disabled; + PCIBus *bus; + + if (root_hp_disabled) { + return; + } + + bus =3D find_i440fx(); + if (bus) { + /* setting the hotplug handler to NULL makes the bus non-hotplugga= ble */ + qbus_set_hotplug_handler(BUS(bus), NULL); + } + root_hp_disabled =3D true; + return; +} + static void acpi_pcihp_test_hotplug_bus(PCIBus *bus, void *opaque) { AcpiPciHpFind *find =3D opaque; @@ -209,8 +227,11 @@ static void acpi_pcihp_update(AcpiPciHpState *s) } } =20 -void acpi_pcihp_reset(AcpiPciHpState *s) +void acpi_pcihp_reset(AcpiPciHpState *s, bool acpihp_root_off) { + if (acpihp_root_off) { + acpi_pcihp_disable_root_bus(); + } acpi_set_pci_info(); acpi_pcihp_update(s); } diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 26bac4f16c..e6163bb6ce 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -78,6 +78,7 @@ typedef struct PIIX4PMState { =20 AcpiPciHpState acpi_pci_hotplug; bool use_acpi_hotplug_bridge; + bool use_acpi_root_pci_hotplug; =20 uint8_t disable_s3; uint8_t disable_s4; @@ -324,7 +325,7 @@ static void piix4_pm_reset(DeviceState *dev) pci_conf[0x5B] =3D 0x02; } pm_io_space_update(s); - acpi_pcihp_reset(&s->acpi_pci_hotplug); + acpi_pcihp_reset(&s->acpi_pci_hotplug, !s->use_acpi_root_pci_hotplug); } =20 static void piix4_pm_powerdown_req(Notifier *n, void *opaque) @@ -635,6 +636,8 @@ static Property piix4_pm_properties[] =3D { DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2), DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState, use_acpi_hotplug_bridge, true), + DEFINE_PROP_BOOL("acpi-root-pci-hotplug", PIIX4PMState, + use_acpi_root_pci_hotplug, true), DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState, acpi_memory_hotplug.is_enabled, true), DEFINE_PROP_END_OF_LIST(), --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535754; cv=none; d=zohomail.com; s=zohoarc; b=M7G3rFC1T+/FYeYywB7V8QBScZbOUwvK1rfOMxJQFeVtQbgFJRPsYMUONkOHqQhh3l0KTvmUbRDInbGSWosdW12TqV5ijswUWDiIxUsLi5zrwAROBwTNZI7D8KGAlFJLIPXYnQAgZOPaY2Rqtn2CvFvyRjG01WhELoQZwCxzJ0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535754; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/ClDOcff+wtkvg45OPGxJst3ciUDP9rU2GNJXIg6PAc=; b=YdL/AF8TIIDr6BMl/aoIZ6bbW0Jkg73Wptmv683g4He09gSUYMX3Lfc5hf2Gw95XL5yQ6l6HYoj7roT0Rb4DWpdFtaowvLTyGri3Ncm540SyPGm1VDcD/TeJ6K+4w9uXavxL8iysSOmDTE2ZBbxpB/igMGJbzXjcUG9Rjf5xxOg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15985357542101020.232836411263; Thu, 27 Aug 2020 06:42:34 -0700 (PDT) Received: from localhost ([::1]:51718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIAi-0004RQ-S6 for importer@patchew.org; Thu, 27 Aug 2020 09:42:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI93-0001dJ-BT for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:49 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:60057 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI91-0006LA-6J for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:48 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-P_rE05lTO-m9gLnUqIbupA-1; Thu, 27 Aug 2020 09:40:44 -0400 Received: by mail-wr1-f70.google.com with SMTP id d15so1555111wrp.10 for ; Thu, 27 Aug 2020 06:40:44 -0700 (PDT) Received: from redhat.com ([192.117.173.58]) by smtp.gmail.com with ESMTPSA id l21sm4769314wmj.25.2020.08.27.06.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535646; 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=/ClDOcff+wtkvg45OPGxJst3ciUDP9rU2GNJXIg6PAc=; b=ZEyfOVQnlCQBeE3H3gqeWch0fdbGVvqbyhScjTqdxMHQMNijAfArcYWV95SZ7l7CXdlB33 dCT75Rb99OqIwoUNTcV9w9HzLQcBCiVGU6n5gfrKQUWTBhb27WWqbCJxDU18GEWT5SD1Ye nbc34Yxx/XpmmAnGtlu8SQ+BoA1isQA= X-MC-Unique: P_rE05lTO-m9gLnUqIbupA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/ClDOcff+wtkvg45OPGxJst3ciUDP9rU2GNJXIg6PAc=; b=mo/eX+VrD6Ue5x7iObwnFoUnVhgsrH9VCzWgQKOiH6UTruTrVsl6I9rvrAILkVaL0c eC8qz9Nhwau8UJVO2ump42ZR4U0uyYCyc6+MW1oO2xlbZQikXQx0R54u6VZvFY7bcMT7 dnVCdixWDZc97DS9s/shwhPKMZVJC8SAXWrmHbbpNkpSE7JGfKL3ni1Z2JTYalCxwCzb FNKxw0fwB09YVQmzD1P98/mvrNsUjpAq+qOQEi4oXbv5WsBIegRP+jDq9qQuYn+asxbN PzbxWFdrP0XJaCJd26ko/ss5Zn664hW4IWDJUipkZT/dE4VzFnrYMb9so2eZTvKvyCab tLzg== X-Gm-Message-State: AOAM530M2or8mI8orljQRqBQOqJ6FQwN7DYKs4UT82TN2YO8RQRLXh1x IuvWmVBQ4WLPxii6mvwf86ViaLE7rU6DGhnF/NH09rWZCRKMrxPair7649/lxf6cfQp22pZS7Yi G5/R/N3rG+CUFaj0= X-Received: by 2002:adf:fa8f:: with SMTP id h15mr17215136wrr.365.1598535642879; Thu, 27 Aug 2020 06:40:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywa6yMwaH70voVF213MlHbmVeYQUkPS3Czv/pBqLCaYXMIb+rBh9foOdEbkEqRIApv+1c5Tg== X-Received: by 2002:adf:fa8f:: with SMTP id h15mr17215120wrr.365.1598535642649; Thu, 27 Aug 2020 06:40:42 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:37 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 07/13] virtio-pci: add virtio_pci_optimal_num_queues() helper Message-ID: <20200827133954.2118749-8-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 00:53:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cornelia Huck , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Multi-queue devices achieve the best performance when each vCPU has a dedicated queue. This ensures that virtqueue used notifications are handled on the same vCPU that submitted virtqueue buffers. When another vCPU handles the the notification an IPI will be necessary to wake the submission vCPU and this incurs a performance overhead. Provide a helper function that virtio-pci devices will use in later patches to automatically select the optimal number of queues. The function handles guests with large numbers of CPUs by limiting the number of queues to fit within the following constraints: 1. The maximum number of MSI-X vectors. 2. The maximum number of virtqueues. Signed-off-by: Stefan Hajnoczi Reviewed-by: Cornelia Huck Message-Id: <20200818143348.310613-4-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.h | 9 +++++++++ hw/virtio/virtio-pci.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index e2eaaa9182..91096f0291 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -243,4 +243,13 @@ typedef struct VirtioPCIDeviceTypeInfo { /* Register virtio-pci type(s). @t must be static. */ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t); =20 +/** + * virtio_pci_optimal_num_queues: + * @fixed_queues: number of queues that are always present + * + * Returns: The optimal number of queues for a multi-queue device, excludi= ng + * @fixed_queues. + */ +unsigned virtio_pci_optimal_num_queues(unsigned fixed_queues); + #endif diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index ccdf54e81c..fc69570dcc 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -19,6 +19,7 @@ =20 #include "exec/memop.h" #include "standard-headers/linux/virtio_pci.h" +#include "hw/boards.h" #include "hw/virtio/virtio.h" #include "migration/qemu-file-types.h" #include "hw/pci/pci.h" @@ -2058,6 +2059,37 @@ void virtio_pci_types_register(const VirtioPCIDevice= TypeInfo *t) g_free(base_name); } =20 +unsigned virtio_pci_optimal_num_queues(unsigned fixed_queues) +{ + /* + * 1:1 vq to vCPU mapping is ideal because the same vCPU that submitted + * virtqueue buffers can handle their completion. When a different vCPU + * handles completion it may need to IPI the vCPU that submitted the + * request and this adds overhead. + * + * Virtqueues consume guest RAM and MSI-X vectors. This is wasteful in + * guests with very many vCPUs and a device that is only used by a few + * vCPUs. Unfortunately optimizing that case requires manual pinning i= nside + * the guest, so those users might as well manually set the number of + * queues. There is no upper limit that can be applied automatically a= nd + * doing so arbitrarily would result in a sudden performance drop once= the + * threshold number of vCPUs is exceeded. + */ + unsigned num_queues =3D current_machine->smp.cpus; + + /* + * The maximum number of MSI-X vectors is PCI_MSIX_FLAGS_QSIZE + 1, bu= t the + * config change interrupt and the fixed virtqueues must be taken into + * account too. + */ + num_queues =3D MIN(num_queues, PCI_MSIX_FLAGS_QSIZE - fixed_queues); + + /* + * There is a limit to how many virtqueues a device can have. + */ + return MIN(num_queues, VIRTIO_QUEUE_MAX - fixed_queues); +} + /* virtio-pci-bus */ =20 static void virtio_pci_bus_new(VirtioBusState *bus, size_t bus_size, --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535841; cv=none; d=zohomail.com; s=zohoarc; b=Ukfaf/Vzij7K+BY4fkC1oy/I0Bh5r100/yY9l1xU2sdoE2UdUhY4Bb3xim7c2ukASCN0rJFxoMDA4v81QbPGUpPnIB3rIh5FHbc+bdtqhAh5L0osSJljsTuueTCIsVdnlrhjJg6DQ2+kCY7VpZAIBIngCB5B6PYqWJC1UitBnEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535841; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a94UYI+65+IE3CC0VO+z1PvpA042gsvmsxJdoYuVA5g=; b=OPZz7MBJJ9lTl3fNO5brkbDkHYMtizSAm5K81MLKvhelaA3BGHxK3MbyYAIYf0J35S3lo7v859+hhcTFE8/nSpbR7qeAmB2G4nNMdGbtOT+E009EwQkT0sRNdO569AcTJ1do0ReUcAGg4NRp9pBIpfA9r2I+81DiS6GzahIhp4c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598535841238654.4914136197723; Thu, 27 Aug 2020 06:44:01 -0700 (PDT) Received: from localhost ([::1]:60014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIC7-0007jK-Va for importer@patchew.org; Thu, 27 Aug 2020 09:43:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI97-0001nr-G2 for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI94-0006NA-Pw for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:53 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-413-aurM-0PPN7y5HZhNEHAasQ-1; Thu, 27 Aug 2020 09:40:47 -0400 Received: by mail-wr1-f70.google.com with SMTP id l14so1558662wrp.9 for ; Thu, 27 Aug 2020 06:40:47 -0700 (PDT) Received: from redhat.com (bzq-79-180-15-82.red.bezeqint.net. [79.180.15.82]) by smtp.gmail.com with ESMTPSA id n8sm6278855wra.32.2020.08.27.06.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535649; 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=a94UYI+65+IE3CC0VO+z1PvpA042gsvmsxJdoYuVA5g=; b=Brs+LV5vnxxFai2pNGGPHOoqQyx8e3g4xqE+FVrsr4lijsIfRPDZsId6qEItgjBgxDVC14 Ao+MPfLZ00Q3HPu+bbnWW0CvCan73O9sk7I/QJATZSYoS9HXkeEU1etyvnSMOmE3O3sQ1E MluahhBbEeLyDEWozyCv2YetTVWm31o= X-MC-Unique: aurM-0PPN7y5HZhNEHAasQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=a94UYI+65+IE3CC0VO+z1PvpA042gsvmsxJdoYuVA5g=; b=UbzCu+pnyWkUI414l4OnE3ewBqAdWn3UQ0kmqciXVBeRFN8PLISshVLsvSO8YZiotz 9f/RQVPRXJDP3gCtu+jjFf0U7akl4ucNG6gljo1KG6aLgoZiq/rfLe90lH9iMXJOXRJ8 oxcUVbxGvHZy8suched8mxC/Ih4sDSvUnSr3mD//vMwLllu1Vsk2BGtR+xUxaBq5asak CRzgqYHjfKhAhhFecWvcK+TAW4KTUSOHMJw8rgRYucolDVUelTZAUX1j1g++E9VSsem9 hZbA+nAeOH11aWha914R7ACkpQnIAYNlT7wSen2vdFCR9ycCf8MvqERJRJ+rgkDBdjNa X8rw== X-Gm-Message-State: AOAM532zH8XnfFOnhtYPi4hUT/jQuV0SLCUOFEwTIlI+pKjueT2Y9fHs svZtVeqE+PR1WmKQQujpTXDfJD0/Fi8FIhchBUew3HdzaflU5pZsU875Fl+/zaqZAHOzifEsfQ2 hvR3UPiLojC1fHAA= X-Received: by 2002:a7b:cd85:: with SMTP id y5mr12713277wmj.66.1598535646050; Thu, 27 Aug 2020 06:40:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxifhvwmceur6ViUsX3vyIfXaCbybcm/YZ97Ro3rDwOyxZ7LJjQFFxNrmVZG5gigX6Td+QFnw== X-Received: by 2002:a7b:cd85:: with SMTP id y5mr12713263wmj.66.1598535645841; Thu, 27 Aug 2020 06:40:45 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:43 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 08/13] virtio-scsi: introduce a constant for fixed virtqueues Message-ID: <20200827133954.2118749-9-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 02:10:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Peter Maydell , Pankaj Gupta , Cornelia Huck , Raphael Norwitz , Stefan Hajnoczi , Paolo Bonzini , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Stefan Hajnoczi The event and control virtqueues are always present, regardless of the multi-queue configuration. Define a constant so that virtqueue number calculations are easier to read. Signed-off-by: Stefan Hajnoczi Reviewed-by: Cornelia Huck Reviewed-by: Pankaj Gupta Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Raphael Norwitz Message-Id: <20200818143348.310613-5-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-scsi.h | 3 +++ hw/scsi/vhost-user-scsi.c | 2 +- hw/scsi/virtio-scsi.c | 7 ++++--- hw/virtio/vhost-scsi-pci.c | 3 ++- hw/virtio/vhost-user-scsi-pci.c | 3 ++- hw/virtio/virtio-scsi-pci.c | 3 ++- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scs= i.h index 24e768909d..9f293bcb80 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -36,6 +36,9 @@ #define VIRTIO_SCSI_MAX_TARGET 255 #define VIRTIO_SCSI_MAX_LUN 16383 =20 +/* Number of virtqueues that are always present */ +#define VIRTIO_SCSI_VQ_NUM_FIXED 2 + typedef struct virtio_scsi_cmd_req VirtIOSCSICmdReq; typedef struct virtio_scsi_cmd_resp VirtIOSCSICmdResp; typedef struct virtio_scsi_ctrl_tmf_req VirtIOSCSICtrlTMFReq; diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index f2e524438a..a8b821466f 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -114,7 +114,7 @@ static void vhost_user_scsi_realize(DeviceState *dev, E= rror **errp) goto free_virtio; } =20 - vsc->dev.nvqs =3D 2 + vs->conf.num_queues; + vsc->dev.nvqs =3D VIRTIO_SCSI_VQ_NUM_FIXED + vs->conf.num_queues; vsc->dev.vqs =3D g_new0(struct vhost_virtqueue, vsc->dev.nvqs); vsc->dev.vq_index =3D 0; vsc->dev.backend_features =3D 0; diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index b49775269e..eecdd05af5 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -191,7 +191,7 @@ static void virtio_scsi_save_request(QEMUFile *f, SCSIR= equest *sreq) VirtIOSCSIReq *req =3D sreq->hba_private; VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(req->dev); VirtIODevice *vdev =3D VIRTIO_DEVICE(req->dev); - uint32_t n =3D virtio_get_queue_index(req->vq) - 2; + uint32_t n =3D virtio_get_queue_index(req->vq) - VIRTIO_SCSI_VQ_NUM_FI= XED; =20 assert(n < vs->conf.num_queues); qemu_put_be32s(f, &n); @@ -892,10 +892,11 @@ void virtio_scsi_common_realize(DeviceState *dev, sizeof(VirtIOSCSIConfig)); =20 if (s->conf.num_queues =3D=3D 0 || - s->conf.num_queues > VIRTIO_QUEUE_MAX - 2) { + s->conf.num_queues > VIRTIO_QUEUE_MAX - VIRTIO_SCSI_VQ_NUM_FIX= ED) { error_setg(errp, "Invalid number of queues (=3D %" PRIu32 "), " "must be a positive integer less than %d.", - s->conf.num_queues, VIRTIO_QUEUE_MAX - 2); + s->conf.num_queues, + VIRTIO_QUEUE_MAX - VIRTIO_SCSI_VQ_NUM_FIXED); virtio_cleanup(vdev); return; } diff --git a/hw/virtio/vhost-scsi-pci.c b/hw/virtio/vhost-scsi-pci.c index 095af23f3f..06e814d30e 100644 --- a/hw/virtio/vhost-scsi-pci.c +++ b/hw/virtio/vhost-scsi-pci.c @@ -50,7 +50,8 @@ static void vhost_scsi_pci_realize(VirtIOPCIProxy *vpci_d= ev, Error **errp) VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(vdev); =20 if (vpci_dev->nvectors =3D=3D DEV_NVECTORS_UNSPECIFIED) { - vpci_dev->nvectors =3D vs->conf.num_queues + 3; + vpci_dev->nvectors =3D vs->conf.num_queues + + VIRTIO_SCSI_VQ_NUM_FIXED + 1; } =20 qdev_realize(vdev, BUS(&vpci_dev->bus), errp); diff --git a/hw/virtio/vhost-user-scsi-pci.c b/hw/virtio/vhost-user-scsi-pc= i.c index 4705cd54e8..ab6dfb71a9 100644 --- a/hw/virtio/vhost-user-scsi-pci.c +++ b/hw/virtio/vhost-user-scsi-pci.c @@ -56,7 +56,8 @@ static void vhost_user_scsi_pci_realize(VirtIOPCIProxy *v= pci_dev, Error **errp) VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(vdev); =20 if (vpci_dev->nvectors =3D=3D DEV_NVECTORS_UNSPECIFIED) { - vpci_dev->nvectors =3D vs->conf.num_queues + 3; + vpci_dev->nvectors =3D vs->conf.num_queues + + VIRTIO_SCSI_VQ_NUM_FIXED + 1; } =20 qdev_realize(vdev, BUS(&vpci_dev->bus), errp); diff --git a/hw/virtio/virtio-scsi-pci.c b/hw/virtio/virtio-scsi-pci.c index c23a134202..3ff9eb7ef6 100644 --- a/hw/virtio/virtio-scsi-pci.c +++ b/hw/virtio/virtio-scsi-pci.c @@ -51,7 +51,8 @@ static void virtio_scsi_pci_realize(VirtIOPCIProxy *vpci_= dev, Error **errp) char *bus_name; =20 if (vpci_dev->nvectors =3D=3D DEV_NVECTORS_UNSPECIFIED) { - vpci_dev->nvectors =3D vs->conf.num_queues + 3; + vpci_dev->nvectors =3D vs->conf.num_queues + + VIRTIO_SCSI_VQ_NUM_FIXED + 1; } =20 /* --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535982; cv=none; d=zohomail.com; s=zohoarc; b=FVdCrEuIp4yiNOyDBOfvBGvGKJbGivfXJ98gyjoqypo6B/y3VIvopyFsU+E49+3Ih7OPkJNt8AG+Xp2JTBZ9M0Kt15MEE6kgwFSjCwySTEx72Qog0qhbWBlMZEo7FUoxvX0Gs5lExwjdrUfcf3TNlt1AHymCrWWeH25h+7t/hxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535982; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eeTgRITWczaxOM8QLYLDDpc4gdXDBgE13i+Oq96xfDM=; b=JN237bSuXX9yWSDbfYKhuyOl+xVIHMZYbZh6zYFwrOhWegFFgX9RezPs9X0y8IuxAOBs/Vlf3aEAICBAfKo+cnEoWccujJYaUAkMcs+BV4ZwJxA6+FZsL6/KpttWcuiAUxGjafVVZJ5ENkZ9jPSwnn5g2rwXWq4L5Z8vtExLCIA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598535982274119.53769972897283; Thu, 27 Aug 2020 06:46:22 -0700 (PDT) Received: from localhost ([::1]:39936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIEP-0002gu-05 for importer@patchew.org; Thu, 27 Aug 2020 09:46:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI9D-0001sw-Iy for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:59 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:46730 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI9B-0006S5-CC for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:40:59 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-116-bJzFqk6JMoqejOMxobftIg-1; Thu, 27 Aug 2020 09:40:51 -0400 Received: by mail-wm1-f70.google.com with SMTP id p23so2156336wmc.2 for ; Thu, 27 Aug 2020 06:40:51 -0700 (PDT) Received: from redhat.com ([192.117.173.58]) by smtp.gmail.com with ESMTPSA id d6sm1703515wrq.67.2020.08.27.06.40.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535656; 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=eeTgRITWczaxOM8QLYLDDpc4gdXDBgE13i+Oq96xfDM=; b=GVcAZt49BFkS3ucIe6C+bNhKrCXMqWwqK/OdNaJ2OqBsMvLjKSsX/opwfEjHwmMkxOPULI mg8zU8bYGqUBfUPuZbQuIFachxaJEEff3huGGl9jDlF7lWq4cgBjFFYZjxU+vfz2+LQsu3 CRgqziGZqlpTzSKnAOv59vFL2TtFFdo= X-MC-Unique: bJzFqk6JMoqejOMxobftIg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=eeTgRITWczaxOM8QLYLDDpc4gdXDBgE13i+Oq96xfDM=; b=XspNLo3fVQNcyYsGHm+0thyJwbz57a2FTwQPIGPPBPAEMl1TzNOb6fGPfMcZX/nG99 DE2e5yP8BmyNuF3SEPiO0kUyXPa+Jy6zncdPWrNdzZqI6QLOde2k9WUtDkKq3AT+MdkP lLZM+aadd3q9mTRXTl+oAkYqUg96Qk/LXQ15ouGsTeMrVbub4COzUK0nk//sMGRgVa5r 4PtRVwCCQkYla3wXKe77dqZStQ0Z+tAZ3WDKOoGFENUkF9SIqIH8/mQUZjDXla036Unp 42BXBBHdGecQBae2KfboQsoCfK1V9fiK/Y4MLmZlkwYaUmegEVfFeio8F16O41zhKpS2 MjvQ== X-Gm-Message-State: AOAM532A9PTXUXKDebV4qRMqS/v7bmL6dTGNBVJeGXyGENYiH5isKRIj WQ9Apg+hvfaRepnMPFdOZkS3TexLWOkC3/GRdfIi27TgWh2Sm4TkWqrYFrver+N2yDyLoaHDMId CqI0KXCEyNDM13o4= X-Received: by 2002:a1c:16:: with SMTP id 22mr11761318wma.75.1598535650169; Thu, 27 Aug 2020 06:40:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBPqe6surZDr/kpUkY46n0krlW4IizizpUH1kCpWfC8UpTuUda5Oi9jcQkDJX4hnDkjFyOSw== X-Received: by 2002:a1c:16:: with SMTP id 22mr11761302wma.75.1598535649920; Thu, 27 Aug 2020 06:40:49 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:46 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 09/13] virtio-scsi-pci: default num_queues to -smp N Message-ID: <20200827133954.2118749-10-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=205.139.110.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 00:13:19 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Peter Maydell , Eduardo Habkost , Cornelia Huck , Stefan Hajnoczi , Raphael Norwitz , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Automatically size the number of virtio-scsi-pci, vhost-scsi-pci, and vhost-user-scsi-pci request virtqueues to match the number of vCPUs. Other transports continue to default to 1 request virtqueue. A 1:1 virtqueue:vCPU mapping ensures that completion interrupts are handled on the same vCPU that submitted the request. No IPI is necessary to complete an I/O request and performance is improved. The maximum number of MSI-X vectors and virtqueues limit are respected. Signed-off-by: Stefan Hajnoczi Message-Id: <20200818143348.310613-6-stefanha@redhat.com> Reviewed-by: Cornelia Huck Reviewed-by: Raphael Norwitz Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-scsi.h | 2 ++ hw/core/machine.c | 6 +++++- hw/scsi/vhost-scsi.c | 3 ++- hw/scsi/vhost-user-scsi.c | 3 ++- hw/scsi/virtio-scsi.c | 6 +++++- hw/virtio/vhost-scsi-pci.c | 10 +++++++--- hw/virtio/vhost-user-scsi-pci.c | 10 +++++++--- hw/virtio/virtio-scsi-pci.c | 10 +++++++--- 8 files changed, 37 insertions(+), 13 deletions(-) diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scs= i.h index 9f293bcb80..c0b8e4dd7e 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -39,6 +39,8 @@ /* Number of virtqueues that are always present */ #define VIRTIO_SCSI_VQ_NUM_FIXED 2 =20 +#define VIRTIO_SCSI_AUTO_NUM_QUEUES UINT32_MAX + typedef struct virtio_scsi_cmd_req VirtIOSCSICmdReq; typedef struct virtio_scsi_cmd_resp VirtIOSCSICmdResp; typedef struct virtio_scsi_ctrl_tmf_req VirtIOSCSICtrlTMFReq; diff --git a/hw/core/machine.c b/hw/core/machine.c index cf5f2dfaeb..9ee2aa0f7b 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -28,7 +28,11 @@ #include "hw/mem/nvdimm.h" #include "migration/vmstate.h" =20 -GlobalProperty hw_compat_5_1[] =3D {}; +GlobalProperty hw_compat_5_1[] =3D { + { "vhost-scsi", "num_queues", "1"}, + { "vhost-user-scsi", "num_queues", "1"}, + { "virtio-scsi-device", "num_queues", "1"}, +}; const size_t hw_compat_5_1_len =3D G_N_ELEMENTS(hw_compat_5_1); =20 GlobalProperty hw_compat_5_0[] =3D { diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 13b05af29b..a83ffeefc8 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -270,7 +270,8 @@ static Property vhost_scsi_properties[] =3D { DEFINE_PROP_STRING("vhostfd", VirtIOSCSICommon, conf.vhostfd), DEFINE_PROP_STRING("wwpn", VirtIOSCSICommon, conf.wwpn), DEFINE_PROP_UINT32("boot_tpgt", VirtIOSCSICommon, conf.boot_tpgt, 0), - DEFINE_PROP_UINT32("num_queues", VirtIOSCSICommon, conf.num_queues, 1), + DEFINE_PROP_UINT32("num_queues", VirtIOSCSICommon, conf.num_queues, + VIRTIO_SCSI_AUTO_NUM_QUEUES), DEFINE_PROP_UINT32("virtqueue_size", VirtIOSCSICommon, conf.virtqueue_= size, 128), DEFINE_PROP_BOOL("seg_max_adjust", VirtIOSCSICommon, conf.seg_max_adju= st, diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index a8b821466f..7c0631656c 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -162,7 +162,8 @@ static void vhost_user_scsi_unrealize(DeviceState *dev) static Property vhost_user_scsi_properties[] =3D { DEFINE_PROP_CHR("chardev", VirtIOSCSICommon, conf.chardev), DEFINE_PROP_UINT32("boot_tpgt", VirtIOSCSICommon, conf.boot_tpgt, 0), - DEFINE_PROP_UINT32("num_queues", VirtIOSCSICommon, conf.num_queues, 1), + DEFINE_PROP_UINT32("num_queues", VirtIOSCSICommon, conf.num_queues, + VIRTIO_SCSI_AUTO_NUM_QUEUES), DEFINE_PROP_UINT32("virtqueue_size", VirtIOSCSICommon, conf.virtqueue_= size, 128), DEFINE_PROP_UINT32("max_sectors", VirtIOSCSICommon, conf.max_sectors, diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index eecdd05af5..3a71ea7097 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -891,6 +891,9 @@ void virtio_scsi_common_realize(DeviceState *dev, virtio_init(vdev, "virtio-scsi", VIRTIO_ID_SCSI, sizeof(VirtIOSCSIConfig)); =20 + if (s->conf.num_queues =3D=3D VIRTIO_SCSI_AUTO_NUM_QUEUES) { + s->conf.num_queues =3D 1; + } if (s->conf.num_queues =3D=3D 0 || s->conf.num_queues > VIRTIO_QUEUE_MAX - VIRTIO_SCSI_VQ_NUM_FIX= ED) { error_setg(errp, "Invalid number of queues (=3D %" PRIu32 "), " @@ -964,7 +967,8 @@ static void virtio_scsi_device_unrealize(DeviceState *d= ev) } =20 static Property virtio_scsi_properties[] =3D { - DEFINE_PROP_UINT32("num_queues", VirtIOSCSI, parent_obj.conf.num_queue= s, 1), + DEFINE_PROP_UINT32("num_queues", VirtIOSCSI, parent_obj.conf.num_queue= s, + VIRTIO_SCSI_AUTO_NUM_QUEUES), DEFINE_PROP_UINT32("virtqueue_size", VirtIOSCSI, parent_obj.conf.virtqueue_size, 2= 56), DEFINE_PROP_BOOL("seg_max_adjust", VirtIOSCSI, diff --git a/hw/virtio/vhost-scsi-pci.c b/hw/virtio/vhost-scsi-pci.c index 06e814d30e..a6bb0dc60d 100644 --- a/hw/virtio/vhost-scsi-pci.c +++ b/hw/virtio/vhost-scsi-pci.c @@ -47,11 +47,15 @@ static void vhost_scsi_pci_realize(VirtIOPCIProxy *vpci= _dev, Error **errp) { VHostSCSIPCI *dev =3D VHOST_SCSI_PCI(vpci_dev); DeviceState *vdev =3D DEVICE(&dev->vdev); - VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(vdev); + VirtIOSCSIConf *conf =3D &dev->vdev.parent_obj.parent_obj.conf; + + if (conf->num_queues =3D=3D VIRTIO_SCSI_AUTO_NUM_QUEUES) { + conf->num_queues =3D + virtio_pci_optimal_num_queues(VIRTIO_SCSI_VQ_NUM_FIXED); + } =20 if (vpci_dev->nvectors =3D=3D DEV_NVECTORS_UNSPECIFIED) { - vpci_dev->nvectors =3D vs->conf.num_queues + - VIRTIO_SCSI_VQ_NUM_FIXED + 1; + vpci_dev->nvectors =3D conf->num_queues + VIRTIO_SCSI_VQ_NUM_FIXED= + 1; } =20 qdev_realize(vdev, BUS(&vpci_dev->bus), errp); diff --git a/hw/virtio/vhost-user-scsi-pci.c b/hw/virtio/vhost-user-scsi-pc= i.c index ab6dfb71a9..25e97ca54e 100644 --- a/hw/virtio/vhost-user-scsi-pci.c +++ b/hw/virtio/vhost-user-scsi-pci.c @@ -53,11 +53,15 @@ static void vhost_user_scsi_pci_realize(VirtIOPCIProxy = *vpci_dev, Error **errp) { VHostUserSCSIPCI *dev =3D VHOST_USER_SCSI_PCI(vpci_dev); DeviceState *vdev =3D DEVICE(&dev->vdev); - VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(vdev); + VirtIOSCSIConf *conf =3D &dev->vdev.parent_obj.parent_obj.conf; + + if (conf->num_queues =3D=3D VIRTIO_SCSI_AUTO_NUM_QUEUES) { + conf->num_queues =3D + virtio_pci_optimal_num_queues(VIRTIO_SCSI_VQ_NUM_FIXED); + } =20 if (vpci_dev->nvectors =3D=3D DEV_NVECTORS_UNSPECIFIED) { - vpci_dev->nvectors =3D vs->conf.num_queues + - VIRTIO_SCSI_VQ_NUM_FIXED + 1; + vpci_dev->nvectors =3D conf->num_queues + VIRTIO_SCSI_VQ_NUM_FIXED= + 1; } =20 qdev_realize(vdev, BUS(&vpci_dev->bus), errp); diff --git a/hw/virtio/virtio-scsi-pci.c b/hw/virtio/virtio-scsi-pci.c index 3ff9eb7ef6..fa4b3bfb50 100644 --- a/hw/virtio/virtio-scsi-pci.c +++ b/hw/virtio/virtio-scsi-pci.c @@ -46,13 +46,17 @@ static void virtio_scsi_pci_realize(VirtIOPCIProxy *vpc= i_dev, Error **errp) { VirtIOSCSIPCI *dev =3D VIRTIO_SCSI_PCI(vpci_dev); DeviceState *vdev =3D DEVICE(&dev->vdev); - VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(vdev); DeviceState *proxy =3D DEVICE(vpci_dev); + VirtIOSCSIConf *conf =3D &dev->vdev.parent_obj.conf; char *bus_name; =20 + if (conf->num_queues =3D=3D VIRTIO_SCSI_AUTO_NUM_QUEUES) { + conf->num_queues =3D + virtio_pci_optimal_num_queues(VIRTIO_SCSI_VQ_NUM_FIXED); + } + if (vpci_dev->nvectors =3D=3D DEV_NVECTORS_UNSPECIFIED) { - vpci_dev->nvectors =3D vs->conf.num_queues + - VIRTIO_SCSI_VQ_NUM_FIXED + 1; + vpci_dev->nvectors =3D conf->num_queues + VIRTIO_SCSI_VQ_NUM_FIXED= + 1; } =20 /* --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598536071; cv=none; d=zohomail.com; s=zohoarc; b=HBLKcISVX0VXaQB0KMxn3+3mDwa/pBZUEptRwQuuSM5LHT9rSO5+oQuhVpL/x0OR/aDFw0bkvRDYqwlEvnbWPxcFu4I0USFKRTUI4D9fTSSOsIiFpMs5C4aqpWBJed3GkgBpxX4z61p491EhBis2qajc/8b/nAU4ZuJGEmaahuw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598536071; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VQdmfd6/QNB5EFTQ/xWH3TrC1t18Cg4IqgMT2a4SAxA=; b=Cao914f4bskR/5pAbYcn9FTaPmLXd0vjDvauucZSukynZZ6sDCebz1AW20vOtCdZVKBntMnjvSZ/4DMbkQSSY7nxDKEwjz+/M++3Ix8NLd+PyKTTe4JUwEzAZMOgpSRNmeMlZJALitApnOZzi4uRjoNdNzUqsR8QGEBxfRlehAo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598536071910949.4547068898464; Thu, 27 Aug 2020 06:47:51 -0700 (PDT) Received: from localhost ([::1]:42114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIFq-0003bL-Ig for importer@patchew.org; Thu, 27 Aug 2020 09:47:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI9F-0001wI-Ve for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:41:02 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:47958 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI9D-0006SH-OJ for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:41:01 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-314-Qvw_JRSZOyyj1sHVCxKPuQ-1; Thu, 27 Aug 2020 09:40:57 -0400 Received: by mail-wm1-f70.google.com with SMTP id p184so2146198wmp.7 for ; Thu, 27 Aug 2020 06:40:55 -0700 (PDT) Received: from redhat.com (bzq-79-180-15-82.red.bezeqint.net. [79.180.15.82]) by smtp.gmail.com with ESMTPSA id a3sm5292661wme.34.2020.08.27.06.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535659; 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=VQdmfd6/QNB5EFTQ/xWH3TrC1t18Cg4IqgMT2a4SAxA=; b=N9oxddSja2wQ+vwcMcExOzLTqqAvG7JAYXdrO9Cf/BLP43Ux1y56GQ/V7i5Dcjks4fbdIF JtLrEzZN+1xikc2H34Ep4+2OUksGXlrtRz1wGEFtHf7uUFYzT5HHaTi/nhPehygdyQYP/K aQSQ5GiyZcUubJqhvyuAZly/5XYoZSA= X-MC-Unique: Qvw_JRSZOyyj1sHVCxKPuQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VQdmfd6/QNB5EFTQ/xWH3TrC1t18Cg4IqgMT2a4SAxA=; b=XjSU/NZFUDc8vNCA43VQ9K8bYvgwtTAWmHeYLKN62iTtB6Ie9EDXsqc0N0ivXDoJoa s83LANpRwNzBrJlqsrI92aBDE3qGkUI4AL63mjyW7/NsFjFbIYHFycCpNmVwz3Fw69eh Cb518TSiZerIhhZde3xr9d/+SZvuCWIH+PFKrPVKYYy+ccNZFfziJP4A+ku+Bh4l27Jv qTY2xKaTelq+yPOr00A9kru9ePXHGPaw4KRSMMEq/dBpX9Mtw0bveJABYtlr5EYYnAi3 V9Kd9zbgtaV8hFkNi1+FtR+rF2Ru1xVrrdO7FeM4fjF2ohXI7YJdskK2B5BcseDoY5d4 IRvA== X-Gm-Message-State: AOAM531lAWc2cZ8R7hF1ejjnDInsZuPFx+isR0+8skyzKXFyEcPeqfgG XWdN6lopKrvMyp0qfz/fc8WXzijqlsWMicOwGcNS8RI0AvOgeJxaotrZUFVhV8Q0coQJRFl7deH P7cb61SGH39t6gMA= X-Received: by 2002:a1c:cc05:: with SMTP id h5mr11397768wmb.129.1598535653600; Thu, 27 Aug 2020 06:40:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtOSgBi/CLd2/8Xi16NQTj3PZqqZdMVo/EOlTvtFjhkD8K//wmBg+8Va4p17dtfJSgwobDMw== X-Received: by 2002:a1c:cc05:: with SMTP id h5mr11397746wmb.129.1598535653385; Thu, 27 Aug 2020 06:40:53 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:50 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 10/13] virtio-blk-pci: default num_queues to -smp N Message-ID: <20200827133954.2118749-11-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=205.139.110.61; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 07:16:16 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Eduardo Habkost , qemu-block@nongnu.org, Pankaj Gupta , Cornelia Huck , Max Reitz , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Automatically size the number of virtio-blk-pci request virtqueues to match the number of vCPUs. Other transports continue to default to 1 request virtqueue. A 1:1 virtqueue:vCPU mapping ensures that completion interrupts are handled on the same vCPU that submitted the request. No IPI is necessary to complete an I/O request and performance is improved. The maximum number of MSI-X vectors and virtqueues limit are respected. Performance improves from 78k to 104k IOPS on a 32 vCPU guest with 101 virtio-blk-pci devices (ioengine=3Dlibaio, iodepth=3D1, bs=3D4k, rw=3Drandr= ead with NVMe storage). Signed-off-by: Stefan Hajnoczi Reviewed-by: Cornelia Huck Reviewed-by: Pankaj Gupta Message-Id: <20200818143348.310613-7-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-blk.h | 2 ++ hw/block/virtio-blk.c | 6 +++++- hw/core/machine.c | 1 + hw/virtio/virtio-blk-pci.c | 7 ++++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h index b1334c3904..7539c2b848 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -30,6 +30,8 @@ struct virtio_blk_inhdr unsigned char status; }; =20 +#define VIRTIO_BLK_AUTO_NUM_QUEUES UINT16_MAX + struct VirtIOBlkConf { BlockConf conf; diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 413783693c..2204ba149e 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -1147,6 +1147,9 @@ static void virtio_blk_device_realize(DeviceState *de= v, Error **errp) error_setg(errp, "Device needs media, but drive is empty"); return; } + if (conf->num_queues =3D=3D VIRTIO_BLK_AUTO_NUM_QUEUES) { + conf->num_queues =3D 1; + } if (!conf->num_queues) { error_setg(errp, "num-queues property must be larger than 0"); return; @@ -1281,7 +1284,8 @@ static Property virtio_blk_properties[] =3D { #endif DEFINE_PROP_BIT("request-merging", VirtIOBlock, conf.request_merging, = 0, true), - DEFINE_PROP_UINT16("num-queues", VirtIOBlock, conf.num_queues, 1), + DEFINE_PROP_UINT16("num-queues", VirtIOBlock, conf.num_queues, + VIRTIO_BLK_AUTO_NUM_QUEUES), DEFINE_PROP_UINT16("queue-size", VirtIOBlock, conf.queue_size, 256), DEFINE_PROP_BOOL("seg-max-adjust", VirtIOBlock, conf.seg_max_adjust, t= rue), DEFINE_PROP_LINK("iothread", VirtIOBlock, conf.iothread, TYPE_IOTHREAD, diff --git a/hw/core/machine.c b/hw/core/machine.c index 9ee2aa0f7b..7f65fa8743 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -31,6 +31,7 @@ GlobalProperty hw_compat_5_1[] =3D { { "vhost-scsi", "num_queues", "1"}, { "vhost-user-scsi", "num_queues", "1"}, + { "virtio-blk-device", "num-queues", "1"}, { "virtio-scsi-device", "num_queues", "1"}, }; const size_t hw_compat_5_1_len =3D G_N_ELEMENTS(hw_compat_5_1); diff --git a/hw/virtio/virtio-blk-pci.c b/hw/virtio/virtio-blk-pci.c index 849cc7dfd8..37c6e0aeb4 100644 --- a/hw/virtio/virtio-blk-pci.c +++ b/hw/virtio/virtio-blk-pci.c @@ -50,9 +50,14 @@ static void virtio_blk_pci_realize(VirtIOPCIProxy *vpci_= dev, Error **errp) { VirtIOBlkPCI *dev =3D VIRTIO_BLK_PCI(vpci_dev); DeviceState *vdev =3D DEVICE(&dev->vdev); + VirtIOBlkConf *conf =3D &dev->vdev.conf; + + if (conf->num_queues =3D=3D VIRTIO_BLK_AUTO_NUM_QUEUES) { + conf->num_queues =3D virtio_pci_optimal_num_queues(0); + } =20 if (vpci_dev->nvectors =3D=3D DEV_NVECTORS_UNSPECIFIED) { - vpci_dev->nvectors =3D dev->vdev.conf.num_queues + 1; + vpci_dev->nvectors =3D conf->num_queues + 1; } =20 qdev_realize(vdev, BUS(&vpci_dev->bus), errp); --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598536133; cv=none; d=zohomail.com; s=zohoarc; b=Nh4327smsdSUVCF7cB2Q6f9Dco82jQ/e+q+p9KJc/wFYmKvfT562jGSNBB9ivBPPxz/rDl/+6kR1BnGRN/azyN60cAR+ssyca2zXTwEYgs1RTES+atM73ifHuK8xtBehUlJIPPCzJJiFKFSmnlEVPHaZtS6BSO7TwaMUT51dkMo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598536133; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bJblkKicNbkNBh8o1ZXz54TSJZeugRiWQqLrT6UAWII=; b=VblZvnmnWZf2fLvTbSk9PeoWhofPcpgtSnUj4A5emh0CA2aK4s8XrfkJzlekSofpbdKNCL/xWCPqPVprAa2aqZBsbDbbNSbndIKCcfXeweYjyIpx2XmGaCsIW20/+lhmFhkiqIiKvVcOnvGWSw+BiYh6x46VMbk71adWYTQEGYQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598536133199199.71257928388786; Thu, 27 Aug 2020 06:48:53 -0700 (PDT) Received: from localhost ([::1]:44270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIGp-0004TG-RO for importer@patchew.org; Thu, 27 Aug 2020 09:48:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI9I-00020F-Sp for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:41:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38651 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI9F-0006Tj-Iw for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:41:04 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-98-wVEanIs8MemjJcWf1_Jahw-1; Thu, 27 Aug 2020 09:40:58 -0400 Received: by mail-wm1-f71.google.com with SMTP id a5so2067666wmj.5 for ; Thu, 27 Aug 2020 06:40:57 -0700 (PDT) Received: from redhat.com (bzq-79-180-15-82.red.bezeqint.net. [79.180.15.82]) by smtp.gmail.com with ESMTPSA id h6sm6347868wrv.40.2020.08.27.06.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535660; 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=bJblkKicNbkNBh8o1ZXz54TSJZeugRiWQqLrT6UAWII=; b=AGMEpzZr+cOMTmhRYjLB+6SUsnHaoHCQ2l+Jo+lJI+5kCiEZvec5c3FoHFGqMKShAVsZFm UDgy1XlX4m4LaDy3fpJ2DgXHJLye1c9dGCI7jl67QjeyDe09wZTWdH/dprN4DT50PWVE7L e7flDbd8Ov0vezchelnfWEYEHMd+Fyg= X-MC-Unique: wVEanIs8MemjJcWf1_Jahw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bJblkKicNbkNBh8o1ZXz54TSJZeugRiWQqLrT6UAWII=; b=OV76QRhloG2u2Lt+W3DW9wVFQFJ98ZmPRQu0+WANKfRAgSNhG3dLcREWANbI2ePR8K ytaLxFu1ECuRIvbWO+7BHKADw3vwULbKTnt/xOMY65KmQJQQQ13U0XujQQqP8gb9NUdP MHMSh/e8oglFV3SvvS4OdQ7Gjbj1oOSkki+L44N8PxjUvt4D+37oLEiGwPbP/NFp93ka N7wf0bHw55V8S3AQzN0pSHhyeya8LCWIkJzOPN7I/0+IJuZnpudqdRLKp8F0+cUOB8Ec vEnJjstVHg965Nqn1FGSezqb6LmhqvnZ/12nJ96F4GJH9H0DkeGZLinJ0jnJDAKupMRh 2QkQ== X-Gm-Message-State: AOAM531tY5LMWVEfbZBg6nu/UeLZtkZndjF43450uEekl/f/sk1dXEw/ lXotNbDCC1djIcSJaNvblohfWupinmcV708tVerv0Te2RqsQRD2xJAHH98MHPp2gq3lzlT0BdzC lDyTLLap9xoDOxFo= X-Received: by 2002:a1c:4c06:: with SMTP id z6mr8889769wmf.40.1598535656624; Thu, 27 Aug 2020 06:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygKS9Jiq8aADOMeabK9vBHTUyRb1l1DvAVxB6W+XuKtHgQV9m1m2pFG8Gy1TQSvugy1HHNwg== X-Received: by 2002:a1c:4c06:: with SMTP id z6mr8889745wmf.40.1598535656433; Thu, 27 Aug 2020 06:40:56 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:53 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 11/13] vhost-user-blk-pci: default num_queues to -smp N Message-ID: <20200827133954.2118749-12-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=205.139.110.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 00:13:19 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Eduardo Habkost , qemu-block@nongnu.org, Cornelia Huck , Max Reitz , Stefan Hajnoczi , Raphael Norwitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Automatically size the number of request virtqueues to match the number of vCPUs. This ensures that completion interrupts are handled on the same vCPU that submitted the request. No IPI is necessary to complete an I/O request and performance is improved. The maximum number of MSI-X vectors and virtqueues limit are respected. Signed-off-by: Stefan Hajnoczi Reviewed-by: Cornelia Huck Reviewed-by: Raphael Norwitz Message-Id: <20200818143348.310613-8-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost-user-blk.h | 2 ++ hw/block/vhost-user-blk.c | 6 +++++- hw/core/machine.c | 1 + hw/virtio/vhost-user-blk-pci.c | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/vhost-user-blk.h b/include/hw/virtio/vhost-u= ser-blk.h index 34ad6f0c0e..292d17147c 100644 --- a/include/hw/virtio/vhost-user-blk.h +++ b/include/hw/virtio/vhost-user-blk.h @@ -25,6 +25,8 @@ #define VHOST_USER_BLK(obj) \ OBJECT_CHECK(VHostUserBlk, (obj), TYPE_VHOST_USER_BLK) =20 +#define VHOST_USER_BLK_AUTO_NUM_QUEUES UINT16_MAX + typedef struct VHostUserBlk { VirtIODevice parent_obj; CharBackend chardev; diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index a00b854736..39aec42dae 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -420,6 +420,9 @@ static void vhost_user_blk_device_realize(DeviceState *= dev, Error **errp) return; } =20 + if (s->num_queues =3D=3D VHOST_USER_BLK_AUTO_NUM_QUEUES) { + s->num_queues =3D 1; + } if (!s->num_queues || s->num_queues > VIRTIO_QUEUE_MAX) { error_setg(errp, "vhost-user-blk: invalid number of IO queues"); return; @@ -531,7 +534,8 @@ static const VMStateDescription vmstate_vhost_user_blk = =3D { =20 static Property vhost_user_blk_properties[] =3D { DEFINE_PROP_CHR("chardev", VHostUserBlk, chardev), - DEFINE_PROP_UINT16("num-queues", VHostUserBlk, num_queues, 1), + DEFINE_PROP_UINT16("num-queues", VHostUserBlk, num_queues, + VHOST_USER_BLK_AUTO_NUM_QUEUES), DEFINE_PROP_UINT32("queue-size", VHostUserBlk, queue_size, 128), DEFINE_PROP_BIT("config-wce", VHostUserBlk, config_wce, 0, true), DEFINE_PROP_END_OF_LIST(), diff --git a/hw/core/machine.c b/hw/core/machine.c index 7f65fa8743..ea26d61237 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -30,6 +30,7 @@ =20 GlobalProperty hw_compat_5_1[] =3D { { "vhost-scsi", "num_queues", "1"}, + { "vhost-user-blk", "num-queues", "1"}, { "vhost-user-scsi", "num_queues", "1"}, { "virtio-blk-device", "num-queues", "1"}, { "virtio-scsi-device", "num_queues", "1"}, diff --git a/hw/virtio/vhost-user-blk-pci.c b/hw/virtio/vhost-user-blk-pci.c index 4f5d5cbf44..a62a71e067 100644 --- a/hw/virtio/vhost-user-blk-pci.c +++ b/hw/virtio/vhost-user-blk-pci.c @@ -54,6 +54,10 @@ static void vhost_user_blk_pci_realize(VirtIOPCIProxy *v= pci_dev, Error **errp) VHostUserBlkPCI *dev =3D VHOST_USER_BLK_PCI(vpci_dev); DeviceState *vdev =3D DEVICE(&dev->vdev); =20 + if (dev->vdev.num_queues =3D=3D VHOST_USER_BLK_AUTO_NUM_QUEUES) { + dev->vdev.num_queues =3D virtio_pci_optimal_num_queues(0); + } + if (vpci_dev->nvectors =3D=3D DEV_NVECTORS_UNSPECIFIED) { vpci_dev->nvectors =3D dev->vdev.num_queues + 1; } --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598536197; cv=none; d=zohomail.com; s=zohoarc; b=de/O3QGpSwNhIPSKDYf2mobG+0dafuyUHSdUdKSiiuSxKKpnkRHsMllTCb3w9R0DCCjNWiFyJhzpLPqFI/IiaskLQcxL5IUri3v7LjXQx24ReZuTRmy62wU6vd/+iAyC6LELt391MkhY9NUV9ZxJzk+HUDdlU3/qJe/9EBL1uqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598536197; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KI4Lf/FaagIQuHMtuVrkntDd4A5CmoFR5x1U+oe+5VI=; b=STk+CosiAlRjNqWCFhKtUHCXsYWIldzXKGTkJ6Ccl7yU5Zbuyour5d0waWu8kX6uNiattUqUa8H1C4p/2VkYtJbpZsrCkjRM6vEK9nleH6YW9H51xW/CcyU91pfX/G+JSrvjYzl4VUFr8qEfqcwClVbh/z6q2ELZoJ4piFDxgbw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598536197313490.4782957023498; Thu, 27 Aug 2020 06:49:57 -0700 (PDT) Received: from localhost ([::1]:46438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIHs-0005Mr-4K for importer@patchew.org; Thu, 27 Aug 2020 09:49:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI9O-00023w-RE for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:41:12 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:20874 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI9M-0006UY-CR for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:41:10 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-NMSxa-lpNaudnGsJHeKIEQ-1; Thu, 27 Aug 2020 09:41:04 -0400 Received: by mail-wm1-f71.google.com with SMTP id a5so2067726wmj.5 for ; Thu, 27 Aug 2020 06:41:01 -0700 (PDT) Received: from redhat.com ([192.117.173.58]) by smtp.gmail.com with ESMTPSA id k11sm5981258wrq.85.2020.08.27.06.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535666; 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=KI4Lf/FaagIQuHMtuVrkntDd4A5CmoFR5x1U+oe+5VI=; b=El8iBew3jECyK1ocbnDiAOctpu52RK2qvLdtPTFxHb1b/zBxTfq/7Gx6tZJcKY6ST9Vj0F bpbiXTXPWgdJGfYv9qtgHAAfPW8pVG0/cEpKm+dARt+ktEA52edgKTfYfzZIejTVJ+xXwW sEORjkyr3OfxQAv9BWBXY/P2nM10qyM= X-MC-Unique: NMSxa-lpNaudnGsJHeKIEQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KI4Lf/FaagIQuHMtuVrkntDd4A5CmoFR5x1U+oe+5VI=; b=LMlNEICBZE2HYB6ktvT1XYz0+f4tXJ0n33VM+n7nTNJ2wp9mO/an133lsxlQJvjYaI MWnu9SR/cHe6QUsENQ0nNWytVp9MTbqmfj9Hl4kiDRwuxo/yKJ9GHdBO0ukqxJrd7eez +zJ2veC32O1/x8vWvGRLBjY+LdZ28JQ1cDJymIlsCXhLL+unwXBqgGLHSDn3Rm/xCY55 XaqszA3gcKQeMhpoaHFwi4Z3KdH8fvBusU0FfKz1gUMUkdimvvwQPipxSuTFxClLZ32F B3/5FlQlVLP7kVR/yzEn5Or26VqqRfTiUWNSr/ezBbLE/aoIoLI1J0AxouOdWXfeCVaz Pz1A== X-Gm-Message-State: AOAM533UwTmi9TQvE+/ezxTsG0PgieZ/oaJj7WQVfxdkiUChSYYOWwyO f7tVxy0Igt/gTSi6MyI0sry2VaQNz3Lz7X53f+WBHsFGkKg17rxJWdW9WPGmGP7CTAV8ssR1qHF uDwwxdeVBvEFrT7s= X-Received: by 2002:a1c:818e:: with SMTP id c136mr12402092wmd.170.1598535660291; Thu, 27 Aug 2020 06:41:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUU6kiMw9xzNcEeTGEJWm8GRnVjYsTl/OIa8FCGlg4KHDd2K4kW9RoHObR++Cwk26AIo6xUA== X-Received: by 2002:a1c:818e:: with SMTP id c136mr12402070wmd.170.1598535660007; Thu, 27 Aug 2020 06:41:00 -0700 (PDT) Date: Thu, 27 Aug 2020 09:40:56 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 12/13] hw/smbios: add options for type 4 max-speed and current-speed Message-ID: <20200827133954.2118749-13-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 00:53:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ying Fang , Peter Maydell , Heyi Guo , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ying Fang Common VM users sometimes care about CPU speed, so we add two new options to allow VM vendors to present CPU speed to their users. Normally these information can be fetched from host smbios. Strictly speaking, the "max speed" and "current speed" in type 4 are not really for the max speed and current speed of processor, for "max speed" identifies a capability of the system, and "current speed" identifies the processor's speed at boot (see smbios spec), but some applications do not tell the differences. Reviewed-by: Igor Mammedov Signed-off-by: Ying Fang Signed-off-by: Heyi Guo Message-Id: <20200806035634.376-2-fangying1@huawei.com> --- hw/smbios/smbios.c | 36 ++++++++++++++++++++++++++++++++---- qemu-options.hx | 2 +- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index f560826904..7cc950b41c 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -92,9 +92,21 @@ static struct { const char *manufacturer, *version, *serial, *asset, *sku; } type3; =20 +/* + * SVVP requires max_speed and current_speed to be set and not being + * 0 which counts as unknown (SMBIOS 3.1.0/Table 21). Set the + * default value to 2000MHz as we did before. + */ +#define DEFAULT_CPU_SPEED 2000 + static struct { const char *sock_pfx, *manufacturer, *version, *serial, *asset, *part; -} type4; + uint64_t max_speed; + uint64_t current_speed; +} type4 =3D { + .max_speed =3D DEFAULT_CPU_SPEED, + .current_speed =3D DEFAULT_CPU_SPEED +}; =20 static struct { size_t nvalues; @@ -272,6 +284,14 @@ static const QemuOptDesc qemu_smbios_type4_opts[] =3D { .name =3D "version", .type =3D QEMU_OPT_STRING, .help =3D "version number", + },{ + .name =3D "max-speed", + .type =3D QEMU_OPT_NUMBER, + .help =3D "max speed in MHz", + },{ + .name =3D "current-speed", + .type =3D QEMU_OPT_NUMBER, + .help =3D "speed at system boot in MHz", },{ .name =3D "serial", .type =3D QEMU_OPT_STRING, @@ -586,9 +606,8 @@ static void smbios_build_type_4_table(MachineState *ms,= unsigned instance) SMBIOS_TABLE_SET_STR(4, processor_version_str, type4.version); t->voltage =3D 0; t->external_clock =3D cpu_to_le16(0); /* Unknown */ - /* SVVP requires max_speed and current_speed to not be unknown. */ - t->max_speed =3D cpu_to_le16(2000); /* 2000 MHz */ - t->current_speed =3D cpu_to_le16(2000); /* 2000 MHz */ + t->max_speed =3D cpu_to_le16(type4.max_speed); + t->current_speed =3D cpu_to_le16(type4.current_speed); t->status =3D 0x41; /* Socket populated, CPU enabled */ t->processor_upgrade =3D 0x01; /* Other */ t->l1_cache_handle =3D cpu_to_le16(0xFFFF); /* N/A */ @@ -1116,6 +1135,15 @@ void smbios_entry_add(QemuOpts *opts, Error **errp) save_opt(&type4.serial, opts, "serial"); save_opt(&type4.asset, opts, "asset"); save_opt(&type4.part, opts, "part"); + type4.max_speed =3D qemu_opt_get_number(opts, "max-speed", + DEFAULT_CPU_SPEED); + type4.current_speed =3D qemu_opt_get_number(opts, "current-spe= ed", + DEFAULT_CPU_SPEED); + if (type4.max_speed > UINT16_MAX || + type4.current_speed > UINT16_MAX) { + error_setg(errp, "SMBIOS CPU speed is too large (> %d)", + UINT16_MAX); + } return; case 11: if (!qemu_opts_validate(opts, qemu_smbios_type11_opts, errp)) { diff --git a/qemu-options.hx b/qemu-options.hx index 708583b4ce..30019c4eca 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2294,7 +2294,7 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios, " [,sku=3Dstr]\n" " specify SMBIOS type 3 fields\n" "-smbios type=3D4[,sock_pfx=3Dstr][,manufacturer=3Dstr][,version=3Dstr= ][,serial=3Dstr]\n" - " [,asset=3Dstr][,part=3Dstr]\n" + " [,asset=3Dstr][,part=3Dstr][,max-speed=3D%d][,current-s= peed=3D%d]\n" " specify SMBIOS type 4 fields\n" "-smbios type=3D17[,loc_pfx=3Dstr][,bank=3Dstr][,manufacturer=3Dstr][,= serial=3Dstr]\n" " [,asset=3Dstr][,part=3Dstr][,speed=3D%d]\n" --=20 MST From nobody Wed Dec 17 07:06:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598535912; cv=none; d=zohomail.com; s=zohoarc; b=KTMHK4jPBQ/i5iyi7hAFHNHR5P4PGIm3/SdCc0DVkSiNR27hJdV8tFwaZMlmVbOuvqIpRtXw9DaU2drN0tN2Kb4HyBli8R7mBfGZxE7QXCH/JU1v+716bUTJW/o/4wLb55U+1a0psrQdyXO6qu4gRaHvNhlP+eA2pYgQr87gBnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598535912; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=V5iyYPg4tvRYFQ2+2ZkkR3GJS89VZ1RmchDLxqTL8l4=; b=TFBlPb2hnjBZO3adyzBoNRDUcToMLozs9gKli1wMkXwphzqyJCyfJKf+KuLQt5/T6/4V+rXQT8WRvgI5s54T3lVqjw0XhU2v+ayzI9iJYqlNpZNRqKgb3cwltt6aCo/yNzPBogiNkpAz0pWKCau/c7FSm6+LHWwt0uezt4yQ86E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598535912133620.8738791051912; Thu, 27 Aug 2020 06:45:12 -0700 (PDT) Received: from localhost ([::1]:36624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBIDG-0001Fk-SZ for importer@patchew.org; Thu, 27 Aug 2020 09:45:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBI9P-00024R-AB for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:41:12 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:54003 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kBI9M-0006Uh-Sl for qemu-devel@nongnu.org; Thu, 27 Aug 2020 09:41:11 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-315-uonY2XQeOAm58xzi07WmCw-1; Thu, 27 Aug 2020 09:41:06 -0400 Received: by mail-wr1-f72.google.com with SMTP id d15so1555424wrp.10 for ; Thu, 27 Aug 2020 06:41:06 -0700 (PDT) Received: from redhat.com ([192.117.173.58]) by smtp.gmail.com with ESMTPSA id n24sm4946658wmi.36.2020.08.27.06.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 06:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598535668; 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=V5iyYPg4tvRYFQ2+2ZkkR3GJS89VZ1RmchDLxqTL8l4=; b=IlGpDjxwBnDcSI5/UohwJZYZPaH97qjWQXnNg6bKSglBcvCi+NU1b3kNQioQFJDA6Ww+20 m8w5ssN5zPaJa3qjvL+MqBG+BI3oPhmGkRNTx/mAHdD0syO+hvb/66EdTo06C+ElXaJ9ug nK8fRdNLRmNWOHlC5RY1OTAyOQVNK6g= X-MC-Unique: uonY2XQeOAm58xzi07WmCw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=V5iyYPg4tvRYFQ2+2ZkkR3GJS89VZ1RmchDLxqTL8l4=; b=Dkd9seHsvrp/S8tpsPFQbyXrSEVZ0rfIaOPXixL7powALpbnPjOrvUbywmIVnQRjHV DSlCwFyAZTmcdEda8f5SeNbOUIRD34FzivYcFBqvvpvKT90RmqBJdjPj2mkq7KTLEmSr 7dYVGo1V7jEENIHO+2rSQJ2cve+sa4W0sKx4gdjlhYc0NGSq4DJEqguN2Kew/BaXscGL x1PtV1GRLn2jFE0SXlS7GjhaWthQnF9qaH8xI8W6k/4E2Ic8A5G5Y0ZUmbq5fIrqah7h 9OIzg4R6u9q3Y92xXJsEDWJ0qeFlmY2LuXl/fMOA84JQ+tBb8l325r8x4eg0L7RZcetC nB7w== X-Gm-Message-State: AOAM532r60cUHmaaz5KMLcmbjq4LvPYCL7f+ksIaqNl0arRhlLknax1Q w+TeD6Jza2/GkKwkX2dj4SZZU6Q4vMunKBHPCSDHnixgAC9eBqIqtTtKnm9EPwgV9hGWN5zymYZ wATsxF7DE6w6QBTs= X-Received: by 2002:a1c:24d5:: with SMTP id k204mr11611516wmk.159.1598535664788; Thu, 27 Aug 2020 06:41:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlSb3DopXh/xizCLqmbnn5CJfBDl3YM4tr1LGfvISz1IYrMPPVlPcpYM+xYAkicILlAsu1uQ== X-Received: by 2002:a1c:24d5:: with SMTP id k204mr11611502wmk.159.1598535664619; Thu, 27 Aug 2020 06:41:04 -0700 (PDT) Date: Thu, 27 Aug 2020 09:41:00 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 13/13] tests/bios-tables-test: add smbios cpu speed test Message-ID: <20200827133954.2118749-14-mst@redhat.com> References: <20200827133954.2118749-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200827133954.2118749-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=207.211.31.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 02:56:52 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Peter Maydell , Thomas Huth , Heyi Guo , Paolo Bonzini , Ying Fang , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ying Fang Add smbios type 4 CPU speed check for we added new options to set smbios type 4 "max speed" and "current speed". The default value should be 2000 when no option is specified, just as the old version did. We add the test case to one machine of each architecture, though it doesn't really run on aarch64 platform for smbios test can't run on uefi only platform yet. Signed-off-by: Ying Fang Signed-off-by: Heyi Guo Message-Id: <20200806035634.376-3-fangying1@huawei.com> --- tests/qtest/bios-tables-test.c | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index d25ff35492..504b810af5 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -80,6 +80,8 @@ typedef struct { GArray *tables; uint32_t smbios_ep_addr; struct smbios_21_entry_point smbios_ep_table; + uint16_t smbios_cpu_max_speed; + uint16_t smbios_cpu_curr_speed; uint8_t *required_struct_types; int required_struct_types_len; QTestState *qts; @@ -563,6 +565,31 @@ static inline bool smbios_single_instance(uint8_t type) } } =20 +static bool smbios_cpu_test(test_data *data, uint32_t addr) +{ + uint16_t expect_speed[2]; + uint16_t real; + int offset[2]; + int i; + + /* Check CPU speed for backward compatibility */ + offset[0] =3D offsetof(struct smbios_type_4, max_speed); + offset[1] =3D offsetof(struct smbios_type_4, current_speed); + expect_speed[0] =3D data->smbios_cpu_max_speed ? : 2000; + expect_speed[1] =3D data->smbios_cpu_curr_speed ? : 2000; + + for (i =3D 0; i < 2; i++) { + real =3D qtest_readw(data->qts, addr + offset[i]); + if (real !=3D expect_speed[i]) { + fprintf(stderr, "Unexpected SMBIOS CPU speed: real %u expect %= u\n", + real, expect_speed[i]); + return false; + } + } + + return true; +} + static void test_smbios_structs(test_data *data) { DECLARE_BITMAP(struct_bitmap, SMBIOS_MAX_TYPE+1) =3D { 0 }; @@ -585,6 +612,10 @@ static void test_smbios_structs(test_data *data) } set_bit(type, struct_bitmap); =20 + if (type =3D=3D 4) { + g_assert(smbios_cpu_test(data, addr)); + } + /* seek to end of unformatted string area of this struct ("\0\0") = */ prv =3D crt =3D 1; while (prv || crt) { @@ -719,6 +750,11 @@ static void test_acpi_q35_tcg(void) data.required_struct_types_len =3D ARRAY_SIZE(base_required_struct_typ= es); test_acpi_one(NULL, &data); free_test_data(&data); + + data.smbios_cpu_max_speed =3D 3000; + data.smbios_cpu_curr_speed =3D 2600; + test_acpi_one("-smbios type=3D4,max-speed=3D3000,current-speed=3D2600"= , &data); + free_test_data(&data); } =20 static void test_acpi_q35_tcg_bridge(void) @@ -1084,6 +1120,12 @@ static void test_acpi_virt_tcg(void) =20 test_acpi_one("-cpu cortex-a57", &data); free_test_data(&data); + + data.smbios_cpu_max_speed =3D 2900; + data.smbios_cpu_curr_speed =3D 2700; + test_acpi_one("-cpu cortex-a57 " + "-smbios type=3D4,max-speed=3D2900,current-speed=3D2700"= , &data); + free_test_data(&data); } =20 int main(int argc, char *argv[]) --=20 MST