Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into…
Browse files Browse the repository at this point in the history
… staging

* KVM startup speedup (Chao Peng)
* configure fixes and cleanups (David, Thomas)
* ctags fix (Sergey)
* NBD cleanups (Peter, Eric)
* "-L help" command line option (Richard)
* More esp.c bugfixes (me, Prasad)
* KVM_CAP_MAX_VCPU_ID support (Greg)

# gpg: Signature made Thu 16 Jun 2016 17:39:10 BST
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# 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: (29 commits)
  vl: smp_parse: cleanups
  scsi: esp: make cmdbuf big enough for maximum CDB size
  scsi: esp: clean up handle_ti/esp_do_dma if s->do_cmd
  scsi: esp: respect FIFO invariant after message phase
  scsi: esp: check buffer length before reading scsi command
  nbd: Avoid magic number for NBD max name size
  nbd: Detect servers that send unexpected error values
  nbd: Clean up ioctl handling of qemu-nbd -c
  nbd: Group all Linux-specific ioctl code in one place
  nbd: Reject unknown request flags
  nbd: Improve server handling of bogus commands
  nbd: Quit server after any write error
  nbd: More debug typo fixes, use correct formats
  nbd: Use BDRV_REQ_FUA for better FUA where supported
  vl.c: Add '-L help' which lists data dirs.
  KVM: use KVM_CAP_MAX_VCPU_ID
  scsi-disk: Use (unsigned long) typecasts when using "%lu" format string
  target-i386: kvm: cache KVM_GET_SUPPORTED_CPUID data
  nbd: simplify the nbd_request and nbd_reply structs
  nbd: Don't use cpu_to_*w() functions
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Jun 16, 2016
2 parents dc278c5 + 0544edd commit 585fcd4
Show file tree
Hide file tree
Showing 77 changed files with 273 additions and 291 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -498,12 +498,12 @@ test speed: all

.PHONY: ctags
ctags:
rm -f $@
rm -f tags
find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +

.PHONY: TAGS
TAGS:
rm -f $@
rm -f TAGS
find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +

cscope:
Expand Down
1 change: 0 additions & 1 deletion audio/ossaudio.c
Expand Up @@ -22,7 +22,6 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
#include "qemu-common.h"
Expand Down
5 changes: 0 additions & 5 deletions block/qcow2-cache.c
Expand Up @@ -24,11 +24,6 @@

/* Needed for CONFIG_MADVISE */
#include "qemu/osdep.h"

#if defined(CONFIG_MADVISE) || defined(CONFIG_POSIX_MADVISE)
#include <sys/mman.h>
#endif

#include "block/block_int.h"
#include "qemu-common.h"
#include "qcow2.h"
Expand Down
1 change: 0 additions & 1 deletion bsd-user/elfload.c
@@ -1,7 +1,6 @@
/* This is the Linux kernel elf-loading code, ported into user space */

#include "qemu/osdep.h"
#include <sys/mman.h>

#include "qemu.h"
#include "disas/disas.h"
Expand Down
1 change: 0 additions & 1 deletion bsd-user/main.c
Expand Up @@ -18,7 +18,6 @@
*/
#include "qemu/osdep.h"
#include <machine/trap.h>
#include <sys/mman.h>

#include "qemu.h"
#include "qemu/path.h"
Expand Down
1 change: 0 additions & 1 deletion bsd-user/mmap.c
Expand Up @@ -17,7 +17,6 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
#include <sys/mman.h>

#include "qemu.h"
#include "qemu-common.h"
Expand Down
1 change: 0 additions & 1 deletion bsd-user/syscall.c
Expand Up @@ -19,7 +19,6 @@
#include "qemu/osdep.h"
#include "qemu/cutils.h"
#include "qemu/path.h"
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/param.h>
#include <sys/sysctl.h>
Expand Down
57 changes: 13 additions & 44 deletions configure
Expand Up @@ -270,7 +270,6 @@ aix="no"
blobs="yes"
pkgversion=""
pie=""
zero_malloc=""
qom_cast_debug="yes"
trace_backends="log"
trace_file="trace"
Expand Down Expand Up @@ -1389,11 +1388,9 @@ fi

