From owner-svn-ports-all@freebsd.org Mon Mar 20 10:42:23 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 109C4D131BC; Mon, 20 Mar 2017 10:42:23 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C96D81AA1; Mon, 20 Mar 2017 10:42:22 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2KAgLmc066446; Mon, 20 Mar 2017 10:42:21 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2KAgLFj066437; Mon, 20 Mar 2017 10:42:21 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201703201042.v2KAgLFj066437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 20 Mar 2017 10:42:21 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r436536 - in head: emulators/xen-kernel emulators/xen-kernel/files sysutils/xen-tools sysutils/xen-tools/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Mar 2017 10:42:23 -0000 Author: royger (src committer) Date: Mon Mar 20 10:42:20 2017 New Revision: 436536 URL: https://svnweb.freebsd.org/changeset/ports/436536 Log: xen: update to 4.7.2 Apply build fixes for clang 4.0 (picked from upstream) and XSA-211. Reviewed by: bapt MFH: 2017Q1 Sponsored by: AsiaBSDCon Differential revision: https://reviews.freebsd.org/D9926 Added: head/emulators/xen-kernel/files/0001-x86-drop-unneeded-__packed-attributes.patch (contents, props changed) head/emulators/xen-kernel/files/0002-build-clang-fix-XSM-dummy-policy-when-using-clang-4..patch (contents, props changed) head/sysutils/xen-tools/files/kdd.patch (contents, props changed) head/sysutils/xen-tools/files/xsa211-qemuu-4.7.patch (contents, props changed) Deleted: head/emulators/xen-kernel/files/xsa191.patch head/emulators/xen-kernel/files/xsa192.patch head/emulators/xen-kernel/files/xsa193-4.7.patch head/emulators/xen-kernel/files/xsa194.patch head/emulators/xen-kernel/files/xsa195.patch head/emulators/xen-kernel/files/xsa200-4.7.patch head/emulators/xen-kernel/files/xsa202.patch head/emulators/xen-kernel/files/xsa204-4.7.patch head/sysutils/xen-tools/files/xsa197-qemuu.patch head/sysutils/xen-tools/files/xsa198.patch head/sysutils/xen-tools/files/xsa208-qemuu.patch head/sysutils/xen-tools/files/xsa209-pre-qemuu.patch head/sysutils/xen-tools/files/xsa209-qemuu.patch Modified: head/emulators/xen-kernel/Makefile head/emulators/xen-kernel/distinfo head/sysutils/xen-tools/Makefile head/sysutils/xen-tools/distinfo Modified: head/emulators/xen-kernel/Makefile ============================================================================== --- head/emulators/xen-kernel/Makefile Mon Mar 20 09:57:41 2017 (r436535) +++ head/emulators/xen-kernel/Makefile Mon Mar 20 10:42:20 2017 (r436536) @@ -2,8 +2,8 @@ PORTNAME= xen PKGNAMESUFFIX= -kernel -PORTVERSION= 4.7.1 -PORTREVISION= 3 +PORTVERSION= 4.7.2 +PORTREVISION= 0 CATEGORIES= emulators MASTER_SITES= http://downloads.xenproject.org/release/xen/${PORTVERSION}/ @@ -40,14 +40,8 @@ PLIST_FILES= /boot/xen \ EXTRA_PATCHES= ${FILESDIR}/0001-xen-logdirty-prevent-preemption-if-finished.patch:-p1 \ ${FILESDIR}/0002-xen-rework-paging_log_dirty_op-to-work-with-hvm-gues.patch:-p1 \ ${FILESDIR}/kconf_arch.patch:-p1 \ - ${FILESDIR}/xsa191.patch:-p1 \ - ${FILESDIR}/xsa192.patch:-p1 \ - ${FILESDIR}/xsa193-4.7.patch:-p1 \ - ${FILESDIR}/xsa194.patch:-p1 \ - ${FILESDIR}/xsa195.patch:-p1 \ - ${FILESDIR}/xsa200-4.7.patch:-p1 \ - ${FILESDIR}/xsa204-4.7.patch:-p1 \ - ${FILESDIR}/xsa202.patch:-p1 + ${FILESDIR}/0001-x86-drop-unneeded-__packed-attributes.patch:-p1 \ + ${FILESDIR}/0002-build-clang-fix-XSM-dummy-policy-when-using-clang-4..patch:-p1 .include Modified: head/emulators/xen-kernel/distinfo ============================================================================== --- head/emulators/xen-kernel/distinfo Mon Mar 20 09:57:41 2017 (r436535) +++ head/emulators/xen-kernel/distinfo Mon Mar 20 10:42:20 2017 (r436536) @@ -1,3 +1,3 @@ -TIMESTAMP = 1480690512 -SHA256 (xen-4.7.1.tar.gz) = e87f4b0575e78657ee23d31470a15ecf1ce8c3a92a771cda46bbcd4d0d671ffe -SIZE (xen-4.7.1.tar.gz) = 20706864 +TIMESTAMP = 1489059095 +SHA256 (xen-4.7.2.tar.gz) = 61494a56d9251e2108080f95b0dc8e3d175f1ba4da34603fc07b91cfebf358d5 +SIZE (xen-4.7.2.tar.gz) = 20714281 Added: head/emulators/xen-kernel/files/0001-x86-drop-unneeded-__packed-attributes.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/xen-kernel/files/0001-x86-drop-unneeded-__packed-attributes.patch Mon Mar 20 10:42:20 2017 (r436536) @@ -0,0 +1,122 @@ +From 7de7d07d47cc389bc341f5524ea8415c3c78e378 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= +Date: Fri, 10 Mar 2017 01:05:51 +0900 +Subject: [PATCH 1/2] x86: drop unneeded __packed attributes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There where a couple of unneeded packed attributes in several x86-specific +structures, that are obviously aligned. The only non-trivial one is +vmcb_struct, which has been checked to have the same layout with and without +the packed attribute using pahole. In that case add a build-time size check to +be on the safe side. + +No functional change is expected as a result of this commit. + +Signed-off-by: Roger Pau Monné +Reviewed-by: Jan Beulich +Reviewed-by: Boris Ostrovsky +--- + xen/arch/x86/hvm/svm/vmcb.c | 3 +++ + xen/arch/x86/x86_emulate/x86_emulate.h | 4 ++-- + xen/include/asm-x86/hvm/svm/vmcb.h | 12 ++++++------ + 3 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c +index 9ea014f..f982fc9 100644 +--- a/xen/arch/x86/hvm/svm/vmcb.c ++++ b/xen/arch/x86/hvm/svm/vmcb.c +@@ -72,6 +72,9 @@ static int construct_vmcb(struct vcpu *v) + struct arch_svm_struct *arch_svm = &v->arch.hvm_svm; + struct vmcb_struct *vmcb = arch_svm->vmcb; + ++ /* Build-time check of the size of VMCB AMD structure. */ ++ BUILD_BUG_ON(sizeof(*vmcb) != PAGE_SIZE); ++ + vmcb->_general1_intercepts = + GENERAL1_INTERCEPT_INTR | GENERAL1_INTERCEPT_NMI | + GENERAL1_INTERCEPT_SMI | GENERAL1_INTERCEPT_INIT | +diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h +index 17c86f3..bbdf16a 100644 +--- a/xen/arch/x86/x86_emulate/x86_emulate.h ++++ b/xen/arch/x86/x86_emulate/x86_emulate.h +@@ -71,7 +71,7 @@ enum x86_swint_emulation { + * Attribute for segment selector. This is a copy of bit 40:47 & 52:55 of the + * segment descriptor. It happens to match the format of an AMD SVM VMCB. + */ +-typedef union __packed segment_attributes { ++typedef union segment_attributes { + uint16_t bytes; + struct + { +@@ -91,7 +91,7 @@ typedef union __packed segment_attributes { + * Full state of a segment register (visible and hidden portions). + * Again, this happens to match the format of an AMD SVM VMCB. + */ +-struct __packed segment_register { ++struct segment_register { + uint16_t sel; + segment_attributes_t attr; + uint32_t limit; +diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h b/xen/include/asm-x86/hvm/svm/vmcb.h +index bad2382..a3cd1b1 100644 +--- a/xen/include/asm-x86/hvm/svm/vmcb.h ++++ b/xen/include/asm-x86/hvm/svm/vmcb.h +@@ -308,7 +308,7 @@ enum VMEXIT_EXITCODE + /* Definition of segment state is borrowed by the generic HVM code. */ + typedef struct segment_register svm_segment_register_t; + +-typedef union __packed ++typedef union + { + u64 bytes; + struct +@@ -322,7 +322,7 @@ typedef union __packed + } fields; + } eventinj_t; + +-typedef union __packed ++typedef union + { + u64 bytes; + struct +@@ -340,7 +340,7 @@ typedef union __packed + } fields; + } vintr_t; + +-typedef union __packed ++typedef union + { + u64 bytes; + struct +@@ -357,7 +357,7 @@ typedef union __packed + } fields; + } ioio_info_t; + +-typedef union __packed ++typedef union + { + u64 bytes; + struct +@@ -366,7 +366,7 @@ typedef union __packed + } fields; + } lbrctrl_t; + +-typedef union __packed ++typedef union + { + uint32_t bytes; + struct +@@ -401,7 +401,7 @@ typedef union __packed + #define IOPM_SIZE (12 * 1024) + #define MSRPM_SIZE (8 * 1024) + +-struct __packed vmcb_struct { ++struct vmcb_struct { + u32 _cr_intercepts; /* offset 0x00 - cleanbit 0 */ + u32 _dr_intercepts; /* offset 0x04 - cleanbit 0 */ + u32 _exception_intercepts; /* offset 0x08 - cleanbit 0 */ +-- +2.10.1 (Apple Git-78) + Added: head/emulators/xen-kernel/files/0002-build-clang-fix-XSM-dummy-policy-when-using-clang-4..patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/xen-kernel/files/0002-build-clang-fix-XSM-dummy-policy-when-using-clang-4..patch Mon Mar 20 10:42:20 2017 (r436536) @@ -0,0 +1,69 @@ +From e5a1bf46187b0d39ec7e8c46e11c42027840747c Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Fri, 10 Mar 2017 01:08:26 +0900 +Subject: [PATCH 2/2] build/clang: fix XSM dummy policy when using clang 4.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There seems to be some weird bug in clang 4.0 that prevents xsm_pmu_op from +working as expected, and vpmu.o ends up with a reference to +__xsm_action_mismatch_detected which makes the build fail: + +[...] +ld -melf_x86_64_fbsd -T xen.lds -N prelink.o \ + xen/common/symbols-dummy.o -o xen/.xen-syms.0 +prelink.o: In function `xsm_default_action': +xen/include/xsm/dummy.h:80: undefined reference to `__xsm_action_mismatch_detected' +xen/xen/include/xsm/dummy.h:80: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__xsm_action_mismatch_detected' +ld: xen/xen/.xen-syms.0: hidden symbol `__xsm_action_mismatch_detected' isn't defined + +Then doing a search in the objects files: + +# find xen/ -type f -name '*.o' -print0 | xargs -0 bash -c \ + 'for filename; do nm "$filename" | \ + grep -q __xsm_action_mismatch_detected && echo "$filename"; done' bash +xen/arch/x86/prelink.o +xen/arch/x86/cpu/vpmu.o +xen/arch/x86/cpu/built_in.o +xen/arch/x86/built_in.o + +The current patch is the only way I've found to fix this so far, by simply +moving the XSM_PRIV check into the default case in xsm_pmu_op. This also fixes +the behavior of do_xenpmu_op, which will now return -EINVAL for unknown +XENPMU_* operations, instead of -EPERM when called by a privileged domain. + +Signed-off-by: Roger Pau Monné +--- +Cc: Daniel De Graaf +--- + xen/include/xsm/dummy.h | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h +index abbe282..0039c39 100644 +--- a/xen/include/xsm/dummy.h ++++ b/xen/include/xsm/dummy.h +@@ -711,18 +711,13 @@ static XSM_INLINE int xsm_pmu_op (XSM_DEFAULT_ARG struct domain *d, unsigned int + XSM_ASSERT_ACTION(XSM_OTHER); + switch ( op ) + { +- case XENPMU_mode_set: +- case XENPMU_mode_get: +- case XENPMU_feature_set: +- case XENPMU_feature_get: +- return xsm_default_action(XSM_PRIV, d, current->domain); + case XENPMU_init: + case XENPMU_finish: + case XENPMU_lvtpc_set: + case XENPMU_flush: + return xsm_default_action(XSM_HOOK, d, current->domain); + default: +- return -EPERM; ++ return xsm_default_action(XSM_PRIV, d, current->domain); + } + } + +-- +2.10.1 (Apple Git-78) + Modified: head/sysutils/xen-tools/Makefile ============================================================================== --- head/sysutils/xen-tools/Makefile Mon Mar 20 09:57:41 2017 (r436535) +++ head/sysutils/xen-tools/Makefile Mon Mar 20 10:42:20 2017 (r436536) @@ -2,8 +2,8 @@ PORTNAME= xen PKGNAMESUFFIX= -tools -PORTVERSION= 4.7.1 -PORTREVISION= 5 +PORTVERSION= 4.7.2 +PORTREVISION= 0 CATEGORIES= sysutils emulators MASTER_SITES= http://downloads.xenproject.org/release/xen/${PORTVERSION}/ @@ -44,10 +44,10 @@ QEMU_ARGS= --disable-gtk \ --cxx=c++ EXTRA_PATCHES= ${FILESDIR}/var_paths.patch:-p1 \ - ${FILESDIR}/xsa198.patch:-p1 \ ${FILESDIR}/0001-libxl-fix-creation-of-pkgconf-install-dir.patch:-p1 \ ${FILESDIR}/0001-tools-configure-fix-pkg-config-install-path-for-Free.patch:-p1 \ - ${FILESDIR}/0001-libs-xenstore-set-correct-FreeBSD-device.patch:-p1 + ${FILESDIR}/0001-libs-xenstore-set-correct-FreeBSD-device.patch:-p1 \ + ${FILESDIR}/kdd.patch:-p1 CONFIGURE_ARGS+= --with-extra-qemuu-configure-args="${QEMU_ARGS}" \ --with-system-seabios=${LOCALBASE}/share/seabios/bios.bin Modified: head/sysutils/xen-tools/distinfo ============================================================================== --- head/sysutils/xen-tools/distinfo Mon Mar 20 09:57:41 2017 (r436535) +++ head/sysutils/xen-tools/distinfo Mon Mar 20 10:42:20 2017 (r436536) @@ -1,3 +1,3 @@ -TIMESTAMP = 1480690512 -SHA256 (xen-4.7.1.tar.gz) = e87f4b0575e78657ee23d31470a15ecf1ce8c3a92a771cda46bbcd4d0d671ffe -SIZE (xen-4.7.1.tar.gz) = 20706864 +TIMESTAMP = 1489085975 +SHA256 (xen-4.7.2.tar.gz) = 61494a56d9251e2108080f95b0dc8e3d175f1ba4da34603fc07b91cfebf358d5 +SIZE (xen-4.7.2.tar.gz) = 20714281 Added: head/sysutils/xen-tools/files/kdd.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/xen-tools/files/kdd.patch Mon Mar 20 10:42:20 2017 (r436536) @@ -0,0 +1,36 @@ +Subject: [PATCH] tools/kdd: don't use a pointer to an unaligned field. + +The 'val' field in the packet is byte-aligned (because it is part of a +packed struct), but the pointer argument to kdd_rdmsr() has the normal +alignment constraints for a uint64_t *. Use a local variable to make sure +the passed pointer has the correct alignment. + +Reported-by: Roger Pau Monné +Signed-off-by: Tim Deegan +--- + tools/debugger/kdd/kdd.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c +index 70f007e..1bd5dd5 100644 +--- a/tools/debugger/kdd/kdd.c ++++ b/tools/debugger/kdd/kdd.c +@@ -710,11 +710,13 @@ static void kdd_handle_read_ctrl(kdd_state *s) + static void kdd_handle_read_msr(kdd_state *s) + { + uint32_t msr = s->rxp.cmd.msr.msr; ++ uint64_t val; + int ok; + KDD_LOG(s, "Read MSR 0x%"PRIx32"\n", msr); + +- ok = (kdd_rdmsr(s->guest, s->cpuid, msr, &s->txp.cmd.msr.val) == 0); ++ ok = (kdd_rdmsr(s->guest, s->cpuid, msr, &val) == 0); + s->txp.cmd.msr.msr = msr; ++ s->txp.cmd.msr.val = val; + s->txp.cmd.msr.status = (ok ? KDD_STATUS_SUCCESS : KDD_STATUS_FAILURE); + kdd_send_cmd(s, KDD_CMD_READ_MSR, 0); + } +-- +2.7.4 + + Added: head/sysutils/xen-tools/files/xsa211-qemuu-4.7.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/xen-tools/files/xsa211-qemuu-4.7.patch Mon Mar 20 10:42:20 2017 (r436536) @@ -0,0 +1,259 @@ +From 9de536fbc2be97ae887560f08f0fd824efa3d5db Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Tue, 14 Feb 2017 19:09:59 +0100 +Subject: [PATCH] cirrus/vnc: zap bitblit support from console code. + +There is a special code path (dpy_gfx_copy) to allow graphic emulation +notify user interface code about bitblit operations carryed out by +guests. It is supported by cirrus and vnc server. The intended purpose +is to optimize display scrolls and just send over the scroll op instead +of a full display update. + +This is rarely used these days though because modern guests simply don't +use the cirrus blitter any more. Any linux guest using the cirrus drm +driver doesn't. Any windows guest newer than winxp doesn't ship with a +cirrus driver any more and thus uses the cirrus as simple framebuffer. + +So this code tends to bitrot and bugs can go unnoticed for a long time. +See for example commit "3e10c3e vnc: fix qemu crash because of SIGSEGV" +which fixes a bug lingering in the code for almost a year, added by +commit "c7628bf vnc: only alloc server surface with clients connected". + +Also the vnc server will throttle the frame rate in case it figures the +network can't keep up (send buffers are full). This doesn't work with +dpy_gfx_copy, for any copy operation sent to the vnc client we have to +send all outstanding updates beforehand, otherwise the vnc client might +run the client side blit on outdated data and thereby corrupt the +display. So this dpy_gfx_copy "optimization" might even make things +worse on slow network links. + +Lets kill it once for all. + +Signed-off-by: Gerd Hoffmann +--- + hw/display/cirrus_vga.c | 12 ++----- + include/ui/console.h | 7 ---- + ui/console.c | 28 --------------- + ui/vnc.c | 91 ------------------------------------------------- + 4 files changed, 3 insertions(+), 135 deletions(-) + +diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index 5901250..2841676 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -758,11 +758,6 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h) + } + } + +- /* we have to flush all pending changes so that the copy +- is generated at the appropriate moment in time */ +- if (notify) +- graphic_hw_update(s->vga.con); +- + (*s->cirrus_rop) (s, s->vga.vram_ptr + + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask), + s->vga.vram_ptr + +@@ -771,10 +766,9 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h) + s->cirrus_blt_width, s->cirrus_blt_height); + + if (notify) { +- qemu_console_copy(s->vga.con, +- sx, sy, dx, dy, +- s->cirrus_blt_width / depth, +- s->cirrus_blt_height); ++ dpy_gfx_update(s->vga.con, dx, dy, ++ s->cirrus_blt_width / depth, ++ s->cirrus_blt_height); + } + + /* we don't have to notify the display that this portion has +diff --git a/include/ui/console.h b/include/ui/console.h +index 047a2b4..ed07065 100644 +--- a/include/ui/console.h ++++ b/include/ui/console.h +@@ -166,9 +166,6 @@ typedef struct DisplayChangeListenerOps { + int x, int y, int w, int h); + void (*dpy_gfx_switch)(DisplayChangeListener *dcl, + struct DisplaySurface *new_surface); +- void (*dpy_gfx_copy)(DisplayChangeListener *dcl, +- int src_x, int src_y, +- int dst_x, int dst_y, int w, int h); + bool (*dpy_gfx_check_format)(DisplayChangeListener *dcl, + pixman_format_code_t format); + +@@ -233,8 +230,6 @@ int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info); + void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h); + void dpy_gfx_replace_surface(QemuConsole *con, + DisplaySurface *surface); +-void dpy_gfx_copy(QemuConsole *con, int src_x, int src_y, +- int dst_x, int dst_y, int w, int h); + void dpy_text_cursor(QemuConsole *con, int x, int y); + void dpy_text_update(QemuConsole *con, int x, int y, int w, int h); + void dpy_text_resize(QemuConsole *con, int w, int h); +@@ -329,8 +324,6 @@ void text_consoles_set_display(DisplayState *ds); + void console_select(unsigned int index); + void console_color_init(DisplayState *ds); + void qemu_console_resize(QemuConsole *con, int width, int height); +-void qemu_console_copy(QemuConsole *con, int src_x, int src_y, +- int dst_x, int dst_y, int w, int h); + DisplaySurface *qemu_console_surface(QemuConsole *con); + + /* console-gl.c */ +diff --git a/ui/console.c b/ui/console.c +index 75fc492..72d91cb 100644 +--- a/ui/console.c ++++ b/ui/console.c +@@ -1495,27 +1495,6 @@ static void dpy_refresh(DisplayState *s) + } + } + +-void dpy_gfx_copy(QemuConsole *con, int src_x, int src_y, +- int dst_x, int dst_y, int w, int h) +-{ +- DisplayState *s = con->ds; +- DisplayChangeListener *dcl; +- +- if (!qemu_console_is_visible(con)) { +- return; +- } +- QLIST_FOREACH(dcl, &s->listeners, next) { +- if (con != (dcl->con ? dcl->con : active_console)) { +- continue; +- } +- if (dcl->ops->dpy_gfx_copy) { +- dcl->ops->dpy_gfx_copy(dcl, src_x, src_y, dst_x, dst_y, w, h); +- } else { /* TODO */ +- dcl->ops->dpy_gfx_update(dcl, dst_x, dst_y, w, h); +- } +- } +-} +- + void dpy_text_cursor(QemuConsole *con, int x, int y) + { + DisplayState *s = con->ds; +@@ -1968,13 +1947,6 @@ void qemu_console_resize(QemuConsole *s, int width, int height) + dpy_gfx_replace_surface(s, surface); + } + +-void qemu_console_copy(QemuConsole *con, int src_x, int src_y, +- int dst_x, int dst_y, int w, int h) +-{ +- assert(con->console_type == GRAPHIC_CONSOLE); +- dpy_gfx_copy(con, src_x, src_y, dst_x, dst_y, w, h); +-} +- + DisplaySurface *qemu_console_surface(QemuConsole *console) + { + return console->surface; +diff --git a/ui/vnc.c b/ui/vnc.c +index 52c6809..61ab611 100644 +--- a/ui/vnc.c ++++ b/ui/vnc.c +@@ -908,96 +908,6 @@ int vnc_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) + return n; + } + +-static void vnc_copy(VncState *vs, int src_x, int src_y, int dst_x, int dst_y, int w, int h) +-{ +- /* send bitblit op to the vnc client */ +- vnc_lock_output(vs); +- vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); +- vnc_write_u8(vs, 0); +- vnc_write_u16(vs, 1); /* number of rects */ +- vnc_framebuffer_update(vs, dst_x, dst_y, w, h, VNC_ENCODING_COPYRECT); +- vnc_write_u16(vs, src_x); +- vnc_write_u16(vs, src_y); +- vnc_unlock_output(vs); +- vnc_flush(vs); +-} +- +-static void vnc_dpy_copy(DisplayChangeListener *dcl, +- int src_x, int src_y, +- int dst_x, int dst_y, int w, int h) +-{ +- VncDisplay *vd = container_of(dcl, VncDisplay, dcl); +- VncState *vs, *vn; +- uint8_t *src_row; +- uint8_t *dst_row; +- int i, x, y, pitch, inc, w_lim, s; +- int cmp_bytes; +- +- vnc_refresh_server_surface(vd); +- QTAILQ_FOREACH_SAFE(vs, &vd->clients, next, vn) { +- if (vnc_has_feature(vs, VNC_FEATURE_COPYRECT)) { +- vs->force_update = 1; +- vnc_update_client(vs, 1, true); +- /* vs might be free()ed here */ +- } +- } +- +- /* do bitblit op on the local surface too */ +- pitch = vnc_server_fb_stride(vd); +- src_row = vnc_server_fb_ptr(vd, src_x, src_y); +- dst_row = vnc_server_fb_ptr(vd, dst_x, dst_y); +- y = dst_y; +- inc = 1; +- if (dst_y > src_y) { +- /* copy backwards */ +- src_row += pitch * (h-1); +- dst_row += pitch * (h-1); +- pitch = -pitch; +- y = dst_y + h - 1; +- inc = -1; +- } +- w_lim = w - (VNC_DIRTY_PIXELS_PER_BIT - (dst_x % VNC_DIRTY_PIXELS_PER_BIT)); +- if (w_lim < 0) { +- w_lim = w; +- } else { +- w_lim = w - (w_lim % VNC_DIRTY_PIXELS_PER_BIT); +- } +- for (i = 0; i < h; i++) { +- for (x = 0; x <= w_lim; +- x += s, src_row += cmp_bytes, dst_row += cmp_bytes) { +- if (x == w_lim) { +- if ((s = w - w_lim) == 0) +- break; +- } else if (!x) { +- s = (VNC_DIRTY_PIXELS_PER_BIT - +- (dst_x % VNC_DIRTY_PIXELS_PER_BIT)); +- s = MIN(s, w_lim); +- } else { +- s = VNC_DIRTY_PIXELS_PER_BIT; +- } +- cmp_bytes = s * VNC_SERVER_FB_BYTES; +- if (memcmp(src_row, dst_row, cmp_bytes) == 0) +- continue; +- memmove(dst_row, src_row, cmp_bytes); +- QTAILQ_FOREACH(vs, &vd->clients, next) { +- if (!vnc_has_feature(vs, VNC_FEATURE_COPYRECT)) { +- set_bit(((x + dst_x) / VNC_DIRTY_PIXELS_PER_BIT), +- vs->dirty[y]); +- } +- } +- } +- src_row += pitch - w * VNC_SERVER_FB_BYTES; +- dst_row += pitch - w * VNC_SERVER_FB_BYTES; +- y += inc; +- } +- +- QTAILQ_FOREACH(vs, &vd->clients, next) { +- if (vnc_has_feature(vs, VNC_FEATURE_COPYRECT)) { +- vnc_copy(vs, src_x, src_y, dst_x, dst_y, w, h); +- } +- } +-} +- + static void vnc_mouse_set(DisplayChangeListener *dcl, + int x, int y, int visible) + { +@@ -3131,7 +3041,6 @@ static void vnc_listen_websocket_read(void *opaque) + static const DisplayChangeListenerOps dcl_ops = { + .dpy_name = "vnc", + .dpy_refresh = vnc_refresh, +- .dpy_gfx_copy = vnc_dpy_copy, + .dpy_gfx_update = vnc_dpy_update, + .dpy_gfx_switch = vnc_dpy_switch, + .dpy_gfx_check_format = qemu_pixman_check_format, +-- +2.1.4 +