From edfb07ed2251c08a34d8f9d8f818deef50a1cba8 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 10 Feb 2016 11:07:01 +0000 Subject: xen: drop support for Xen 4.1 and older. Xen 4.2 become unsupported upstream in 09/2015 (see http://wiki.xen.org/wiki/Xen_Release_Features). However as far as the interfaces provided by the toolstack libraries go 4.2 and 4.3 are indistinguishable. Therefore drop support for Xen 4.1 and earlier which removes a whole pile of compatibility code which makes future work (to use stable library interfaces provided by upstream) more difficult. In particular all supported versions now use a pointer as a libxc handle (4.1 and earlier used an integer, resulting in various shim layers). Also Xen 4.2 was the first version of Xen to formally support upstream QEMU (as a preview) so that makes sense as a cut-off now. This change drops all the configure-y and resulting ifdefs in a mostly mechanical way. A follow up will refactor wrappers which are now unused. Signed-off-by: Ian Campbell Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- xen-hvm.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'xen-hvm.c') diff --git a/xen-hvm.c b/xen-hvm.c index 6861c51..8350ca2 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -316,7 +316,6 @@ static hwaddr xen_phys_offset_to_gaddr(hwaddr start_addr, return start_addr; } -#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 340 static int xen_add_to_physmap(XenIOState *state, hwaddr start_addr, ram_addr_t size, @@ -451,24 +450,6 @@ static int xen_remove_from_physmap(XenIOState *state, return 0; } -#else -static int xen_add_to_physmap(XenIOState *state, - hwaddr start_addr, - ram_addr_t size, - MemoryRegion *mr, - hwaddr offset_within_region) -{ - return -ENOSYS; -} - -static int xen_remove_from_physmap(XenIOState *state, - hwaddr start_addr, - ram_addr_t size) -{ - return -ENOSYS; -} -#endif - static void xen_set_memory(struct MemoryListener *listener, MemoryRegionSection *section, bool add) -- cgit v1.1 From 2ac9f6d4b1de075f2ac34eb54b18ddda7a414a2b Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 10 Feb 2016 11:07:02 +0000 Subject: xen: drop xen_xc_hvm_inject_msi wrapper The xc version is now always present. Signed-off-by: Ian Campbell Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- xen-hvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xen-hvm.c') diff --git a/xen-hvm.c b/xen-hvm.c index 8350ca2..918cabc 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -169,7 +169,7 @@ int xen_is_pirq_msi(uint32_t msi_data) void xen_hvm_inject_msi(uint64_t addr, uint32_t data) { - xen_xc_hvm_inject_msi(xen_xc, xen_domid, addr, data); + xc_hvm_inject_msi(xen_xc, xen_domid, addr, data); } static void xen_suspend_notifier(Notifier *notifier, void *data) -- cgit v1.1 From 81daba58803cd11a27c2b4684ee3642302c14351 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 10 Feb 2016 11:07:03 +0000 Subject: xen: drop XenXC and associated interface wrappers Now that 4.2 and earlier are no longer supported "xc_interface *" is always the right type for the xc interface handle. With this we can also simplify the handling of the xenforeignmemory compatibility wrapper by making xenforeignmemory_handle == xc_interface, instead of an xc_interface* and remove various uses of & and *h. Signed-off-by: Ian Campbell Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- xen-hvm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'xen-hvm.c') diff --git a/xen-hvm.c b/xen-hvm.c index 918cabc..fbe0e3a 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -1224,7 +1224,7 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) &ioreq_pfn, &bufioreq_pfn, &bufioreq_evtchn); if (rc < 0) { - error_report("failed to get ioreq server info: error %d handle=" XC_INTERFACE_FMT, + error_report("failed to get ioreq server info: error %d handle=%p", errno, xen_xc); goto err; } @@ -1237,7 +1237,7 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) PROT_READ|PROT_WRITE, 1, &ioreq_pfn, NULL); if (state->shared_page == NULL) { - error_report("map shared IO page returned error %d handle=" XC_INTERFACE_FMT, + error_report("map shared IO page returned error %d handle=%p", errno, xen_xc); goto err; } @@ -1249,8 +1249,8 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) xenforeignmemory_map(xen_fmem, xen_domid, PROT_READ|PROT_WRITE, 1, &ioreq_pfn, NULL); if (state->shared_vmport_page == NULL) { - error_report("map shared vmport IO page returned error %d handle=" - XC_INTERFACE_FMT, errno, xen_xc); + error_report("map shared vmport IO page returned error %d handle=%p", + errno, xen_xc); goto err; } } else if (rc != -ENOSYS) { @@ -1272,7 +1272,7 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) rc = xen_set_ioreq_server_state(xen_xc, xen_domid, state->ioservid, true); if (rc < 0) { - error_report("failed to enable ioreq server info: error %d handle=" XC_INTERFACE_FMT, + error_report("failed to enable ioreq server info: error %d handle=%p", errno, xen_xc); goto err; } @@ -1333,11 +1333,11 @@ err: void destroy_hvm_domain(bool reboot) { - XenXC xc_handle; + xc_interface *xc_handle; int sts; - xc_handle = xen_xc_interface_open(0, 0, 0); - if (xc_handle == XC_HANDLER_INITIAL_VALUE) { + xc_handle = xc_interface_open(0, 0, 0); + if (xc_handle == NULL) { fprintf(stderr, "Cannot acquire xenctrl handle\n"); } else { sts = xc_domain_shutdown(xc_handle, xen_domid, -- cgit v1.1 From 47d3df2387ed6927732584ffa4159c26d9f4dee8 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 10 Feb 2016 11:07:05 +0000 Subject: xen: Drop __XEN_LATEST_INTERFACE_VERSION__ checks from prior to Xen 4.2 We assume (and check for in configure) 4.2 or later now. In reality all of the removed checks are for far older versions. FMT_ioreq_size is no longer needed. Signed-off-by: Ian Campbell Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- xen-hvm.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'xen-hvm.c') diff --git a/xen-hvm.c b/xen-hvm.c index fbe0e3a..039680a 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -67,17 +67,6 @@ struct shared_vmport_iopage { typedef struct shared_vmport_iopage shared_vmport_iopage_t; #endif -#if __XEN_LATEST_INTERFACE_VERSION__ < 0x0003020a -static inline uint32_t xen_vcpu_eport(shared_iopage_t *shared_page, int i) -{ - return shared_page->vcpu_iodata[i].vp_eport; -} -static inline ioreq_t *xen_vcpu_ioreq(shared_iopage_t *shared_page, int vcpu) -{ - return &shared_page->vcpu_iodata[vcpu].vp_ioreq; -} -# define FMT_ioreq_size PRIx64 -#else static inline uint32_t xen_vcpu_eport(shared_iopage_t *shared_page, int i) { return shared_page->vcpu_ioreq[i].vp_eport; @@ -86,8 +75,6 @@ static inline ioreq_t *xen_vcpu_ioreq(shared_iopage_t *shared_page, int vcpu) { return &shared_page->vcpu_ioreq[vcpu]; } -# define FMT_ioreq_size "u" -#endif #define BUFFER_IO_MAX_DELAY 100 @@ -688,7 +675,7 @@ static ioreq_t *cpu_get_ioreq_from_shared_memory(XenIOState *state, int vcpu) if (req->state != STATE_IOREQ_READY) { DPRINTF("I/O request not ready: " "%x, ptr: %x, port: %"PRIx64", " - "data: %"PRIx64", count: %" FMT_ioreq_size ", size: %" FMT_ioreq_size "\n", + "data: %"PRIx64", count: %u, size: %u\n", req->state, req->data_is_ptr, req->addr, req->data, req->count, req->size); return NULL; @@ -1050,9 +1037,7 @@ static void cpu_handle_ioreq(void *opaque) if (req->state != STATE_IOREQ_INPROCESS) { fprintf(stderr, "Badness in I/O request ... not in service?!: " "%x, ptr: %x, port: %"PRIx64", " - "data: %"PRIx64", count: %" FMT_ioreq_size - ", size: %" FMT_ioreq_size - ", type: %"FMT_ioreq_size"\n", + "data: %"PRIx64", count: %u, size: %u, type: %u\n", req->state, req->data_is_ptr, req->addr, req->data, req->count, req->size, req->type); destroy_hvm_domain(false); -- cgit v1.1