# Consult white-list to determine whether to enable werror
# by default. Only enable by default for git builds
z_version=$(cut -f3 -d. $source_path/VERSION)

if test -z "$werror" ; then
if test -d "$source_path/.git" -a \
"$linux" = "yes" ; then
\( "$linux" = "yes" -o "$mingw32" = "yes" \) ; then
werror="yes"
else
werror="no"
Expand Down Expand Up @@ -1782,13 +1779,20 @@ fi
# avx2 optimization requirement check

cat > $TMPC << EOF
static void bar(void) {}
#pragma GCC push_options
#pragma GCC target("avx2")
#include <cpuid.h>
#include <immintrin.h>
static int bar(void *a) {
return _mm256_movemask_epi8(_mm256_cmpeq_epi8(*(__m256i *)a, (__m256i){0}));
}
static void *bar_ifunc(void) {return (void*) bar;}
static void foo(void) __attribute__((ifunc("bar_ifunc")));
int main(void) { foo(); return 0; }
int foo(void *a) __attribute__((ifunc("bar_ifunc")));
int main(int argc, char *argv[]) { return foo(argv[0]);}
EOF
if compile_prog "-mavx2" "" ; then
if readelf --syms $TMPE |grep "IFUNC.*foo" >/dev/null 2>&1; then
if compile_object "" ; then
if readelf --syms $TMPO |grep "IFUNC.*foo" >/dev/null 2>&1; then
avx2_opt="yes"
fi
fi
Expand Down Expand Up @@ -4177,24 +4181,6 @@ if compile_prog "" "" ; then
posix_madvise=yes
fi

##########################################
# check if we have usable SIGEV_THREAD_ID

sigev_thread_id=no
cat > $TMPC << EOF
#include <signal.h>
int main(void) {
struct sigevent ev;
ev.sigev_notify = SIGEV_THREAD_ID;
ev._sigev_un._tid = 0;
asm volatile("" : : "g"(&ev));
return 0;
}
EOF
if compile_prog "" "" ; then
sigev_thread_id=yes
fi

##########################################
# check if trace backend exists

Expand Down Expand Up @@ -4574,16 +4560,6 @@ if test "$libnfs" != "no" ; then
fi
fi

# Disable zero malloc errors for official releases unless explicitly told to
# enable/disable
if test -z "$zero_malloc" ; then
if test "$z_version" = "50" ; then
zero_malloc="no"
else
zero_malloc="yes"
fi
fi

# Now we've finished running tests it's OK to add -Werror to the compiler flags
if test "$werror" = "yes"; then
QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
Expand Down Expand Up @@ -4862,7 +4838,6 @@ echo "preadv support $preadv"
echo "fdatasync $fdatasync"
echo "madvise $madvise"
echo "posix_madvise $posix_madvise"
echo "sigev_thread_id $sigev_thread_id"
echo "uuid support $uuid"
echo "libcap-ng support $cap_ng"
echo "vhost-net support $vhost_net"
Expand Down Expand Up @@ -5277,9 +5252,6 @@ fi
if test "$posix_madvise" = "yes" ; then
echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak
fi
if test "$sigev_thread_id" = "yes" ; then
echo "CONFIG_SIGEV_THREAD_ID=y" >> $config_host_mak
fi

if test "$spice" = "yes" ; then
echo "CONFIG_SPICE=y" >> $config_host_mak
Expand Down Expand Up @@ -5342,9 +5314,6 @@ if [ "$bsd" = "yes" ] ; then
echo "CONFIG_BSD=y" >> $config_host_mak
fi

if test "$zero_malloc" = "yes" ; then
echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak
fi
if test "$localtime_r" = "yes" ; then
echo "CONFIG_LOCALTIME_R=y" >> $config_host_mak
fi
Expand Down
1 change: 0 additions & 1 deletion contrib/ivshmem-server/ivshmem-server.c
Expand Up @@ -10,7 +10,6 @@
#include "qemu/host-utils.h"
#include "qemu/sockets.h"

#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/un.h>

