Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/sstabellini/tags/xen-2016-02-12…
Browse files Browse the repository at this point in the history
…' into staging

Xen 2016-02-12

# gpg: Signature made Fri 12 Feb 2016 17:28:09 GMT using RSA key ID 70E1AE90
# gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>"

* remotes/sstabellini/tags/xen-2016-02-12:
  xen: Drop __XEN_LATEST_INTERFACE_VERSION__ checks from prior to Xen 4.2
  xen: move xenforeignmemory compat layer into common place
  xen: drop XenXC and associated interface wrappers
  xen: drop xen_xc_hvm_inject_msi wrapper
  xen: drop support for Xen 4.1 and older.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Feb 12, 2016
2 parents fc1ec1a + 47d3df2 commit a5af128
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 375 deletions.
101 changes: 3 additions & 98 deletions configure
Expand Up @@ -2051,100 +2051,10 @@ EOF
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) {
xs_daemon_open();
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);
return 0;
}
EOF
compile_prog "" "$xen_libs"
then
xen_ctrl_version=410
xen=yes

# Xen 4.0.0
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) {
struct xen_add_to_physmap xatp = {
.domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
};
xs_daemon_open();
xc_interface_open();
xc_gnttab_open();
xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
return 0;
}
EOF
compile_prog "" "$xen_libs"
then
xen_ctrl_version=400
xen=yes

# Xen 3.4.0
elif
cat > $TMPC <<EOF &&
#include <xenctrl.h>
#include <xs.h>
int main(void) {
struct xen_add_to_physmap xatp = {
.domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
};
xs_daemon_open();
xc_interface_open();
xc_gnttab_open();
xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
return 0;
}
EOF
compile_prog "" "$xen_libs"
then
xen_ctrl_version=340
xen=yes

# Xen 3.3.0
elif
cat > $TMPC <<EOF &&
#include <xenctrl.h>
#include <xs.h>
int main(void) {
xs_daemon_open();
xc_interface_open();
xc_gnttab_open();
xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
return 0;
}
EOF
compile_prog "" "$xen_libs"
then
xen_ctrl_version=330
xen=yes

# Xen version unsupported
else
if test "$xen" = "yes" ; then
feature_not_found "xen (unsupported version)" "Install supported xen (e.g. 4.0, 3.4, 3.3)"
feature_not_found "xen (unsupported version)" \
"Install a supported xen (xen 4.2 or newer)"
fi
xen=no
fi
Expand All @@ -2158,15 +2068,10 @@ EOF
fi

if test "$xen_pci_passthrough" != "no"; then
if test "$xen" = "yes" && test "$linux" = "yes" &&
test "$xen_ctrl_version" -ge 340; then
if test "$xen" = "yes" && test "$linux" = "yes"; then
xen_pci_passthrough=yes
else
if test "$xen_pci_passthrough" = "yes"; then
if test "$xen_ctrl_version" -lt 340; then
error_exit "User requested feature Xen PCI Passthrough" \
"This feature does not work with Xen 3.3"
fi
error_exit "User requested feature Xen PCI Passthrough" \
" but this feature requires /sys from Linux"
fi
Expand Down
7 changes: 0 additions & 7 deletions hw/display/xenfb.c
Expand Up @@ -241,9 +241,7 @@ static int xenfb_send_motion(struct XenInput *xenfb,
event.type = XENKBD_TYPE_MOTION;
event.motion.rel_x = rel_x;
event.motion.rel_y = rel_y;
#if __XEN_LATEST_INTERFACE_VERSION__ >= 0x00030207
event.motion.rel_z = rel_z;
#endif

return xenfb_kbd_event(xenfb, &event);
}
Expand All @@ -258,12 +256,7 @@ static int xenfb_send_position(struct XenInput *xenfb,
event.type = XENKBD_TYPE_POS;
event.pos.abs_x = abs_x;
event.pos.abs_y = abs_y;
#if __XEN_LATEST_INTERFACE_VERSION__ == 0x00030207
event.pos.abs_z = z;
#endif
#if __XEN_LATEST_INTERFACE_VERSION__ >= 0x00030208
event.pos.rel_z = z;
#endif

return xenfb_kbd_event(xenfb, &event);
}
Expand Down
4 changes: 0 additions & 4 deletions hw/i386/xen/xen_apic.c
Expand Up @@ -44,11 +44,7 @@ static void xen_apic_realize(DeviceState *dev, Error **errp)
s->vapic_control = 0;
memory_region_init_io(&s->io_memory, OBJECT(s), &xen_apic_io_ops, s,
"xen-apic-msi", APIC_SPACE_SIZE);

#if defined(CONFIG_XEN_CTRL_INTERFACE_VERSION) \
&& CONFIG_XEN_CTRL_INTERFACE_VERSION >= 420
msi_supported = true;
#endif
}

static void xen_apic_set_base(APICCommonState *s, uint64_t val)
Expand Down
4 changes: 2 additions & 2 deletions hw/xen/xen_backend.c
Expand Up @@ -36,7 +36,7 @@
/* ------------------------------------------------------------- */

/* public */
XenXC xen_xc = XC_HANDLER_INITIAL_VALUE;
xc_interface *xen_xc = NULL;
xenforeignmemory_handle *xen_fmem = NULL;
struct xs_handle *xenstore = NULL;
const char *xen_protocol;
Expand Down Expand Up @@ -710,7 +710,7 @@ int xen_be_init(void)

qemu_set_fd_handler(xs_fileno(xenstore), xenstore_update, NULL, NULL);

if (xen_xc == XC_HANDLER_INITIAL_VALUE || xen_fmem == NULL) {
if (xen_xc == NULL || xen_fmem == NULL) {
/* Check if xen_init() have been called */
goto err;
}
Expand Down
4 changes: 0 additions & 4 deletions include/hw/xen/xen.h
Expand Up @@ -48,8 +48,4 @@ void xen_modified_memory(ram_addr_t start, ram_addr_t length);

void xen_register_framebuffer(struct MemoryRegion *mr);

#if defined(CONFIG_XEN) && CONFIG_XEN_CTRL_INTERFACE_VERSION < 400
# define HVM_MAX_VCPUS 32
#endif

#endif /* QEMU_HW_XEN_H */
2 changes: 1 addition & 1 deletion include/hw/xen/xen_backend.h
Expand Up @@ -56,7 +56,7 @@ struct XenDevice {
/* ------------------------------------------------------------- */

/* variables */
extern XenXC xen_xc;
extern xc_interface *xen_xc;
extern xenforeignmemory_handle *xen_fmem;
extern struct xs_handle *xenstore;
extern const char *xen_protocol;
Expand Down

0 comments on commit a5af128

Please sign in to comment.