From patchwork Mon May 26 05:31:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 892602 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e53:0:b0:3a3:61c9:c5d4 with SMTP id j19csp1038537wrz; Sun, 25 May 2025 22:33:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX+L8/6Kt2+D27CQGrNs538E23WoZ+pVdXgbgJwkgShICqj02t2/I/AwtIVfEBhjqaPc1a/Uw==@linaro.org X-Google-Smtp-Source: AGHT+IGUPu1LPjkYSpKAQ49AWwL1kiFVom8HLxAFheT7PxiqEMigNeiOJXRGl5HNxzk0kvWyjNBv X-Received: by 2002:a05:622a:1f89:b0:494:b1f9:d699 with SMTP id d75a77b69052e-49f3515515bmr134043291cf.23.1748237587550; Sun, 25 May 2025 22:33:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1748237587; cv=none; d=google.com; s=arc-20240605; b=A6SFa9QdY2jBnM5d/SoExPZ2aJ/3pX3w2wTIOpkit5n/FKtKg+Ly9xOt5+77OQyDvX Ij6oW6nARp0SlcsxhNs5yDhMO9UcTmJKoxKMzW1pQRGD581nl0HqkdB9b/4hPh0fPRLJ OEbSlhOLVNUHcHvU8KT+F+vbskJ9eQNkKbWgTjovAQ6QUA88e2jqLPvzy6oEW3w2vWBU qyw2ZtT26zGa/NkHcDYdqF2h2IWcDO7u80q3fKGfD5fRz9KTJT1ReoMrGotsPJNJFRYu xrD7wAAZf+h5QnU5nbrDRmMbmqxcXOND319qnF3nCFOF+hwCeoFehndSqxtJcPQY6uIc yZgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:cc:to :from:dkim-signature; bh=JiA6hOZT8dbZS3oxbupOyToDge/JikBtR/d7vAGhdTw=; fh=l0mju90xLx6bbDE0/STIK7UKEZKkkMQW8VsWHpVpQ8c=; b=VVyo0NoEKG6VqJF2hxzj/ibopcfazOI4KtHrzm7UFJB1PJB9ScadagHgTPOTkeaK/D BhXYM7sfObx/U/8GPoSrhXRpUMt61uqnJVmk0gFiScJDvQbP5L7CiAQa7pba4/O1jsbl gl784gywBsg4jXSs4v7qvgiZy5hATDc7jA+SRc5N+HKau+JXmAngs4BJUumzt6IXyUui K3rsrC/VCqXK03CLH2eWktxyQGBt8gyoSfHOWriIhvBLTL+KC+cFL21S41PGOeb4V7Xf rrOIYv4UuwII3PmMTawylbTiGgPMm46L6Lk9/tW4l8O0Cl80/kT6pUo45De1jtP/ZTlW zNQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j3N+UtSD; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-494ae56034bsi246463781cf.261.2025.05.25.22.33.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 May 2025 22:33:07 -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=pass header.i=@linaro.org header.s=google header.b=j3N+UtSD; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uJQS3-0004gk-W1; Mon, 26 May 2025 01:32:44 -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 1uJQRd-0002vH-1z for qemu-devel@nongnu.org; Mon, 26 May 2025 01:32:19 -0400 Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uJQRX-0002KM-7S for qemu-devel@nongnu.org; Mon, 26 May 2025 01:32:12 -0400 Received: by mail-ua1-x932.google.com with SMTP id a1e0cc1a2514c-86dc3482b3dso1898598241.0 for ; Sun, 25 May 2025 22:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1748237529; x=1748842329; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JiA6hOZT8dbZS3oxbupOyToDge/JikBtR/d7vAGhdTw=; b=j3N+UtSDkLV/jcYWjBdYSUZHw9wgHc+3xR10vpCeqCMZETBcyXDich5w0lnTrWYJRc D1DSH2WnsRrRdKkIq/pOAYtWJzX1E2X2KwA7DgK8a/nDyqlq77YOuCPQ25PI3CUwMUzt TAvgS/zpSolU6GrPVGkwjE8poVDwycX5CVGH3JK8z57O+D7bOMOruAmMPS2rYJibcWeE X7r/RDOS2bsTXJwBsHG0FSE2ibQW+L7Aq23Mfdgpv8AwNorH1TcP4/yHyEQwi2jjlsVP vY5tMzLD+ObFLY4HXZxFEFSj69120s1aCIu6v6O7aeFcsl5vUvtlvaO39BLQdcFvdXdE vJjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748237529; x=1748842329; 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=JiA6hOZT8dbZS3oxbupOyToDge/JikBtR/d7vAGhdTw=; b=X/ux3wd3+DRABSRqLH/03FT5J57dlipMl0ZhO7frffNnbY7viFi82/vFkxo57KKjYl U8dnse0xNYsoAX1XwEdFKzdMb4vN36maVX/3hKU1b9kuEd+RII2JqndyDFNehu8hCTwi rZXGxWyeDb5Y+/xrB2NDezCA+2xDf5zcIfat/iYSkUUxp9jYWUmhPWqnOilYra0H3uQy uP6n+DlrSpPXdsXEnoBqoEgSmZ+Lbw6jyUaHhgGWMwrry6GHEPnyyEX+L9wBtWLXVnS7 m4IjEXYkRgoAHETI/+J/BzbPkiKNAEJq1nZ/cEGlgiaI26uxc1PDAPvrrktSkpqatJtJ Twtw== X-Gm-Message-State: AOJu0YynC9rc9Vwj7jY0VC/rhWl07qIelZ3yGer4aAfz2zUxKX3pqocJ hHTXBcsBVBK6R3FXO9YLZND4dD4D5IvF+SZ4jpc/ZKwoaHoLy2t1hJ+hzuupsumlEIDeb7OG1zx cK9AAT/c= X-Gm-Gg: ASbGncuT7dDMOfAOTKCJEuk5aLIrZXKjwS+y03y6zzZ3GRENGdqnTY7hJPwYmt2LGt2 Nrrnm5HZ386rshauXHyufgqID8ehP4S+qTSeh5P6Nvkt+9NnWayaMN8OZeR2EM5Juz8ur+OlbNT gdG4m74WU9BjzvmbOwE7+f5RFqxEPQDaGW3xyH6uEYaQcU/UyMR38NCKguvpzwWZcTJc8v2AraX XgqiedB/nEJ78jsYREMH1EAUIpU4gRNCN3MJvo6G3zN/xhohI1ZDoqkgToto74Dg/WPtG8z+4xt q+NJziPCf99790Dr4J6Tfg57SCQz/NRNTzQRU/u2+sNsZXgDPPsFV2N+XmVu3hPMGF6hT8fNBG6 0UL2xmGl3xJL9AwIj9CCuLw== X-Received: by 2002:a05:6102:4407:b0:4e2:82b1:efe0 with SMTP id ada2fe7eead31-4e423d6eda2mr4871280137.1.1748237529338; Sun, 25 May 2025 22:32:09 -0700 (PDT) Received: from gromero0.. (200-100-75-183.dial-up.telesp.net.br. [200.100.75.183]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-4e454da4378sm784310137.17.2025.05.25.22.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 May 2025 22:32:08 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com Cc: qemu-arm@nongnu.org, thuth@redhat.com, gustavo.romero@linaro.org, alex.bennee@linaro.org, mst@redhat.com, imammedo@redhat.com Subject: [PATCH 4/5] tests/qtest/bios-tables-test: Add aarch64 ACPI PCI hotplug test Date: Mon, 26 May 2025 05:31:22 +0000 Message-Id: <20250526053123.1434204-5-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250526053123.1434204-1-gustavo.romero@linaro.org> References: <20250526053123.1434204-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::932; envelope-from=gustavo.romero@linaro.org; helo=mail-ua1-x932.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=unavailable 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-bounces+patch=linaro.org@nongnu.org Add a test to verify that the aarch64 'virt' machine correctly generates the ACPI tables and AML code for PCI device hotplug. Signed-off-by: Gustavo Romero --- tests/data/acpi/aarch64/virt/DSDT.acpipcihp | 0 tests/qtest/bios-tables-test-allowed-diff.h | 1 + tests/qtest/bios-tables-test.c | 32 +++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 tests/data/acpi/aarch64/virt/DSDT.acpipcihp diff --git a/tests/data/acpi/aarch64/virt/DSDT.acpipcihp b/tests/data/acpi/aarch64/virt/DSDT.acpipcihp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..dc3ab24d05 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/aarch64/virt/DSDT.acpipcihp", diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 216941dbb5..1bf45bc6e3 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1643,6 +1643,37 @@ static void test_acpi_aarch64_virt_tcg_memhp(void) } +static void test_acpi_aarch64_virt_pci_hotplug(void) +{ + test_data data = { + .machine = "virt", + .arch = "aarch64", + .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 = 512ULL * 1024 * 1024, + .variant = ".acpipcihp", + }; + + test_acpi_one(" -machine acpi-pcihp=on" + " -cpu cortex-a57" + " -m 512M" + /* + * We just pick address=0x04 for the root port to avoid + * collisions with other PCI devices on the root bus (pcie.0). + * It could be any other value that doesn't collide. + * + * The 'chassis' and 'slot' options equal to 1 have no special + * meaning here, could be any integer, but we set them to known + * values to keep the test consistent. + */ + " -device pcie-root-port,bus=pcie.0,chassis=1,slot=1,addr=0x04.0x00", + &data); + + free_test_data(&data); +} + static void test_acpi_microvm_prepare(test_data *data) { data->machine = "microvm"; @@ -2584,6 +2615,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/virt/numamem", test_acpi_aarch64_virt_tcg_numamem); qtest_add_func("acpi/virt/memhp", test_acpi_aarch64_virt_tcg_memhp); + qtest_add_func("acpi/virt/pcihp", test_acpi_aarch64_virt_pci_hotplug); qtest_add_func("acpi/virt/pxb", test_acpi_aarch64_virt_tcg_pxb); qtest_add_func("acpi/virt/oem-fields", test_acpi_aarch64_virt_oem_fields);