Expand Down
1 change: 0 additions & 1 deletion exec.c
Expand Up @@ -19,7 +19,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#ifndef _WIN32
#include <sys/mman.h>
#endif

#include "qemu/cutils.h"
Expand Down
1 change: 0 additions & 1 deletion hw/block/xen_disk.c
Expand Up @@ -21,7 +21,6 @@

#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/uio.h>

#include "hw/hw.h"
Expand Down
1 change: 0 additions & 1 deletion hw/char/xen_console.c
Expand Up @@ -22,7 +22,6 @@
#include "qemu/osdep.h"
#include <sys/select.h>
#include <termios.h>
#include <sys/mman.h>

#include "hw/hw.h"
#include "sysemu/char.h"
Expand Down
1 change: 0 additions & 1 deletion hw/display/xenfb.c
Expand Up @@ -25,7 +25,6 @@
*/

#include "qemu/osdep.h"
#include <sys/mman.h>

#include "hw/hw.h"
#include "ui/console.h"
Expand Down
1 change: 0 additions & 1 deletion hw/i386/kvm/pci-assign.c
Expand Up @@ -22,7 +22,6 @@
*/
#include "qemu/osdep.h"
#include "qapi/error.h"
#include <sys/mman.h>
#include "hw/hw.h"
#include "hw/i386/pc.h"
#include "qemu/error-report.h"
Expand Down
2 changes: 0 additions & 2 deletions hw/misc/ivshmem.c
Expand Up @@ -36,8 +36,6 @@

#include "hw/misc/ivshmem.h"

#include <sys/mman.h>

#define PCI_VENDOR_ID_IVSHMEM PCI_VENDOR_ID_REDHAT_QUMRANET
#define PCI_DEVICE_ID_IVSHMEM 0x1110

Expand Down
3 changes: 0 additions & 3 deletions hw/misc/pc-testdev.c
Expand Up @@ -36,9 +36,6 @@
*/

#include "qemu/osdep.h"
#if defined(CONFIG_POSIX)
#include <sys/mman.h>
#endif
#include "hw/hw.h"
#include "hw/qdev.h"
#include "hw/isa/isa.h"
Expand Down
1 change: 1 addition & 0 deletions hw/net/net_tx_pkt.c
Expand Up @@ -15,6 +15,7 @@
*
*/

#include "qemu/osdep.h"
#include "net_tx_pkt.h"
#include "net/eth.h"
#include "net/checksum.h"
Expand Down
1 change: 0 additions & 1 deletion hw/net/net_tx_pkt.h
Expand Up @@ -18,7 +18,6 @@
#ifndef NET_TX_PKT_H
#define NET_TX_PKT_H

#include "qemu/osdep.h"
#include "net/eth.h"
#include "exec/hwaddr.h"

Expand Down
1 change: 0 additions & 1 deletion hw/net/xen_nic.c
Expand Up @@ -22,7 +22,6 @@
#include "qemu/osdep.h"
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/wait.h>

#include "hw/hw.h"
Expand Down
22 changes: 12 additions & 10 deletions hw/scsi/esp.c
Expand Up @@ -98,6 +98,9 @@ static uint32_t get_cmd(ESPState *s, uint8_t *buf, uint8_t buflen)
s->dma_memory_read(s->dma_opaque, buf, dmalen);
} else {
dmalen = s->ti_size;
if (dmalen > TI_BUFSZ) {
return 0;
}
memcpy(buf, s->ti_buf, dmalen);
buf[0] = buf[2] >> 5;
}
Expand Down Expand Up @@ -219,7 +222,7 @@ static void write_response(ESPState *s)
} else {
s->ti_size = 2;
s->ti_rptr = 0;
s->ti_wptr = 0;
s->ti_wptr = 2;
s->rregs[ESP_RFLAGS] = 2;
}
esp_raise_irq(s);
Expand All @@ -242,15 +245,12 @@ static void esp_do_dma(ESPState *s)
uint32_t len;
int to_device;

