From patchwork Tue Oct 26 18:20:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 516218 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp627542imj; Tue, 26 Oct 2021 11:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDgjr5sbvZU1t99Ssv1jRMNRpw6pKFa6ojv4GonjJw8RWMp3WoZysjFLENoiE4bg2Bg101 X-Received: by 2002:a05:6122:1827:: with SMTP id ay39mr13101830vkb.24.1635273253270; Tue, 26 Oct 2021 11:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635273253; cv=none; d=google.com; s=arc-20160816; b=mGDjd0xus6Z4tfWElh6tCEvDKGm4v9BuVszca/bOsrkw1RZT1t8nWO//ngTWyUoh+n PeQZO6sQO6U238xIe3hBT25Kn6GgSh9wdl2lW6OmuvN9PIv7iK9hOYAlzwhuYZfrV7TE 1BOCHYQOUUmj1ByJKUMtd79PA6eCRyByVf2JBzLUY6il49VoAVXku9hmhqh2PIagbPxH ztozMYySWIkXk+hcKddHxH/riHvwowsnXcQlEYwYD2LRqv1LXVRMXlzGEKq7nYvnw54Y JEht6lP/cy4nTeLIHHJWQS4IO2cY0XhQSTG1CuKklH3x+YqH2uxiO94G701dUuUYjWzN HoIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=qt5axnO0OaNcSTLDmMP/AtPoeSrtu9sIOj7togz8E+k=; b=xP/TpiJdlMfHzKxTyj2fOLFGdUWooQMDeN+CW/JmhFBAtLYlHwHiGoSYaH0JFwk9+2 yXxFF3M72dG3d+O9iERrTe8c5ZLmfPv9N/IWkuo013WwbEqM3miY+PWjwCDMS8dw9HoG v/rSWx9kYMkpwCDKl6azORithgOtAohwiCdnEvsWTYh4x5X1jHq4BWE4+gnSLqatuQjJ 1pY1PDSSC1v2CgMV2XMwCz7sjy67uMaUwpoD8iYjtJWi3xv5qdyGNZFTj78jjyPGEUVE WbIdqi58iwXsrbx6dM5TqDD9gpIuB6R7mrReu6sHf/aVHzCW6doGx6BmIqlJf4wJD8p+ YAAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="KH/qNslB"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p2si3385126vsl.338.2021.10.26.11.34.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 11:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="KH/qNslB"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfRH1-0002wM-GU for patch@linaro.org; Tue, 26 Oct 2021 14:34:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfR8V-0005tZ-KZ for qemu-devel@nongnu.org; Tue, 26 Oct 2021 14:25:23 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:45634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfR8M-0006kn-2L for qemu-devel@nongnu.org; Tue, 26 Oct 2021 14:25:23 -0400 Received: by mail-wr1-x42e.google.com with SMTP id o14so3617290wra.12 for ; Tue, 26 Oct 2021 11:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qt5axnO0OaNcSTLDmMP/AtPoeSrtu9sIOj7togz8E+k=; b=KH/qNslBSHyLdT9pSclX/WNHUswwalG7a4jJR2ozShhTQ9OmbkXB2DWj8BBcnMYIkT yDwBZ7NltCddJS+MLDvBWoSJiJ7CEZZYqPKjKjJ1/qJPvDUGpfbZ9ceU2jVDxovEx2s5 Nt1gHGMHgqxgjChvCCj20nCRwnSg400HtfBINFUeH4jUef30yWS+w1WzxlfP9OAWQ+XJ UNVO1N5MZilAY9kGJYy7eEJ3W2JIvtYww8FKww1WMLTLZ3b+JisQz8WswpnApHIIqey7 5n8xhuHgupAAqJPFLkAloURJaDnqLBraNklAt+6B5BeBhHFIgpp0ucac3CKw4qRBy1xU 8Upg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qt5axnO0OaNcSTLDmMP/AtPoeSrtu9sIOj7togz8E+k=; b=bs2Fmcyd24LmLHoKDKUhYF0sKQ41eat5WXp81aJv8LNlDJ082o78sUwD5mV2uPyT6I S5uTxMInbeq2H5EIKo79y0u56ZLgLj7ZPLuGwIFIVtydnuTSWfM+NUA/Lb69Q22p41vE djmdVCP0D4pJao1lZndlKl5c2W4XtyAdkrjSZGheEeuKm8XfCzol13RU8B/IctwjMTrF liHiD2MiCznDy3K2SLk3sylsT9tbx2X1sqMJ19nAeCQQEhInvsR89HYQROh6JkP+gEYM cIemMLchj/R7RejDfLXQOaS6MyDGnp26NuFbIcfPYCAHIuV8WL0ZoBhoPyzBRd64WXRl Q+ag== X-Gm-Message-State: AOAM530bQcUJ4uxD3xqEeOT18f75Fk4DogceFZoj7SM4exmCboZL4VlF ILdoGK0dI43+IMmj0gHy9vfEdw== X-Received: by 2002:a05:6000:44:: with SMTP id k4mr34220006wrx.68.1635272712476; Tue, 26 Oct 2021 11:25:12 -0700 (PDT) Received: from localhost.localdomain (cpc92880-cmbg19-2-0-cust679.5-4.cable.virginm.net. [82.27.106.168]) by smtp.gmail.com with ESMTPSA id b19sm1275283wmj.9.2021.10.26.11.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 11:25:11 -0700 (PDT) From: Jean-Philippe Brucker To: mst@redhat.com, imammedo@redhat.com Subject: [PATCH v6 6/7] tests/acpi: add test case for VIOT on q35 machine Date: Tue, 26 Oct 2021 19:20:25 +0100 Message-Id: <20211026182024.2642038-7-jean-philippe@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211026182024.2642038-1-jean-philippe@linaro.org> References: <20211026182024.2642038-1-jean-philippe@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=jean-philippe@linaro.org; helo=mail-wr1-x42e.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: Jean-Philippe Brucker , ehabkost@redhat.com, jasowang@redhat.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, peterx@redhat.com, eric.auger@redhat.com, ani@anisinha.ca, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add a test case for VIOT on the q35 machine. To test complex topologies it has two PCIe buses that bypass the IOMMU (and are therefore not described by VIOT), and two buses that are translated by virtio-iommu. Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) -- 2.33.0 diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 258874167e..a5e0fab9d5 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1465,6 +1465,26 @@ static void test_acpi_virt_tcg(void) free_test_data(&data); } +static void test_acpi_q35_viot(void) +{ + test_data data = { + .machine = MACHINE_Q35, + .variant = ".viot", + }; + + /* + * To keep things interesting, two buses bypass the IOMMU. + * VIOT should only describes the other two buses. + */ + test_acpi_one("-machine default_bus_bypass_iommu=on " + "-device virtio-iommu-pci " + "-device pxb-pcie,bus_nr=0x10,id=pcie.100,bus=pcie.0 " + "-device pxb-pcie,bus_nr=0x20,id=pcie.200,bus=pcie.0,bypass_iommu=on " + "-device pxb-pcie,bus_nr=0x30,id=pcie.300,bus=pcie.0", + &data); + free_test_data(&data); +} + static void test_oem_fields(test_data *data) { int i; @@ -1639,6 +1659,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/kvm/xapic", test_acpi_q35_kvm_xapic); qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar); } + qtest_add_func("acpi/q35/viot", test_acpi_q35_viot); } else if (strcmp(arch, "aarch64") == 0) { if (has_tcg) { qtest_add_func("acpi/virt", test_acpi_virt_tcg);