Commit cb4e0f9d authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging



* i8254 security fix
* Avoid long 100% CPU wait after restarting guests that use the periodic timer
* Fixes for access clamping (WinXP, MIPS)
* wixl/.msi support for qemu-ga on Windows

# gpg: Signature made Fri Jun 19 11:30:53 2015 BST using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  exec: clamp accesses against the MemoryRegionSection
  exec: do not clamp accesses to MMIO regions
  mc146818rtc: Reset the periodic timer on load
  qemu-timer: Call clock reset notifiers on forward jumps
  tests: virtio-scsi: Add test for unaligned WRITE SAME
  tests: virtio-scsi: Move start/stop to individual test functions
  libqos: Complete virtio device ID definition list
  libqos: Allow calling guest_free on NULL pointer
  tests: Link libqos virtio object to virtio-scsi-test
  i8254: fix out-of-bounds memory access in pit_ioport_read()
  qemu-ga: Building Windows MSI installation with configure/Makefile
  qemu-ga: Introduce Windows MSI script
  qemu-ga: debug printouts to help troubleshoot installation
  qemu-ga: adding vss-[un]install options
  qemu-log: Open file for logging when specified

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents ad7020a7 e4a511f8
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ Makefile: ;
configure: ;

.PHONY: all clean cscope distclean dvi html info install install-doc \
	pdf recurse-all speed test dist
	pdf recurse-all speed test dist msi

$(call set-vpath, $(SRC_PATH))

@@ -287,10 +287,32 @@ $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
	$(call LINK, $^)

ifdef QEMU_GA_MSI_ENABLED
QEMU_GA_MSI=qemu-ga-$(ARCH).msi

msi: ${QEMU_GA_MSI}

$(QEMU_GA_MSI): qemu-ga.exe

ifdef QEMU_GA_MSI_WITH_VSS
$(QEMU_GA_MSI): qga/vss-win32/qga-vss.dll
endif

$(QEMU_GA_MSI): config-host.mak

$(QEMU_GA_MSI):  qga/installer/qemu-ga.wxs
	$(call quiet-command,QEMU_GA_VERSION="$(QEMU_GA_VERSION)" QEMU_GA_MANUFACTURER="$(QEMU_GA_MANUFACTURER)" QEMU_GA_DISTRO="$(QEMU_GA_DISTRO)" \
	wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<, "  WIXL  $@")
else
msi:
	@echo MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)
endif

