diff options
-rwxr-xr-x | configure | 59 | ||||
-rw-r--r-- | dump.c | 5 | ||||
-rw-r--r-- | hw/cpu/cluster.c | 3 | ||||
-rw-r--r-- | hw/input/tsc210x.c | 18 | ||||
-rw-r--r-- | hw/sparc/sun4m.c | 25 | ||||
-rw-r--r-- | hw/sparc64/sun4u.c | 17 | ||||
-rw-r--r-- | hw/unicore32/puv3.c | 1 | ||||
-rw-r--r-- | include/qemu-common.h | 2 | ||||
-rw-r--r-- | linux-user/fd-trans.c | 8 | ||||
-rw-r--r-- | linux-user/syscall.c | 68 | ||||
-rw-r--r-- | scripts/dump-guest-memory.py | 1 | ||||
-rw-r--r-- | target/hppa/gdbstub.c | 2 | ||||
-rw-r--r-- | target/hppa/op_helper.c | 14 | ||||
-rw-r--r-- | target/hppa/translate.c | 2 | ||||
-rw-r--r-- | target/moxie/cpu.c | 2 | ||||
-rw-r--r-- | target/moxie/cpu.h | 4 | ||||
-rw-r--r-- | target/moxie/helper.c | 4 | ||||
-rw-r--r-- | target/moxie/mmu.c | 4 | ||||
-rw-r--r-- | target/moxie/translate.c | 4 |
19 files changed, 142 insertions, 101 deletions
@@ -1834,8 +1834,8 @@ fi # Consult white-list to determine whether to enable werror # by default. Only enable by default for git builds if test -z "$werror" ; then - if test -d "$source_path/.git" -a \ - \( "$linux" = "yes" -o "$mingw32" = "yes" \) ; then + if test -d "$source_path/.git" && \ + { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then werror="yes" else werror="no" @@ -2940,7 +2940,7 @@ EOF sdl=yes # static link with sdl ? (note: sdl.pc's --static --libs is broken) - if test "$sdl" = "yes" -a "$static" = "yes" ; then + if test "$sdl" = "yes" && test "$static" = "yes" ; then if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then sdl_libs="$sdl_libs $(aalib-config --static-libs 2>/dev/null)" sdl_cflags="$sdl_cflags $(aalib-config --cflags 2>/dev/null)" @@ -3082,7 +3082,7 @@ fi ########################################## # VNC SASL detection -if test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then +if test "$vnc" = "yes" && test "$vnc_sasl" != "no" ; then cat > $TMPC <<EOF #include <sasl/sasl.h> #include <stdio.h> @@ -3105,7 +3105,7 @@ fi ########################################## # VNC JPEG detection -if test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then +if test "$vnc" = "yes" && test "$vnc_jpeg" != "no" ; then cat > $TMPC <<EOF #include <stdio.h> #include <jpeglib.h> @@ -3127,7 +3127,7 @@ fi ########################################## # VNC PNG detection -if test "$vnc" = "yes" -a "$vnc_png" != "no" ; then +if test "$vnc" = "yes" && test "$vnc_png" != "no" ; then cat > $TMPC <<EOF //#include <stdio.h> #include <png.h> @@ -3491,7 +3491,7 @@ fi # This workaround is required due to a bug in pkg-config file for glib as it # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static -if test "$static" = yes -a "$mingw32" = yes; then +if test "$static" = yes && test "$mingw32" = yes; then QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS" fi @@ -3584,7 +3584,7 @@ fi ########################################## # pixman support probe -if test "$want_tools" = "no" -a "$softmmu" = "no"; then +if test "$want_tools" = "no" && test "$softmmu" = "no"; then pixman_cflags= pixman_libs= elif $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then @@ -3699,7 +3699,7 @@ else done fi -if test "$mingw32" != yes -a "$pthread" = no; then +if test "$mingw32" != yes && test "$pthread" = no; then error_exit "pthread check failed" \ "Make sure to have the pthread libs and headers installed." fi @@ -3826,7 +3826,7 @@ fi ########################################## # TPM passthrough is only on x86 Linux -if test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64; then +if test "$targetos" = Linux && { test "$cpu" = i386 || test "$cpu" = x86_64; }; then tpm_passthrough=$tpm else tpm_passthrough=no @@ -3992,7 +3992,7 @@ EOF fi fi -if test "$opengl" = "yes" -a "$have_x11" = "yes"; then +if test "$opengl" = "yes" && test "$have_x11" = "yes"; then for target in $target_list; do case $target in lm32-softmmu) # milkymist-tmu2 requires X11 and OpenGL @@ -4696,7 +4696,8 @@ fi ########################################## # check if we have VSS SDK headers for win -if test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$vss_win32_sdk" != "no" ; then +if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \ + test "$vss_win32_sdk" != "no" ; then case "$vss_win32_sdk" in "") vss_win32_include="-isystem $source_path" ;; *\ *) # The SDK is installed in "Program Files" by default, but we cannot @@ -4735,7 +4736,8 @@ fi # VSS provider from the source. It is usually unnecessary because the # pre-compiled .tlb file is included. -if test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$guest_agent_with_vss" = "yes" ; then +if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \ + test "$guest_agent_with_vss" = "yes" ; then if test -z "$win_sdk"; then programfiles="$PROGRAMFILES" test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432" @@ -4751,7 +4753,7 @@ fi ########################################## # check if mingw environment provides a recent ntddscsi.h -if test "$mingw32" = "yes" -a "$guest_agent" != "no"; then +if test "$mingw32" = "yes" && test "$guest_agent" != "no"; then cat > $TMPC << EOF #include <windows.h> #include <ntddscsi.h> @@ -4798,7 +4800,7 @@ case "$capstone" in "" | yes) if $pkg_config capstone; then capstone=system - elif test -e "${source_path}/.git" -a $git_update = 'yes' ; then + elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then capstone=git elif test -e "${source_path}/capstone/Makefile" ; then capstone=internal @@ -5170,7 +5172,7 @@ fi # There is no point enabling this if cpuid.h is not usable, # since we won't be able to select the new routines. -if test "$cpuid_h" = "yes" -a "$avx2_opt" != "no"; then +if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then cat > $TMPC << EOF #pragma GCC push_options #pragma GCC target("avx2") @@ -5228,7 +5230,7 @@ EOF fi cmpxchg128=no -if test "$int128" = yes -a "$atomic128" = no; then +if test "$int128" = yes && test "$atomic128" = no; then cat > $TMPC << EOF int main(void) { @@ -5901,9 +5903,9 @@ fi # Mac OS X ships with a broken assembler roms= -if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ - "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ - "$softmmu" = yes ; then +if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ + test "$targetos" != "Darwin" && test "$targetos" != "SunOS" && \ + test "$softmmu" = yes ; then # Different host OS linkers have different ideas about the name of the ELF # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe. @@ -5915,7 +5917,7 @@ if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ fi done fi -if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then +if test "$cpu" = "ppc64" && test "$targetos" != "Darwin" ; then roms="$roms spapr-rtas" fi @@ -6381,7 +6383,7 @@ if test "$modules" = "yes"; then echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak echo "CONFIG_MODULES=y" >> $config_host_mak fi -if test "$have_x11" = "yes" -a "$need_x11" = "yes"; then +if test "$have_x11" = "yes" && test "$need_x11" = "yes"; then echo "CONFIG_X11=y" >> $config_host_mak echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak echo "X11_LIBS=$x11_libs" >> $config_host_mak @@ -6576,7 +6578,7 @@ fi if test "$vhost_scsi" = "yes" ; then echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak fi -if test "$vhost_net" = "yes" -a "$vhost_user" = "yes"; then +if test "$vhost_net" = "yes" && test "$vhost_user" = "yes"; then echo "CONFIG_VHOST_NET_USED=y" >> $config_host_mak fi if test "$vhost_crypto" = "yes" ; then @@ -6971,11 +6973,11 @@ elif test "$ARCH" = "sparc64" ; then QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" elif test "$ARCH" = "s390x" ; then QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" -elif test "$ARCH" = "x86_64" -o "$ARCH" = "x32" ; then +elif test "$ARCH" = "x86_64" || test "$ARCH" = "x32" ; then QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" elif test "$ARCH" = "ppc64" ; then QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/ppc $QEMU_INCLUDES" -elif test "$ARCH" = "riscv32" -o "$ARCH" = "riscv64" ; then +elif test "$ARCH" = "riscv32" || test "$ARCH" = "riscv64" ; then QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/riscv $QEMU_INCLUDES" else QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" @@ -7392,7 +7394,7 @@ if test ! -z "$gdb_xml_files" ; then echo "TARGET_XML_FILES=$list" >> $config_target_mak fi -if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then +if test "$target_user_only" = "yes" && test "$bflt" = "yes"; then echo "TARGET_HAS_BFLT=y" >> $config_target_mak fi if test "$target_bsd_user" = "yes" ; then @@ -7514,7 +7516,7 @@ if test "$gprof" = "yes" ; then fi fi -if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then +if test "$target_linux_user" = "yes" || test "$target_bsd_user" = "yes" ; then ldflags="$ldflags $textseg_ldflags" fi @@ -7526,7 +7528,8 @@ fi # - we build the system emulation for s390x (qemu-system-s390x) # - KVM is enabled # - the linker supports --s390-pgste -if test "$TARGET_ARCH" = "s390x" -a "$target_softmmu" = "yes" -a "$ARCH" = "s390x" -a "$kvm" = "yes"; then +if test "$TARGET_ARCH" = "s390x" && test "$target_softmmu" = "yes" && \ + test "$ARCH" = "s390x" && test "$kvm" = "yes"; then if ld_has --s390-pgste ; then ldflags="-Wl,--s390-pgste $ldflags" fi @@ -192,7 +192,7 @@ static void write_elf64_load(DumpState *s, MemoryMapping *memory_mapping, phdr.p_paddr = cpu_to_dump64(s, memory_mapping->phys_addr); phdr.p_filesz = cpu_to_dump64(s, filesz); phdr.p_memsz = cpu_to_dump64(s, memory_mapping->length); - phdr.p_vaddr = cpu_to_dump64(s, memory_mapping->virt_addr); + phdr.p_vaddr = cpu_to_dump64(s, memory_mapping->virt_addr) ?: phdr.p_paddr; assert(memory_mapping->length >= filesz); @@ -216,7 +216,8 @@ static void write_elf32_load(DumpState *s, MemoryMapping *memory_mapping, phdr.p_paddr = cpu_to_dump32(s, memory_mapping->phys_addr); phdr.p_filesz = cpu_to_dump32(s, filesz); phdr.p_memsz = cpu_to_dump32(s, memory_mapping->length); - phdr.p_vaddr = cpu_to_dump32(s, memory_mapping->virt_addr); + phdr.p_vaddr = + cpu_to_dump32(s, memory_mapping->virt_addr) ?: phdr.p_paddr; assert(memory_mapping->length >= filesz); diff --git a/hw/cpu/cluster.c b/hw/cpu/cluster.c index 25f90702b1..6f5f037b3c 100644 --- a/hw/cpu/cluster.c +++ b/hw/cpu/cluster.c @@ -79,6 +79,9 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) dc->props = cpu_cluster_properties; dc->realize = cpu_cluster_realize; + + /* This is not directly for users, CPU children must be attached by code */ + dc->user_creatable = false; } static const TypeInfo cpu_cluster_type_info = { diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c index ded0db9351..2eb3cb9518 100644 --- a/hw/input/tsc210x.c +++ b/hw/input/tsc210x.c @@ -552,10 +552,8 @@ static void tsc2102_data_register_write( return; default: -#ifdef TSC_VERBOSE - fprintf(stderr, "tsc2102_data_register_write: " - "no such register: 0x%02x\n", reg); -#endif + qemu_log_mask(LOG_GUEST_ERROR, "tsc2102_data_register_write: " + "no such register: 0x%02x\n", reg); } } @@ -636,10 +634,8 @@ static void tsc2102_control_register_write( default: bad_reg: -#ifdef TSC_VERBOSE - fprintf(stderr, "tsc2102_control_register_write: " - "no such register: 0x%02x\n", reg); -#endif + qemu_log_mask(LOG_GUEST_ERROR, "tsc2102_control_register_write: " + "no such register: 0x%02x\n", reg); } } @@ -764,10 +760,8 @@ static void tsc2102_audio_register_write( return; default: -#ifdef TSC_VERBOSE - fprintf(stderr, "tsc2102_audio_register_write: " - "no such register: 0x%02x\n", reg); -#endif + qemu_log_mask(LOG_GUEST_ERROR, "tsc2102_audio_register_write: " + "no such register: 0x%02x\n", reg); } } diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 779f3f97d5..ca1e3825d5 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -224,11 +224,12 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr) static unsigned long sun4m_load_kernel(const char *kernel_filename, const char *initrd_filename, - ram_addr_t RAM_size) + ram_addr_t RAM_size, + uint32_t *initrd_size) { int linux_boot; unsigned int i; - long initrd_size, kernel_size; + long kernel_size; uint8_t *ptr; linux_boot = (kernel_filename != NULL); @@ -259,23 +260,23 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename, } /* load initrd */ - initrd_size = 0; + *initrd_size = 0; if (initrd_filename) { - initrd_size = load_image_targphys(initrd_filename, - INITRD_LOAD_ADDR, - RAM_size - INITRD_LOAD_ADDR); - if (initrd_size < 0) { + *initrd_size = load_image_targphys(initrd_filename, + INITRD_LOAD_ADDR, + RAM_size - INITRD_LOAD_ADDR); + if ((int)*initrd_size < 0) { error_report("could not load initial ram disk '%s'", initrd_filename); exit(1); } } - if (initrd_size > 0) { + if (*initrd_size > 0) { for (i = 0; i < 64 * TARGET_PAGE_SIZE; i += TARGET_PAGE_SIZE) { ptr = rom_ptr(KERNEL_LOAD_ADDR + i, 24); if (ptr && ldl_p(ptr) == 0x48647253) { /* HdrS */ stl_p(ptr + 16, INITRD_LOAD_ADDR); - stl_p(ptr + 20, initrd_size); + stl_p(ptr + 20, *initrd_size); break; } } @@ -846,6 +847,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, qemu_irq *cpu_irqs[MAX_CPUS], slavio_irq[32], slavio_cpu_irq[MAX_CPUS]; qemu_irq fdc_tc; unsigned long kernel_size; + uint32_t initrd_size; DriveInfo *fd[MAX_FD]; FWCfgState *fw_cfg; unsigned int num_vsimms; @@ -1024,9 +1026,10 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, empty_slot_init(hwdef->bpp_base, 0x20); } + initrd_size = 0; kernel_size = sun4m_load_kernel(machine->kernel_filename, machine->initrd_filename, - machine->ram_size); + machine->ram_size, &initrd_size); nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, machine->kernel_cmdline, machine->boot_order, machine->ram_size, kernel_size, @@ -1069,7 +1072,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, 0); } fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_ADDR, INITRD_LOAD_ADDR); - fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, 0); // not used + fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size); fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, machine->boot_order[0]); qemu_register_boot_set(fw_cfg_boot_set, fw_cfg); } diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index b9bd4be5d5..ff24d9b350 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -33,7 +33,6 @@ #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" #include "hw/pci-host/sabre.h" -#include "hw/i386/pc.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" #include "hw/timer/m48t59.h" @@ -214,6 +213,11 @@ typedef struct PowerDevice { } PowerDevice; /* Power */ +static uint64_t power_mem_read(void *opaque, hwaddr addr, unsigned size) +{ + return 0; +} + static void power_mem_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { @@ -224,6 +228,7 @@ static void power_mem_write(void *opaque, hwaddr addr, } static const MemoryRegionOps power_mem_ops = { + .read = power_mem_read, .write = power_mem_write, .endianness = DEVICE_NATIVE_ENDIAN, .valid = { @@ -596,7 +601,15 @@ static void sun4uv_init(MemoryRegion *address_space_mem, qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 4, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_SER_IRQ)); - pci_dev = pci_create_simple(pci_busA, PCI_DEVFN(2, 0), "VGA"); + switch (vga_interface_type) { + case VGA_STD: + pci_create_simple(pci_busA, PCI_DEVFN(2, 0), "VGA"); + break; + case VGA_NONE: + break; + default: + abort(); /* Should not happen - types are checked in vl.c already */ + } memset(&macaddr, 0, sizeof(MACAddr)); onboard_nic = false; diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index 830fe3face..b42e600f74 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -15,7 +15,6 @@ #include "ui/console.h" #include "hw/boards.h" #include "hw/loader.h" -#include "hw/i386/pc.h" #include "sysemu/qtest.h" #undef DEBUG_PUV3 diff --git a/include/qemu-common.h b/include/qemu-common.h index ed60ba251d..a102245519 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -17,7 +17,7 @@ #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) /* Copyright string for -version arguments, About dialogs, etc */ -#define QEMU_COPYRIGHT "Copyright (c) 2003-2018 " \ +#define QEMU_COPYRIGHT "Copyright (c) 2003-2019 " \ "Fabrice Bellard and the QEMU Project developers" /* Bug reporting information for --help arguments, About dialogs, etc */ diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index 216b9f0614..30425c9df6 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -129,6 +129,8 @@ enum { QEMU_IFLA_CARRIER_UP_COUNT, QEMU_IFLA_CARRIER_DOWN_COUNT, QEMU_IFLA_NEW_IFINDEX, + QEMU_IFLA_MIN_MTU, + QEMU_IFLA_MAX_MTU, QEMU___IFLA_MAX }; @@ -166,6 +168,8 @@ enum { QEMU_IFLA_BRPORT_BCAST_FLOOD, QEMU_IFLA_BRPORT_GROUP_FWD_MASK, QEMU_IFLA_BRPORT_NEIGH_SUPPRESS, + QEMU_IFLA_BRPORT_ISOLATED, + QEMU_IFLA_BRPORT_BACKUP_PORT, QEMU___IFLA_BRPORT_MAX }; @@ -510,6 +514,7 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr, case QEMU_IFLA_BRPORT_VLAN_TUNNEL: case QEMU_IFLA_BRPORT_BCAST_FLOOD: case QEMU_IFLA_BRPORT_NEIGH_SUPPRESS: + case QEMU_IFLA_BRPORT_ISOLATED: break; /* uint16_t */ case QEMU_IFLA_BRPORT_PRIORITY: @@ -523,6 +528,7 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr, break; /* uin32_t */ case QEMU_IFLA_BRPORT_COST: + case QEMU_IFLA_BRPORT_BACKUP_PORT: u32 = NLA_DATA(nlattr); *u32 = tswap32(*u32); break; @@ -787,6 +793,8 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr) case QEMU_IFLA_GSO_MAX_SIZE: case QEMU_IFLA_CARRIER_UP_COUNT: case QEMU_IFLA_CARRIER_DOWN_COUNT: + case QEMU_IFLA_MIN_MTU: + case QEMU_IFLA_MAX_MTU: u32 = RTA_DATA(rtattr); *u32 = tswap32(*u32); break; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bf076cbf8c..5bbb72f3d5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4187,28 +4187,33 @@ static abi_long do_ioctl_ifconf(const IOCTLEntry *ie, uint8_t *buf_temp, unlock_user(argptr, arg, 0); host_ifconf = (struct ifconf *)(unsigned long)buf_temp; - target_ifc_len = host_ifconf->ifc_len; target_ifc_buf = (abi_long)(unsigned long)host_ifconf->ifc_buf; - target_ifreq_size = thunk_type_size(ifreq_arg_type, 0); - nb_ifreq = target_ifc_len / target_ifreq_size; - host_ifc_len = nb_ifreq * sizeof(struct ifreq); - outbufsz = sizeof(*host_ifconf) + host_ifc_len; - if (outbufsz > MAX_STRUCT_SIZE) { - /* We can't fit all the extents into the fixed size buffer. - * Allocate one that is large enough and use it instead. - */ - host_ifconf = malloc(outbufsz); - if (!host_ifconf) { - return -TARGET_ENOMEM; + if (target_ifc_buf != 0) { + target_ifc_len = host_ifconf->ifc_len; + nb_ifreq = target_ifc_len / target_ifreq_size; + host_ifc_len = nb_ifreq * sizeof(struct ifreq); + + outbufsz = sizeof(*host_ifconf) + host_ifc_len; + if (outbufsz > MAX_STRUCT_SIZE) { + /* + * We can't fit all the extents into the fixed size buffer. + * Allocate one that is large enough and use it instead. + */ + host_ifconf = malloc(outbufsz); + if (!host_ifconf) { + return -TARGET_ENOMEM; + } + memcpy(host_ifconf, buf_temp, sizeof(*host_ifconf)); + free_buf = 1; } - memcpy(host_ifconf, buf_temp, sizeof(*host_ifconf)); - free_buf = 1; - } - host_ifc_buf = (char*)host_ifconf + sizeof(*host_ifconf); + host_ifc_buf = (char *)host_ifconf + sizeof(*host_ifconf); - host_ifconf->ifc_len = host_ifc_len; + host_ifconf->ifc_len = host_ifc_len; + } else { + host_ifc_buf = NULL; + } host_ifconf->ifc_buf = host_ifc_buf; ret = get_errno(safe_ioctl(fd, ie->host_cmd, host_ifconf)); @@ -4231,15 +4236,16 @@ static abi_long do_ioctl_ifconf(const IOCTLEntry *ie, uint8_t *buf_temp, thunk_convert(argptr, host_ifconf, arg_type, THUNK_TARGET); unlock_user(argptr, arg, target_size); - /* copy ifreq[] to target user */ - - argptr = lock_user(VERIFY_WRITE, target_ifc_buf, target_ifc_len, 0); - for (i = 0; i < nb_ifreq ; i++) { - thunk_convert(argptr + i * target_ifreq_size, - host_ifc_buf + i * sizeof(struct ifreq), - ifreq_arg_type, THUNK_TARGET); + if (target_ifc_buf != 0) { + /* copy ifreq[] to target user */ + argptr = lock_user(VERIFY_WRITE, target_ifc_buf, target_ifc_len, 0); + for (i = 0; i < nb_ifreq ; i++) { + thunk_convert(argptr + i * target_ifreq_size, + host_ifc_buf + i * sizeof(struct ifreq), + ifreq_arg_type, THUNK_TARGET); + } + unlock_user(argptr, target_ifc_buf, target_ifc_len); } - unlock_user(argptr, target_ifc_buf, target_ifc_len); } if (free_buf) { @@ -6762,9 +6768,15 @@ static int open_net_route(void *cpu_env, int fd) char iface[16]; uint32_t dest, gw, mask; unsigned int flags, refcnt, use, metric, mtu, window, irtt; - sscanf(line, "%s\t%08x\t%08x\t%04x\t%d\t%d\t%d\t%08x\t%d\t%u\t%u\n", - iface, &dest, &gw, &flags, &refcnt, &use, &metric, - &mask, &mtu, &window, &irtt); + int fields; + + fields = sscanf(line, + "%s\t%08x\t%08x\t%04x\t%d\t%d\t%d\t%08x\t%d\t%u\t%u\n", + iface, &dest, &gw, &flags, &refcnt, &use, &metric, + &mask, &mtu, &window, &irtt); + if (fields != 11) { + continue; + } dprintf(fd, "%s\t%08x\t%08x\t%04x\t%d\t%d\t%d\t%08x\t%d\t%u\t%u\n", iface, tswap32(dest), tswap32(gw), flags, refcnt, use, metric, tswap32(mask), mtu, window, irtt); diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py index 198cd0fe40..2c587cbefc 100644 --- a/scripts/dump-guest-memory.py +++ b/scripts/dump-guest-memory.py @@ -163,6 +163,7 @@ class ELF(object): phdr = get_arch_phdr(self.endianness, self.elfclass) phdr.p_type = p_type phdr.p_paddr = p_paddr + phdr.p_vaddr = p_paddr phdr.p_filesz = p_size phdr.p_memsz = p_size self.segments.append(phdr) diff --git a/target/hppa/gdbstub.c b/target/hppa/gdbstub.c index e2e9c4d77f..3157a690f2 100644 --- a/target/hppa/gdbstub.c +++ b/target/hppa/gdbstub.c @@ -266,7 +266,7 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) case 65 ... 127: { uint64_t *fr = &env->fr[(n - 64) / 2]; - *fr = deposit64(*fr, val, (n & 1 ? 0 : 32), 32); + *fr = deposit64(*fr, (n & 1 ? 0 : 32), 32, val); } break; default: diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 912e8d5be4..6bf478e7b0 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -665,11 +665,15 @@ void HELPER(reset)(CPUHPPAState *env) target_ureg HELPER(swap_system_mask)(CPUHPPAState *env, target_ureg nsm) { target_ulong psw = env->psw; - /* ??? On second reading this condition simply seems - to be undefined rather than a diagnosed trap. */ - if (nsm & ~psw & PSW_Q) { - hppa_dynamic_excp(env, EXCP_ILL, GETPC()); - } + /* + * Setting the PSW Q bit to 1, if it was not already 1, is an + * undefined operation. + * + * However, HP-UX 10.20 does this with the SSM instruction. + * Tested this on HP9000/712 and HP9000/785/C3750 and both + * machines set the Q bit from 0 to 1 without an exception, + * so let this go without comment. + */ env->psw = (psw & ~PSW_SM) | (nsm & PSW_SM); return psw & PSW_SM; } diff --git a/target/hppa/translate.c b/target/hppa/translate.c index ce05d5619d..51bfd9849d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2059,7 +2059,7 @@ static DisasJumpType trans_mfctl(DisasContext *ctx, uint32_t insn, /* FIXME: Respect PSW_S bit. */ nullify_over(ctx); tmp = dest_gpr(ctx, rt); - if (ctx->base.tb->cflags & CF_USE_ICOUNT) { + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { gen_io_start(); gen_helper_read_interval_timer(tmp); gen_io_end(); diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 8d67eb6727..46434e65ba 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -13,7 +13,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h index d40f1e6c45..080df4ee6f 100644 --- a/target/moxie/cpu.h +++ b/target/moxie/cpu.h @@ -6,14 +6,14 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ diff --git a/target/moxie/helper.c b/target/moxie/helper.c index 5b1532b837..f3d8ee7d6b 100644 --- a/target/moxie/helper.c +++ b/target/moxie/helper.c @@ -6,14 +6,14 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ diff --git a/target/moxie/mmu.c b/target/moxie/mmu.c index bd90b1eebc..87783a36f8 100644 --- a/target/moxie/mmu.c +++ b/target/moxie/mmu.c @@ -6,14 +6,14 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ diff --git a/target/moxie/translate.c b/target/moxie/translate.c index 29da02bc05..68ca223e22 100644 --- a/target/moxie/translate.c +++ b/target/moxie/translate.c @@ -5,7 +5,7 @@ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 of + * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but @@ -13,7 +13,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License + * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ |