summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure12
-rw-r--r--fpu/softfloat-specialize.h2
-rw-r--r--hw/virtio/vhost-user.c127
-rw-r--r--include/fpu/softfloat.h4
-rw-r--r--pc-bios/optionrom/Makefile12
-rw-r--r--target-arm/neon_helper.c2
6 files changed, 76 insertions, 83 deletions
diff --git a/configure b/configure
index 8d849191db..4b808f9d17 100755
--- a/configure
+++ b/configure
@@ -4699,7 +4699,16 @@ roms=
if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
"$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
"$softmmu" = yes ; then
- roms="optionrom"
+ # Different host OS linkers have different ideas about the name of the ELF
+ # emulation. Linux and OpenBSD use 'elf_i386'; FreeBSD uses the _fbsd
+ # variant; and Windows uses i386pe.
+ for emu in elf_i386 elf_i386_fbsd i386pe; do
+ if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then
+ ld_i386_emulation="$emu"
+ roms="optionrom"
+ break
+ fi
+ done
fi
if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
roms="$roms spapr-rtas"
@@ -5539,6 +5548,7 @@ fi
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak
echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak
+echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
echo "LIBS+=$LIBS" >> $config_host_mak
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
echo "PTHREAD_LIB=$PTHREAD_LIB" >> $config_host_mak
diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h
index 43d08903a5..f5aed72e8f 100644
--- a/fpu/softfloat-specialize.h
+++ b/fpu/softfloat-specialize.h
@@ -197,7 +197,7 @@ float128 float128_default_nan(float_status *status)
| should be simply `float_exception_flags |= flags;'.
*----------------------------------------------------------------------------*/
-void float_raise(int8_t flags, float_status *status)
+void float_raise(uint8_t flags, float_status *status)
{
status->float_exception_flags |= flags;
}
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 1a7d53c8f4..b57454a4b7 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -263,6 +263,66 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
return 0;
}
+static int vhost_user_set_mem_table(struct vhost_dev *dev,
+ struct vhost_memory *mem)
+{
+ int fds[VHOST_MEMORY_MAX_NREGIONS];
+ int i, fd;
+ size_t fd_num = 0;
+ bool reply_supported = virtio_has_feature(dev->protocol_features,
+ VHOST_USER_PROTOCOL_F_REPLY_ACK);
+
+ VhostUserMsg msg = {
+ .request = VHOST_USER_SET_MEM_TABLE,
+ .flags = VHOST_USER_VERSION,
+ };
+
+ if (reply_supported) {
+ msg.flags |= VHOST_USER_NEED_REPLY_MASK;
+ }
+
+ for (i = 0; i < dev->mem->nregions; ++i) {
+ struct vhost_memory_region *reg = dev->mem->regions + i;
+ ram_addr_t offset;
+ MemoryRegion *mr;
+
+ assert((uintptr_t)reg->userspace_addr == reg->userspace_addr);
+ mr = memory_region_from_host((void *)(uintptr_t)reg->userspace_addr,
+ &offset);
+ fd = memory_region_get_fd(mr);
+ if (fd > 0) {
+ msg.payload.memory.regions[fd_num].userspace_addr = reg->userspace_addr;
+ msg.payload.memory.regions[fd_num].memory_size = reg->memory_size;
+ msg.payload.memory.regions[fd_num].guest_phys_addr = reg->guest_phys_addr;
+ msg.payload.memory.regions[fd_num].mmap_offset = offset;
+ assert(fd_num < VHOST_MEMORY_MAX_NREGIONS);
+ fds[fd_num++] = fd;
+ }
+ }
+
+ msg.payload.memory.nregions = fd_num;
+
+ if (!fd_num) {
+ error_report("Failed initializing vhost-user memory map, "
+ "consider using -object memory-backend-file share=on");
+ return -1;
+ }
+
+ msg.size = sizeof(msg.payload.memory.nregions);
+ msg.size += sizeof(msg.payload.memory.padding);
+ msg.size += fd_num * sizeof(VhostUserMemoryRegion);
+
+ if (vhost_user_write(dev, &msg, fds, fd_num) < 0) {
+ return -1;
+ }
+
+ if (reply_supported) {
+ return process_message_reply(dev, msg.request);
+ }
+
+ return 0;
+}
+
static int vhost_user_set_vring_addr(struct vhost_dev *dev,
struct vhost_vring_addr *addr)
{
@@ -477,73 +537,6 @@ static int vhost_user_get_features(struct vhost_dev *dev, uint64_t *features)
return vhost_user_get_u64(dev, VHOST_USER_GET_FEATURES, features);
}
-static int vhost_user_set_mem_table(struct vhost_dev *dev,
- struct vhost_memory *mem)
-{
- int fds[VHOST_MEMORY_MAX_NREGIONS];
- int i, fd;
- size_t fd_num = 0;
- uint64_t features;
- bool reply_supported = virtio_has_feature(dev->protocol_features,
- VHOST_USER_PROTOCOL_F_REPLY_ACK);
-
- VhostUserMsg msg = {
- .request = VHOST_USER_SET_MEM_TABLE,
- .flags = VHOST_USER_VERSION,
- };
-
- if (reply_supported) {
- msg.flags |= VHOST_USER_NEED_REPLY_MASK;
- }
-
- for (i = 0; i < dev->mem->nregions; ++i) {
- struct vhost_memory_region *reg = dev->mem->regions + i;
- ram_addr_t offset;
- MemoryRegion *mr;
-
- assert((uintptr_t)reg->userspace_addr == reg->userspace_addr);
- mr = memory_region_from_host((void *)(uintptr_t)reg->userspace_addr,
- &offset);
- fd = memory_region_get_fd(mr);
- if (fd > 0) {
- msg.payload.memory.regions[fd_num].userspace_addr
- = reg->userspace_addr;
- msg.payload.memory.regions[fd_num].memory_size = reg->memory_size;
- msg.payload.memory.regions[fd_num].guest_phys_addr
- = reg->guest_phys_addr;
- msg.payload.memory.regions[fd_num].mmap_offset = offset;
- assert(fd_num < VHOST_MEMORY_MAX_NREGIONS);
- fds[fd_num++] = fd;
- }
- }
-
- msg.payload.memory.nregions = fd_num;
-
- if (!fd_num) {
- error_report("Failed initializing vhost-user memory map, "
- "consider using -object memory-backend-file share=on");
- return -1;
- }
-
- msg.size = sizeof(msg.payload.memory.nregions);
- msg.size += sizeof(msg.payload.memory.padding);
- msg.size += fd_num * sizeof(VhostUserMemoryRegion);
-
- vhost_user_write(dev, &msg, fds, fd_num);
-
- if (reply_supported) {
- return process_message_reply(dev, msg.request);
- } else {
- /* Note: It is (yet) unknown when the client application has finished
- * remapping the GPA.
- * Attempt to prevent a race by sending a command that requires a reply.
- */
- vhost_user_get_features(dev, &features);
- }
-
- return 0;
-}
-
static int vhost_user_set_owner(struct vhost_dev *dev)
{
VhostUserMsg msg = {
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index 0e57ee53c0..1bde349b74 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -198,7 +198,7 @@ enum {
typedef struct float_status {
signed char float_detect_tininess;
signed char float_rounding_mode;
- signed char float_exception_flags;
+ uint8_t float_exception_flags;
signed char floatx80_rounding_precision;
/* should denormalised results go to zero and set the inexact flag? */
flag flush_to_zero;
@@ -274,7 +274,7 @@ static inline flag get_default_nan_mode(float_status *status)
| Routine to raise any or all of the software IEC/IEEE floating-point
| exception flags.
*----------------------------------------------------------------------------*/
-void float_raise(int8_t flags, float_status *status);
+void float_raise(uint8_t flags, float_status *status);
/*----------------------------------------------------------------------------
| If `a' is denormal and we are in flush-to-zero mode then set the
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 8aef152262..9bdc49798c 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -48,18 +48,8 @@ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin
%.o: %.S
$(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@," AS $(TARGET_DIR)$@")
-ifdef CONFIG_WIN32
-LD_EMULATION = i386pe
-else
-ifdef CONFIG_BSD
-LD_EMULATION = elf_i386_fbsd
-else
-LD_EMULATION = elf_i386
-endif
-endif
-
%.img: %.o
- $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<," Building $(TARGET_DIR)$@")
+ $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<," Building $(TARGET_DIR)$@")
%.raw: %.img
$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@," Building $(TARGET_DIR)$@")
diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
index 1f1844f5b2..ebdf7c9b10 100644
--- a/target-arm/neon_helper.c
+++ b/target-arm/neon_helper.c
@@ -1051,7 +1051,7 @@ uint64_t HELPER(neon_qrshl_u64)(CPUARMState *env, uint64_t val, uint64_t shiftop
if (tmp >= (ssize_t)sizeof(src1) * 8) { \
if (src1) { \
SET_QC(); \
- dest = (1 << (sizeof(src1) * 8 - 1)); \
+ dest = (typeof(dest))(1 << (sizeof(src1) * 8 - 1)); \
if (src1 > 0) { \
dest--; \
} \