mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00

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>
24 lines
432 B
C
24 lines
432 B
C
/*
|
|
* QEMU AHCI Emulation (PCI devices)
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
#ifndef HW_IDE_AHCI_PCI_H
|
|
#define HW_IDE_AHCI_PCI_H
|
|
|
|
#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)
|
|
|
|
struct AHCIPCIState {
|
|
PCIDevice parent_obj;
|
|
|
|
AHCIState ahci;
|
|
IRQState irq;
|
|
};
|
|
|
|
#endif
|