From: Jishnu Warrier <jishnuvw@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: npiggin@gmail.com, philmd@linaro.org, farosas@suse.de,
akihiko.odaki@daynix.com, mst@redhat.com,
marcel.apfelbaum@gmail.com, david@gibson.dropbear.id.au,
adityag@linux.ibm.com, harshpb@linux.ibm.com,
amachhiw@linux.ibm.com
Subject: [PATCH v6 06/10] tests/qtest/ahci: don't unmap pci bar if it wasn't mapped
Date: Tue, 18 Aug 2026 00:25:36 +0530 [thread overview]
Message-ID: <20260817185539.376740-7-jishnuvw@linux.ibm.com> (raw)
In-Reply-To: <20260817185539.376740-1-jishnuvw@linux.ibm.com>
From: Nicholas Piggin <npiggin@gmail.com>
ahci-test has a bunch of tests where the pci bar was not mapped. Avoid
unmapping it in these cases, to keep iomaps balanced.
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
tests/qtest/ahci-test.c | 3 +++
tests/qtest/libqos/ahci.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c
index 64bbdd49..43b5a38b 100644
--- a/tests/qtest/ahci-test.c
+++ b/tests/qtest/ahci-test.c
@@ -85,6 +85,8 @@ static void verify_state(AHCIQState *ahci, uint64_t hba_old)
uint64_t hba_base;
AHCICommandHeader cmd;
+ g_assert_cmphex(ahci->hba_bar.addr, ==, hba_old);
+
ahci_fingerprint = qpci_config_readl(ahci->dev, PCI_VENDOR_ID);
g_assert_cmphex(ahci_fingerprint, ==, ahci->fingerprint);
@@ -1421,6 +1423,7 @@ static void test_reset(void)
ahci_set(ahci, AHCI_GHC, AHCI_GHC_HR);
stop_ahci_device(ahci);
ahci_clean_mem(ahci);
+ start_ahci_device(ahci);
}
ahci_shutdown(ahci);
diff --git a/tests/qtest/libqos/ahci.c b/tests/qtest/libqos/ahci.c
index f5859c6e..71d19a44 100644
--- a/tests/qtest/libqos/ahci.c
+++ b/tests/qtest/libqos/ahci.c
@@ -224,7 +224,7 @@ void start_ahci_device(AHCIQState *ahci)
void stop_ahci_device(AHCIQState *ahci)
{
- /* Unmap AHCI's ABAR */
+ /* Unmap AHCI's ABAR (no-op if not mapped) */
qpci_iounmap(ahci->dev, ahci->hba_bar);
}
@@ -249,6 +249,7 @@ void ahci_hba_enable(AHCIQState *ahci)
uint8_t num_cmd_slots;
g_assert(ahci != NULL);
+ g_assert(ahci->hba_bar.mapped);
/* Set GHC.AE to 1 */
ahci_set(ahci, AHCI_GHC, AHCI_GHC_AE);
--
2.55.0
next prev parent reply other threads:[~2026-08-17 18:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 18:55 [PATCH v6 00/10] tests/qtest: pci and MSI-X fixes Jishnu Warrier
2026-08-17 18:55 ` [PATCH v6 01/10] tests/qtest: Enforce zero for the "un-fired" msix message value Jishnu Warrier
2026-08-17 18:55 ` [PATCH v6 02/10] tests/qtest: Fix virtio msix message endianness Jishnu Warrier
2026-08-17 18:55 ` [PATCH v6 03/10] tests/qtest: Add libqos function for testing msix interrupt status Jishnu Warrier
2026-08-17 18:55 ` [PATCH v6 04/10] tests/qtest: Enable spapr dma with linear iommu map Jishnu Warrier
2026-08-18 19:50 ` Fabiano Rosas
2026-08-17 18:55 ` [PATCH v6 05/10] tests/qtest/ahci: unmap pci bar before reusing device Jishnu Warrier
2026-08-17 18:55 ` Jishnu Warrier [this message]
2026-08-17 18:55 ` [PATCH v6 07/10] tests/qtest/libquos/pci: Add migration fixup helper for pci devices Jishnu Warrier
2026-08-17 18:55 ` [PATCH v6 08/10] qtest/libqos/pci: Enforce balanced iomap/unmap Jishnu Warrier
2026-08-17 18:55 ` [PATCH v6 09/10] qtest/libqos/pci: Fix qpci_msix_enable sharing bar0 Jishnu Warrier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260817185539.376740-7-jishnuvw@linux.ibm.com \
--to=jishnuvw@linux.ibm.com \
--cc=adityag@linux.ibm.com \
--cc=akihiko.odaki@daynix.com \
--cc=amachhiw@linux.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=farosas@suse.de \
--cc=harshpb@linux.ibm.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=npiggin@gmail.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.