to_device = (s->ti_size < 0);
len = s->dma_left;
if (s->do_cmd) {
trace_esp_do_dma(s->cmdlen, len);
assert (s->cmdlen <= sizeof(s->cmdbuf) &&
len <= sizeof(s->cmdbuf) - s->cmdlen);
s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len);
s->ti_size = 0;
s->cmdlen = 0;
s->do_cmd = 0;
do_cmd(s, s->cmdbuf);
return;
}
if (s->async_len == 0) {
Expand All @@ -260,6 +260,7 @@ static void esp_do_dma(ESPState *s)
if (len > s->async_len) {
len = s->async_len;
}
to_device = (s->ti_size < 0);
if (to_device) {
s->dma_memory_read(s->dma_opaque, s->async_buf, len);
} else {
Expand Down Expand Up @@ -315,6 +316,7 @@ void esp_transfer_data(SCSIRequest *req, uint32_t len)
{
ESPState *s = req->hba_private;

assert(!s->do_cmd);
trace_esp_transfer_data(s->dma_left, s->ti_size);
s->async_len = len;
s->async_buf = scsi_req_get_buf(req);
Expand Down Expand Up @@ -345,7 +347,7 @@ static void handle_ti(ESPState *s)
s->dma_counter = dmalen;

if (s->do_cmd)
minlen = (dmalen < 32) ? dmalen : 32;
minlen = (dmalen < ESP_CMDBUF_SZ) ? dmalen : ESP_CMDBUF_SZ;
else if (s->ti_size < 0)
minlen = (dmalen < -s->ti_size) ? dmalen : -s->ti_size;
else
Expand All @@ -355,13 +357,13 @@ static void handle_ti(ESPState *s)
s->dma_left = minlen;
s->rregs[ESP_RSTAT] &= ~STAT_TC;
esp_do_dma(s);
} else if (s->do_cmd) {
}
if (s->do_cmd) {
trace_esp_handle_ti_cmd(s->cmdlen);
s->ti_size = 0;
s->cmdlen = 0;
s->do_cmd = 0;
do_cmd(s, s->cmdbuf);
return;
}
}

Expand Down Expand Up @@ -449,7 +451,7 @@ void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val)
break;
case ESP_FIFO:
if (s->do_cmd) {
if (s->cmdlen < TI_BUFSZ) {
if (s->cmdlen < ESP_CMDBUF_SZ) {
s->cmdbuf[s->cmdlen++] = val & 0xff;
} else {
trace_esp_error_fifo_overrun();
Expand Down
8 changes: 4 additions & 4 deletions hw/scsi/scsi-disk.c
Expand Up @@ -2060,13 +2060,13 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
}
break;
case MODE_SELECT:
DPRINTF("Mode Select(6) (len %lu)\n", (long)r->req.cmd.xfer);
DPRINTF("Mode Select(6) (len %lu)\n", (unsigned long)r->req.cmd.xfer);
break;
case MODE_SELECT_10:
DPRINTF("Mode Select(10) (len %lu)\n", (long)r->req.cmd.xfer);
DPRINTF("Mode Select(10) (len %lu)\n", (unsigned long)r->req.cmd.xfer);
break;
case UNMAP:
DPRINTF("Unmap (len %lu)\n", (long)r->req.cmd.xfer);
DPRINTF("Unmap (len %lu)\n", (unsigned long)r->req.cmd.xfer);
break;
case VERIFY_10:
case VERIFY_12:
Expand All @@ -2080,7 +2080,7 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
case WRITE_SAME_16:
DPRINTF("WRITE SAME %d (len %lu)\n",
req->cmd.buf[0] == WRITE_SAME_10 ? 10 : 16,
(long)r->req.cmd.xfer);
(unsigned long)r->req.cmd.xfer);
break;
default:
DPRINTF("Unknown SCSI command (%2.2x=%s)\n", buf[0],
Expand Down
1 change: 0 additions & 1 deletion hw/usb/xen-usb.c
Expand Up @@ -21,7 +21,6 @@

#include "qemu/osdep.h"
#include <libusb.h>
#include <sys/mman.h>

#include "qemu-common.h"
#include "qemu/config-file.h"
Expand Down

0 comments on commit 585fcd4

Please sign in to comment.