From patchwork Wed May 28 01:55:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 892925 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e53:0:b0:3a3:61c9:c5d4 with SMTP id j19csp1980550wrz; Tue, 27 May 2025 18:56:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUAZwjQeyvtxErY/PPItInIprhPympl48oYGnxB2u6aUaFQB/xAbg8euLO33geAH7izGe+Tbg==@linaro.org X-Google-Smtp-Source: AGHT+IFpfV3sWGvb7Ac84CLiQKx7XrOxLS5x4OgDmxaZ3KeRrnOmcYQRaowiEaDdpDKAvY+G5Geh X-Received: by 2002:a05:620a:4306:b0:7c7:97ff:ca42 with SMTP id af79cd13be357-7ceecbe079cmr2280645285a.41.1748397368624; Tue, 27 May 2025 18:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1748397368; cv=none; d=google.com; s=arc-20240605; b=kwHgH9ykeha+0fvS8nxJKZX/LIBtDwLiYWZ11DtK44kDwBZkQnjiKKbQ3Npw6L8zrj nPe4M1pDX+iELWCoJz0aazB9Ql7qWbU24iFl8IJI7Y0xPU/b7lnc/yiwX5xPiW4S5YZW Dn3EtwULFBTgzpHFLH4oaz0IwTtFyU6A8q/1e6bv79KkPsGNdf5ksF0CY60hbN2qZNYA Q2Fzfl6Hb6ngKU7AZAgHr2YYDO9P0UNbF9Z5AZQ4ntFT9lHHCiDHjGSwhJxahPnDSxXk 6az5RE3PriyOKI7dEkfhrX6MNxniE+oElEMpgrn9WgM6dUGDTs+he142xpTR+vZIjPvj 5VLw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=ekdSO3MxkWEhWoItetIsPFvG7mQY8NVEEt05rbTMaZs=; fh=LebsTHgAzErxi8Up0yO3aO/KpBjPuj4mHMwfrGw5KZA=; b=aQKDOjmXybCtvxby0Pak23Kd4esrPf6T/Cuo9gM6hcv1RbZjniC5ZepOi+SDIePHwk L9PDqM/Qy9I7Jv9P5jNgcd/dcYFcI1fnZnqGYanAIIdQ14rzDf9M0JoNuWwyyIu11JRP Vq6bjH1PgmycKIQiLSea58aZK04/PXx7oF7+HIPPRsWwb7kisgCJQQuqDrqW1Kf+0ib9 SGrbEujAyczCXPjwN/OiQV7j6VckrQwpT2iLlaeGX6rz3M85A9f3ASxLsYnkrUhMgLex Nt4+TiVCBJzRtd5ZKW2Jp2Z20Ar3FHr1Xo45gKIO0Fgm/7Q9R1ZhYmE2ucXy16qSkuKS TWtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wvy4JiIs; 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 af79cd13be357-7cfc5d62737si29365485a.329.2025.05.27.18.56.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 May 2025 18:56:08 -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=Wvy4JiIs; 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 1uK60z-0000iE-AH; Tue, 27 May 2025 21:55:33 -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 1uK60x-0000hy-VL for qemu-devel@nongnu.org; Tue, 27 May 2025 21:55:32 -0400 Received: from mail-vk1-xa31.google.com ([2607:f8b0:4864:20::a31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uK60w-0003Ag-3f for qemu-devel@nongnu.org; Tue, 27 May 2025 21:55:31 -0400 Received: by mail-vk1-xa31.google.com with SMTP id 71dfb90a1353d-525da75d902so1185520e0c.3 for ; Tue, 27 May 2025 18:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1748397328; x=1749002128; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ekdSO3MxkWEhWoItetIsPFvG7mQY8NVEEt05rbTMaZs=; b=Wvy4JiIsUc9kuIgtYsOmugglSv5j5zPqkGVgT+usfVxPvK9ghKr3SrHSWrEzQ7r6Fr jIuuYvK1bV3GvBsVmad63daHNN2VSU7HUevIQ0xYXDAC7LqaOEwPjKkvsgipyyc24h1C RcBPwQ3TAhg6ufT0t8HrwoHKpibm2ovyxtuH7tdBZZ7+1D69VHzflVvJlFtAye4mn5Ps 1qBrLMJhnccjTJ1G4BVjYBzGe3X5ecLmbu9tVLnvb6GrvR7hhB4H/f/WzKzJmIbPa/A+ 9ZFToP8Jtow9klKX5iMV9l0eu2TtQ04GRVA17Ihn6NTQFl4RNUwy5hL/xpnJXltlmazl Uzgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748397328; x=1749002128; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ekdSO3MxkWEhWoItetIsPFvG7mQY8NVEEt05rbTMaZs=; b=W2L+yIF99Cz/zk8oPJTYH4WzzmFfI34kma6Mt7EaB9E/J4jWxXXX7MMt4toB12D4wp 9WqnqHCHecZ9Q6M6TrEyUZ+rtoON6kVg87w/zW/AUHgd1uec4XbEK9HlKw3ZuYHqN6nh VM8PucaGlIJs4wBiJirFk9WUnIepw82SNNSu3uf8JtDszWZ4EPQUKlAeeARFbVz+6tJV ikKYABpGf7sv+z5qHqmpRB3E43hLpLtt04ZdpqKMeRTkNu7stq9Av1X1TT40w/Ra3lb7 P0oXJ3GuD70VGGATCxDz1r3av04gJ3QzRk2T21xSOGt+2dop1llg229A0ZyXIU8WagE4 eIqg== X-Gm-Message-State: AOJu0YyMAXoXfz4toZrNkTa+MrtHyj5BH/QOQzIgzY62+Ph6RIbtZxoS g2sCMv2lFwSJZjdFb8Vn8WZ3pjPUUUpH0vCGKOVYbzmGb7FzVn+IAmlrUV7wlFCABJQlyNP+Gbp M+aS1 X-Gm-Gg: ASbGncvT0LF1pJGtg/34Wu343Cn5rfcLes9E0sK9BgNRYVpBIutH5O0ong0tkLvbIov MkDuyfV4mAnCRlLc+p2yOGCrESgNjXUfnbQ9c69I84mS6HDpc0OgnMdQvy34IjWq9OVZn78B2Y3 Gmz7WsJ3M3rcHpnde4BrgnCb3G14P8y3aCt745sm/fX6IjFKrA6zL2Ac32XGyK8jnH3YvejA267 84TBckfcOnrYX+OtCXUlR1mvh2JVXrzjeFaJz0awV+RPNe/SB6BGkr4ZOSyqBmFZ9c/S4Mhx3A0 Q/a5iw3V/0dJJ9pZ33wQn79K8o04UeKlDt0fDzBQi9M9z5+PB5l2z4DNJITwYfdCgjvT6rWmr0I QBnhX8d0b+mRafHA+k+6ixA== X-Received: by 2002:a05:6122:2527:b0:530:65b3:4920 with SMTP id 71dfb90a1353d-53065b349f8mr413923e0c.5.1748397328493; Tue, 27 May 2025 18:55:28 -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 71dfb90a1353d-53066864b70sm174242e0c.18.2025.05.27.18.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 May 2025 18:55:27 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com Cc: qemu-arm@nongnu.org, thuth@redhat.com, alex.bennee@linaro.org, gustavo.romero@linaro.org Subject: [PATCH REPOST] tests/functional/test_aarch64_hotplug_pci: Add test for ACPI PCI hotplug Date: Wed, 28 May 2025 01:55:08 +0000 Message-Id: <20250528015508.1630804-1-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::a31; envelope-from=gustavo.romero@linaro.org; helo=mail-vk1-xa31.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 Currently, test_aarch64_hotplug_pci only tests PCI hotplug using the native PCI hotplug mechanism. Now that aarch64 supports PCI hotplug via the ACPI mechanism it's time to support it in the test as well. Signed-off-by: Gustavo Romero --- tests/functional/test_aarch64_hotplug_pci.py | 24 +++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/functional/test_aarch64_hotplug_pci.py b/tests/functional/test_aarch64_hotplug_pci.py index 2cf5c28b9f..ec8c7afe96 100755 --- a/tests/functional/test_aarch64_hotplug_pci.py +++ b/tests/functional/test_aarch64_hotplug_pci.py @@ -27,11 +27,26 @@ class HotplugPCI(LinuxKernelTest): '20230607+deb12u11/images/netboot/debian-installer/arm64/initrd.gz'), '9f817f76951f3237bca8216bee35267bfb826815687f4b2fcdd5e6c2a917790c') - def test_hotplug_pci(self): + def run_vm_and_test_hotplug_pci(self, use_acpi_pci_hotplug=False): + """ + Run an aarch64 VM and test the PCI hotplug mechanism by plugging and + unplugging a PCI network adapter to the VM. Proper plug and unplug of + the adapter is verified by checking if the network device is correctly + added and removed in Linux. + + Parameters + ---------- + use_acpi_pci_hotplug : bool + If true the ACPI PCI hotplug mechanim is used, otherwise the + Native PCIe Hotplug mechanism is used. + """ + + acpi_pci_hotplug = "on" if use_acpi_pci_hotplug else "off" self.set_machine('virt') self.vm.add_args('-m', '512M') self.vm.add_args('-cpu', 'cortex-a57') + self.vm.add_args('-machine', f"acpi-pcihp={acpi_pci_hotplug}") self.vm.add_args('-append', 'console=ttyAMA0,115200 init=/bin/sh') self.vm.add_args('-device', @@ -70,5 +85,12 @@ def test_hotplug_pci(self): 'ls -l /sys/class/net | wc -l', '2') + def test_native_pci_hotplug(self): + self.run_vm_and_test_hotplug_pci(use_acpi_pci_hotplug=False) + + def test_acpi_pci_hotplug(self): + self.run_vm_and_test_hotplug_pci(use_acpi_pci_hotplug=True) + + if __name__ == '__main__': LinuxKernelTest.main()