From: test Date: Tue, 2 Jul 2013 08:51:55 +0000 (+0900) Subject: Merge 'qemu 1.5.1' into tizen_qemu_1.5.1 X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~900^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d7ee3e0d990b38cfe087fe1a179fda8d4b5e289;p=sdk%2Femulator%2Fqemu.git Merge 'qemu 1.5.1' into tizen_qemu_1.5.1 Conflicts: Makefile arch_init.h block/raw-win32.c blockdev.c configure console.h cpu-defs.h cpu-exec.c cpus.c default-configs/arm-softmmu.mak exec-all.h exec.c fpu/softfloat.h hw/9pfs/virtio-9p-device.c hw/Makefile.objs hw/acpi_piix4.c hw/apic_common.c hw/arm/Makefile.objs hw/exynos4210.c hw/exynos4210.h hw/exynos4210_fimd.c hw/exynos4210_gic.c hw/exynos4210_uart.c hw/pc.c hw/pc_sysfw.c hw/pci-hotplug.c hw/pci.c hw/pci.h hw/pl050.c hw/ps2.c hw/qdev-properties.c hw/qdev.c hw/qdev.h hw/vga-pci.c hw/vga-pci.h hw/vga_int.h hw/virtio-balloon.c hw/virtio-balloon.h hw/virtio-blk.c hw/virtio-blk.h hw/virtio-net.c hw/virtio-net.h hw/virtio-pci.c hw/virtio-pci.h hw/virtio-serial-bus.c hw/virtio-serial.h hw/virtio.c hw/virtio.h input.c kvm.h main-loop.c main-loop.h os-win32.c oslib-posix.c oslib-win32.c qemu-char.c qemu-options.hx qemu-sockets.c softmmu_defs.h softmmu_template.h sysemu.h tcg/i386/tcg-target.c tcg/tcg.c tcg/tcg.h vl.c --- 6d7ee3e0d990b38cfe087fe1a179fda8d4b5e289 diff --cc Makefile index 602615a5c0,46439f8490..789739b3f6 --- a/Makefile +++ b/Makefile @@@ -152,15 -184,9 +184,21 @@@ libqemuutil.a: $(util-obj-y qemu-img.o: qemu-img-cmds.h ++<<<<<<< HEAD +tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \ + qemu-timer-common.o main-loop.o notify.o \ + iohandler.o cutils.o iov.o async.o +tools-obj-$(CONFIG_POSIX) += compatfd.o +tools-obj-$(CONFIG_HAX_BACKEND) += hax-stub.o + +qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) +qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) +qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) ++======= + qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a + qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a + qemu-io$(EXESUF): qemu-io.o cmd.o $(block-obj-y) libqemuutil.a libqemustub.a ++>>>>>>> test1.5 qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o diff --cc Makefile.target index c6dc96846a,ce4391fca7..6e0bf9bfcd mode 100755,100644..100755 --- a/Makefile.target +++ b/Makefile.target @@@ -164,113 -134,11 +144,116 @@@ GENERATED_HEADERS += hmp-commands.h qmp endif # CONFIG_SOFTMMU + # Workaround for http://gcc.gnu.org/PR55489, see configure. + %/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS) + nested-vars += obj-y +# Makefile for TIZEN-maru +ifdef CONFIG_MARU +include $(SRC_PATH)/tizen/src/Makefile.tizen +endif +## + +ifdef CONFIG_BUILD_YAGL + +# YaGL +QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl_inc + +$(call set-vpath, $(SRC_PATH)/hw/yagl_apis/egl: \ + $(SRC_PATH)/hw/yagl_apis/gles: \ + $(SRC_PATH)/hw/yagl_apis/gles1: \ + $(SRC_PATH)/hw/yagl_apis/gles2: \ + $(SRC_PATH)/hw/yagl_drivers/egl_glx: \ + $(SRC_PATH)/hw/yagl_drivers/egl_wgl: \ + $(SRC_PATH)/hw/yagl_drivers/gles_ogl: \ + $(SRC_PATH)/hw/yagl_drivers/gles1_ogl: \ + $(SRC_PATH)/hw/yagl_drivers/gles2_ogl) + +obj-y += yagl_device.o +obj-y += yagl_log.o +obj-y += yagl_process.o +obj-y += yagl_thread.o +obj-y += yagl_server.o +obj-y += yagl_ref.o +obj-y += yagl_mem.o +obj-y += yagl_mem_egl.o +obj-y += yagl_mem_gl.o +obj-y += yagl_mem_transfer.o +obj-y += yagl_event.o +obj-y += yagl_handle_gen.o +obj-y += yagl_dyn_lib.o +obj-y += yagl_api.o +obj-y += yagl_vector.o +obj-y += yagl_avl.o +obj-y += yagl_range_list.o +obj-y += yagl_egl_driver.o +obj-y += yagl_gles_driver.o +obj-y += yagl_gles1_driver.o +obj-y += yagl_gles2_driver.o +obj-y += yagl_egl_interface.o +obj-y += yagl_client_interface.o +obj-y += yagl_client_context.o +obj-y += yagl_resource.o +obj-y += yagl_resource_list.o +obj-y += yagl_object.o +obj-y += yagl_namespace.o +obj-y += yagl_sharegroup.o +obj-y += yagl_stats.o +obj-y += yagl_compiled_transfer.o +obj-y += yagl_egl_native_config.o +obj-y += yagl_egl_surface_attribs.o +# EGL api +obj-y += yagl_egl_api.o +obj-y += yagl_egl_api_ps.o +obj-y += yagl_egl_api_ts.o +obj-y += yagl_egl_calls.o +obj-y += yagl_egl_display.o +obj-y += yagl_egl_config.o +obj-y += yagl_egl_surface.o +obj-y += yagl_egl_context.o +obj-y += yagl_egl_validate.o +obj-y += yagl_host_egl_calls.o +# GLES common api +obj-y += yagl_gles_context.o +obj-y += yagl_gles_array.o +obj-y += yagl_gles_buffer.o +obj-y += yagl_gles_texture.o +obj-y += yagl_gles_framebuffer.o +obj-y += yagl_gles_renderbuffer.o +obj-y += yagl_gles_texture_unit.o +obj-y += yagl_gles_validate.o +obj-y += yagl_host_gles_calls.o +# GLESv1_CM api +obj-y += yagl_gles1_calls.o +obj-y += yagl_host_gles1_calls.o +# GLESv2 api +obj-y += yagl_gles2_api.o +obj-y += yagl_gles2_api_ps.o +obj-y += yagl_gles2_api_ts.o +obj-y += yagl_gles2_calls.o +obj-y += yagl_gles2_context.o +obj-y += yagl_gles2_shader.o +obj-y += yagl_gles2_program.o +obj-y += yagl_gles2_validate.o +obj-y += yagl_host_gles2_calls.o +# EGL GLX driver +ifdef CONFIG_YAGL_EGL_GLX +obj-y += yagl_egl_glx.o +endif +# EGL WGL driver +ifdef CONFIG_YAGL_EGL_WGL +obj-y += yagl_egl_wgl.o +endif +# GLES OpenGL common driver +obj-y += yagl_gles_ogl.o +# GLESv1_CM OpenGL driver +obj-y += yagl_gles1_ogl.o +# GLESv2 OpenGL driver +obj-y += yagl_gles2_ogl.o + +endif + # This resolves all nested paths, so it must come last include $(SRC_PATH)/Makefile.objs diff --cc block/raw-win32.c index 18ec935441,7c03b6df52..06af7a5331 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@@ -85,115 -246,89 +246,139 @@@ static int raw_open(BlockDriverState *b s->type = FTYPE_FILE; ++<<<<<<< HEAD +#ifndef CONFIG_MARU + if (flags & BDRV_O_RDWR) { + access_flags = GENERIC_READ | GENERIC_WRITE; + } else { + access_flags = GENERIC_READ; + } + + overlapped = FILE_ATTRIBUTE_NORMAL; + if (flags & BDRV_O_NOCACHE) + overlapped |= FILE_FLAG_NO_BUFFERING; + if (!(flags & BDRV_O_CACHE_WB)) + overlapped |= FILE_FLAG_WRITE_THROUGH; + s->hfile = CreateFile(filename, + access_flags, ++======= + opts = qemu_opts_create_nofail(&raw_runtime_opts); + qemu_opts_absorb_qdict(opts, options, &local_err); + if (error_is_set(&local_err)) { + qerror_report_err(local_err); + error_free(local_err); + ret = -EINVAL; + goto fail; + } + + filename = qemu_opt_get(opts, "filename"); + + raw_parse_flags(flags, &access_flags, &overlapped); + + if ((flags & BDRV_O_NATIVE_AIO) && aio == NULL) { + aio = win32_aio_init(); + if (aio == NULL) { + ret = -EINVAL; + goto fail; + } + } + + s->hfile = CreateFile(filename, access_flags, ++>>>>>>> test1.5 FILE_SHARE_READ, NULL, OPEN_EXISTING, overlapped, NULL); - if (s->hfile == INVALID_HANDLE_VALUE) { + if (s->hfile == INVALID_HANDLE_VALUE) { int err = GetLastError(); - if (err == ERROR_ACCESS_DENIED) - return -EACCES; - return -1; + if (err == ERROR_ACCESS_DENIED) { + ret = -EACCES; + } else { + ret = -EINVAL; + } + goto fail; } ++<<<<<<< HEAD +#else +#include + int open_flags = O_BINARY; + open_flags &= ~O_ACCMODE; + if (flags & BDRV_O_RDWR) { + open_flags |= O_RDWR; + } else { + open_flags |= O_RDONLY; + } + + /* Use O_DSYNC for write-through caching, no flags for write-back caching, + * and O_DIRECT for no caching. */ + /* + if ((flags & BDRV_O_NOCACHE)) { + open_flags |= O_DIRECT; + } + if (!(flags & BDRV_O_CACHE_WB)) { + open_flags |= O_DSYNC; + } + */ + + int ret = qemu_open(filename, open_flags, 0644); + if (ret < 0) { + error_report("raw_open failed(%d) \n", ret); + return -errno; + } + s->hfile = (HANDLE)_get_osfhandle(ret); + +#endif + return 0; ++======= + if (flags & BDRV_O_NATIVE_AIO) { + ret = win32_aio_attach(aio, s->hfile); + if (ret < 0) { + CloseHandle(s->hfile); + goto fail; + } + s->aio = aio; + } + + ret = 0; + fail: + qemu_opts_del(opts); + return ret; ++>>>>>>> test1.5 } - static int raw_read(BlockDriverState *bs, int64_t sector_num, - uint8_t *buf, int nb_sectors) + static BlockDriverAIOCB *raw_aio_readv(BlockDriverState *bs, + int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, + BlockDriverCompletionFunc *cb, void *opaque) { BDRVRawState *s = bs->opaque; - OVERLAPPED ov; - DWORD ret_count; - int ret; - int64_t offset = sector_num * 512; - int count = nb_sectors * 512; - - memset(&ov, 0, sizeof(ov)); - ov.Offset = offset; - ov.OffsetHigh = offset >> 32; - ret = ReadFile(s->hfile, buf, count, &ret_count, &ov); - if (!ret) - return ret_count; - if (ret_count == count) - ret_count = 0; - return ret_count; + if (s->aio) { + return win32_aio_submit(bs, s->aio, s->hfile, sector_num, qiov, + nb_sectors, cb, opaque, QEMU_AIO_READ); + } else { + return paio_submit(bs, s->hfile, sector_num, qiov, nb_sectors, + cb, opaque, QEMU_AIO_READ); + } } - static int raw_write(BlockDriverState *bs, int64_t sector_num, - const uint8_t *buf, int nb_sectors) + static BlockDriverAIOCB *raw_aio_writev(BlockDriverState *bs, + int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, + BlockDriverCompletionFunc *cb, void *opaque) { BDRVRawState *s = bs->opaque; - OVERLAPPED ov; - DWORD ret_count; - int ret; - int64_t offset = sector_num * 512; - int count = nb_sectors * 512; - - memset(&ov, 0, sizeof(ov)); - ov.Offset = offset; - ov.OffsetHigh = offset >> 32; - ret = WriteFile(s->hfile, buf, count, &ret_count, &ov); - if (!ret) - return ret_count; - if (ret_count == count) - ret_count = 0; - return ret_count; + if (s->aio) { + return win32_aio_submit(bs, s->aio, s->hfile, sector_num, qiov, + nb_sectors, cb, opaque, QEMU_AIO_WRITE); + } else { + return paio_submit(bs, s->hfile, sector_num, qiov, nb_sectors, + cb, opaque, QEMU_AIO_WRITE); + } } - static int raw_flush(BlockDriverState *bs) + static BlockDriverAIOCB *raw_aio_flush(BlockDriverState *bs, + BlockDriverCompletionFunc *cb, void *opaque) { BDRVRawState *s = bs->opaque; - int ret; - - ret = FlushFileBuffers(s->hfile); - if (ret == 0) { - return -EIO; - } - - return 0; + return paio_submit(bs, s->hfile, 0, NULL, 0, cb, opaque, QEMU_AIO_FLUSH); } static void raw_close(BlockDriverState *bs) @@@ -406,25 -553,14 +603,33 @@@ static int hdev_open(BlockDriverState * } s->type = find_device_type(bs, filename); ++<<<<<<< HEAD +#ifndef CONFIG_MARU + if (flags & BDRV_O_RDWR) { + access_flags = GENERIC_READ | GENERIC_WRITE; + } else { + access_flags = GENERIC_READ; + } + create_flags = OPEN_EXISTING; + + overlapped = FILE_ATTRIBUTE_NORMAL; + if (flags & BDRV_O_NOCACHE) + overlapped |= FILE_FLAG_NO_BUFFERING; + if (!(flags & BDRV_O_CACHE_WB)) + overlapped |= FILE_FLAG_WRITE_THROUGH; + + s->hfile = CreateFile(filename, + access_flags, ++======= + raw_parse_flags(flags, &access_flags, &overlapped); + + create_flags = OPEN_EXISTING; + + s->hfile = CreateFile(filename, access_flags, ++>>>>>>> test1.5 FILE_SHARE_READ, NULL, create_flags, overlapped, NULL); - if (s->hfile == INVALID_HANDLE_VALUE) { + if (s->hfile == INVALID_HANDLE_VALUE) { int err = GetLastError(); if (err == ERROR_ACCESS_DENIED) diff --cc blockdev.c index ca391dd3c5,625d04123d..2346f09d9c --- a/blockdev.c +++ b/blockdev.c @@@ -254,12 -280,7 +280,16 @@@ static int parse_block_error_action(con } } ++<<<<<<< HEAD +#ifdef CONFIG_MARU +extern int start_simple_client(char* msg); +extern char* maru_convert_path(char* msg, const char *path); +#endif + +static bool do_check_io_limits(BlockIOLimit *io_limits) ++======= + static bool do_check_io_limits(BlockIOLimit *io_limits, Error **errp) ++>>>>>>> test1.5 { bool bps_flag; bool iops_flag; @@@ -611,21 -695,17 +704,33 @@@ DriveInfo *drive_init(QemuOpts *all_opt error_report("warning: disabling copy_on_read on readonly drive"); } - ret = bdrv_open(dinfo->bdrv, file, bdrv_flags, drv); + ret = bdrv_open(dinfo->bdrv, file, bs_opts, bdrv_flags, drv); + bs_opts = NULL; + if (ret < 0) { ++<<<<<<< HEAD + error_report("could not open disk image %s: %s", + file, strerror(-ret)); + +#ifdef CONFIG_MARU + const char _msg[] = "Failed to load disk file from the following path. Check if the file is corrupted or missing.\n\n"; + char* err_msg = NULL; + err_msg = maru_convert_path((char*)_msg, file); + start_simple_client(err_msg); + if (err_msg) { + g_free(err_msg); + } +#endif + ++======= + if (ret == -EMEDIUMTYPE) { + error_report("could not open disk image %s: not in %s format", + file ?: dinfo->id, drv->format_name); + } else { + error_report("could not open disk image %s: %s", + file ?: dinfo->id, strerror(-ret)); + } ++>>>>>>> test1.5 goto err; } diff --cc configure index 3b4a42ab37,eb74510940..db679f0e53 --- a/configure +++ b/configure @@@ -168,8 -177,8 +177,9 @@@ libattr=" xfs="" vhost_net="no" + vhost_scsi="no" kvm="no" +hax="no" gprof="no" debug_tcg="no" debug="no" @@@ -211,24 -225,22 +226,38 @@@ trace_backend="nop trace_file="trace" spice="" rbd="" - smartcard="" smartcard_nss="" + libusb="" usb_redir="" ++<<<<<<< HEAD +opengl="" +efence="no" +yagl="no" +yagl_stats="no" ++======= + glx="" ++>>>>>>> test1.5 zlib="yes" guest_agent="yes" + want_tools="yes" libiscsi="" coroutine="" seccomp="" ++<<<<<<< HEAD +gl="yes" + +# for TIZEN-maru +maru="no" +shm="no" +# ++======= + glusterfs="" + virtio_blk_data_plane="" + gtk="" + gtkabi="2.0" + tpm="no" + libssh2="" ++>>>>>>> test1.5 # parse CC options first for opt do @@@ -539,8 -546,7 +563,12 @@@ Haiku if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then audio_possible_drivers="$audio_possible_drivers fmod" fi ++<<<<<<< HEAD +# fix linking error on Ubuntu 13.04 + libs_qga="-lrt $libs_qga" ++======= + QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers $QEMU_INCLUDES" ++>>>>>>> test1.5 ;; esac @@@ -855,21 -872,13 +902,29 @@@ for opt d ;; --enable-vhost-net) vhost_net="yes" ;; ++<<<<<<< HEAD + --enable-efence) efence="yes" + ;; + --disable-efence) efence="no" + ;; + --enable-yagl) yagl="yes" + ;; + --disable-yagl) yagl="no" + ;; + --enable-yagl-stats) yagl_stats="yes" + ;; + --disable-yagl-stats) yagl_stats="no" + ;; + --disable-opengl) opengl="no" ++======= + --disable-vhost-scsi) vhost_scsi="no" ;; - --enable-opengl) opengl="yes" + --enable-vhost-scsi) vhost_scsi="yes" + ;; + --disable-glx) glx="no" ++>>>>>>> test1.5 + ;; + --enable-glx) glx="yes" ;; --disable-rbd) rbd="no" ;; @@@ -901,12 -914,26 +960,35 @@@ ;; --disable-seccomp) seccomp="no" ;; ++<<<<<<< HEAD +# for TIZEN-maru + --enable-maru) maru="yes" + ;; + --enable-shm) shm="yes" + ;; +# ++======= + --disable-glusterfs) glusterfs="no" + ;; + --enable-glusterfs) glusterfs="yes" + ;; + --disable-virtio-blk-data-plane) virtio_blk_data_plane="no" + ;; + --enable-virtio-blk-data-plane) virtio_blk_data_plane="yes" + ;; + --disable-gtk) gtk="no" + ;; + --enable-gtk) gtk="yes" + ;; + --with-gtkabi=*) gtkabi="$optarg" + ;; + --enable-tpm) tpm="yes" + ;; + --disable-libssh2) libssh2="no" + ;; + --enable-libssh2) libssh2="yes" + ;; ++>>>>>>> test1.5 *) echo "ERROR: unknown option $opt"; show_help="yes" ;; esac @@@ -1194,16 -1180,10 +1242,21 @@@ echo " --enable-spice enabl echo " --enable-rbd enable building the rados block device (rbd)" echo " --disable-libiscsi disable iscsi support" echo " --enable-libiscsi enable iscsi support" ++<<<<<<< HEAD +echo " --enable-efence enable Electic Fence" +echo " --disable-efence disable Electic Fence" +echo " --enable-yagl enable YaGL device" +echo " --disable-yagl disable YaGL device" +echo " --enable-yagl-stats enable YaGL stats" +echo " --disable-yagl-stats disable YaGL stats" +echo " --disable-smartcard disable smartcard support" +echo " --enable-smartcard enable smartcard support" ++======= ++>>>>>>> test1.5 echo " --disable-smartcard-nss disable smartcard nss support" echo " --enable-smartcard-nss enable smartcard nss support" + echo " --disable-libusb disable libusb (for usb passthrough)" + echo " --enable-libusb enable libusb (for usb passthrough)" echo " --disable-usb-redir disable usb network redirection support" echo " --enable-usb-redir enable usb network redirection support" echo " --disable-guest-agent disable building of the QEMU Guest Agent" @@@ -1212,11 -1192,14 +1265,18 @@@ echo " --disable-seccomp disabl echo " --enable-seccomp enables seccomp support" echo " --with-coroutine=BACKEND coroutine backend. Supported options:" echo " gthread, ucontext, sigaltstack, windows" + echo " --enable-glusterfs enable GlusterFS backend" + echo " --disable-glusterfs disable GlusterFS backend" + echo " --enable-gcov enable test coverage analysis with gcov" + echo " --gcov=GCOV use specified gcov [$gcov_tool]" + echo " --enable-tpm enable TPM support" + echo " --disable-libssh2 disable ssh block device support" + echo " --enable-libssh2 enable ssh block device support" echo "" +# for TIZEN-maru +echo "TIZEN-maru options:" +echo " --enable-maru enable maru board" +echo " --enable-shm enable shared memory for framebuffer" echo "NOTE: The object files are built at the place where configure is launched" exit 1 fi @@@ -2191,26 -2253,46 +2330,62 @@@ the LIBS="$glib_libs $LIBS" libs_qga="$glib_libs $libs_qga" else - echo "glib-$glib_req_ver required to compile QEMU" - exit 1 + error_exit "glib-$glib_req_ver required to compile QEMU" + fi + + ########################################## + # pixman support probe + + if test "$pixman" = ""; then + if test "$want_tools" = "no" -a "$softmmu" = "no"; then + pixman="none" + elif $pkg_config pixman-1 > /dev/null 2>&1; then + pixman="system" + else + pixman="internal" + fi + fi + if test "$pixman" = "none"; then + if test "$want_tools" != "no" -o "$softmmu" != "no"; then + error_exit "pixman disabled but system emulation or tools build" \ + "enabled. You can turn off pixman only if you also" \ + "disable all system emulation targets and the tools" \ + "build with '--disable-tools --disable-system'." + fi + pixman_cflags= + pixman_libs= + elif test "$pixman" = "system"; then + pixman_cflags=`$pkg_config --cflags pixman-1 2>/dev/null` + pixman_libs=`$pkg_config --libs pixman-1 2>/dev/null` + else + if test ! -d ${source_path}/pixman/pixman; then + error_exit "pixman not present. Your options:" \ + " (1) Preferred: Install the pixman devel package (any recent" \ + " distro should have packages as Xorg needs pixman too)." \ + " (2) Fetch the pixman submodule, using:" \ + " git submodule update --init pixman" + fi + mkdir -p pixman/pixman + pixman_cflags="-I\$(SRC_PATH)/pixman/pixman -I\$(BUILD_DIR)/pixman/pixman" + pixman_libs="-L\$(BUILD_DIR)/pixman/pixman/.libs -lpixman-1" fi +########################################## +# pixman support probe + +if test "$shm" = no; then + if $pkg_config pixman-1 > /dev/null 2>&1; then + pixman_cflags=`$pkg_config --cflags pixman-1 2>/dev/null` + pixman_libs=`$pkg_config --libs pixman-1 2>/dev/null` + QEMU_CFLAGS="$pixman_cflags $QEMU_CFLAGS" + LIBS="$pixman_libs $LIBS" + else + echo "Error: pixman-1 check failed" + echo "Make sure to have the pixman-1 libs and headers installed" + exit 1 + fi +fi + ########################################## # libcap probe @@@ -2743,10 -2981,10 +3074,17 @@@ f cat > $TMPC < #include ++<<<<<<< HEAD +/* Fix linking error on Ubuntu 13.04 +int main(void) { return clock_gettime(CLOCK_REALTIME, NULL); } +*/ +int main(void) { return timer_gettime(CLOCK_REALTIME, NULL); } ++======= + int main(void) { + timer_create(CLOCK_REALTIME, NULL, NULL); + return clock_gettime(CLOCK_REALTIME, NULL); + } ++>>>>>>> test1.5 EOF if compile_prog "" "" ; then @@@ -3236,21 -3570,22 +3672,34 @@@ echo "spice support $spice ($spice_ echo "rbd support $rbd" echo "xfsctl support $xfs" echo "nss used $smartcard_nss" + echo "libusb $libusb" echo "usb net redir $usb_redir" ++<<<<<<< HEAD +echo "OpenGL support $opengl" +echo "EFence support $efence" +echo "YaGL support $yagl" +echo "YaGL stats $yagl_stats" ++======= + echo "GLX support $glx" ++>>>>>>> test1.5 echo "libiscsi support $libiscsi" echo "build guest agent $guest_agent" echo "seccomp support $seccomp" - echo "coroutine backend $coroutine_backend" + echo "coroutine backend $coroutine" + echo "GlusterFS support $glusterfs" + echo "virtio-blk-data-plane $virtio_blk_data_plane" + echo "gcov $gcov_tool" + echo "gcov enabled $gcov" + echo "TPM support $tpm" + echo "libssh2 support $libssh2" + echo "TPM passthrough $tpm_passthrough" + echo "QOM debugging $qom_cast_debug" +# for TIZEN-maru +echo "TIZEN-maru support $maru" +echo "TIZEN-maru shared framebuffer support $shm" +# + if test "$sdl_too_old" = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" fi @@@ -3522,30 -3882,6 +3996,33 @@@ if test "$spice" = "yes" ; the echo "CONFIG_SPICE=y" >> $config_host_mak fi ++<<<<<<< HEAD +if test "$efence" = "yes" ; then + echo "CONFIG_EFENCE=y" >> $config_host_mak +fi + +if test "$yagl" = "yes" ; then + echo "CONFIG_YAGL=y" >> $config_host_mak + if test "$linux" = "yes" ; then + echo "CONFIG_YAGL_EGL_GLX=y" >> $config_host_mak + elif test "$mingw32" = "yes" ; then + echo "CONFIG_YAGL_EGL_WGL=y" >> $config_host_mak + else + echo "ERROR: YaGL is not available on $targetos" + exit 1 + fi +fi + +if test "$yagl_stats" = "yes" ; then + echo "CONFIG_YAGL_STATS=y" >> $config_host_mak +fi + +if test "$smartcard" = "yes" ; then + echo "CONFIG_SMARTCARD=y" >> $config_host_mak +fi + ++======= ++>>>>>>> test1.5 if test "$smartcard_nss" = "yes" ; then echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak echo "libcacard_libs=$libcacard_libs" >> $config_host_mak @@@ -3621,16 -3992,14 +4133,27 @@@ libusb ;; esac ++<<<<<<< HEAD +# for TIZEN-maru +if test "$maru" = "yes" ; then + echo "CONFIG_MARU=y" >> $config_host_mak +fi +if test "$shm" = "yes" ; then + echo "CONFIG_USE_SHM=y" >> $config_host_mak +fi +if test "$gl" = "yes" ; then + echo "CONFIG_GL_BACKEND=y" >> $config_host_mak +fi ++======= + # TPM passthrough support? + if test "$tpm" = "yes"; then + echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak + if test "$tpm_passthrough" = "yes"; then + echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak + fi + fi + ++>>>>>>> test1.5 # use default implementation for tracing backend-specific routines trace_default=yes echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak @@@ -3660,16 -4037,20 +4191,29 @@@ echo "CONFIG_TRACE_FILE=$trace_file" > if test "$trace_default" = "yes"; then echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak fi +if test "$hax" = "yes" ; then + if test "$mingw32" = "yes" ; then + echo "CONFIG_HAX_BACKEND=y" >> $config_host_mak + elif test "$darwin" = "yes" ; then + echo "CONFIG_HAX_BACKEND=y" >> $config_host_mak + else + hax="no" + fi +fi + if test "$tcg_interpreter" = "yes"; then + QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" + elif test "$ARCH" = "sparc64" ; then + QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" + elif test "$ARCH" = "s390x" ; then + QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" + elif test "$ARCH" = "x86_64" ; then + QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" + else + QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" + fi + QEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES" + echo "TOOLS=$tools" >> $config_host_mak echo "ROMS=$roms" >> $config_host_mak echo "MAKE=$make" >> $config_host_mak @@@ -3961,16 -4301,6 +4464,19 @@@ upper() echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' } ++<<<<<<< HEAD +case "$cpu" in + i386|x86_64) + echo "CONFIG_QEMU_LDST_OPTIMIZATION=y" >> $config_target_mak + ;; +esac + +echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak +echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak +echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak +echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak ++======= ++>>>>>>> test1.5 echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak target_arch_name="`upper $TARGET_ARCH`" echo "TARGET_$target_arch_name=y" >> $config_target_mak @@@ -4017,40 -4343,6 +4519,43 @@@ case "$target_arch2" i i386|x86_64) echo "CONFIG_HAVE_GET_MEMORY_MAPPING=y" >> $config_target_mak esac ++<<<<<<< HEAD +if test "$hax" = "yes" ; then + if test "$target_softmmu" = "yes" ; then + case "$target_arch2" in + i386|x86_64) + echo "CONFIG_HAX=y" >> $config_target_mak + ;; + *) + echo "CONFIG_NO_HAX=y" >> $config_target_mak + ;; + esac + else + echo "CONFIG_NO_HAX=y" >> $config_target_mak + fi +fi +if test "$gl" = "yes" ; then + case "$target_arch2" in + i386|x86_64|arm) + echo "CONFIG_GL=y" >> $config_target_mak + if test "$mingw32" = "yes" ; then + echo "LIBS+=-lopengl32 -lglu32" >> $config_target_mak + elif test "$darwin" = "yes" ; then + echo "LIBS+=-framework OpenGL -framework AGL " >> $config_target_mak + else + echo "LIBS+=-lGLU -ldl" >> $config_target_mak + fi + ;; + *) + echo "CONFIG_NO_GL=y" >> $config_target_mak + ;; + esac +fi +if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then + echo "CONFIG_PSERIES=y" >> $config_target_mak +fi ++======= ++>>>>>>> test1.5 if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fi @@@ -4100,46 -4385,8 +4598,43 @@@ f # generate QEMU_CFLAGS/LDFLAGS for targets cflags="" - includes="" ldflags="" ++<<<<<<< HEAD +if test "$tcg_interpreter" = "yes"; then + includes="-I\$(SRC_PATH)/tcg/tci $includes" +elif test "$ARCH" = "sparc64" ; then + includes="-I\$(SRC_PATH)/tcg/sparc $includes" +elif test "$ARCH" = "s390x" ; then + includes="-I\$(SRC_PATH)/tcg/s390 $includes" +elif test "$ARCH" = "x86_64" ; then + includes="-I\$(SRC_PATH)/tcg/i386 $includes" +else + includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes" +fi +includes="-I\$(SRC_PATH)/tcg $includes" + +if test "$linux" = "yes" ; then + includes="-I\$(SRC_PATH)/linux-headers $includes" +fi + +if test "$target_user_only" = "yes" ; then + libdis_config_mak=libdis-user/config.mak +else + libdis_config_mak=libdis/config.mak +fi + +if test "$efence" = "yes" ; then + echo "CONFIG_BUILD_WITH_EFENCE=y" >> $config_target_mak + echo "LIBS+=-lefence" >> $config_target_mak +fi + +if test "$yagl" = "yes" ; then + echo "CONFIG_BUILD_YAGL=y" >> $config_target_mak +fi + ++======= ++>>>>>>> test1.5 for i in $ARCH $TARGET_BASE_ARCH ; do case "$i" in alpha) @@@ -4220,20 -4471,6 +4719,23 @@@ alpha ;; esac ++<<<<<<< HEAD +if test "$target_softmmu" = "yes" ; then + case "$TARGET_BASE_ARCH" in + arm) + cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags" + ;; + lm32) + cflags="-DHAS_AUDIO $cflags" + ;; + i386|mips|ppc) + cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags" + ;; + esac +fi + ++======= ++>>>>>>> test1.5 if test "$gprof" = "yes" ; then echo "TARGET_GPROF=yes" >> $config_target_mak if test "$target_linux_user" = "yes" ; then diff --cc cpu-exec.c index 9500e91c04,31c089dac0..9ed3f8dd25 --- a/cpu-exec.c +++ b/cpu-exec.c @@@ -18,19 -18,14 +18,20 @@@ */ #include "config.h" #include "cpu.h" - #include "disas.h" + #include "disas/disas.h" #include "tcg.h" ++<<<<<<< HEAD +#include "hax.h" +#include "qemu-barrier.h" +#include "qtest.h" ++======= + #include "qemu/atomic.h" + #include "sysemu/qtest.h" ++>>>>>>> test1.5 - int tb_invalidated_flag; - - //#define CONFIG_DEBUG_EXEC - - bool qemu_cpu_has_work(CPUArchState *env) + bool qemu_cpu_has_work(CPUState *cpu) { - return cpu_has_work(env); + return cpu_has_work(cpu); } void cpu_loop_exit(CPUArchState *env) @@@ -180,28 -193,12 +199,30 @@@ static void cpu_handle_debug_exception( volatile sig_atomic_t exit_request; +/* + * QEMU emulate can happens because of MMIO or emulation mode, i.e. non-PG mode, + * when it's because of MMIO, the MMIO, the interrupt should not be emulated, + * because MMIO is emulated for only one instruction now and then back to + * HAX kernel + */ +int need_handle_intr_request(CPUArchState *env) +{ +#ifdef CONFIG_HAX + if (!hax_enabled() || hax_vcpu_emulation_mode(env)) + return env->interrupt_request; + return 0; +#else + return env->interrupt_request; +#endif +} + + int cpu_exec(CPUArchState *env) { - #ifdef TARGET_PPC CPUState *cpu = ENV_GET_CPU(env); + #if !(defined(CONFIG_USER_ONLY) && \ + (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X))) + CPUClass *cc = CPU_GET_CLASS(cpu); #endif int ret, interrupt_request; TranslationBlock *tb; @@@ -281,14 -287,9 +311,18 @@@ } } +#ifdef CONFIG_HAX + if (hax_enabled() && !hax_vcpu_exec(env)) + longjmp(env->jmp_env, 1); +#endif + next_tb = 0; /* force lookup of first TB */ for(;;) { ++<<<<<<< HEAD + interrupt_request = need_handle_intr_request(env); ++======= + interrupt_request = cpu->interrupt_request; ++>>>>>>> test1.5 if (unlikely(interrupt_request)) { if (unlikely(env->singlestep_enabled & SSTEP_NOIRQ)) { /* Mask out external interrupts for this step. */ @@@ -330,16 -330,12 +364,25 @@@ !(env->hflags & HF_SMM_MASK)) { cpu_svm_check_intercept_param(env, SVM_EXIT_SMI, 0); ++<<<<<<< HEAD + env->interrupt_request &= ~CPU_INTERRUPT_SMI; +#ifdef CONFIG_HAX + if (hax_enabled()) + env->hax_vcpu->resync = 1; +#endif + do_smm_enter(env); + next_tb = 0; + } else if ((interrupt_request & CPU_INTERRUPT_NMI) && + !(env->hflags2 & HF2_NMI_MASK)) { + env->interrupt_request &= ~CPU_INTERRUPT_NMI; ++======= + cpu->interrupt_request &= ~CPU_INTERRUPT_SMI; + do_smm_enter(env); + next_tb = 0; + } else if ((interrupt_request & CPU_INTERRUPT_NMI) && + !(env->hflags2 & HF2_NMI_MASK)) { + cpu->interrupt_request &= ~CPU_INTERRUPT_NMI; ++>>>>>>> test1.5 env->hflags2 |= HF2_NMI_MASK; do_interrupt_x86_hardirq(env, EXCP02_NMI, 1); next_tb = 0; @@@ -654,14 -660,13 +707,22 @@@ next_tb = 0; cpu_loop_exit(env); } + break; + } + default: + break; } } ++<<<<<<< HEAD + env->current_tb = NULL; +#ifdef CONFIG_HAX + if (hax_enabled() && hax_stop_emulation(env)) + cpu_loop_exit(env); +#endif + ++======= + cpu->current_tb = NULL; ++>>>>>>> test1.5 /* reset soft MMU for next block (it can currently only be set by a memory fault) */ } /* for(;;) */ diff --cc cpus.c index 82d82396eb,c232265cd2..2579250a25 --- a/cpus.c +++ b/cpus.c @@@ -25,22 -25,21 +25,30 @@@ /* Needed early for CONFIG_BSD etc. */ #include "config-host.h" ++<<<<<<< HEAD +#include "monitor.h" +#include "sysemu.h" +#include "gdbstub.h" +#include "dma.h" +#include "kvm.h" +#include "hax.h" ++======= + #include "monitor/monitor.h" + #include "sysemu/sysemu.h" + #include "exec/gdbstub.h" + #include "sysemu/dma.h" + #include "sysemu/kvm.h" ++>>>>>>> test1.5 #include "qmp-commands.h" - #include "qemu-thread.h" - #include "cpus.h" - #include "qtest.h" - #include "main-loop.h" - #include "bitmap.h" + #include "qemu/thread.h" + #include "sysemu/cpus.h" + #include "sysemu/qtest.h" + #include "qemu/main-loop.h" + #include "qemu/bitmap.h" #ifndef _WIN32 - #include "compatfd.h" + #include "qemu/compatfd.h" #endif #ifdef CONFIG_LINUX @@@ -65,14 -64,16 +73,21 @@@ static CPUArchState *next_cpu static bool cpu_thread_is_idle(CPUArchState *env) { - if (env->stop || env->queued_work_first) { + CPUState *cpu = ENV_GET_CPU(env); + + if (cpu->stop || cpu->queued_work_first) { return false; } - if (env->stopped || !runstate_is_running()) { + if (cpu->stopped || !runstate_is_running()) { return true; } ++<<<<<<< HEAD + if (!env->halted || qemu_cpu_has_work(env) || + kvm_async_interrupts_enabled() || hax_enabled()) { ++======= + if (!cpu->halted || qemu_cpu_has_work(cpu) || + kvm_async_interrupts_enabled()) { ++>>>>>>> test1.5 return false; } return true; @@@ -859,18 -861,31 +875,38 @@@ static void qemu_cpu_kick_thread(CPUSta fprintf(stderr, "qemu:%s: %s", __func__, strerror(err)); exit(1); } +/* The cpu thread cannot catch it reliably when shutdown the guest on Mac. + * We can double check it and resend it + */ +#ifdef CONFIG_DARWIN + if (!exit_request) + cpu_signal(0); +#endif #else /* _WIN32 */ - if (!qemu_cpu_is_self(env)) { - SuspendThread(cpu->hThread); + if (!qemu_cpu_is_self(cpu)) { + CONTEXT tcgContext; + + if (SuspendThread(cpu->hThread) == (DWORD)-1) { + fprintf(stderr, "qemu:%s: GetLastError:%lu\n", __func__, + GetLastError()); + exit(1); + } + + /* On multi-core systems, we are not sure that the thread is actually + * suspended until we can get the context. + */ + tcgContext.ContextFlags = CONTEXT_CONTROL; + while (GetThreadContext(cpu->hThread, &tcgContext) != 0) { + continue; + } + cpu_signal(0); - ResumeThread(cpu->hThread); + + if (ResumeThread(cpu->hThread) == (DWORD)-1) { + fprintf(stderr, "qemu:%s: GetLastError:%lu\n", __func__, + GetLastError()); + exit(1); + } } #endif } @@@ -990,15 -1014,8 +1035,18 @@@ void resume_all_vcpus(void } } - static void qemu_tcg_init_vcpu(void *_env) + static void qemu_tcg_init_vcpu(CPUState *cpu) { ++<<<<<<< HEAD + CPUArchState *env = _env; + CPUState *cpu = ENV_GET_CPU(env); + +#ifdef CONFIG_HAX + if (hax_enabled()) + hax_init_vcpu(env); +#endif ++======= ++>>>>>>> test1.5 /* share a single thread for all cpus with TCG */ if (!tcg_cpu_thread) { cpu->thread = g_malloc0(sizeof(QemuThread)); diff --cc default-configs/arm-softmmu.mak index 3d860d987e,27cbe3d088..84606e7dea --- a/default-configs/arm-softmmu.mak +++ b/default-configs/arm-softmmu.mak @@@ -47,4 -79,4 +80,8 @@@ CONFIG_ZYNQ= CONFIG_VERSATILE_PCI=y CONFIG_VERSATILE_I2C=y ++<<<<<<< HEAD +CONFIG_SOUND=y ++======= + CONFIG_SDHCI=y ++>>>>>>> test1.5 diff --cc exec.c index 8e6bf12671,aec65c5063..4c62ee1cb1 --- a/exec.c +++ b/exec.c @@@ -29,86 -29,30 +29,40 @@@ #include "tcg.h" #include "hw/hw.h" #include "hw/qdev.h" ++<<<<<<< HEAD +#include "osdep.h" +#include "kvm.h" +#include "hax.h" +#include "hw/xen.h" +#include "qemu-timer.h" +#include "memory.h" +#include "exec-memory.h" ++======= + #include "qemu/osdep.h" + #include "sysemu/kvm.h" + #include "hw/xen/xen.h" + #include "qemu/timer.h" + #include "qemu/config-file.h" + #include "exec/memory.h" + #include "sysemu/dma.h" + #include "exec/address-spaces.h" ++>>>>>>> test1.5 #if defined(CONFIG_USER_ONLY) #include - #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - #include - #if __FreeBSD_version >= 700104 - #define HAVE_KINFO_GETVMMAP - #define sigqueue sigqueue_freebsd /* avoid redefinition */ - #include - #include - #include - #define _KERNEL - #include - #undef _KERNEL - #undef sigqueue - #include - #endif - #endif #else /* !CONFIG_USER_ONLY */ - #include "xen-mapcache.h" + #include "sysemu/xen-mapcache.h" #include "trace.h" #endif + #include "exec/cpu-all.h" - #include "cputlb.h" + #include "exec/cputlb.h" + #include "translate-all.h" - #define WANT_EXEC_OBSOLETE - #include "exec-obsolete.h" + #include "exec/memory-internal.h" - //#define DEBUG_TB_INVALIDATE - //#define DEBUG_FLUSH //#define DEBUG_UNASSIGNED - - /* make various TB consistency checks */ - //#define DEBUG_TB_CHECK - - //#define DEBUG_IOPORT //#define DEBUG_SUBPAGE - #if !defined(CONFIG_USER_ONLY) - /* TB consistency checks only implemented for usermode emulation. */ - #undef DEBUG_TB_CHECK - #endif - - #define SMC_BITMAP_USE_THRESHOLD 10 - - static TranslationBlock *tbs; - static int code_gen_max_blocks; - TranslationBlock *tb_phys_hash[CODE_GEN_PHYS_HASH_SIZE]; - static int nb_tbs; - /* any access to the tbs or the page table must use this lock */ - spinlock_t tb_lock = SPIN_LOCK_UNLOCKED; - - #if defined(__arm__) || defined(__sparc_v9__) - /* The prologue must be reachable with a direct jump. ARM and Sparc64 - have limited branch ranges (possibly also PPC) so place it in a - section close to code segment. */ - #define code_gen_section \ - __attribute__((__section__(".gen_code"))) \ - __attribute__((aligned (32))) - #elif defined(_WIN32) && !defined(_WIN64) - #define code_gen_section \ - __attribute__((aligned (16))) - #else - #define code_gen_section \ - __attribute__((aligned (32))) - #endif - - uint8_t code_gen_prologue[1024] code_gen_section; - static uint8_t *code_gen_buffer; - static unsigned long code_gen_buffer_size; - /* threshold to flush the translated code buffer */ - static unsigned long code_gen_buffer_max_size; - static uint8_t *code_gen_ptr; - #if !defined(CONFIG_USER_ONLY) int phys_ram_fd; static int in_migration; @@@ -1284,185 -210,68 +220,85 @@@ bool memory_region_is_unassigned(Memory } #endif - /* add the tb in the target page and protect it if necessary */ - static inline void tb_alloc_page(TranslationBlock *tb, - unsigned int n, tb_page_addr_t page_addr) + void cpu_exec_init_all(void) { - PageDesc *p; - #ifndef CONFIG_USER_ONLY - bool page_already_protected; - #endif - - tb->page_addr[n] = page_addr; - p = page_find_alloc(page_addr >> TARGET_PAGE_BITS, 1); - tb->page_next[n] = p->first_tb; - #ifndef CONFIG_USER_ONLY - page_already_protected = p->first_tb != NULL; - #endif - p->first_tb = (TranslationBlock *)((uintptr_t)tb | n); - invalidate_page_bitmap(p); - - #if defined(TARGET_HAS_SMC) || 1 - - #if defined(CONFIG_USER_ONLY) - if (p->flags & PAGE_WRITE) { - target_ulong addr; - PageDesc *p2; - int prot; - - /* force the host page as non writable (writes will have a - page fault + mprotect overhead) */ - page_addr &= qemu_host_page_mask; - prot = 0; - for(addr = page_addr; addr < page_addr + qemu_host_page_size; - addr += TARGET_PAGE_SIZE) { - - p2 = page_find (addr >> TARGET_PAGE_BITS); - if (!p2) - continue; - prot |= p2->flags; - p2->flags &= ~PAGE_WRITE; - } - mprotect(g2h(page_addr), qemu_host_page_size, - (prot & PAGE_BITS) & ~PAGE_WRITE); - #ifdef DEBUG_TB_INVALIDATE - printf("protecting code page: 0x" TARGET_FMT_lx "\n", - page_addr); - #endif - } - #else - /* if some code is already present, then the pages are already - protected. So we handle the case where only the first TB is - allocated in a physical page */ - if (!page_already_protected) { - tlb_protect_code(page_addr); - } + #if !defined(CONFIG_USER_ONLY) + qemu_mutex_init(&ram_list.mutex); + memory_map_init(); + io_mem_init(); #endif - - #endif /* TARGET_HAS_SMC */ } - /* add a new TB and link it to the physical page tables. phys_page2 is - (-1) to indicate that only one page contains the TB. */ - void tb_link_page(TranslationBlock *tb, - tb_page_addr_t phys_pc, tb_page_addr_t phys_page2) - { - unsigned int h; - TranslationBlock **ptb; - - /* Grab the mmap lock to stop another thread invalidating this TB - before we are done. */ - mmap_lock(); - /* add in the physical hash table */ - h = tb_phys_hash_func(phys_pc); - ptb = &tb_phys_hash[h]; - tb->phys_hash_next = *ptb; - *ptb = tb; + #if !defined(CONFIG_USER_ONLY) - /* add in the page list */ - tb_alloc_page(tb, 0, phys_pc & TARGET_PAGE_MASK); - if (phys_page2 != -1) - tb_alloc_page(tb, 1, phys_page2); - else - tb->page_addr[1] = -1; + static int cpu_common_post_load(void *opaque, int version_id) + { + CPUState *cpu = opaque; - tb->jmp_first = (TranslationBlock *)((uintptr_t)tb | 2); - tb->jmp_next[0] = NULL; - tb->jmp_next[1] = NULL; + /* 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the + version_id is increased. */ + cpu->interrupt_request &= ~0x01; + tlb_flush(cpu->env_ptr, 1); - /* init original jump addresses */ - if (tb->tb_next_offset[0] != 0xffff) - tb_reset_jump(tb, 0); - if (tb->tb_next_offset[1] != 0xffff) - tb_reset_jump(tb, 1); + return 0; + } - #ifdef DEBUG_TB_CHECK - tb_page_check(); + static const VMStateDescription vmstate_cpu_common = { + .name = "cpu_common", + .version_id = 1, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .post_load = cpu_common_post_load, + .fields = (VMStateField []) { + VMSTATE_UINT32(halted, CPUState), + VMSTATE_UINT32(interrupt_request, CPUState), + VMSTATE_END_OF_LIST() + } + }; + #else + #define vmstate_cpu_common vmstate_dummy #endif - mmap_unlock(); - } ++<<<<<<< HEAD +#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU) +/* check whether the given addr is in TCG generated code buffer or not */ +bool is_tcg_gen_code(uintptr_t tc_ptr) +{ + /* This can be called during code generation, code_gen_buffer_size + is used instead of code_gen_ptr for upper boundary checking */ + return (tc_ptr >= (uintptr_t)code_gen_buffer && + tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_size)); +} +#endif + +/* find the TB 'tb' such that tb[0].tc_ptr <= tc_ptr < + tb[1].tc_ptr. Return NULL if not found */ +TranslationBlock *tb_find_pc(uintptr_t tc_ptr) ++======= + CPUState *qemu_get_cpu(int index) ++>>>>>>> test1.5 { - int m_min, m_max, m; - uintptr_t v; - TranslationBlock *tb; + CPUArchState *env = first_cpu; + CPUState *cpu = NULL; - if (nb_tbs <= 0) - return NULL; - if (tc_ptr < (uintptr_t)code_gen_buffer || - tc_ptr >= (uintptr_t)code_gen_ptr) { - return NULL; - } - /* binary search (cf Knuth) */ - m_min = 0; - m_max = nb_tbs - 1; - while (m_min <= m_max) { - m = (m_min + m_max) >> 1; - tb = &tbs[m]; - v = (uintptr_t)tb->tc_ptr; - if (v == tc_ptr) - return tb; - else if (tc_ptr < v) { - m_max = m - 1; - } else { - m_min = m + 1; + while (env) { + cpu = ENV_GET_CPU(env); + if (cpu->cpu_index == index) { + break; } + env = env->next_cpu; } - return &tbs[m_max]; - } - static void tb_reset_jump_recursive(TranslationBlock *tb); + return env ? cpu : NULL; + } - static inline void tb_reset_jump_recursive2(TranslationBlock *tb, int n) + void qemu_for_each_cpu(void (*func)(CPUState *cpu, void *data), void *data) { - TranslationBlock *tb1, *tb_next, **ptb; - unsigned int n1; - - tb1 = tb->jmp_next[n]; - if (tb1 != NULL) { - /* find head of list */ - for(;;) { - n1 = (uintptr_t)tb1 & 3; - tb1 = (TranslationBlock *)((uintptr_t)tb1 & ~3); - if (n1 == 2) - break; - tb1 = tb1->jmp_next[n1]; - } - /* we are now sure now that tb jumps to tb1 */ - tb_next = tb1; - - /* remove tb from the jmp_first list */ - ptb = &tb_next->jmp_first; - for(;;) { - tb1 = *ptb; - n1 = (uintptr_t)tb1 & 3; - tb1 = (TranslationBlock *)((uintptr_t)tb1 & ~3); - if (n1 == n && tb1 == tb) - break; - ptb = &tb1->jmp_next[n1]; - } - *ptb = tb->jmp_next[n]; - tb->jmp_next[n] = NULL; - - /* suppress the jump to next tb in generated code */ - tb_reset_jump(tb, n); + CPUArchState *env = first_cpu; - /* suppress jumps in the tb on which we could have jumped */ - tb_reset_jump_recursive(tb_next); + while (env) { + func(ENV_GET_CPU(env), data); + env = env->next_cpu; } } @@@ -2567,28 -1074,11 +1101,32 @@@ ram_addr_t qemu_ram_alloc_from_ptr(ram_ xen_ram_alloc(new_block->offset, size, mr); } else if (kvm_enabled()) { /* some s390/kvm configurations have special constraints */ - new_block->host = kvm_vmalloc(size); + new_block->host = kvm_ram_alloc(size); } else { ++<<<<<<< HEAD + new_block->host = qemu_vmalloc(size); +#ifdef CONFIG_HAX + /* + * In Hax, the qemu allocate the virtual address, and HAX kernel + * populate the memory with physical memory. Currently we have no + * paging, so user should make sure enough free memory in advance + */ + if (hax_enabled()) + { + int ret; + ret = hax_populate_ram((uint64_t)new_block->host, size); + if (ret < 0) + { + fprintf(stderr, "Hax failed to populate ram\n"); + exit(-1); + } + } +#endif ++======= + new_block->host = qemu_anon_ram_alloc(size); ++>>>>>>> test1.5 } - qemu_madvise(new_block->host, size, QEMU_MADV_MERGEABLE); + memory_try_enable_merging(new_block->host, size); } } new_block->length = size; diff --cc hw/9pfs/virtio-9p-device.c index 0c945f0d08,dc6f4e404f..1f524ee5d8 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@@ -115,17 -98,8 +103,22 @@@ static int virtio_9p_device_init(VirtIO if (s->ops->init(&s->ctx) < 0) { fprintf(stderr, "Virtio-9p Failed to initialize fs-driver with id:%s" ++<<<<<<< HEAD + " and export path:%s\n", conf->fsdev_id, s->ctx.fs_root); +#ifdef CONFIG_MARU + const char _msg[] = "Failed to find the file sharing path. Check if the path is correct or not.\n\n"; + char* err_msg = NULL; + err_msg = maru_convert_path((char*)_msg, s->ctx.fs_root); + maru_register_exit_msg(MARU_EXIT_UNKNOWN, err_msg); + if (err_msg) { + g_free(err_msg); + } +#endif + exit(1); ++======= + " and export path:%s\n", s->fsconf.fsdev_id, s->ctx.fs_root); + return -1; ++>>>>>>> test1.5 } if (v9fs_init_worker_threads() < 0) { fprintf(stderr, "worker thread initialization failed\n"); diff --cc hw/Makefile.objs index 2eb520f0ee,0243d6aa0e..032176b115 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@@ -1,208 -1,32 +1,243 @@@ ++<<<<<<< HEAD +hw-obj-y = usb/ ide/ +hw-obj-y += loader.o +hw-obj-$(CONFIG_VIRTIO) += virtio-console.o +hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o +hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci-new.o +hw-obj-$(CONFIG_VIRTIO) += virtio-transport.o +hw-obj-$(CONFIG_VIRTIO) += virtio-mmio.o +hw-obj-y += fw_cfg.o +hw-obj-$(CONFIG_PCI) += pci.o pci_bridge.o pci_bridge_dev.o +hw-obj-$(CONFIG_PCI) += msix.o msi.o +hw-obj-$(CONFIG_PCI) += shpc.o +hw-obj-$(CONFIG_PCI) += slotid_cap.o +hw-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o +hw-obj-$(CONFIG_PCI) += ioh3420.o xio3130_upstream.o xio3130_downstream.o +hw-obj-y += watchdog.o +hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o +hw-obj-$(CONFIG_ECC) += ecc.o +hw-obj-$(CONFIG_NAND) += nand.o +hw-obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o +hw-obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o + +hw-obj-$(CONFIG_M48T59) += m48t59.o +hw-obj-$(CONFIG_ESCC) += escc.o +hw-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o + +hw-obj-$(CONFIG_SERIAL) += serial.o +hw-obj-$(CONFIG_PARALLEL) += parallel.o +hw-obj-$(CONFIG_I8254) += i8254_common.o i8254.o +hw-obj-$(CONFIG_PCSPK) += pcspk.o +hw-obj-$(CONFIG_PCKBD) += pckbd.o +hw-obj-$(CONFIG_FDC) += fdc.o +hw-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o +hw-obj-$(CONFIG_APM) += pm_smbus.o apm.o +hw-obj-$(CONFIG_DMA) += dma.o +hw-obj-$(CONFIG_I82374) += i82374.o +hw-obj-$(CONFIG_HPET) += hpet.o +hw-obj-$(CONFIG_APPLESMC) += applesmc.o +hw-obj-$(CONFIG_SMARTCARD) += ccid-card-passthru.o +hw-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o +hw-obj-$(CONFIG_I8259) += i8259_common.o i8259.o + +# PPC devices +hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o +hw-obj-$(CONFIG_I82378) += i82378.o +# Mac shared devices +hw-obj-$(CONFIG_MACIO) += macio.o +hw-obj-$(CONFIG_CUDA) += cuda.o +hw-obj-$(CONFIG_ADB) += adb.o +hw-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o +hw-obj-$(CONFIG_MAC_DBDMA) += mac_dbdma.o +# OldWorld PowerMac +hw-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o +hw-obj-$(CONFIG_GRACKLE_PCI) += grackle_pci.o +# NewWorld PowerMac +hw-obj-$(CONFIG_UNIN_PCI) += unin_pci.o +hw-obj-$(CONFIG_DEC_PCI) += dec_pci.o +# PowerPC E500 boards +hw-obj-$(CONFIG_PPCE500_PCI) += ppce500_pci.o + +# MIPS devices +hw-obj-$(CONFIG_PIIX4) += piix4.o +hw-obj-$(CONFIG_G364FB) += g364fb.o +hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o + +# Xilinx devices +hw-obj-$(CONFIG_XILINX) += xilinx_intc.o +hw-obj-$(CONFIG_XILINX) += xilinx_timer.o +hw-obj-$(CONFIG_XILINX) += xilinx_uartlite.o +hw-obj-$(CONFIG_XILINX_AXI) += xilinx_axidma.o +hw-obj-$(CONFIG_XILINX_AXI) += xilinx_axienet.o +hw-obj-$(CONFIG_XILINX_AXI) += stream.o + +# PKUnity SoC devices +hw-obj-$(CONFIG_PUV3) += puv3_intc.o +hw-obj-$(CONFIG_PUV3) += puv3_ost.o +hw-obj-$(CONFIG_PUV3) += puv3_gpio.o +hw-obj-$(CONFIG_PUV3) += puv3_pm.o +hw-obj-$(CONFIG_PUV3) += puv3_dma.o + +# ARM devices +hw-obj-$(CONFIG_ARM_TIMER) += arm_timer.o +hw-obj-$(CONFIG_PL011) += pl011.o +hw-obj-$(CONFIG_PL022) += pl022.o +hw-obj-$(CONFIG_PL031) += pl031.o +hw-obj-$(CONFIG_PL041) += pl041.o lm4549.o +hw-obj-$(CONFIG_PL050) += pl050.o +hw-obj-$(CONFIG_PL061) += pl061.o +hw-obj-$(CONFIG_PL080) += pl080.o +hw-obj-$(CONFIG_PL110) += pl110.o +hw-obj-$(CONFIG_PL181) += pl181.o +hw-obj-$(CONFIG_PL190) += pl190.o +hw-obj-$(CONFIG_PL310) += arm_l2x0.o +hw-obj-$(CONFIG_VERSATILE_PCI) += versatile_pci.o +hw-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o +hw-obj-$(CONFIG_CADENCE) += cadence_uart.o +hw-obj-$(CONFIG_CADENCE) += cadence_ttc.o +hw-obj-$(CONFIG_CADENCE) += cadence_gem.o +hw-obj-$(CONFIG_XGMAC) += xgmac.o + +# PCI watchdog devices +hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o + +hw-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o + +# PCI network cards +hw-obj-$(CONFIG_NE2000_PCI) += ne2000.o +hw-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o +hw-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o +hw-obj-$(CONFIG_PCNET_COMMON) += pcnet.o +hw-obj-$(CONFIG_E1000_PCI) += e1000.o +hw-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o + +hw-obj-$(CONFIG_SMC91C111) += smc91c111.o +hw-obj-$(CONFIG_LAN9118) += lan9118.o +hw-obj-$(CONFIG_NE2000_ISA) += ne2000-isa.o +hw-obj-$(CONFIG_OPENCORES_ETH) += opencores_eth.o + +# SCSI layer +hw-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o +hw-obj-$(CONFIG_MEGASAS_SCSI_PCI) += megasas.o +hw-obj-$(CONFIG_ESP) += esp.o +hw-obj-$(CONFIG_ESP_PCI) += esp-pci.o + +hw-obj-y += sysbus.o isa-bus.o +hw-obj-y += qdev-addr.o + +# VGA +hw-obj-$(CONFIG_VGA_PCI) += vga-pci.o +hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o +hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o +hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o +hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o +hw-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o + +hw-obj-$(CONFIG_RC4030) += rc4030.o +hw-obj-$(CONFIG_DP8393X) += dp8393x.o +hw-obj-$(CONFIG_DS1225Y) += ds1225y.o +hw-obj-$(CONFIG_MIPSNET) += mipsnet.o + +hw-obj-y += null-machine.o + +# Sound +sound-obj-y = +sound-obj-$(CONFIG_SB16) += sb16.o +sound-obj-$(CONFIG_ES1370) += es1370.o +sound-obj-$(CONFIG_AC97) += ac97.o +sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o +sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o +sound-obj-$(CONFIG_CS4231A) += cs4231a.o +sound-obj-$(CONFIG_HDA) += intel-hda.o hda-audio.o + +$(obj)/adlib.o $(obj)/fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0 + +hw-obj-$(CONFIG_SOUND) += $(sound-obj-y) + +hw-obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/ + +common-obj-y += usb/ +common-obj-y += irq.o +common-obj-$(CONFIG_PTIMER) += ptimer.o +common-obj-$(CONFIG_MAX7310) += max7310.o +common-obj-$(CONFIG_WM8750) += wm8750.o +common-obj-$(CONFIG_WM8994) += wm8994.o +common-obj-$(CONFIG_TWL92230) += twl92230.o +common-obj-$(CONFIG_TSC2005) += tsc2005.o +common-obj-$(CONFIG_LM832X) += lm832x.o +common-obj-$(CONFIG_TMP105) += tmp105.o +common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o +common-obj-$(CONFIG_SSD0303) += ssd0303.o +common-obj-$(CONFIG_SSD0323) += ssd0323.o +common-obj-$(CONFIG_ADS7846) += ads7846.o +common-obj-$(CONFIG_MAX111X) += max111x.o +common-obj-$(CONFIG_DS1338) += ds1338.o +common-obj-y += i2c.o smbus.o smbus_eeprom.o +common-obj-y += eeprom93xx.o +common-obj-y += scsi-disk.o cdrom.o hd-geometry.o block-common.o +common-obj-y += scsi-generic.o scsi-bus.o +common-obj-y += hid.o +common-obj-$(CONFIG_SSI) += ssi.o +common-obj-$(CONFIG_SSI_SD) += ssi-sd.o +common-obj-$(CONFIG_SD) += sd.o +common-obj-y += bt.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o +common-obj-y += bt-hci-csr.o +common-obj-y += msmouse.o ps2.o +common-obj-y += qdev.o qdev-properties.o qdev-monitor.o +common-obj-$(CONFIG_BRLAPI) += baum.o + +# xen backend driver support +common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o +common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o + +# Per-target files +# virtio has to be here due to weird dependency between PCI and virtio-net. +# need to fix this properly +obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o +obj-$(CONFIG_VIRTIO) += virtio-serial-bus.o virtio-scsi.o +obj-$(CONFIG_SOFTMMU) += vhost_net.o +obj-$(CONFIG_VHOST_NET) += vhost.o +obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/ +obj-$(CONFIG_NO_PCI) += pci-stub.o +obj-$(CONFIG_VGA) += vga.o +obj-$(CONFIG_SOFTMMU) += device-hotplug.o +obj-$(CONFIG_XEN) += xen_domainbuild.o xen_machine_pv.o + +# Inter-VM PCI shared memory +ifeq ($(CONFIG_PCI), y) +obj-$(CONFIG_KVM) += ivshmem.o +endif ++======= + devices-dirs-$(CONFIG_REALLY_VIRTFS) += 9pfs/ + devices-dirs-$(CONFIG_ACPI) += acpi/ + devices-dirs-$(CONFIG_SOFTMMU) += audio/ + devices-dirs-$(CONFIG_SOFTMMU) += block/ + devices-dirs-$(CONFIG_SOFTMMU) += bt/ + devices-dirs-$(CONFIG_SOFTMMU) += char/ + devices-dirs-$(CONFIG_SOFTMMU) += cpu/ + devices-dirs-$(CONFIG_SOFTMMU) += display/ + devices-dirs-$(CONFIG_SOFTMMU) += dma/ + devices-dirs-$(CONFIG_SOFTMMU) += gpio/ + devices-dirs-$(CONFIG_SOFTMMU) += i2c/ + devices-dirs-$(CONFIG_SOFTMMU) += ide/ + devices-dirs-$(CONFIG_SOFTMMU) += input/ + devices-dirs-$(CONFIG_SOFTMMU) += intc/ + devices-dirs-$(CONFIG_SOFTMMU) += isa/ + devices-dirs-$(CONFIG_SOFTMMU) += misc/ + devices-dirs-$(CONFIG_SOFTMMU) += net/ + devices-dirs-$(CONFIG_SOFTMMU) += nvram/ + devices-dirs-$(CONFIG_SOFTMMU) += pci/ + devices-dirs-$(CONFIG_PCI) += pci-bridge/ pci-host/ + devices-dirs-$(CONFIG_SOFTMMU) += scsi/ + devices-dirs-$(CONFIG_SOFTMMU) += sd/ + devices-dirs-$(CONFIG_SOFTMMU) += ssi/ + devices-dirs-$(CONFIG_SOFTMMU) += timer/ + devices-dirs-$(CONFIG_TPM) += tpm/ + devices-dirs-$(CONFIG_SOFTMMU) += usb/ + devices-dirs-$(CONFIG_VIRTIO) += virtio/ + devices-dirs-$(CONFIG_SOFTMMU) += watchdog/ + devices-dirs-$(CONFIG_SOFTMMU) += xen/ + devices-dirs-y += core/ + common-obj-y += $(devices-dirs-y) + obj-y += $(devices-dirs-y) ++>>>>>>> test1.5 diff --cc hw/arm/Makefile.objs index 70895c56e9,9e3a06fc18..77155ea31f --- a/hw/arm/Makefile.objs +++ b/hw/arm/Makefile.objs @@@ -1,36 -1,7 +1,44 @@@ ++<<<<<<< HEAD +obj-y = integratorcp.o versatilepb.o arm_pic.o +obj-y += arm_boot.o +obj-y += xilinx_zynq.o zynq_slcr.o +obj-y += arm_gic.o arm_gic_common.o +obj-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o +obj-y += exynos4210_gic.o exynos4210_combiner.o exynos4210.o +obj-y += exynos4_boards.o exynos4210_uart.o exynos4210_pwm.o +obj-y += exynos4210_pmu.o exynos4210_mct.o exynos4210_fimd.o +obj-y += exynos4210_rtc.o exynos4210_i2c.o +obj-y += exynos4210_cmu.o exynos4210_g3d.o +obj-y += exynos4210_i2s.o exynos4210_audio.o +obj-y += arm_mptimer.o a15mpcore.o +obj-y += armv7m.o armv7m_nvic.o stellaris.o stellaris_enet.o +obj-y += highbank.o +obj-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o +obj-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o +obj-y += gumstix.o +obj-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o +obj-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o \ + omap_gpio.o omap_intc.o omap_uart.o +obj-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \ + omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o +obj-y += omap_sx1.o palm.o tsc210x.o +obj-y += nseries.o blizzard.o onenand.o cbus.o tusb6010.o usb/hcd-musb.o +obj-y += mst_fpga.o mainstone.o +obj-y += z2.o +obj-y += musicpal.o bitbang_i2c.o marvell_88w8618_audio.o +obj-y += framebuffer.o +obj-y += vexpress.o +obj-y += strongarm.o +obj-y += collie.o +obj-y += imx_serial.o imx_ccm.o imx_timer.o imx_avic.o +obj-y += kzm.o +obj-$(CONFIG_FDT) += ../device_tree.o ++======= + obj-y += boot.o collie.o exynos4_boards.o gumstix.o highbank.o + obj-y += integratorcp.o kzm.o mainstone.o musicpal.o nseries.o + obj-y += omap_sx1.o palm.o pic_cpu.o realview.o spitz.o stellaris.o + obj-y += tosa.o versatilepb.o vexpress.o xilinx_zynq.o z2.o ++>>>>>>> test1.5 - obj-y := $(addprefix ../,$(obj-y)) + obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o + obj-y += omap1.o omap2.o strongarm.o diff --cc hw/usb/dev-hid.c index bbc48ca96c,b48899d500..13c8adb585 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@@ -23,16 -23,12 +23,16 @@@ * THE SOFTWARE. */ #include "hw/hw.h" - #include "console.h" + #include "ui/console.h" #include "hw/usb.h" #include "hw/usb/desc.h" - #include "qemu-timer.h" - #include "hw/hid.h" + #include "qemu/timer.h" + #include "hw/input/hid.h" +#ifdef CONFIG_MARU +#include "../tizen/src/mloop_event.h" +#endif + /* HID interface requests */ #define GET_REPORT 0xa101 #define GET_IDLE 0xa102 diff --cc hw/usb/dev-storage.c index 0efd16658d,1073901af1..2532de8838 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@@ -8,20 -8,16 +8,20 @@@ */ #include "qemu-common.h" - #include "qemu-option.h" - #include "qemu-config.h" + #include "qemu/option.h" + #include "qemu/config-file.h" #include "hw/usb.h" #include "hw/usb/desc.h" - #include "hw/scsi.h" - #include "console.h" - #include "monitor.h" - #include "sysemu.h" - #include "blockdev.h" + #include "hw/scsi/scsi.h" + #include "ui/console.h" + #include "monitor/monitor.h" + #include "sysemu/sysemu.h" + #include "sysemu/blockdev.h" +#ifdef CONFIG_MARU +#include "../tizen/src/mloop_event.h" +#endif + //#define DEBUG_MSD #ifdef DEBUG_MSD @@@ -499,20 -542,11 +546,18 @@@ static void usb_msd_handle_data(USBDevi default: DPRINTF("Bad token\n"); fail: - ret = USB_RET_STALL; + p->status = USB_RET_STALL; break; } - - return ret; } +#ifdef CONFIG_MARU +static void usb_msd_handle_destroy(USBDevice *dev) +{ + mloop_evcmd_set_usbdisk(NULL); +} +#endif + static void usb_msd_password_cb(void *opaque, int err) { MSDState *s = opaque; @@@ -700,15 -751,29 +769,32 @@@ static void usb_msd_class_initfn_common uc->handle_reset = usb_msd_handle_reset; uc->handle_control = usb_msd_handle_control; uc->handle_data = usb_msd_handle_data; +#ifdef CONFIG_MARU + uc->handle_destroy = usb_msd_handle_destroy; +#endif dc->fw_name = "storage"; dc->vmsd = &vmstate_usb_msd; + } + + static void usb_msd_class_initfn_storage(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); + USBDeviceClass *uc = USB_DEVICE_CLASS(klass); + + uc->init = usb_msd_initfn_storage; dc->props = msd_properties; + usb_msd_class_initfn_common(klass); } - static TypeInfo msd_info = { + static void usb_msd_class_initfn_bot(ObjectClass *klass, void *data) + { + USBDeviceClass *uc = USB_DEVICE_CLASS(klass); + + uc->init = usb_msd_initfn_bot; + usb_msd_class_initfn_common(klass); + } + + static const TypeInfo msd_info = { .name = "usb-storage", .parent = TYPE_USB_DEVICE, .instance_size = sizeof(MSDState), diff --cc main-loop.c index b09a82ab67,cf36645af4..79b1e2b2c5 --- a/main-loop.c +++ b/main-loop.c @@@ -29,74 -30,7 +30,78 @@@ #ifndef _WIN32 ++<<<<<<< HEAD +#include "compatfd.h" + +static int io_thread_fd = -1; + +void qemu_notify_event(void) +{ + /* Write 8 bytes to be compatible with eventfd. */ + static const uint64_t val = 1; + ssize_t ret; + + if (io_thread_fd == -1) { + return; + } + + qemu_notify_hax_event(); + + do { + ret = write(io_thread_fd, &val, sizeof(val)); + } while (ret < 0 && errno == EINTR); + + /* EAGAIN is fine, a read must be pending. */ + if (ret < 0 && errno != EAGAIN) { + fprintf(stderr, "qemu_notify_event: write() failed: %s\n", + strerror(errno)); + exit(1); + } +} + +static void qemu_event_read(void *opaque) +{ + int fd = (intptr_t)opaque; + ssize_t len; + char buffer[512]; + + /* Drain the notify pipe. For eventfd, only 8 bytes will be read. */ + do { + len = read(fd, buffer, sizeof(buffer)); + } while ((len == -1 && errno == EINTR) || len == sizeof(buffer)); +} + +static int qemu_event_init(void) +{ + int err; + int fds[2]; + + err = qemu_eventfd(fds); + if (err == -1) { + return -errno; + } + err = fcntl_setfl(fds[0], O_NONBLOCK); + if (err < 0) { + goto fail; + } + err = fcntl_setfl(fds[1], O_NONBLOCK); + if (err < 0) { + goto fail; + } + qemu_set_fd_handler2(fds[0], NULL, qemu_event_read, NULL, + (void *)(intptr_t)fds[0]); + + io_thread_fd = fds[1]; + return 0; + +fail: + close(fds[0]); + close(fds[1]); + return err; +} ++======= + #include "qemu/compatfd.h" ++>>>>>>> test1.5 /* If we have signalfd, we mask out the signals we want to handle and then * use signalfd to listen for them. We rely on whatever the current signal @@@ -186,37 -116,26 +187,37 @@@ AioContext *qemu_get_aio_context(void void qemu_notify_event(void) { - if (!qemu_event_handle) { + if (!qemu_aio_context) { return; } ++<<<<<<< HEAD + + qemu_notify_hax_event(); + + if (!SetEvent(qemu_event_handle)) { + fprintf(stderr, "qemu_notify_event: SetEvent failed: %ld\n", + GetLastError()); + exit(1); + } ++======= + aio_notify(qemu_aio_context); ++>>>>>>> test1.5 } - static int qemu_signal_init(void) - { - return 0; - } - #endif + static GArray *gpollfds; - int main_loop_init(void) + int qemu_init_main_loop(void) { int ret; + GSource *src; - qemu_mutex_lock_iothread(); - ret = qemu_signal_init(); - if (ret) { - return ret; + init_clocks(); + if (init_timer_alarm() < 0) { + fprintf(stderr, "could not initialize alarm timer\n"); + exit(1); } - /* Note eventfd must be drained before signalfd handlers run */ - ret = qemu_event_init(); + ret = qemu_signal_init(); if (ret) { return ret; } diff --cc os-win32.c index cf59e623cd,50b7f6f885..99f2b97a49 --- a/os-win32.c +++ b/os-win32.c @@@ -67,35 -68,20 +68,31 @@@ static BOOL WINAPI qemu_ctrl_handler(DW return TRUE; } ++<<<<<<< HEAD +#ifdef CONFIG_MARU +void os_setup_early_signal_handling(void) +{ + SetConsoleCtrlHandler(qemu_ctrl_handler, TRUE); +} +#else +void os_setup_early_signal_handling(void) ++======= + static TIMECAPS mm_tc; + + static void os_undo_timer_resolution(void) ++>>>>>>> test1.5 { - /* Note: cpu_interrupt() is currently not SMP safe, so we force - QEMU to run on a single CPU */ - HANDLE h; - DWORD_PTR mask, smask; - int i; + timeEndPeriod(mm_tc.wPeriodMin); + } + void os_setup_early_signal_handling(void) + { SetConsoleCtrlHandler(qemu_ctrl_handler, TRUE); - - h = GetCurrentProcess(); - if (GetProcessAffinityMask(h, &mask, &smask)) { - for(i = 0; i < 32; i++) { - if (mask & (1 << i)) - break; - } - if (i != 32) { - mask = 1 << i; - SetProcessAffinityMask(h, mask); - } - } + timeGetDevCaps(&mm_tc, sizeof(mm_tc)); + timeBeginPeriod(mm_tc.wPeriodMin); + atexit(os_undo_timer_resolution); } +#endif /* CONFIG_MARU */ /* Look for support files in the same directory as the executable. */ char *os_find_datadir(const char *argv0) diff --cc qemu-char.c index 921185ff11,efe706df3f..3319b85795 --- a/qemu-char.c +++ b/qemu-char.c @@@ -1805,33 -1919,6 +1932,36 @@@ static CharDriverState *qemu_chr_open_w return qemu_chr_open_win_file(GetStdHandle(STD_OUTPUT_HANDLE)); } ++<<<<<<< HEAD +static CharDriverState *qemu_chr_open_win_file_out(QemuOpts *opts) +{ + const char *file_out = qemu_opt_get(opts, "path"); + HANDLE fd_out; + +#ifndef CONFIG_MARU + fd_out = CreateFile(file_out, GENERIC_WRITE, FILE_SHARE_READ, NULL, + OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); +#else + int open_flags = O_BINARY | O_RDWR | O_CREAT | O_TRUNC; + + int ret = qemu_open(file_out, open_flags, 0644); + if (ret < 0) { + error_report("qemu_chr_open_win_file_out failed(%d) \n", ret); + return -errno; + } + fd_out = (HANDLE)_get_osfhandle(ret); + +#endif + + if (fd_out == INVALID_HANDLE_VALUE) { + return NULL; + } + + return qemu_chr_open_win_file(fd_out); +} + ++======= ++>>>>>>> test1.5 static int win_stdio_write(CharDriverState *chr, const uint8_t *buf, int len) { HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); diff --cc qemu-options.hx index 4be6d46960,fb62b75ccb..5799d97d0c --- a/qemu-options.hx +++ b/qemu-options.hx @@@ -2828,32 -3048,9 +3076,38 @@@ the @var{simple} tracing backend @end table ETEXI ++<<<<<<< HEAD +DEF("max-touch-point", HAS_ARG, QEMU_OPTION_max_touch_point, \ + "-max-touch-point [count]\n" + " define maximum number of touch point\n", + QEMU_ARCH_ALL) +STEXI +@item -max-touch-point @var{max_count} +@findex -max-touch-point +Use @var{max_count} as Integer +ETEXI + +DEF("disable-skin", 0, QEMU_OPTION_disable_skin, \ + "-disable-skin\n" + " do not start with java skin process\n", + QEMU_ARCH_ALL) +STEXI +@item -disable-skin +@findex -disable-skin +ETEXI + +DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, + "-qtest CHR specify tracing options\n", + QEMU_ARCH_ALL) + +DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, + "-qtest-log LOG specify tracing options\n", + QEMU_ARCH_ALL) ++======= + HXCOMM Internal use + DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) + DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL) ++>>>>>>> test1.5 #ifdef __linux__ DEF("enable-fips", 0, QEMU_OPTION_enablefips, diff --cc target-i386/translate.c index bf5fccdc3d,14b0298749..f165937a37 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@@ -7977,16 -8362,8 +8363,16 @@@ static inline void gen_intermediate_cod if (num_insns + 1 == max_insns && (tb->cflags & CF_LAST_IO)) gen_io_start(); - pc_ptr = disas_insn(dc, pc_ptr); + pc_ptr = disas_insn(env, dc, pc_ptr); num_insns++; +#ifdef CONFIG_HAX + if (hax_enabled() && hax_stop_translate(env)) + { + gen_jmp_im(pc_ptr - dc->cs_base); + gen_eob(dc); + break; + } +#endif /* stop translation if indicated */ if (dc->is_jmp) break; diff --cc tcg/i386/tcg-target.c index 88ab27e985,9eec06c8a4..45c55e65ff --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@@ -983,26 -1020,7 +1020,18 @@@ static const void *qemu_st_helpers[4] helper_stl_mmu, helper_stq_mmu, }; - #else - /* legacy helper signature: __ld_mmu(target_ulong addr, int - mmu_idx) */ - static void *qemu_ld_helpers[4] = { - __ldb_mmu, - __ldw_mmu, - __ldl_mmu, - __ldq_mmu, - }; - /* legacy helper signature: __st_mmu(target_ulong addr, uintxx_t val, - int mmu_idx) */ - static void *qemu_st_helpers[4] = { - __stb_mmu, - __stw_mmu, - __stl_mmu, - __stq_mmu, - }; - #endif ++static void add_qemu_ldst_label(TCGContext *s, ++ int is_ld, ++ int opc, ++ int data_reg, ++ int data_reg2, ++ int addrlo_reg, ++ int addrhi_reg, ++ int mem_index, ++ uint8_t *raddr, ++ uint8_t **label_ptr); + static void add_qemu_ldst_label(TCGContext *s, int is_ld, int opc, @@@ -1200,8 -1241,7 +1252,12 @@@ static void tcg_out_qemu_ld(TCGContext label_ptr, offsetof(CPUTLBEntry, addr_read)); /* TLB Hit. */ ++<<<<<<< HEAD + tcg_out_qemu_ld_direct(s, data_reg, data_reg2, + tcg_target_call_iarg_regs[0], 0, opc); ++======= + tcg_out_qemu_ld_direct(s, data_reg, data_reg2, TCG_REG_L1, 0, 0, opc); ++>>>>>>> test1.5 /* Record the current context of a load into ldst label */ add_qemu_ldst_label(s, @@@ -1325,86 -1368,84 +1384,164 @@@ static void tcg_out_qemu_st(TCGContext label_ptr, offsetof(CPUTLBEntry, addr_write)); /* TLB Hit. */ - tcg_out_qemu_st_direct(s, data_reg, data_reg2, - tcg_target_call_iarg_regs[0], 0, opc); + tcg_out_qemu_st_direct(s, data_reg, data_reg2, TCG_REG_L1, 0, 0, opc); + + /* Record the current context of a store into ldst label */ + add_qemu_ldst_label(s, + 0, + opc, + data_reg, + data_reg2, + args[addrlo_idx], + args[addrlo_idx + 1], + mem_index, + s->code_ptr, + label_ptr); + #else + { + int32_t offset = GUEST_BASE; + int base = args[addrlo_idx]; + int seg = 0; + + /* ??? We assume all operations have left us with register contents + that are zero extended. So far this appears to be true. If we + want to enforce this, we can either do an explicit zero-extension + here, or (if GUEST_BASE == 0, or a segment register is in use) + use the ADDR32 prefix. For now, do nothing. */ + if (GUEST_BASE && guest_base_flags) { + seg = guest_base_flags; + offset = 0; + } else if (TCG_TARGET_REG_BITS == 64 && offset != GUEST_BASE) { + tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_L1, GUEST_BASE); + tgen_arithr(s, ARITH_ADD + P_REXW, TCG_REG_L1, base); + base = TCG_REG_L1; + offset = 0; + } + + tcg_out_qemu_st_direct(s, data_reg, data_reg2, base, offset, seg, opc); + } + #endif + } + + #if defined(CONFIG_SOFTMMU) + /* + * Record the context of a call to the out of line helper code for the slow path + * for a load or store, so that we can later generate the correct helper code + */ + static void add_qemu_ldst_label(TCGContext *s, + int is_ld, + int opc, + int data_reg, + int data_reg2, + int addrlo_reg, + int addrhi_reg, + int mem_index, + uint8_t *raddr, + uint8_t **label_ptr) + { + int idx; + TCGLabelQemuLdst *label; + + if (s->nb_qemu_ldst_labels >= TCG_MAX_QEMU_LDST) { + tcg_abort(); + } + + idx = s->nb_qemu_ldst_labels++; + label = (TCGLabelQemuLdst *)&s->qemu_ldst_labels[idx]; + label->is_ld = is_ld; + label->opc = opc; + label->datalo_reg = data_reg; + label->datahi_reg = data_reg2; + label->addrlo_reg = addrlo_reg; + label->addrhi_reg = addrhi_reg; + label->mem_index = mem_index; + label->raddr = raddr; + label->label_ptr[0] = label_ptr[0]; + if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { + label->label_ptr[1] = label_ptr[1]; + } + } ++<<<<<<< HEAD + /* Record the current context of a store into ldst label */ + add_qemu_ldst_label(s, + 0, + opc, + data_reg, + data_reg2, + args[addrlo_idx], + args[addrlo_idx + 1], + mem_index, + s->code_ptr, + label_ptr); +#else + { + int32_t offset = GUEST_BASE; + int base = args[addrlo_idx]; + + if (TCG_TARGET_REG_BITS == 64) { + /* ??? We assume all operations have left us with register + contents that are zero extended. So far this appears to + be true. If we want to enforce this, we can either do + an explicit zero-extension here, or (if GUEST_BASE == 0) + use the ADDR32 prefix. For now, do nothing. */ + + if (offset != GUEST_BASE) { + tcg_out_movi(s, TCG_TYPE_I64, + tcg_target_call_iarg_regs[0], GUEST_BASE); + tgen_arithr(s, ARITH_ADD + P_REXW, + tcg_target_call_iarg_regs[0], base); + base = tcg_target_call_iarg_regs[0]; + offset = 0; + } + } + + tcg_out_qemu_st_direct(s, data_reg, data_reg2, base, offset, opc); + } +#endif +} + +#if defined(CONFIG_SOFTMMU) +/* + * Record the context of a call to the out of line helper code for the slow path + * for a load or store, so that we can later generate the correct helper code + */ +static void add_qemu_ldst_label(TCGContext *s, + int is_ld, + int opc, + int data_reg, + int data_reg2, + int addrlo_reg, + int addrhi_reg, + int mem_index, + uint8_t *raddr, + uint8_t **label_ptr) +{ + int idx; + TCGLabelQemuLdst *label; + + if (s->nb_qemu_ldst_labels >= TCG_MAX_QEMU_LDST) { + tcg_abort(); + } + + idx = s->nb_qemu_ldst_labels++; + label = (TCGLabelQemuLdst *)&s->qemu_ldst_labels[idx]; + label->is_ld = is_ld; + label->opc = opc; + label->datalo_reg = data_reg; + label->datahi_reg = data_reg2; + label->addrlo_reg = addrlo_reg; + label->addrhi_reg = addrhi_reg; + label->mem_index = mem_index; + label->raddr = raddr; + label->label_ptr[0] = label_ptr[0]; + if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { + label->label_ptr[1] = label_ptr[1]; + } +} + ++======= ++>>>>>>> test1.5 /* * Generate code for the slow path for a load at the end of block */ @@@ -1440,25 -1481,12 +1577,34 @@@ static void tcg_out_qemu_ld_slow_path(T } tcg_out_push(s, addrlo_reg); stack_adjust += 4; ++<<<<<<< HEAD +#ifdef CONFIG_TCG_PASS_AREG0 + tcg_out_push(s, TCG_AREG0); + stack_adjust += 4; +#endif +#else + /* The first argument is already loaded with addrlo. */ + tcg_out_movi(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[1], + mem_index); +#ifdef CONFIG_TCG_PASS_AREG0 + /* XXX/FIXME: suboptimal */ + tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[3], + tcg_target_call_iarg_regs[2]); + tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[2], + tcg_target_call_iarg_regs[1]); + tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[1], + tcg_target_call_iarg_regs[0]); + tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[0], + TCG_AREG0); +#endif ++======= + tcg_out_push(s, TCG_AREG0); + stack_adjust += 4; + #else + tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[0], TCG_AREG0); + /* The second argument is already loaded with addrlo. */ + tcg_out_movi(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[2], mem_index); ++>>>>>>> test1.5 #endif /* Code generation of qemu_ld/st's slow path calling MMU helper @@@ -1530,25 -1558,25 +1676,47 @@@ /* Jump to the code corresponding to next IR of qemu_st */ tcg_out_jmp(s, (tcg_target_long)raddr); } ++<<<<<<< HEAD + +/* + * Generate code for the slow path for a store at the end of block + */ +static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *label) +{ + int s_bits; + int stack_adjust; + int opc = label->opc; + int mem_index = label->mem_index; + int data_reg = label->datalo_reg; +#if TCG_TARGET_REG_BITS == 32 + int data_reg2 = label->datahi_reg; + int addrlo_reg = label->addrlo_reg; + int addrhi_reg = label->addrhi_reg; +#endif + uint8_t *raddr = label->raddr; + uint8_t **label_ptr = &label->label_ptr[0]; + ++======= + + /* + * Generate code for the slow path for a store at the end of block + */ + static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *label) + { + int s_bits; + int stack_adjust; + int opc = label->opc; + int mem_index = label->mem_index; + int data_reg = label->datalo_reg; + #if TCG_TARGET_REG_BITS == 32 + int data_reg2 = label->datahi_reg; + int addrlo_reg = label->addrlo_reg; + int addrhi_reg = label->addrhi_reg; + #endif + uint8_t *raddr = label->raddr; + uint8_t **label_ptr = &label->label_ptr[0]; + ++>>>>>>> test1.5 s_bits = opc & 3; /* resolve label address */ diff --cc tcg/tcg.c index 5eac190d5a,1d8099cca8..2e96306539 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@@ -243,9 -234,8 +234,8 @@@ void tcg_context_init(TCGContext *s int *sorted_args; memset(s, 0, sizeof(*s)); - s->temps = s->static_temps; s->nb_globals = 0; - + /* Count total number of arguments and allocate the corresponding space */ total_args = 0; @@@ -299,8 -299,12 +299,17 @@@ void tcg_func_start(TCGContext *s s->nb_labels = 0; s->current_frame_offset = s->frame_start; ++<<<<<<< HEAD + gen_opc_ptr = gen_opc_buf; + gen_opparam_ptr = gen_opparam_buf; ++======= + #ifdef CONFIG_DEBUG_TCG + s->goto_tb_issue_mask = 0; + #endif + + s->gen_opc_ptr = s->gen_opc_buf; + s->gen_opparam_ptr = s->gen_opparam_buf; ++>>>>>>> test1.5 #if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU) /* Initialize qemu_ld/st labels to assist code generation at the end of TB diff --cc tcg/tcg.h index 08bbbd8d3b,df375cf31e..a0d46015a7 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@@ -199,9 -208,9 +208,15 @@@ typedef struct TCGLabelQemuLdst int addrhi_reg; /* reg index for high word of guest virtual addr */ int datalo_reg; /* reg index for low word to be loaded or stored */ int datahi_reg; /* reg index for high word to be loaded or stored */ ++<<<<<<< HEAD + int mem_index; /* soft MMU memory index */ + uint8_t *raddr; /* gen code addr of the next IR of qemu_ld/st IR */ + uint8_t *label_ptr[2]; /* label pointers to be updated */ ++======= + int mem_index; /* soft MMU memory index */ + uint8_t *raddr; /* gen code addr of the next IR of qemu_ld/st IR */ + uint8_t *label_ptr[2]; /* label pointers to be updated */ ++>>>>>>> test1.5 } TCGLabelQemuLdst; #endif @@@ -269,15 -278,24 +284,35 @@@ typedef int TCGv_i64 #define TCGV_UNUSED_I32(x) x = MAKE_TCGV_I32(-1) #define TCGV_UNUSED_I64(x) x = MAKE_TCGV_I64(-1) + #define TCGV_IS_UNUSED_I32(x) (GET_TCGV_I32(x) == -1) + #define TCGV_IS_UNUSED_I64(x) (GET_TCGV_I64(x) == -1) + /* call flags */ ++<<<<<<< HEAD +/* A pure function only reads its arguments and TCG global variables + and cannot raise exceptions. Hence a call to a pure function can be + safely suppressed if the return value is not used. */ +#define TCG_CALL_PURE 0x0010 +/* A const function only reads its arguments and does not use TCG + global variables. Hence a call to such a function does not + save TCG global variables back to their canonical location. */ +#define TCG_CALL_CONST 0x0020 ++======= + /* Helper does not read globals (either directly or through an exception). It + implies TCG_CALL_NO_WRITE_GLOBALS. */ + #define TCG_CALL_NO_READ_GLOBALS 0x0010 + /* Helper does not write globals */ + #define TCG_CALL_NO_WRITE_GLOBALS 0x0020 + /* Helper can be safely suppressed if the return value is not used. */ + #define TCG_CALL_NO_SIDE_EFFECTS 0x0040 + + /* convenience version of most used call flags */ + #define TCG_CALL_NO_RWG TCG_CALL_NO_READ_GLOBALS + #define TCG_CALL_NO_WG TCG_CALL_NO_WRITE_GLOBALS + #define TCG_CALL_NO_SE TCG_CALL_NO_SIDE_EFFECTS + #define TCG_CALL_NO_RWG_SE (TCG_CALL_NO_RWG | TCG_CALL_NO_SE) + #define TCG_CALL_NO_WG_SE (TCG_CALL_NO_WG | TCG_CALL_NO_SE) ++>>>>>>> test1.5 /* used to align parameters */ #define TCG_CALL_DUMMY_TCGV MAKE_TCGV_I32(-1) @@@ -368,7 -416,10 +433,14 @@@ struct TCGContext /* liveness analysis */ uint16_t *op_dead_args; /* for each operation, each bit tells if the corresponding argument is dead */ - ++<<<<<<< HEAD ++ ++======= + uint8_t *op_sync_args; /* for each operation, each bit tells if the + corresponding output argument needs to be + sync to memory. */ + ++>>>>>>> test1.5 /* tells in which temporary a given register is. It does not take into account fixed registers */ int reg_to_temp[TCG_TARGET_NB_REGS]; @@@ -406,8 -458,29 +479,36 @@@ #ifdef CONFIG_DEBUG_TCG int temps_in_use; + int goto_tb_issue_mask; + #endif + + uint16_t gen_opc_buf[OPC_BUF_SIZE]; + TCGArg gen_opparam_buf[OPPARAM_BUF_SIZE]; + + uint16_t *gen_opc_ptr; + TCGArg *gen_opparam_ptr; + target_ulong gen_opc_pc[OPC_BUF_SIZE]; + uint16_t gen_opc_icount[OPC_BUF_SIZE]; + uint8_t gen_opc_instr_start[OPC_BUF_SIZE]; + + /* Code generation */ + int code_gen_max_blocks; + uint8_t *code_gen_prologue; + uint8_t *code_gen_buffer; + size_t code_gen_buffer_size; + /* threshold to flush the translated code buffer */ + size_t code_gen_buffer_max_size; + uint8_t *code_gen_ptr; + + TBContext tb_ctx; + ++#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU) ++ /* labels info for qemu_ld/st IRs ++ The labels help to generate TLB miss case codes at the end of TB */ ++ TCGLabelQemuLdst *qemu_ldst_labels; ++ int nb_qemu_ldst_labels; +#endif + #if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU) /* labels info for qemu_ld/st IRs The labels help to generate TLB miss case codes at the end of TB */ diff --cc vl.c index daf3066551,efb073ff4a..64c22889de --- a/vl.c +++ b/vl.c @@@ -127,39 -117,39 +127,48 @@@ int qemu_main(int argc, char **argv, ch #include "hw/boards.h" #include "hw/usb.h" #include "hw/pcmcia.h" - #include "hw/pc.h" - #include "hw/isa.h" - #include "hw/baum.h" + #include "hw/i386/pc.h" + #include "hw/isa/isa.h" #include "hw/bt.h" - #include "hw/watchdog.h" - #include "hw/smbios.h" - #include "hw/xen.h" + #include "sysemu/watchdog.h" + #include "hw/i386/smbios.h" + #include "hw/xen/xen.h" #include "hw/qdev.h" #include "hw/loader.h" - #include "bt-host.h" - #include "net.h" + #include "monitor/qdev.h" + #include "sysemu/bt.h" + #include "net/net.h" #include "net/slirp.h" - #include "monitor.h" - #include "console.h" - #include "sysemu.h" - #include "gdbstub.h" - #include "qemu-timer.h" - #include "qemu-char.h" - #include "cache-utils.h" - #include "blockdev.h" - #include "hw/block-common.h" - #include "block-migration.h" - #include "dma.h" + #include "monitor/monitor.h" + #include "ui/console.h" + #include "sysemu/sysemu.h" + #include "exec/gdbstub.h" + #include "qemu/timer.h" + #include "sysemu/char.h" + #include "qemu/cache-utils.h" + #include "sysemu/blockdev.h" + #include "hw/block/block.h" + #include "migration/block.h" + #include "sysemu/tpm.h" + #include "sysemu/dma.h" #include "audio/audio.h" ++<<<<<<< HEAD +#include "migration.h" +#include "kvm.h" +#include "hax.h" +#include "qjson.h" +#include "qemu-option.h" +#include "qemu-config.h" ++======= + #include "migration/migration.h" + #include "sysemu/kvm.h" + #include "qapi/qmp/qjson.h" + #include "qemu/option.h" + #include "qemu/config-file.h" ++>>>>>>> test1.5 #include "qemu-options.h" #include "qmp-commands.h" - #include "main-loop.h" + #include "qemu/main-loop.h" #ifdef CONFIG_VIRTFS #include "fsdev/qemu-fsdev.h" #endif @@@ -173,37 -163,24 +182,44 @@@ #include "trace.h" #include "trace/control.h" - #include "qemu-queue.h" - #include "cpus.h" - #include "arch_init.h" - #include "osdep.h" + #include "qemu/queue.h" + #include "sysemu/cpus.h" + #include "sysemu/arch_init.h" + #include "qemu/osdep.h" #include "ui/qemu-spice.h" + #include "qapi/string-input-visitor.h" +#ifdef CONFIG_MARU +#include "tizen/src/maru_common.h" +#include "tizen/src/emulator.h" +#include "tizen/src/maru_err_table.h" +#include "tizen/src/emul_state.h" +#include "tizen/src/maru_display.h" +#include "tizen/src/skin/maruskin_operation.h" +#endif + //#define DEBUG_NET //#define DEBUG_SLIRP #define DEFAULT_RAM_SIZE 128 #define MAX_VIRTIO_CONSOLES 1 + #define MAX_SCLP_CONSOLES 1 ++<<<<<<< HEAD +#ifdef CONFIG_MARU +int skin_disabled = 0; +//virtio-gl +extern int enable_gl; +extern int enable_yagl; +#endif + +static const char *data_dir; ++======= + static const char *data_dir[16]; + static int data_dir_idx; ++>>>>>>> test1.5 const char *bios_name = NULL; enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB; DisplayType display_type = DT_DEFAULT; @@@ -257,11 -234,11 +273,12 @@@ int ctrl_grab = 0 unsigned int nb_prom_envs = 0; const char *prom_envs[MAX_PROM_ENVS]; int boot_menu; + bool boot_strict; uint8_t *boot_splash_filedata; - int boot_splash_filedata_size; + size_t boot_splash_filedata_size; uint8_t qemu_extra_params_fw[2]; + typedef struct FWBootEntry FWBootEntry; struct FWBootEntry { @@@ -288,10 -266,8 +306,15 @@@ static NotifierList exit_notifiers static NotifierList machine_init_done_notifiers = NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers); ++<<<<<<< HEAD +static int tcg_allowed = 1; +int kvm_allowed = 0; +int xen_allowed = 0; +int hax_allowed = 0; ++======= + static bool tcg_allowed = true; + bool xen_allowed; ++>>>>>>> test1.5 uint32_t xen_domid; enum xen_mode xen_mode = XEN_EMULATE; static int tcg_tb_size; @@@ -1669,11 -2021,8 +2073,15 @@@ static void main_loop(void #ifdef CONFIG_PROFILER int64_t ti; #endif + + hax_sync_vcpus(); + do { ++<<<<<<< HEAD + nonblocking = !(kvm_enabled()|| hax_enabled()) && last_io > 0; ++======= + nonblocking = !kvm_enabled() && !xen_enabled() && last_io > 0; ++>>>>>>> test1.5 #ifdef CONFIG_PROFILER ti = profile_getclock(); #endif @@@ -1769,11 -2124,12 +2183,20 @@@ static void select_vgahw (const char *p } else if (strstart(p, "xenfb", &opts)) { vga_interface_type = VGA_XENFB; } else if (strstart(p, "qxl", &opts)) { ++<<<<<<< HEAD + vga_interface_type = VGA_QXL; +#ifdef CONFIG_MARU + } else if (strstart(p, "maru", &opts)) { + vga_interface_type = VGA_MARU; +#endif ++======= + if (qxl_vga_available()) { + vga_interface_type = VGA_QXL; + } else { + fprintf(stderr, "Error: QXL VGA not available\n"); + exit(0); + } ++>>>>>>> test1.5 } else if (!strstart(p, "none", &opts)) { invalid_vga: fprintf(stderr, "Unknown vga type: %s\n", p); @@@ -1933,25 -2298,18 +2365,27 @@@ char *qemu_find_file(int type, const ch default: abort(); } - len = strlen(data_dir) + strlen(name) + strlen(subdir) + 2; - buf = g_malloc0(len); - snprintf(buf, len, "%s/%s%s", data_dir, subdir, name); - if (access(buf, R_OK)) { + + for (i = 0; i < data_dir_idx; i++) { + buf = g_strdup_printf("%s/%s%s", data_dir[i], subdir, name); + if (access(buf, R_OK) == 0) { + trace_load_file(name, buf); + return buf; + } g_free(buf); - return NULL; } - return buf; + return NULL; } +#ifdef CONFIG_MARU +const char *qemu_get_data_dir(void); + +const char *qemu_get_data_dir(void) +{ + return data_dir; +} +#endif + static int device_help_func(QemuOpts *opts, void *opaque) { return qdev_device_help(opts); @@@ -2299,10 -2690,9 +2774,16 @@@ static int configure_accelerator(void } if (!accel_initialised) { ++<<<<<<< HEAD + fprintf(stderr, "No accelerator found!\n"); +#ifdef CONFIG_MARU + maru_register_exit_msg(MARU_EXIT_UNKNOWN, "No accelerator found."); +#endif ++======= + if (!init_failed) { + fprintf(stderr, "No accelerator found!\n"); + } ++>>>>>>> test1.5 exit(1); } @@@ -2404,17 -2788,53 +2885,59 @@@ static void free_and_trace(gpointer mem free(mem); } - int qemu_init_main_loop(void) + static int object_set_property(const char *name, const char *value, void *opaque) { - return main_loop_init(); + Object *obj = OBJECT(opaque); + StringInputVisitor *siv; + Error *local_err = NULL; + + if (strcmp(name, "qom-type") == 0 || strcmp(name, "id") == 0) { + return 0; + } + + siv = string_input_visitor_new(value); + object_property_set(obj, string_input_get_visitor(siv), name, &local_err); + string_input_visitor_cleanup(siv); + + if (local_err) { + qerror_report_err(local_err); + error_free(local_err); + return -1; + } + + return 0; + } + + static int object_create(QemuOpts *opts, void *opaque) + { + const char *type = qemu_opt_get(opts, "qom-type"); + const char *id = qemu_opts_id(opts); + Object *obj; + + g_assert(type != NULL); + + if (id == NULL) { + qerror_report(QERR_MISSING_PARAMETER, "id"); + return -1; + } + + obj = object_new(type); + if (qemu_opt_foreach(opts, object_set_property, obj, 1) < 0) { + return -1; + } + + object_property_add_child(container_get(object_get_root(), "/objects"), + id, obj, NULL); + + return 0; } +#ifdef CONFIG_MARU +int use_qemu_display = 0; //0:use tizen qemu sdl, 1:use original qemu sdl +// W/A for preserve larger continuous heap for RAM. +void *preallocated_ptr = 0; +#endif + int main(int argc, char **argv, char **envp) { int i; @@@ -3373,32 -3846,34 +3964,60 @@@ case QEMU_OPTION_sandbox: opts = qemu_opts_parse(qemu_find_opts("sandbox"), optarg, 1); if (!opts) { - exit(0); + exit(1); } break; ++<<<<<<< HEAD + case QEMU_OPTION_enable_hax: +#ifdef CONFIG_HAX_BACKEND + olist = qemu_find_opts("machine"); + //qemu_opts_reset(olist); + hax_disable(0); + //qemu_opts_parse(olist, "accel=hax", 0); +#else + fprintf(stderr, + "HAX support is disabled, ignoring -enable-hax\n"); +#endif + break; +#ifdef CONFIG_MARU + case QEMU_OPTION_max_touch_point: + { + int cnt = atoi(optarg); + fprintf(stderr, "maxTouchPoint:%d\n", cnt); + set_emul_max_touch_point(cnt); + break; + } + case QEMU_OPTION_disable_skin: + skin_disabled = 1; + break; +#endif ++======= + case QEMU_OPTION_add_fd: + #ifndef _WIN32 + opts = qemu_opts_parse(qemu_find_opts("add-fd"), optarg, 0); + if (!opts) { + exit(1); + } + #else + error_report("File descriptor passing is disabled on this " + "platform"); + exit(1); + #endif + break; + case QEMU_OPTION_object: + opts = qemu_opts_parse(qemu_find_opts("object"), optarg, 1); + if (!opts) { + exit(1); + } + break; + case QEMU_OPTION_realtime: + opts = qemu_opts_parse(qemu_find_opts("realtime"), optarg, 0); + if (!opts) { + exit(1); + } + configure_realtime(opts); + break; ++>>>>>>> test1.5 default: os_parse_cmd_args(popt->index, optarg); } @@@ -3527,11 -4064,31 +4208,33 @@@ monitor_parse("vc:80Cx24C", "readline"); if (default_virtcon) add_device_config(DEV_VIRTCON, "vc:80Cx24C"); + if (default_sclp) { + add_device_config(DEV_SCLP, "vc:80Cx24C"); + } + } + + if (display_type == DT_DEFAULT && !display_remote) { + #if defined(CONFIG_GTK) + display_type = DT_GTK; + #elif defined(CONFIG_SDL) || defined(CONFIG_COCOA) + display_type = DT_SDL; + #elif defined(CONFIG_VNC) + vnc_display = "localhost:0,to=99"; + show_vnc_port = 1; + #else + display_type = DT_NONE; + #endif + } + + #if defined(CONFIG_GTK) + if (display_type == DT_GTK) { + early_gtk_display_init(); } + #endif +#ifndef CONFIG_MARU socket_init(); +#endif if (qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, 1) != 0) exit(1); @@@ -3732,13 -4293,17 +4445,27 @@@ qdev_machine_init(); ++<<<<<<< HEAD +#ifdef CONFIG_MARU + // return variable points different address from input variable. + kernel_cmdline = prepare_maru_devices(kernel_cmdline); +#endif + + machine->init(ram_size, boot_devices, + kernel_filename, kernel_cmdline, initrd_filename, cpu_model); ++======= + QEMUMachineInitArgs args = { .ram_size = ram_size, + .boot_device = (boot_devices[0] == '\0') ? + machine->boot_order : + boot_devices, + .kernel_filename = kernel_filename, + .kernel_cmdline = kernel_cmdline, + .initrd_filename = initrd_filename, + .cpu_model = cpu_model }; + machine->init(&args); + + audio_init(); ++>>>>>>> test1.5 cpu_synchronize_all_post_init(); @@@ -3746,12 -4311,8 +4473,12 @@@ current_machine = machine; + if (hax_enabled()) { + hax_sync_vcpus(); + } + /* init USB devices */ - if (usb_enabled) { + if (usb_enabled(false)) { if (foreach_device_config(DEV_USB, usb_parse) < 0) exit(1); } @@@ -3762,24 -4323,7 +4489,28 @@@ net_check_clients(); ++<<<<<<< HEAD + /* just use the first displaystate for the moment */ + ds = get_displaystate(); + + if (using_spice) + display_remote++; + if (display_type == DT_DEFAULT && !display_remote) { +#if defined(CONFIG_SDL) || defined(CONFIG_COCOA) + display_type = DT_SDL; +#elif defined(CONFIG_VNC) + vnc_display = "localhost:0,to=99"; + show_vnc_port = 1; +#elif defined(CONFIG_MARU) && defined (__APPLE__) + display_type = DT_MARU; +#else + display_type = DT_NONE; +#endif + } + ++======= + ds = init_displaystate(); ++>>>>>>> test1.5 /* init local displays */ switch (display_type) { @@@ -3811,16 -4343,10 +4542,23 @@@ cocoa_display_init(ds, full_screen); break; #endif ++<<<<<<< HEAD +#if defined(CONFIG_MARU) && defined(__APPLE__) + case DT_MARU: + maru_display_init(ds); + if (skin_disabled == 1) { + //do not start skin client process + set_emul_skin_enable(0); + } else { + set_emul_skin_enable(1); + } + break; ++======= + #if defined(CONFIG_GTK) + case DT_GTK: + gtk_display_init(ds); + break; ++>>>>>>> test1.5 #endif default: break; @@@ -3902,13 -4414,8 +4626,12 @@@ vm_start(); } +#ifdef CONFIG_MARU + prepare_maru(); +#endif + os_setup_post(); - resume_all_vcpus(); main_loop(); bdrv_close_all(); pause_all_vcpus();