From patchwork Fri Oct 1 17:33:57 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: 515116 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1043880jaf; Fri, 1 Oct 2021 11:11:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGk63THEIOOmcgyhr6QECZPmpOKMLRfBilN/wvBInQ5ZRkc2YfluJF/evdz7A+TYfqLTDH X-Received: by 2002:ab0:5b03:: with SMTP id u3mr11589376uae.41.1633111917083; Fri, 01 Oct 2021 11:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633111917; cv=none; d=google.com; s=arc-20160816; b=NvyzcaRnpUTQZMUmmSVYdOuOFQvlLolrftGZmq851NVmGLg1r++AwmILJ5Ma/10ffB sConA4cw0rAhmPzKrLsCNimJtgVQ7qRyDOkAe/qS8kVvMLDpWuihELO829aG045Xm8OP w+Om4ZAs1GFRiHVdcpz0CeJZT3sbkw9x2Js/qNwaW1qqb+DSb0FInux7OqIEJJRScMBK YZGIE06rFhtkT9mcwioQn+oPbWsTETcE9c2SQd8Nv6uzoWTwyBXxoKBTtlBG9+DBOVM3 /AfrEYuw29cD21GMnjn6RBy3/tcTvY/+GfQjwWuH12v2AliFmncT7po54tkYNKSs1b66 8HQw== 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=39Knl8lMnepL6kcVt9jhZefLZXbFTU/t5RlVQ8xkhKg=; b=fcHb6/9Oh0UrM5YxSwV86LbfLp+c4VO0JH0N9uwFlmvk6jNQgdALp+s+StOY1nlnWY llIhsFqDtaDuUfwsEmaT7UanyUPTk2osWvShVq4RaW6ELPZH6JaMiQZXeFbL7N0SfE3X bXTQnXOcKSHk/Dw4gD2BxcFJVCmj1PgNAbzlak7ISMHcG02Cnl0HWRrPYcmHoPu97ZC7 Yw4zuVq6sMiIZzgSQqbBBeV3oUBmghvxOsbckW55EhJOnY+MYYoJXt6Gx2xIn5349LTG aKaGEIuKhH71l+GldBdBbgE/wg+p0yBp6ecy/eHqoDnrrIg6BtkJBwqIJTo0/lCo+9Ou H1BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=osDyd0R6; 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 q18si5033710vkn.96.2021.10.01.11.11.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 11:11:57 -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=osDyd0R6; 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]:53562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWN0m-0003DP-HN for patch@linaro.org; Fri, 01 Oct 2021 14:11:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWMUM-0000aX-Oe for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:38:28 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:39709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWMUI-0000nB-5g for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:38:25 -0400 Received: by mail-wr1-x42f.google.com with SMTP id d26so16633449wrb.6 for ; Fri, 01 Oct 2021 10:38:21 -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=39Knl8lMnepL6kcVt9jhZefLZXbFTU/t5RlVQ8xkhKg=; b=osDyd0R6KgbdCpelgFoytLwm532Ov3WtmrWBS7gtdFfp+1o+h8w/RExiVQlqlQj34U GBjLiBEHt5r0QqprQa3SSLi+sYVALZf4VYVWNRA9mphAaahv9Av4ba3Uk2fivx6P4mFN vriMUK+Exp/tYQs64E6JhqHoF5fSRN9PZl3gBfZOe8JSnqSbn9kVlnhRfM8Mmgc4r7uC dZjdeeqZP6KS1talvEUWua+QX+8WyAKvXMtDT2phNKMaFCTrbn6AfVA4lzUxvDBVkIuu p0FtFxjFrobqK8ZsEAt6W+cj3KV54eyeM0q0ink/cdyPZUwuVhiUwzSn6pWuoV08OgsV VQSg== 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=39Knl8lMnepL6kcVt9jhZefLZXbFTU/t5RlVQ8xkhKg=; b=LcKu/IwpfF6l/qB1iDXmfxoQuk8rMCizJFsQfRA+gUVwG8S48hJEdPxKSWs6AqkycE NjxgfAvrAW5YCKwuun/ojwj1xQ0dR4/wEDQtHtiYZm1jOqR5PrLICY1p8yVxt8Kq8HFJ Ym8UlvFqts0Qb212CctQEYA3dj7L8SR32zyc9vUkXz9jFVbU3CDJHg+rhzaIGpBbKy4l JtO/Nd2HbWhpspHA/6v4M7CTEP0QdOIgKLDhuOjImLc5zF7SZmAfVZfvrN/QP8suL42M MmlgmdfRvq/G4KJJZ5adSM01nQ12t7YEb1BKRnhoQo7g3Dj/oTCtW81Jy0q9UbA3rKRa 7Fug== X-Gm-Message-State: AOAM531Aa0vdAebOvzKMLcPZh+N7Ztwg7RsQ8SaNfNQe6Ahy/05KiHh9 sBE7/7ipVW3NrThtXDNUfawOPg== X-Received: by 2002:a05:6000:228:: with SMTP id l8mr13914848wrz.413.1633109900241; Fri, 01 Oct 2021 10:38:20 -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 k9sm6186592wrz.22.2021.10.01.10.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:38:19 -0700 (PDT) From: Jean-Philippe Brucker To: eric.auger@redhat.com, imammedo@redhat.com Subject: [PATCH v4 09/11] tests/acpi: add test cases for VIOT Date: Fri, 1 Oct 2021 18:33:57 +0100 Message-Id: <20211001173358.863017-10-jean-philippe@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001173358.863017-1-jean-philippe@linaro.org> References: <20211001173358.863017-1-jean-philippe@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=jean-philippe@linaro.org; helo=mail-wr1-x42f.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: peter.maydell@linaro.org, ehabkost@redhat.com, mst@redhat.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, shannon.zhaosl@gmail.com, Jean-Philippe Brucker , qemu-arm@nongnu.org, ani@anisinha.ca, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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. Signed-off-by: Jean-Philippe Brucker --- tests/qtest/bios-tables-test.c | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) -- 2.33.0 Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 4f11d03055..b6cb383bd9 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1403,6 +1403,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 " + "-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", &data); + free_test_data(&data); +} + static void test_oem_fields(test_data *data) { int i; @@ -1567,12 +1603,14 @@ int main(int argc, char *argv[]) if (strcmp(arch, "x86_64") == 0) { qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg); } + qtest_add_func("acpi/q35/viot", test_acpi_q35_viot); } else if (strcmp(arch, "aarch64") == 0) { qtest_add_func("acpi/virt", test_acpi_virt_tcg); qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem); 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(); boot_sector_cleanup(disk);