clean:
# avoid old build problems by removing potentially incorrect old files
	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
	rm -f qemu-options.def
	rm -f *.msi
	find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
	rm -f fsdev/*.pod
+66 −0
Original line number Diff line number Diff line
@@ -315,6 +315,7 @@ snappy=""
bzip2=""
guest_agent=""
guest_agent_with_vss="no"
guest_agent_msi=""
vss_win32_sdk=""
win_sdk="no"
want_tools="yes"
@@ -1078,6 +1079,10 @@ for opt do
  ;;
  --disable-guest-agent) guest_agent="no"
  ;;
  --enable-guest-agent-msi) guest_agent_msi="yes"
  ;;
  --disable-guest-agent-msi) guest_agent_msi="no"
  ;;
  --with-vss-sdk) vss_win32_sdk=""
  ;;
  --with-vss-sdk=*) vss_win32_sdk="$optarg"
@@ -1394,6 +1399,8 @@ Advanced options (experts only):
                           reading bzip2-compressed dmg images)
  --disable-guest-agent    disable building of the QEMU Guest Agent
  --enable-guest-agent     enable building of the QEMU Guest Agent
  --enable-guest-agent-msi enable building guest agent Windows MSI installation package
  --disable-guest-agent-msi disable building guest agent Windows MSI installation
  --with-vss-sdk=SDK-path  enable Windows VSS support in QEMU Guest Agent
  --with-win-sdk=SDK-path  path to Windows Platform SDK (to build VSS .tlb)
  --disable-seccomp        disable seccomp support
@@ -3862,6 +3869,56 @@ if test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$guest_agent_with_vss"
fi

##########################################
# Guest agent Window MSI  package

if test "$guest_agent" != yes; then
  if test "$guest_agent_msi" = yes; then
    error_exit "MSI guest agent package requires guest agent enabled"
  fi
  guest_agent_msi=no
elif test "$mingw32" != "yes"; then
  if test "$guest_agent_msi" = "yes"; then
    error_exit "MSI guest agent package is available only for MinGW Windows cross-compilation"
  fi
  guest_agent_msi=no
elif ! has wixl; then
  if test "$guest_agent_msi" = "yes"; then
    error_exit "MSI guest agent package requires wixl tool installed ( usually from msitools package )"
  fi
  guest_agent_msi=no
fi

if test "$guest_agent_msi" != "no"; then
  if test "$guest_agent_with_vss" = "yes"; then
    QEMU_GA_MSI_WITH_VSS="-D InstallVss"
  fi

  if test "$QEMU_GA_MANUFACTURER" = ""; then
    QEMU_GA_MANUFACTURER=QEMU
  fi

  if test "$QEMU_GA_DISTRO" = ""; then
    QEMU_GA_DISTRO=Linux
  fi

  if test "$QEMU_GA_VERSION" = ""; then
      QEMU_GA_VERSION=`cat $source_path/VERSION`
  fi

  QEMU_GA_MSI_MINGW_DLL_PATH="-D Mingw_dlls=`$pkg_config --variable=prefix glib-2.0`/bin"
  
  case "$cpu" in
  x86_64)
    QEMU_GA_MSI_ARCH="-a x64 -D Arch=64"
    ;;
  i386)
    QEMU_GA_MSI_ARCH="-D Arch=32"
    ;;
  *)
    error_exit "CPU $cpu not supported for building installation package"
    ;;
  esac
fi

##########################################
# check if we have fdatasync
@@ -4558,6 +4615,15 @@ if test "$mingw32" = "yes" ; then
    echo "CONFIG_QGA_VSS=y" >> $config_host_mak
    echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak
  fi
  if test "$guest_agent_msi" != "no"; then
    echo "QEMU_GA_MSI_ENABLED=yes" >> $config_host_mak  
    echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
    echo "QEMU_GA_MSI_WITH_VSS=${QEMU_GA_MSI_WITH_VSS}" >> $config_host_mak
    echo "QEMU_GA_MSI_ARCH=${QEMU_GA_MSI_ARCH}" >> $config_host_mak
    echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
    echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
    echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
  fi
else
  echo "CONFIG_POSIX=y" >> $config_host_mak
fi
+6 −2
Original line number Diff line number Diff line
@@ -341,6 +341,7 @@ address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *x
                                 hwaddr *plen, bool resolve_subpage)
{
    MemoryRegionSection *section;
    MemoryRegion *mr;
    Int128 diff;

    section = address_space_lookup_region(d, addr, resolve_subpage);
@@ -350,8 +351,11 @@ address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *x
    /* Compute offset within MemoryRegion */
    *xlat = addr + section->offset_within_region;

    diff = int128_sub(section->mr->size, int128_make64(addr));
    mr = section->mr;
    if (memory_region_is_ram(mr)) {
        diff = int128_sub(section->size, int128_make64(addr));
        *plen = int128_get64(int128_min(diff, int128_make64(*plen)));
    }
    return section;
}

+6 −0
Original line number Diff line number Diff line
@@ -196,6 +196,12 @@ static uint64_t pit_ioport_read(void *opaque, hwaddr addr,
    PITChannelState *s;

    addr &= 3;

    if (addr == 3) {
        /* Mode/Command register is write only, read is ignored */
        return 0;
    }

    s = &pit->channels[addr];
    if (s->status_latched) {
        s->status_latched = 0;
+6 −0
Original line number Diff line number Diff line
@@ -723,6 +723,12 @@ static int rtc_post_load(void *opaque, int version_id)
        check_update_timer(s);
    }

    uint64_t now = qemu_clock_get_ns(rtc_clock);
    if (now < s->next_periodic_time ||
        now > (s->next_periodic_time + get_max_clock_jump())) {
        periodic_timer_update(s, qemu_clock_get_ns(rtc_clock));
    }

#ifdef TARGET_I386
    if (version_id >= 2) {
        if (s->lost_tick_policy == LOST_TICK_POLICY_SLEW) {
Loading