mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
xen: add a dummy xc_hvm_inject_msi for Xen < 4.2
xc_hvm_inject_msi is only available on Xen >= 4.2: add a dummy compatibility function for Xen < 4.2. Also enable msi support only on Xen >= 4.2. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
This commit is contained in:
@@ -916,7 +916,7 @@ static DeviceState *apic_init(void *env, uint8_t apic_id)
|
||||
msi_supported = true;
|
||||
}
|
||||
|
||||
if (xen_enabled()) {
|
||||
if (xen_msi_support()) {
|
||||
msi_supported = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,4 +57,14 @@ void xen_register_framebuffer(struct MemoryRegion *mr);
|
||||
# define HVM_MAX_VCPUS 32
|
||||
#endif
|
||||
|
||||
static inline int xen_msi_support(void)
|
||||
{
|
||||
#if defined(CONFIG_XEN_CTRL_INTERFACE_VERSION) \
|
||||
&& CONFIG_XEN_CTRL_INTERFACE_VERSION >= 420
|
||||
return xen_enabled();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* QEMU_HW_XEN_H */
|
||||
|
||||
@@ -133,6 +133,21 @@ static inline int xc_fd(xc_interface *xen_xc)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Xen before 4.2 */
|
||||
#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 420
|
||||
static inline int xen_xc_hvm_inject_msi(XenXC xen_xc, domid_t dom,
|
||||
uint64_t addr, uint32_t data)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
#else
|
||||
static inline int xen_xc_hvm_inject_msi(XenXC xen_xc, domid_t dom,
|
||||
uint64_t addr, uint32_t data)
|
||||
{
|
||||
return xc_hvm_inject_msi(xen_xc, dom, addr, data);
|
||||
}
|
||||
#endif
|
||||
|
||||
void destroy_hvm_domain(void);
|
||||
|
||||
#endif /* QEMU_HW_XEN_COMMON_H */
|
||||
|
||||
@@ -129,7 +129,7 @@ void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len)
|
||||
|
||||
void xen_hvm_inject_msi(uint64_t addr, uint32_t data)
|
||||
{
|
||||
xc_hvm_inject_msi(xen_xc, xen_domid, addr, data);
|
||||
xen_xc_hvm_inject_msi(xen_xc, xen_domid, addr, data);
|
||||
}
|
||||
|
||||
static void xen_suspend_notifier(Notifier *notifier, void *data)
|
||||
|
||||
Reference in New Issue
Block a user