From patchwork Thu Jun 29 04:07:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 13296589 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D895C3DA41 for ; Thu, 29 Jun 2023 04:09:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEix4-0004FV-Ns; Thu, 29 Jun 2023 00:08:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEix2-0004FE-6o for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEix0-00015p-OO for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688011690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XEZcgPReFyzDcO9cLJl1A0SSdm0joHIvq6RFVgYxRzg=; b=ZYjD4Vh0xZ0tONTRY4faJRBYFHJk9th+FEasSXp6fSSRDun/PrlBigRnHnqQwie8vmASyL jMPn48rcno3D0q6pcPIh+uRRxpzAuXPgsengLFmYo6FmNNrzNvcpYsDy/BoGd95tOBiAiT POvTh05T/sfXiqfkmg1BZTmwy+J4v70= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-645-toD9BCt4McmEubqS0SBG8Q-1; Thu, 29 Jun 2023 00:08:08 -0400 X-MC-Unique: toD9BCt4McmEubqS0SBG8Q-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-763a3e3e760so34283485a.0 for ; Wed, 28 Jun 2023 21:08:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688011687; x=1690603687; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XEZcgPReFyzDcO9cLJl1A0SSdm0joHIvq6RFVgYxRzg=; b=SQqbjE+FcWVi2qmFtKkDOwUZWES+r+iyg0jW7OCAYHIrOTDX+mrU5/ftGnzeNAN39D 9SLM7GSlpO8aUyeyMkueqibnZJ/I9xcr26hYdn4ei/ii6kxS5ecl+Sv7My5GzADLoER1 nuWQC+/4U/CPRSooAGoL4Ha+nCuF3d0YhSaa9Xpv6Ajbfskqx+cfCm2Lw+ET6o8DqzCH eswYwKa3SE69ay1XxN4q8Dd4tSXqrtxL+6WxqGBd4erhkzNB4D3z53gy3tkwHy3PZkHM 0BOdfoFmzsx6orqUXrBD9KeHbpanU8EGHYzQM7UclHWgwX+CRHw3MrPcviWjuWV5Nf9c 3fLQ== X-Gm-Message-State: AC+VfDx59M2driiWPd7iliPlc2gd7TcxawutpJNKt0qvCT4TFbySmH7k P/er+mwLy/kljEZa2vImiLLMqMONOCREYe7xNJSzBwN+vn+K3w8r3cNUl4MRBpayf3jXygvRr/+ SPdURHsKKq6Chhd7XEUhrsFGq7GEwKeF+0I4t/Xwre/yBM27etMRGSm8AIprcLn/rtMlh5mpyzj Q= X-Received: by 2002:a05:620a:2a07:b0:767:2919:f38f with SMTP id o7-20020a05620a2a0700b007672919f38fmr3605796qkp.10.1688011686901; Wed, 28 Jun 2023 21:08:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4RFAs/49F87mFuUJow1mPX/wikMTXIIMBs+ti4/r6Ji1IWskHT090goZprnlcJH3PXps7TUg== X-Received: by 2002:a05:620a:2a07:b0:767:2919:f38f with SMTP id o7-20020a05620a2a0700b007672919f38fmr3605775qkp.10.1688011686575; Wed, 28 Jun 2023 21:08:06 -0700 (PDT) Received: from localhost.localdomain ([203.163.234.183]) by smtp.googlemail.com with ESMTPSA id 21-20020a17090a019500b00256b67208b1sm10978169pjc.56.2023.06.28.21.08.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 21:08:06 -0700 (PDT) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [PATCH v6 1/5] tests/acpi: allow changes in DSDT.noacpihp table blob Date: Thu, 29 Jun 2023 09:37:03 +0530 Message-Id: <20230629040707.115656-2-anisinha@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230629040707.115656-1-anisinha@redhat.com> References: <20230629040707.115656-1-anisinha@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org We are going to fix bio-tables-test in the next patch and hence need to make sure the acpi tests continue to pass. Signed-off-by: Ani Sinha Acked-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..31df9c6187 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/DSDT.noacpihp", From patchwork Thu Jun 29 04:07:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 13296590 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6299EB64DC for ; Thu, 29 Jun 2023 04:09:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEixG-0004I6-Fv; Thu, 29 Jun 2023 00:08:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEixC-0004G2-L4 for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEix7-00016k-3d for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688011695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YQi5DNpBee1TXBxFEGyYLPk0MTnw7h1zNgmbfk3WRkU=; b=T6JUoecbuthLm0ggYRMlTThkywx/9qqfnnq2i+kxUt1YgF+dXAbvzLlh8+lyXxPBhu/wqq H9IpxfWL28oL2IUda2VtrhBpSX5QIHQdDp2jcm7u45xnXnyvvJnL++U619evSEtmnzB8zj EzFwcnlrE/KxFzjJHuLQO82UkJOACIE= Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-365-Wyly94E8M9aJ6hqvYIzhRQ-1; Thu, 29 Jun 2023 00:08:10 -0400 X-MC-Unique: Wyly94E8M9aJ6hqvYIzhRQ-1 Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-39ecef7a101so371094b6e.2 for ; Wed, 28 Jun 2023 21:08:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688011689; x=1690603689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YQi5DNpBee1TXBxFEGyYLPk0MTnw7h1zNgmbfk3WRkU=; b=FWSQXsKc63yyjF+7raAzabVjNGjWWXaFh1J8e2ceya1x/UPPrg5JtPTgvjTV278ryq Tc6RY4dYgeXFunOOzuDcIavBzrEaTNqa5aQZUwQhqOE13SaTnsVOPoIX8dl0uQWFFo7I MO82lVNxfiPTTqNcQRD/JdIZoD8yaMdHyFfve+LAD3w0HGqVUpUm36U2+BL9mzQxiAth gIJOS0QE3dcuK6VyMtk5j1vgkC0K7eXeuAr5Yu6CyW31PLK2INAsyY8LApJ6RR3YQ09K FXWZEz2Zu2qC+WdMbQf5cYCWvsR7puuVtsTkzVjCtmVDe0xTpXw+eTos0hRcafWnO7zC Hanw== X-Gm-Message-State: AC+VfDzDKnxxM0AbExgg+MLt8wbfRrVbtMBSuZ/WyVT/e4sLv8++pICr +mQ5XNkFN6Q/iWAnDSMiyw+OYN/41XNPX5/UT81XCXTwH55WX6VaGioVqA5LNVbaYVp89aTiLLA VXExUdkrkudHzH+TXZ3wzciQWN0KDWgf3/WJhbNcKn/uf3qPxKeiwMaMmRCi0aWIZsO/+grMQWt U= X-Received: by 2002:a05:6808:1922:b0:3a2:f91a:cb08 with SMTP id bf34-20020a056808192200b003a2f91acb08mr7479558oib.42.1688011689669; Wed, 28 Jun 2023 21:08:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4oRSmKIaFvfx6yUPmOr1wUlk/jSkUXlpzp4w4W3OFZEXttpm7zYNk0UJPD00CBFE6+xF93vQ== X-Received: by 2002:a05:6808:1922:b0:3a2:f91a:cb08 with SMTP id bf34-20020a056808192200b003a2f91acb08mr7479534oib.42.1688011689261; Wed, 28 Jun 2023 21:08:09 -0700 (PDT) Received: from localhost.localdomain ([203.163.234.183]) by smtp.googlemail.com with ESMTPSA id 21-20020a17090a019500b00256b67208b1sm10978169pjc.56.2023.06.28.21.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 21:08:08 -0700 (PDT) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [PATCH v6 2/5] tests/acpi/bios-tables-test: use the correct slot on the pcie-root-port Date: Thu, 29 Jun 2023 09:37:04 +0530 Message-Id: <20230629040707.115656-3-anisinha@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230629040707.115656-1-anisinha@redhat.com> References: <20230629040707.115656-1-anisinha@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org PCIE ports only have one slot, slot 0. Hence, non-zero slots are not available for PCIE devices on PCIE root ports. Fix test_acpi_q35_tcg_no_acpi_hotplug() so that the test does not use them. Signed-off-by: Ani Sinha Reviewed-by: Igor Mammedov --- tests/qtest/bios-tables-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index ed1c69cf01..47ba20b957 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1020,9 +1020,9 @@ static void test_acpi_q35_tcg_no_acpi_hotplug(void) " -device pci-testdev,bus=nohprp,acpi-index=501" " -device pcie-root-port,id=nohprpint,port=0x0,chassis=3,hotplug=off," "multifunction=on,addr=8.0" - " -device pci-testdev,bus=nohprpint,acpi-index=601,addr=8.1" + " -device pci-testdev,bus=nohprpint,acpi-index=601,addr=0.1" " -device pcie-root-port,id=hprp2,port=0x0,chassis=4,bus=nohprpint," - "addr=9.0" + "addr=0.2" " -device pci-testdev,bus=hprp2,acpi-index=602" , &data); free_test_data(&data); From patchwork Thu Jun 29 04:07:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 13296592 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9011EB64D9 for ; Thu, 29 Jun 2023 04:09:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEixI-0004Ih-T7; Thu, 29 Jun 2023 00:08:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEixC-0004G3-LM for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEix7-00016j-3W for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688011695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UVrMQo5OTuj/Z/ArUoRLIJdd/O7g0cHC9ea86NhATqc=; b=HpIIBwdJj8B5nwPupfbr4ynjobd6IvBdWyFaAEzN6eLSE+cWp91qnKaG3BCsz/IgOwNV/n PVewqX20CeB1dZnw2qi+nggAiuOaJ+5lj6SrN/Qc0wP9LrzuxWxccfyfrWhNL2fhBfPYDY yObT9BUumV7PEISGREWgpIPj/BedlnY= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-170-WQn0qN6MNiiMo9ENrwqlyg-1; Thu, 29 Jun 2023 00:08:13 -0400 X-MC-Unique: WQn0qN6MNiiMo9ENrwqlyg-1 Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-262d69faef9so122850a91.3 for ; Wed, 28 Jun 2023 21:08:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688011692; x=1690603692; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UVrMQo5OTuj/Z/ArUoRLIJdd/O7g0cHC9ea86NhATqc=; b=S0WgJtNsxVEp2XgAoa7CtDJAAuIxDw0CoPhSnn+0S1WUEvs9uFK/Gt1upOIko0KAlo 4hRfRkj4qK2hW6z9C1Cq6BqurpSzIMY0Hjb9QCtvHCR9BhI+6XGBH+ptykYTKhXXMNi8 OybVZsqz7NOyqFHy+wJjDXE5/wJfbDOaldW9sueHvgfwKZQ2SF+qxtVRjtRHCgTEP1fj n2RT2Aas0qZESLvehnAseMbAjHVW7XOhj/GypUU9UABqLcKLfPQyUO+qR3DzPxFBPpUJ SxcMwVnDF9ZGsNQbgaLmfs/c/omglXfY0qQ8DoZBdnjNpc2jelGOlbmNWzvds8nroBrH lmbA== X-Gm-Message-State: AC+VfDwSkXjPB+dkBwDyWP1Zg2375iqPm7bFcAixZX2+iq1pXf6C+x24 /UoQwdbN+DuWeew9qfDWGyCB7TixdcAKSLjqr2/4bWvMsg7ScaqwXxigZ/pjdkope6h9IimXRS2 f7Dw4FQwK+Xbb0c3HLYPtXcfqahc5lv6YRNFJNQx8iM5vIZaRjPwynMK0mCBPeEo85TU8ZmZK0Q Q= X-Received: by 2002:a17:90a:db90:b0:263:8e8:6d32 with SMTP id h16-20020a17090adb9000b0026308e86d32mr6819590pjv.37.1688011692043; Wed, 28 Jun 2023 21:08:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4LsSbQ/Tdt9uruODYcWQy6BCq51S+cWxmKA1oK3IkNFyaOEqipaKJBKxF8Oeh95/+zWJrhLA== X-Received: by 2002:a17:90a:db90:b0:263:8e8:6d32 with SMTP id h16-20020a17090adb9000b0026308e86d32mr6819581pjv.37.1688011691655; Wed, 28 Jun 2023 21:08:11 -0700 (PDT) Received: from localhost.localdomain ([203.163.234.183]) by smtp.googlemail.com with ESMTPSA id 21-20020a17090a019500b00256b67208b1sm10978169pjc.56.2023.06.28.21.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 21:08:11 -0700 (PDT) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [PATCH v6 3/5] tests/acpi/bios-tables-test: update acpi blob q35/DSDT.noacpihp Date: Thu, 29 Jun 2023 09:37:05 +0530 Message-Id: <20230629040707.115656-4-anisinha@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230629040707.115656-1-anisinha@redhat.com> References: <20230629040707.115656-1-anisinha@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Some fixes were committed in bios-tables-test in the previous commit. Update the acpi blob and clear bios-tables-test-allowed-diff.h so that the test continues to pass with the changes in the bios-tables-test. Following is the asl diff between the old and the newly updated blob: @@ -1,30 +1,30 @@ /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20210604 (64-bit version) * Copyright (c) 2000 - 2021 Intel Corporation * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/q35/DSDT.noacpihp, Wed Jun 21 18:26:52 2023 + * Disassembly of /tmp/aml-O8SU61, Wed Jun 21 18:26:52 2023 * * Original Table Header: * Signature "DSDT" - * Length 0x00002038 (8248) + * Length 0x00002031 (8241) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0x4A + * Checksum 0x89 * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) * Compiler ID "BXPC" * Compiler Version 0x00000001 (1) */ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) { Scope (\) { OperationRegion (DBG, SystemIO, 0x0402, One) Field (DBG, ByteAcc, NoLock, Preserve) { DBGB, 8 } @@ -3148,48 +3148,48 @@ { Name (_ADR, Zero) // _ADR: Address Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method { Local0 = Package (0x01) { 0x01F5 } Return (EDSM (Arg0, Arg1, Arg2, Arg3, Local0)) } } } Device (S40) { Name (_ADR, 0x00080000) // _ADR: Address - Device (S41) + Device (S01) { - Name (_ADR, 0x00080001) // _ADR: Address + Name (_ADR, One) // _ADR: Address Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method { Local0 = Package (0x01) { 0x0259 } Return (EDSM (Arg0, Arg1, Arg2, Arg3, Local0)) } } - Device (S48) + Device (S02) { - Name (_ADR, 0x00090000) // _ADR: Address + Name (_ADR, 0x02) // _ADR: Address Device (S00) { Name (_ADR, Zero) // _ADR: Address } } } Device (SF8) { Name (_ADR, 0x001F0000) // _ADR: Address OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C) Scope (\_SB) { Field (PCI0.SF8.PIRQ, ByteAcc, NoLock, Preserve) { PRQA, 8, Signed-off-by: Ani Sinha Acked-by: Igor Mammedov --- tests/data/acpi/q35/DSDT.noacpihp | Bin 8248 -> 8241 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/q35/DSDT.noacpihp b/tests/data/acpi/q35/DSDT.noacpihp index 6ab1f0e52543fcb7f84a7fd1327fe5aa42010565..8cab2f8eb9ae94e0165f3f17857ec7d080fb0e13 100644 GIT binary patch delta 109 zcmdntu+f3bCDi)r&-xoSoL DyqFtK delta 94 zcmdn!u)~4NCD X-Patchwork-Id: 13296591 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 619C5EB64DC for ; Thu, 29 Jun 2023 04:09:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEixI-0004Ia-4e; Thu, 29 Jun 2023 00:08:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEixD-0004Hb-VV for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEixC-00018K-8c for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688011698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8E3L/eh8xTMWqqFxd2K3iGDv+eq82X+mKSmU3uQ/MtY=; b=L4cpDAXrGTqCBYiE6l9b/fMzH4hjJCvuXHLc3q6OGGvTntoHL+8JdemzQ4jGBRA6+ChPzd qQl8ldWtStntzDixEjXXbPRLPZVBPvE3HbTjeS6gquVCCZlkY/cLtJcZ8H3LcXReI8dbvR AnqPKJl8ZjdzZ22dhh0Bs0xhwd8SBHo= Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-33-sfCyeaEENTip4ggMTwu_1w-1; Thu, 29 Jun 2023 00:08:16 -0400 X-MC-Unique: sfCyeaEENTip4ggMTwu_1w-1 Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-1b016818400so384215fac.0 for ; Wed, 28 Jun 2023 21:08:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688011695; x=1690603695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8E3L/eh8xTMWqqFxd2K3iGDv+eq82X+mKSmU3uQ/MtY=; b=aY4U+QZULx8pOZC1dK7amTWbvtnAA0LJ0ePWkQIoqNSKQhDvPjxw0V+5ffScraJUCv J0X3NWOcjQn8xq3A+PpfB9iKuyBPuiph6ewC6WDVPO40wDGyMlJdG6N1PfbY7su0L9ma BeCvApxhIvnOxAQMQFmCPGS2DXFM5SuOY3WbhIl5Ni03Lwv/i2iQlFwcA5AZECPqyDf0 D4en5yLb6wUJllWZkDP+xdrpRSNJ3ZD6kpO4nFjdyp3P0zJpXNYZgWr26hwPtcFqm7o9 xhkp0NHyuVuK5QGwwBPZQvkgLRMIfxSXE1oUwYHQ4Fp14qnWGS8YEpizm6kne6QByGY1 YyHA== X-Gm-Message-State: AC+VfDzBQ4ctCLm3Dg+7KB9Lo3DOvCaTiTqffaA+PznKH5mLratuHeAj +b3+6Xg9ZsI9Mw6N7XVYnnbRWnsT0fJmz9tQvEyCPI5hrbq8X7B7m3JS1P9ItbUFr+Dvj218SUV c2kptCjBFLVTxK796TF04F/2FGHAEiu95004zBbGzEVzCSYNaSKx9SeEFJH72qOyRlhPkFW2BD9 E= X-Received: by 2002:a05:6870:c155:b0:1b0:89fb:9e77 with SMTP id g21-20020a056870c15500b001b089fb9e77mr2843584oad.35.1688011695292; Wed, 28 Jun 2023 21:08:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6h1jcZbyztsCfZOqZC0QC/Oy1APsfvxMmkiQuAHZY12aYjToAoacsNNEEtt+qcr+1tI2ePxg== X-Received: by 2002:a05:6870:c155:b0:1b0:89fb:9e77 with SMTP id g21-20020a056870c15500b001b089fb9e77mr2843566oad.35.1688011694980; Wed, 28 Jun 2023 21:08:14 -0700 (PDT) Received: from localhost.localdomain ([203.163.234.183]) by smtp.googlemail.com with ESMTPSA id 21-20020a17090a019500b00256b67208b1sm10978169pjc.56.2023.06.28.21.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 21:08:14 -0700 (PDT) From: Ani Sinha To: qemu-devel@nongnu.org, Thomas Huth , Laurent Vivier , Paolo Bonzini Cc: Ani Sinha , mst@redhat.com, imammedo@redhat.com, Michael Labiuk Subject: [PATCH v6 4/5] tests/qtest/hd-geo-test: fix incorrect pcie-root-port usage and simplify test Date: Thu, 29 Jun 2023 09:37:06 +0530 Message-Id: <20230629040707.115656-5-anisinha@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230629040707.115656-1-anisinha@redhat.com> References: <20230629040707.115656-1-anisinha@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The test attaches a SCSI controller to a non-zero slot and a pcie-to-pci bridge on slot 0 on the same pcie-root-port. Since a downstream device can be attached to a pcie-root-port only on slot 0, the above test configuration is not allowed. Additionally using pcie.0 as id for pcie-to-pci bridge is incorrect as that id is reserved only for the root bus. In the test scenario, there is no need to attach a pcie-root-port to the root complex. A SCSI controller can be attached to a pcie-to-pci bridge which can then be directly attached to the root bus (pcie.0). Fix the test and simplify it. CC: mst@redhat.com CC: imammedo@redhat.com CC: Michael Labiuk Signed-off-by: Ani Sinha Acked-by: Thomas Huth Reviewed-by: Igor Mammedov --- tests/qtest/hd-geo-test.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 5aa258a2b3..d08bffad91 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -784,14 +784,12 @@ static void test_override_scsi(void) test_override(args, "pc", expected); } -static void setup_pci_bridge(TestArgs *args, const char *id, const char *rootid) +static void setup_pci_bridge(TestArgs *args, const char *id) { - char *root, *br; - root = g_strdup_printf("-device pcie-root-port,id=%s", rootid); - br = g_strdup_printf("-device pcie-pci-bridge,bus=%s,id=%s", rootid, id); + char *br; + br = g_strdup_printf("-device pcie-pci-bridge,bus=pcie.0,id=%s", id); - args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, root); args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, br); } @@ -811,8 +809,8 @@ static void test_override_scsi_q35(void) add_drive_with_mbr(args, empty_mbr, 1); add_drive_with_mbr(args, empty_mbr, 1); add_drive_with_mbr(args, empty_mbr, 1); - setup_pci_bridge(args, "pcie.0", "br"); - add_scsi_controller(args, "lsi53c895a", "br", 3); + setup_pci_bridge(args, "pcie-pci-br"); + add_scsi_controller(args, "lsi53c895a", "pcie-pci-br", 3); add_scsi_disk(args, 0, 0, 0, 0, 0, 10000, 120, 30); add_scsi_disk(args, 1, 0, 0, 1, 0, 9000, 120, 30); add_scsi_disk(args, 2, 0, 0, 2, 0, 1, 0, 0); @@ -868,9 +866,9 @@ static void test_override_virtio_blk_q35(void) }; add_drive_with_mbr(args, empty_mbr, 1); add_drive_with_mbr(args, empty_mbr, 1); - setup_pci_bridge(args, "pcie.0", "br"); - add_virtio_disk(args, 0, "br", 3, 10000, 120, 30); - add_virtio_disk(args, 1, "br", 4, 9000, 120, 30); + setup_pci_bridge(args, "pcie-pci-br"); + add_virtio_disk(args, 0, "pcie-pci-br", 3, 10000, 120, 30); + add_virtio_disk(args, 1, "pcie-pci-br", 4, 9000, 120, 30); test_override(args, "q35", expected); } From patchwork Thu Jun 29 04:07:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 13296587 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5ABFFEB64DC for ; Thu, 29 Jun 2023 04:09:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEixH-0004IR-G4; Thu, 29 Jun 2023 00:08:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEixE-0004Hc-4Q for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEixC-000195-Dy for qemu-devel@nongnu.org; Thu, 29 Jun 2023 00:08:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688011701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GoBS0EC4cwBNnpcmWPjz9AcRRSQCOhYWW+JOrffjg2c=; b=ZrPOOwnU5AnQAOEPlB3RMWkAxl0ypBmzwnUa/j7ONT8ypAWhhzSIAxVHoZQukhdM49RXlq 81eLlM1/RkQ6lAaH0PZxroYwB8bLJ4xyKm86u+4mSKq+Z6neYkATl88mmS1lwjIDwhGDoh iJRm99OYEo2zIyy7LWvv0Pw856d+LFE= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-562-vYea4MMNMjKRqjb8V2csew-1; Thu, 29 Jun 2023 00:08:19 -0400 X-MC-Unique: vYea4MMNMjKRqjb8V2csew-1 Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-26337f5d2daso230492a91.0 for ; Wed, 28 Jun 2023 21:08:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688011698; x=1690603698; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GoBS0EC4cwBNnpcmWPjz9AcRRSQCOhYWW+JOrffjg2c=; b=G0SRXBCbA76T3FxELTg6q4Wh9lAMwlo49cCWsuF7OMU/uXLQLxSL/wji/xw9TzGts/ DeKnZMpXLmcyg2Rg6bhaBp2cn89m5h7ch+C4e0X4B2LDW1Wt/dU+geBBcp8C+YeZORu4 WpvYrfTgnPF/SEo5xdEF+xQ9x01Xp1nhb6L8xVVNxDl89r5azv3MacO+4kZn1t2LfJ5S Ku2X/qPSZku42ZD4baySJJztUdRYe+YwER2Ko9+V413Q9TGpvcMx9PDNfBPT/Luix7+J dQ9nVHJhKxjCYkbmCVLCW3h+Gx5vX5eYW2V8cGE/AuN4fE5e1yt3E6e5eZBeHsIY5xWD GWRA== X-Gm-Message-State: AC+VfDxnTv4SYOzoLW3AvlYto4gQaHtXaSwPMa5MWVbicCnemPuVAPvU h8ZoTMkq7ySTpPWLDJVfViWYUYqeFq0NizjmLR5Me6M7UE1gm2OmCJyYA2IDK9ibJE8JWzEw8ah QK1dUIHQrama1PvKdoez6KcL0GJzoZ7SROY/vowZztkyYcynLnX+TzUQowk0Xo6lR6PB4YbV7Dm c= X-Received: by 2002:a17:90a:8d09:b0:262:f449:4497 with SMTP id c9-20020a17090a8d0900b00262f4494497mr9606143pjo.2.1688011698400; Wed, 28 Jun 2023 21:08:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7asSaYoTZygpM8utTywpaThVmrfqBiWRAIQog79mLQcg486a7xuk2AS+F5sSazfKDolhxyUw== X-Received: by 2002:a17:90a:8d09:b0:262:f449:4497 with SMTP id c9-20020a17090a8d0900b00262f4494497mr9606128pjo.2.1688011698047; Wed, 28 Jun 2023 21:08:18 -0700 (PDT) Received: from localhost.localdomain ([203.163.234.183]) by smtp.googlemail.com with ESMTPSA id 21-20020a17090a019500b00256b67208b1sm10978169pjc.56.2023.06.28.21.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 21:08:17 -0700 (PDT) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Marcel Apfelbaum Cc: Ani Sinha , jusual@redhat.com, imammedo@redhat.com, akihiko.odaki@daynix.com Subject: [PATCH v6 5/5] hw/pci: ensure PCIE devices are plugged into only slot 0 of PCIE port Date: Thu, 29 Jun 2023 09:37:07 +0530 Message-Id: <20230629040707.115656-6-anisinha@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230629040707.115656-1-anisinha@redhat.com> References: <20230629040707.115656-1-anisinha@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org PCI Express ports only have one slot, so PCI Express devices can only be plugged into slot 0 on a PCIE port. Enforce it. The change has been tested to not break ARI by instantiating seven vfs on an emulated igb device (the maximum number of vfs the linux igb driver supports). The vfs are seen to have non-zero device/slot numbers in the conventional PCI BDF representation. CC: jusual@redhat.com CC: imammedo@redhat.com CC: akihiko.odaki@daynix.com Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2128929 Signed-off-by: Ani Sinha Reviewed-by: Julia Suvorova --- hw/pci/pci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index e2eb4c3b4a..0320ac2bb3 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -65,6 +65,7 @@ bool pci_available = true; static char *pcibus_get_dev_path(DeviceState *dev); static char *pcibus_get_fw_dev_path(DeviceState *dev); static void pcibus_reset(BusState *qbus); +static bool pcie_has_upstream_port(PCIDevice *dev); static Property pci_props[] = { DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1), @@ -1190,6 +1191,20 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, name); return NULL; + } /* + * With SRIOV and ARI, vfs can have non-zero slot in the conventional + * PCI interpretation as all five bits reserved for slot addresses are + * also used for function bits for the various vfs. Ignore that case. + * It is too early here to check for ARI capabilities in the PCI config + * space. Hence, we check for a vf device instead. + */ + else if (!pci_is_vf(pci_dev) && + pcie_has_upstream_port(pci_dev) && + PCI_SLOT(devfn)) { + error_setg(errp, "PCI: slot %d is not valid for %s," + " parent device only allows plugging into slot 0.", + PCI_SLOT(devfn), name); + return NULL; } pci_dev->devfn = devfn;