aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBernhard Beschow <shentey@gmail.com>2024-12-05 12:44:53 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-12-14 00:16:20 +0100
commit8a4989f526cae238d1cf044c62c847ed708c92c6 (patch)
treeddf23fe300f281b51cd66453e6ce7f0814639405 /include
parentc0179ead952b80ccf0d9d741fc4f66b57ab1250d (diff)
downloadqemu-8a4989f526cae238d1cf044c62c847ed708c92c6.zip
qemu-8a4989f526cae238d1cf044c62c847ed708c92c6.tar.gz
qemu-8a4989f526cae238d1cf044c62c847ed708c92c6.tar.bz2
hw/ide/ahci: Decouple from PCI
In some adhoc profiling booting Linux VMs, it's observed that ahci_irq_lower() can be a hot path (10000+ triggers until login prompt appears). Even though the parent device never changes, this method re-determines whether the parent device is a PCI device or not using the rather expensive object_dynamic_cast() function. Avoid this overhead by pushing the interrupt handling to the parent device, essentially turning AHCIState into an "IP block". Note that this change also frees AHCIState from the PCI dependency which wasn't reflected in Kconfig. Reported-by: Peter Xu <peterx@redhat.com> Inspired-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20241212110926.23548-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/ide/ahci-pci.h2
-rw-r--r--include/hw/ide/ahci.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/hw/ide/ahci-pci.h b/include/hw/ide/ahci-pci.h
index c2ee616..face1a9 100644
--- a/include/hw/ide/ahci-pci.h
+++ b/include/hw/ide/ahci-pci.h
@@ -9,6 +9,7 @@
#include "qom/object.h"
#include "hw/ide/ahci.h"
#include "hw/pci/pci_device.h"
+#include "hw/irq.h"
#define TYPE_ICH9_AHCI "ich9-ahci"
OBJECT_DECLARE_SIMPLE_TYPE(AHCIPCIState, ICH9_AHCI)
@@ -17,6 +18,7 @@ struct AHCIPCIState {
PCIDevice parent_obj;
AHCIState ahci;
+ IRQState irq;
};
#endif
diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h
index ba31e75..ac0292c 100644
--- a/include/hw/ide/ahci.h
+++ b/include/hw/ide/ahci.h
@@ -37,8 +37,6 @@ typedef struct AHCIControlRegs {
} AHCIControlRegs;
typedef struct AHCIState {
- DeviceState *container;
-
AHCIDevice *dev;
AHCIControlRegs control_regs;
MemoryRegion mem;