From patchwork Wed Dec 15 10:40:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 524261 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp238188imb; Wed, 15 Dec 2021 03:22:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4k6XWNWMXEdBumLQZ/OVk8njDcAqO6J2h5AadaW3Q/Xy489zi+vASHIxD9KEj6GY1HrCf X-Received: by 2002:a25:d492:: with SMTP id m140mr6132097ybf.105.1639567340920; Wed, 15 Dec 2021 03:22:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639567340; cv=none; d=google.com; s=arc-20160816; b=XuAhv/MksrGhr99Suzbgni/+HshsDC+Ray26oQ9b7jwTkaMI87wizi1GaVzvQLu/ks 695WqHq9dKV/nZxroO8zoyOrm3BC2jPbhBAncxRDBV/3ex3vr76tkZsYb28G/q2mxv5w 3KeJsPJjU2BVo5AhpzGkMFhibIQO7hGQLMbd2sQ0Wre2a01UL4E8LUs2mcG1bShcxBTL aolGpamRRgVFV8pABxDvwPX9YRBlpELyoItp0diX/MNLUJcXO6mC2Y2hn3uOQaosDp9s PjsnhtyH3Sx6DXcnnr9dJ4abjgByUB4pYsN0SqRQBXlkb3iFSQq+nfiXpmISz622VWe7 vkPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=AxAfi0cSCTWP0iQobjmr0rvRXa2XPUga+L6BtFS0ls8=; b=Ctn+6WwrsXbGnBv+NDpVvqKL7ZyNo1Y2hduwnI9KeQJuwnJ0ibWYawjxp7huFmQda5 DgLsKb6MJMTgDroK0KLEWSWbnbvQT25osqkNRQebzuwcIwrYIDn4lHz9Z5EF3iFtLopI ivxgH9CkdQKCCFo0zekzFnMv18F9la9EWrbHHiT2RlG6E6HsDHgDMsTClIfCx41kqM9U GqBXgKrthPRxEsn/cOftEaDe3Hzb0YF7jAbtNMbLoTaqnFhIkB4KXmM6nZqDn5qGn4mB CqKfseD6OKU1x5ox4kDSAo+XNzbq6WYxZivxSRnxeRmgivj9l/RIomz/q402gVhIZ5tB +8Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=asxNSw+s; 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=pass (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 a203si1642727ybb.27.2021.12.15.03.22.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Dec 2021 03:22:20 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=asxNSw+s; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxSMW-0003Cg-BT for patch@linaro.org; Wed, 15 Dec 2021 06:22:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxRij-0007Mr-KY for qemu-devel@nongnu.org; Wed, 15 Dec 2021 05:41:13 -0500 Received: from [2a00:1450:4864:20::32a] (port=44973 helo=mail-wm1-x32a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxRif-0000Md-E0 for qemu-devel@nongnu.org; Wed, 15 Dec 2021 05:41:13 -0500 Received: by mail-wm1-x32a.google.com with SMTP id p27-20020a05600c1d9b00b0033bf8532855so15664373wms.3 for ; Wed, 15 Dec 2021 02:41:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=AxAfi0cSCTWP0iQobjmr0rvRXa2XPUga+L6BtFS0ls8=; b=asxNSw+sUQmaJBWVfsUCoQq5vwTKFerAZ7hHiBEzsMdxDuj2mBsdv9yi3LME4Ib4AT Xg4ydphVVRyCy989cmX1+AY50HAGMXXkNckqMPIL+1VzBo2DdrCbi/FwlNRytpngczSt qhuw7AtvSzNJuLpMFvbWzjceI/GbfRRhaRrFQEQ/XmQUSBaOQrz4M6xGpX+WPX6l/T/j ovXaTqa3To0gDQesuTy5wEwSGvbzUIPlHswGikJ0MQ1jGaY30OGEAR7vWovE6kxKCW8T 2R+IR6sSbpgkHJfTDVJJkhKadLJrP/CAItxVZQAKs11VaExAuiOPbrnyLduM/yI4chIh lAwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AxAfi0cSCTWP0iQobjmr0rvRXa2XPUga+L6BtFS0ls8=; b=vIERub9Amfw4BSLyZjo7Tai1jkJVtRno0FI8coScsiCn5ly8KjbhcEm8wLlMxh1YM2 B9MTbxyPUZpbZXZRv3SEPuTKeY7TnERWuNk1U0xCqItS0qSE+WX74sBVJPZtsKC0M/X+ 2pelz1Q4E92LqfgtOhqKn13iozrBLXj+8LK+x4YNJr69opTjdNEISAA0g03FV91dtkt+ PpsNOpTbJcbNhizvbhBCx8NwvGw+rOrxAJLvBgUEKjGfnphonmM9nOakzu2RPlg361ac pNXzSkaPTED79KngQK1H+5GpdphktwY2o1+CeKS5+pgyz9T2cs7hJLpciExyTa15lpbv d+jA== X-Gm-Message-State: AOAM533qkB1MdDVf/JrpVUGlYGrwVV+p9YP1u6m6MUutty7swk50Hf1j 8NpsvkrB/L4Wp7dzzOrS4b2GfB4HMMVuMg== X-Received: by 2002:a7b:c0d7:: with SMTP id s23mr2998395wmh.135.1639564868031; Wed, 15 Dec 2021 02:41:08 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e18sm1600815wrs.48.2021.12.15.02.41.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 02:41:07 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 31/33] tests/acpi: add test case for VIOT Date: Wed, 15 Dec 2021 10:40:47 +0000 Message-Id: <20211215104049.2030475-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211215104049.2030475-1-peter.maydell@linaro.org> References: <20211215104049.2030475-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Jean-Philippe Brucker Add two test cases for VIOT, one on the q35 machine and the other on virt. To test complex topologies the q35 test 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 Message-id: 20211210170415.583179-7-jean-philippe@linaro.org Signed-off-by: Peter Maydell Reported-by: Richard Henderson Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test.c | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 258874167ef..58df53b15b5 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1465,6 +1465,42 @@ 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_acpi_virt_viot(void) +{ + test_data data = { + .machine = "virt", + .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd", + .uefi_fl2 = "pc-bios/edk2-arm-vars.fd", + .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2", + .ram_start = 0x40000000ULL, + .scan_len = 128ULL * 1024 * 1024, + }; + + test_acpi_one("-cpu cortex-a57 " + "-device virtio-iommu-pci", &data); + free_test_data(&data); +} + static void test_oem_fields(test_data *data) { int i; @@ -1639,6 +1675,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); @@ -1646,6 +1683,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp); qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); qtest_add_func("acpi/virt/oem-fields", test_acpi_oem_fields_virt); + qtest_add_func("acpi/virt/viot", test_acpi_virt_viot); } } ret = g_test_run();