Merge remote-tracking branch 'sstabellini/build_fix' into staging

* sstabellini/build_fix:
  xen: add a dummy xc_hvm_inject_msi for Xen < 4.2
  xen,configure: detect Xen 4.2
This commit is contained in:
Anthony Liguori 2012-04-23 09:58:54 -05:00
commit 53878a132a
5 changed files with 52 additions and 2 deletions

25
configure vendored
View File

@ -1391,6 +1391,31 @@ EOF
#if !defined(HVM_MAX_VCPUS)
# error HVM_MAX_VCPUS not defined
#endif
int main(void) {
xc_interface *xc;
xs_daemon_open();
xc = xc_interface_open(0, 0, 0);
xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
xc_gnttab_open(NULL, 0);
xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
return 0;
}
EOF
compile_prog "" "$xen_libs"
) ; then
xen_ctrl_version=420
xen=yes
elif (
cat > $TMPC <<EOF
#include <xenctrl.h>
#include <xs.h>
#include <stdint.h>
#include <xen/hvm/hvm_info_table.h>
#if !defined(HVM_MAX_VCPUS)
# error HVM_MAX_VCPUS not defined
#endif
int main(void) {
xc_interface *xc;
xs_daemon_open();

View File

@ -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;
}

View File

@ -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 */

View File

@ -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 */

View File

@ -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)