]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request...
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 8 Jun 2020 10:04:57 +0000 (11:04 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 8 Jun 2020 10:04:57 +0000 (11:04 +0100)
linux-user pull request 20200605-v2

Implement F_OFD_ fcntl() command, /proc/cpuinfo for hppa
Fix socket(), prnctl() error codes, underflow in target_mremap,
    epoll_create() strace, oldumount for alpha
User-mode build dependencies improvement

# gpg: Signature made Sat 06 Jun 2020 14:15:36 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-5.1-pull-request:
  stubs: Restrict ui/win32-kbd-hook to system-mode
  hw/core: Restrict CpuClass::get_crash_info() to system-mode
  target/s390x: Restrict CpuClass::get_crash_info() to system-mode
  target/i386: Restrict CpuClass::get_crash_info() to system-mode
  arch_init: Remove unused 'qapi-commands-misc.h' include
  exec: Assert CPU migration is not used on user-only build
  target/riscv/cpu: Restrict CPU migration to system-mode
  stubs/Makefile: Reduce the user-mode object list
  util/Makefile: Reduce the user-mode object list
  tests/Makefile: Restrict some softmmu-only tests
  tests/Makefile: Only display TCG-related tests when TCG is available
  configure: Avoid building TCG when not needed
  Makefile: Only build virtiofsd if system-mode is enabled
  linux-user: implement OFD locks
  linux-user/mmap.c: fix integer underflow in target_mremap
  linux-user/strace.list: fix epoll_create{,1} -strace output
  linux-user: Add support for /proc/cpuinfo on hppa platform
  linux-user: return target error codes for socket() and prctl()
  linux-user, alpha: fix oldumount syscall

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1  2 
configure
exec.c
linux-user/syscall.c
target/i386/cpu.c
target/riscv/cpu.c
tests/Makefile.include

diff --combined configure
index f087d2bcd1774729d73a9d13dce198c7444bce69,fccc56bd4d1f8c01bb0aaa6f09222dfa98b7eeb6..597e909b5371cb50bc61e96dd2e354d5c0b2939f
+++ b/configure
@@@ -198,7 -198,7 +198,7 @@@ supported_kvm_target() 
          arm:arm | aarch64:aarch64 | \
          i386:i386 | i386:x86_64 | i386:x32 | \
          x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \
 -        mips:mips | mipsel:mips | \
 +        mips:mips | mipsel:mips | mips64:mips | mips64el:mips | \
          ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | ppc64:ppc64le | \
          s390x:s390x)
              return 0
@@@ -941,7 -941,7 +941,7 @@@ don
  
  # Check for ancillary tools used in testing
  genisoimage=
 -for binary in genisoimage
 +for binary in genisoimage mkisofs
  do
      if has $binary
      then
@@@ -1663,6 -1663,10 +1663,10 @@@ if [ "$ARCH" = "unknown" ]; the
    linux_user="no"
  fi
  
+ if [ "$bsd_user" = "no" -a "$linux_user" = "no" -a "$softmmu" = "no" ] ; then
+   tcg="no"
+ fi
  default_target_list=""
  
  mak_wilds=""
diff --combined exec.c
index 3d4c94a9dc3640c653eaf07954263941556432fb,6dfd314469de1c83bff6020880c96ecc9501db1f..be4be2df3a1f9f23feb3ab14efeb9037f69ecf8d
--- 1/exec.c
--- 2/exec.c
+++ b/exec.c
@@@ -946,7 -946,9 +946,9 @@@ void cpu_exec_realizefn(CPUState *cpu, 
  
      qemu_plugin_vcpu_init_hook(cpu);
  
- #ifndef CONFIG_USER_ONLY
+ #ifdef CONFIG_USER_ONLY
+     assert(cc->vmsd == NULL);
+ #else /* !CONFIG_USER_ONLY */
      if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {
          vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu);
      }
@@@ -2127,7 -2129,7 +2129,7 @@@ int qemu_ram_resize(RAMBlock *block, ra
   * Otherwise no-op.
   * @Note: this is supposed to be a synchronous op.
   */
 -void qemu_ram_writeback(RAMBlock *block, ram_addr_t start, ram_addr_t length)
 +void qemu_ram_msync(RAMBlock *block, ram_addr_t start, ram_addr_t length)
  {
      /* The requested range should fit in within the block range */
      g_assert((start + length) <= block->used_length);
diff --combined linux-user/syscall.c
index 7f6700c54e3cbcfecb83fcc76bdf19b9270c8bf3,2d8125fa53c6f9821c158c748dc5cfba05788916..97de9fb5c92a9ee01918ffe3900cd5a32325482e
@@@ -2987,7 -2987,7 +2987,7 @@@ static abi_long do_socket(int domain, i
  #endif
           protocol == NETLINK_KOBJECT_UEVENT ||
           protocol == NETLINK_AUDIT)) {
-         return -EPFNOSUPPORT;
+         return -TARGET_EPFNOSUPPORT;
      }
  
      if (domain == AF_PACKET ||
@@@ -5856,7 -5856,7 +5856,7 @@@ static abi_long do_get_thread_area(CPUX
  
  abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
  {
-     return -ENOSYS;
+     return -TARGET_ENOSYS;
  }
  #else
  abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
@@@ -6098,6 -6098,9 +6098,9 @@@ static int target_to_host_fcntl_cmd(in
      case TARGET_F_SETFD:
      case TARGET_F_GETFL:
      case TARGET_F_SETFL:
+     case TARGET_F_OFD_GETLK:
+     case TARGET_F_OFD_SETLK:
+     case TARGET_F_OFD_SETLKW:
          ret = cmd;
          break;
      case TARGET_F_GETLK:
@@@ -6383,6 -6386,7 +6386,7 @@@ static abi_long do_fcntl(int fd, int cm
          break;
  
      case TARGET_F_GETLK64:
+     case TARGET_F_OFD_GETLK:
          ret = copy_from_user_flock64(&fl64, arg);
          if (ret) {
              return ret;
          break;
      case TARGET_F_SETLK64:
      case TARGET_F_SETLKW64:
+     case TARGET_F_OFD_SETLK:
+     case TARGET_F_OFD_SETLKW:
          ret = copy_from_user_flock64(&fl64, arg);
          if (ret) {
              return ret;
@@@ -7378,7 -7384,7 +7384,7 @@@ static int is_proc_myself(const char *f
  }
  
  #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) || \
-     defined(TARGET_SPARC) || defined(TARGET_M68K)
+     defined(TARGET_SPARC) || defined(TARGET_M68K) || defined(TARGET_HPPA)
  static int is_proc(const char *filename, const char *entry)
  {
      return strcmp(filename, entry) == 0;
@@@ -7438,6 -7444,18 +7444,18 @@@ static int open_cpuinfo(void *cpu_env, 
  }
  #endif
  
+ #if defined(TARGET_HPPA)
+ static int open_cpuinfo(void *cpu_env, int fd)
+ {
+     dprintf(fd, "cpu family\t: PA-RISC 1.1e\n");
+     dprintf(fd, "cpu\t\t: PA7300LC (PCX-L2)\n");
+     dprintf(fd, "capabilities\t: os32\n");
+     dprintf(fd, "model\t\t: 9000/778/B160L\n");
+     dprintf(fd, "model name\t: Merlin L2 160 QEMU (9000/778/B160L)\n");
+     return 0;
+ }
+ #endif
  #if defined(TARGET_M68K)
  static int open_hardware(void *cpu_env, int fd)
  {
@@@ -7462,7 -7480,7 +7480,7 @@@ static int do_openat(void *cpu_env, in
  #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
          { "/proc/net/route", open_net_route, is_proc },
  #endif
- #if defined(TARGET_SPARC)
+ #if defined(TARGET_SPARC) || defined(TARGET_HPPA)
          { "/proc/cpuinfo", open_cpuinfo, is_proc },
  #endif
  #if defined(TARGET_M68K)
@@@ -7635,33 -7653,30 +7653,33 @@@ static abi_long do_syscall1(void *cpu_e
              return -TARGET_ERESTARTSYS;
          }
  
 -        cpu_list_lock();
 +        pthread_mutex_lock(&clone_lock);
  
          if (CPU_NEXT(first_cpu)) {
 -            TaskState *ts;
 +            TaskState *ts = cpu->opaque;
  
 -            /* Remove the CPU from the list.  */
 -            QTAILQ_REMOVE_RCU(&cpus, cpu, node);
 +            object_property_set_bool(OBJECT(cpu), false, "realized", NULL);
 +            object_unref(OBJECT(cpu));
 +            /*
 +             * At this point the CPU should be unrealized and removed
 +             * from cpu lists. We can clean-up the rest of the thread
 +             * data without the lock held.
 +             */
  
 -            cpu_list_unlock();
 +            pthread_mutex_unlock(&clone_lock);
  
 -            ts = cpu->opaque;
              if (ts->child_tidptr) {
                  put_user_u32(0, ts->child_tidptr);
                  do_sys_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX,
                            NULL, NULL, 0);
              }
              thread_cpu = NULL;
 -            object_unref(OBJECT(cpu));
              g_free(ts);
              rcu_unregister_thread();
              pthread_exit(NULL);
          }
  
 -        cpu_list_unlock();
 +        pthread_mutex_unlock(&clone_lock);
          preexit_cleanup(cpu_env, arg1);
          _exit(arg1);
          return 0; /* avoid warning */
              }
          }
          return ret;
- #ifdef TARGET_NR_umount
+ #if defined(TARGET_NR_umount) || defined(TARGET_NR_oldumount)
+ #if defined(TARGET_NR_umount)
      case TARGET_NR_umount:
+ #endif
+ #if defined(TARGET_NR_oldumount)
+     case TARGET_NR_oldumount:
+ #endif
          if (!(p = lock_user_string(arg1)))
              return -TARGET_EFAULT;
          ret = get_errno(umount(p));
diff --combined target/i386/cpu.c
index 3733d9a27908be66903b60fb95bc11dd89c98f79,dd31c1de5f2be8d487c13b16447e1b208c4f1425..ba05da3f2e7fff6e37ac2769d107b901feee6081
@@@ -5078,7 -5078,7 +5078,7 @@@ static void x86_cpu_apply_version_props
  
  /* Load data from X86CPUDefinition into a X86CPU object
   */
 -static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model, Error **errp)
 +static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model)
  {
      X86CPUDefinition *def = model->cpudef;
      CPUX86State *env = &cpu->env;
       */
  
      /* CPU models only set _minimum_ values for level/xlevel: */
 -    object_property_set_uint(OBJECT(cpu), def->level, "min-level", errp);
 -    object_property_set_uint(OBJECT(cpu), def->xlevel, "min-xlevel", errp);
 -
 -    object_property_set_int(OBJECT(cpu), def->family, "family", errp);
 -    object_property_set_int(OBJECT(cpu), def->model, "model", errp);
 -    object_property_set_int(OBJECT(cpu), def->stepping, "stepping", errp);
 -    object_property_set_str(OBJECT(cpu), def->model_id, "model-id", errp);
 +    object_property_set_uint(OBJECT(cpu), def->level, "min-level",
 +                             &error_abort);
 +    object_property_set_uint(OBJECT(cpu), def->xlevel, "min-xlevel",
 +                             &error_abort);
 +
 +    object_property_set_int(OBJECT(cpu), def->family, "family",
 +                            &error_abort);
 +    object_property_set_int(OBJECT(cpu), def->model, "model",
 +                            &error_abort);
 +    object_property_set_int(OBJECT(cpu), def->stepping, "stepping",
 +                            &error_abort);
 +    object_property_set_str(OBJECT(cpu), def->model_id, "model-id",
 +                            &error_abort);
      for (w = 0; w < FEATURE_WORDS; w++) {
          env->features[w] = def->features[w];
      }
          vendor = host_vendor;
      }
  
 -    object_property_set_str(OBJECT(cpu), vendor, "vendor", errp);
 +    object_property_set_str(OBJECT(cpu), vendor, "vendor",
 +                            &error_abort);
  
      x86_cpu_apply_version_props(cpu, model);
  }
@@@ -6850,6 -6843,7 +6850,7 @@@ static void x86_cpu_register_feature_bi
      x86_cpu_register_bit_prop(cpu, name, w, bitnr);
  }
  
+ #if !defined(CONFIG_USER_ONLY)
  static GuestPanicInformation *x86_cpu_get_crash_info(CPUState *cs)
  {
      X86CPU *cpu = X86_CPU(cs);
@@@ -6893,6 -6887,7 +6894,7 @@@ static void x86_cpu_get_crash_info_qom(
                                       errp);
      qapi_free_GuestPanicInformation(panic_info);
  }
+ #endif /* !CONFIG_USER_ONLY */
  
  static void x86_cpu_initfn(Object *obj)
  {
                          x86_cpu_get_unavailable_features,
                          NULL, NULL, NULL);
  
+ #if !defined(CONFIG_USER_ONLY)
      object_property_add(obj, "crash-information", "GuestPanicInformation",
                          x86_cpu_get_crash_info_qom, NULL, NULL, NULL);
+ #endif
  
      for (w = 0; w < FEATURE_WORDS; w++) {
          int bitnr;
      object_property_add_alias(obj, "sse4_2", obj, "sse4.2");
  
      if (xcc->model) {
 -        x86_cpu_load_model(cpu, xcc->model, &error_abort);
 +        x86_cpu_load_model(cpu, xcc->model);
      }
  }
  
@@@ -7252,7 -7249,6 +7256,6 @@@ static void x86_cpu_common_class_init(O
      cc->cpu_exec_interrupt = x86_cpu_exec_interrupt;
  #endif
      cc->dump_state = x86_cpu_dump_state;
-     cc->get_crash_info = x86_cpu_get_crash_info;
      cc->set_pc = x86_cpu_set_pc;
      cc->synchronize_from_tb = x86_cpu_synchronize_from_tb;
      cc->gdb_read_register = x86_cpu_gdb_read_register;
      cc->asidx_from_attrs = x86_asidx_from_attrs;
      cc->get_memory_mapping = x86_cpu_get_memory_mapping;
      cc->get_phys_page_attrs_debug = x86_cpu_get_phys_page_attrs_debug;
+     cc->get_crash_info = x86_cpu_get_crash_info;
      cc->write_elf64_note = x86_cpu_write_elf64_note;
      cc->write_elf64_qemunote = x86_cpu_write_elf64_qemunote;
      cc->write_elf32_note = x86_cpu_write_elf32_note;
diff --combined target/riscv/cpu.c
index 9007a2565618b090c9dcb553c0b4bf4ebebb554d,6c78337858ad53bff4362f7c7bd7ae91e7fdc6bd..3a6d202d034291faaf7b54de6a212d76c5a331e4
@@@ -133,24 -133,26 +133,24 @@@ static void riscv_base32_cpu_init(Objec
      CPURISCVState *env = &RISCV_CPU(obj)->env;
      /* We set this in the realise function */
      set_misa(env, 0);
 +    set_resetvec(env, DEFAULT_RSTVEC);
  }
  
 -static void rv32gcsu_priv1_09_1_cpu_init(Object *obj)
 +static void rv32gcsu_priv1_10_0_cpu_init(Object *obj)
  {
      CPURISCVState *env = &RISCV_CPU(obj)->env;
      set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
 -    set_priv_version(env, PRIV_VERSION_1_09_1);
 +    set_priv_version(env, PRIV_VERSION_1_10_0);
      set_resetvec(env, DEFAULT_RSTVEC);
 -    set_feature(env, RISCV_FEATURE_MMU);
 -    set_feature(env, RISCV_FEATURE_PMP);
  }
  
 -static void rv32gcsu_priv1_10_0_cpu_init(Object *obj)
 +static void rv32imcu_nommu_cpu_init(Object *obj)
  {
      CPURISCVState *env = &RISCV_CPU(obj)->env;
 -    set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
 +    set_misa(env, RV32 | RVI | RVM | RVC | RVU);
      set_priv_version(env, PRIV_VERSION_1_10_0);
 -    set_resetvec(env, DEFAULT_RSTVEC);
 -    set_feature(env, RISCV_FEATURE_MMU);
 -    set_feature(env, RISCV_FEATURE_PMP);
 +    set_resetvec(env, 0x8090);
 +    qdev_prop_set_bit(DEVICE(obj), "mmu", false);
  }
  
  static void rv32imacu_nommu_cpu_init(Object *obj)
      set_misa(env, RV32 | RVI | RVM | RVA | RVC | RVU);
      set_priv_version(env, PRIV_VERSION_1_10_0);
      set_resetvec(env, DEFAULT_RSTVEC);
 -    set_feature(env, RISCV_FEATURE_PMP);
 +    qdev_prop_set_bit(DEVICE(obj), "mmu", false);
  }
  
  static void rv32imafcu_nommu_cpu_init(Object *obj)
      set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVC | RVU);
      set_priv_version(env, PRIV_VERSION_1_10_0);
      set_resetvec(env, DEFAULT_RSTVEC);
 -    set_feature(env, RISCV_FEATURE_PMP);
 +    qdev_prop_set_bit(DEVICE(obj), "mmu", false);
  }
  
  #elif defined(TARGET_RISCV64)
@@@ -178,7 -180,16 +178,7 @@@ static void riscv_base64_cpu_init(Objec
      CPURISCVState *env = &RISCV_CPU(obj)->env;
      /* We set this in the realise function */
      set_misa(env, 0);
 -}
 -
 -static void rv64gcsu_priv1_09_1_cpu_init(Object *obj)
 -{
 -    CPURISCVState *env = &RISCV_CPU(obj)->env;
 -    set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
 -    set_priv_version(env, PRIV_VERSION_1_09_1);
      set_resetvec(env, DEFAULT_RSTVEC);
 -    set_feature(env, RISCV_FEATURE_MMU);
 -    set_feature(env, RISCV_FEATURE_PMP);
  }
  
  static void rv64gcsu_priv1_10_0_cpu_init(Object *obj)
      set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU);
      set_priv_version(env, PRIV_VERSION_1_10_0);
      set_resetvec(env, DEFAULT_RSTVEC);
 -    set_feature(env, RISCV_FEATURE_MMU);
 -    set_feature(env, RISCV_FEATURE_PMP);
  }
  
  static void rv64imacu_nommu_cpu_init(Object *obj)
      set_misa(env, RV64 | RVI | RVM | RVA | RVC | RVU);
      set_priv_version(env, PRIV_VERSION_1_10_0);
      set_resetvec(env, DEFAULT_RSTVEC);
 -    set_feature(env, RISCV_FEATURE_PMP);
 +    qdev_prop_set_bit(DEVICE(obj), "mmu", false);
  }
  
  #endif
@@@ -375,6 -388,8 +375,6 @@@ static void riscv_cpu_realize(DeviceSta
              priv_version = PRIV_VERSION_1_11_0;
          } else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.10.0")) {
              priv_version = PRIV_VERSION_1_10_0;
 -        } else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.9.1")) {
 -            priv_version = PRIV_VERSION_1_09_1;
          } else {
              error_setg(errp,
                         "Unsupported privilege spec version '%s'",
      }
  
      set_priv_version(env, priv_version);
 -    set_resetvec(env, DEFAULT_RSTVEC);
  
      if (cpu->cfg.mmu) {
          set_feature(env, RISCV_FEATURE_MMU);
@@@ -469,10 -485,12 +469,12 @@@ static void riscv_cpu_init(Object *obj
      cpu_set_cpustate_pointers(cpu);
  }
  
+ #ifndef CONFIG_USER_ONLY
  static const VMStateDescription vmstate_riscv_cpu = {
      .name = "cpu",
      .unmigratable = 1,
  };
+ #endif
  
  static Property riscv_cpu_properties[] = {
      DEFINE_PROP_BOOL("i", RISCVCPU, cfg.ext_i, true),
@@@ -528,13 -546,13 +530,13 @@@ static void riscv_cpu_class_init(Object
      cc->do_transaction_failed = riscv_cpu_do_transaction_failed;
      cc->do_unaligned_access = riscv_cpu_do_unaligned_access;
      cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug;
+     /* For now, mark unmigratable: */
+     cc->vmsd = &vmstate_riscv_cpu;
  #endif
  #ifdef CONFIG_TCG
      cc->tcg_initialize = riscv_translate_init;
      cc->tlb_fill = riscv_cpu_tlb_fill;
  #endif
-     /* For now, mark unmigratable: */
-     cc->vmsd = &vmstate_riscv_cpu;
      device_class_set_props(dc, riscv_cpu_properties);
  }
  
@@@ -602,14 -620,21 +604,14 @@@ static const TypeInfo riscv_cpu_type_in
      DEFINE_CPU(TYPE_RISCV_CPU_ANY,              riscv_any_cpu_init),
  #if defined(TARGET_RISCV32)
      DEFINE_CPU(TYPE_RISCV_CPU_BASE32,           riscv_base32_cpu_init),
 +    DEFINE_CPU(TYPE_RISCV_CPU_IBEX,             rv32imcu_nommu_cpu_init),
      DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E31,       rv32imacu_nommu_cpu_init),
      DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E34,       rv32imafcu_nommu_cpu_init),
      DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34,       rv32gcsu_priv1_10_0_cpu_init),
 -    /* Depreacted */
 -    DEFINE_CPU(TYPE_RISCV_CPU_RV32IMACU_NOMMU,  rv32imacu_nommu_cpu_init),
 -    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_09_1, rv32gcsu_priv1_09_1_cpu_init),
 -    DEFINE_CPU(TYPE_RISCV_CPU_RV32GCSU_V1_10_0, rv32gcsu_priv1_10_0_cpu_init)
  #elif defined(TARGET_RISCV64)
      DEFINE_CPU(TYPE_RISCV_CPU_BASE64,           riscv_base64_cpu_init),
      DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E51,       rv64imacu_nommu_cpu_init),
      DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54,       rv64gcsu_priv1_10_0_cpu_init),
 -    /* Deprecated */
 -    DEFINE_CPU(TYPE_RISCV_CPU_RV64IMACU_NOMMU,  rv64imacu_nommu_cpu_init),
 -    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_09_1, rv64gcsu_priv1_09_1_cpu_init),
 -    DEFINE_CPU(TYPE_RISCV_CPU_RV64GCSU_V1_10_0, rv64gcsu_priv1_10_0_cpu_init)
  #endif
  };
  
diff --combined tests/Makefile.include
index 6e3d6370df950f2a874959619ab92af44ad783fb,0cb58aad2685fb9257daccc0734d0956bd7da912..c2397de8ed60a403ef5d39ec87a19b66df7ba2eb
@@@ -4,7 -4,7 +4,7 @@@
  check-help:
        @echo "Regression testing targets:"
        @echo
 -      @echo " $(MAKE) check                Run unit, qapi-schema, qtest and decodetree"
 +      @echo " $(MAKE) check                Run block, qapi-schema, unit, softfloat, qtest and decodetree tests"
        @echo
        @echo " $(MAKE) check-qtest-TARGET   Run qtest tests for given target"
        @echo " $(MAKE) check-qtest          Run qtest tests"
        @echo " $(MAKE) check-speed          Run qobject speed tests"
        @echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
        @echo " $(MAKE) check-block          Run block tests"
+ ifeq ($(CONFIG_TCG),y)
        @echo " $(MAKE) check-tcg            Run TCG tests"
        @echo " $(MAKE) check-softfloat      Run FPU emulation tests"
+ endif
        @echo " $(MAKE) check-acceptance     Run all acceptance (functional) tests"
        @echo
        @echo " $(MAKE) check-report.tap     Generates an aggregated TAP test report"
@@@ -64,14 -66,14 +66,14 @@@ check-unit-y += tests/check-qlit$(EXESU
  check-unit-y += tests/test-qobject-output-visitor$(EXESUF)
  check-unit-y += tests/test-clone-visitor$(EXESUF)
  check-unit-y += tests/test-qobject-input-visitor$(EXESUF)
- check-unit-y += tests/test-qmp-cmds$(EXESUF)
+ check-unit-$(CONFIG_SOFTMMU) += tests/test-qmp-cmds$(EXESUF)
  check-unit-y += tests/test-string-input-visitor$(EXESUF)
  check-unit-y += tests/test-string-output-visitor$(EXESUF)
  check-unit-y += tests/test-qmp-event$(EXESUF)
  check-unit-y += tests/test-opts-visitor$(EXESUF)
  check-unit-$(CONFIG_BLOCK) += tests/test-coroutine$(EXESUF)
  check-unit-y += tests/test-visitor-serialization$(EXESUF)
- check-unit-y += tests/test-iov$(EXESUF)
+ check-unit-$(CONFIG_SOFTMMU) += tests/test-iov$(EXESUF)
  check-unit-y += tests/test-bitmap$(EXESUF)
  check-unit-$(CONFIG_BLOCK) += tests/test-aio$(EXESUF)
  check-unit-$(CONFIG_BLOCK) += tests/test-aio-multithread$(EXESUF)
@@@ -106,7 -108,7 +108,7 @@@ check-unit-y += tests/test-qht$(EXESUF
  check-unit-y += tests/test-qht-par$(EXESUF)
  check-unit-y += tests/test-bitops$(EXESUF)
  check-unit-y += tests/test-bitcnt$(EXESUF)
- check-unit-y += tests/test-qdev-global-props$(EXESUF)
+ check-unit-$(CONFIG_SOFTMMU) += tests/test-qdev-global-props$(EXESUF)
  check-unit-y += tests/check-qom-interface$(EXESUF)
  check-unit-y += tests/check-qom-proplist$(EXESUF)
  check-unit-y += tests/test-qemu-opts$(EXESUF)
@@@ -124,9 -126,9 +126,9 @@@ check-unit-$(call land,$(CONFIG_BLOCK),
  ifneq (,$(findstring qemu-ga,$(TOOLS)))
  check-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) += tests/test-qga$(EXESUF)
  endif
- check-unit-y += tests/test-timed-average$(EXESUF)
- check-unit-$(CONFIG_INOTIFY1) += tests/test-util-filemonitor$(EXESUF)
- check-unit-y += tests/test-util-sockets$(EXESUF)
+ check-unit-$(CONFIG_SOFTMMU) += tests/test-timed-average$(EXESUF)
+ check-unit-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_INOTIFY1)) += tests/test-util-filemonitor$(EXESUF)
+ check-unit-$(CONFIG_SOFTMMU) += tests/test-util-sockets$(EXESUF)
  check-unit-$(CONFIG_BLOCK) += tests/test-authz-simple$(EXESUF)
  check-unit-$(CONFIG_BLOCK) += tests/test-authz-list$(EXESUF)
  check-unit-$(CONFIG_BLOCK) += tests/test-authz-listfile$(EXESUF)
@@@ -137,7 -139,7 +139,7 @@@ check-unit-$(CONFIG_BLOCK) += tests/tes
  check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-io-channel-tls$(EXESUF)
  check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-command$(EXESUF)
  check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-buffer$(EXESUF)
- check-unit-y += tests/test-base64$(EXESUF)
+ check-unit-$(CONFIG_SOFTMMU) += tests/test-base64$(EXESUF)
  check-unit-$(call land,$(CONFIG_BLOCK),$(if $(CONFIG_NETTLE),y,$(CONFIG_GCRYPT))) += tests/test-crypto-pbkdf$(EXESUF)
  check-unit-$(CONFIG_BLOCK) += tests/test-crypto-ivgen$(EXESUF)
  check-unit-$(CONFIG_BLOCK)  += tests/test-crypto-afsplit$(EXESUF)
@@@ -145,7 -147,7 +147,7 @@@ check-unit-$(call land,$(CONFIG_BLOCK),
  check-unit-$(CONFIG_BLOCK)  += tests/test-crypto-block$(EXESUF)
  check-unit-y += tests/test-logging$(EXESUF)
  check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_REPLICATION)) += tests/test-replication$(EXESUF)
- check-unit-y += tests/test-bufferiszero$(EXESUF)
+ check-unit-$(CONFIG_SOFTMMU) += tests/test-bufferiszero$(EXESUF)
  check-unit-y += tests/test-uuid$(EXESUF)
  check-unit-y += tests/ptimer-test$(EXESUF)
  check-unit-y += tests/test-qapi-util$(EXESUF)
@@@ -687,26 -689,11 +689,26 @@@ test-softfloat = $(call quiet-command, 
                        (cat $2.out && exit 1;), \
                        "FLOAT TEST", $2)
  
 -# Conversion Routines:
 +# Conversion Routines: Float to Float
 +# FIXME: f32_to_f128 (broken), f64_to_f128 (broken)
 +# FIXME: f128_to_f32(broken), f128_to_f64 (broken)
 +# FIXME: f128_to_extF80 (broken)
 +check-softfloat-conv-f2f: $(FP_TEST_BIN)
 +      $(call test-softfloat, \
 +              f16_to_f32 f16_to_f64 \
 +              f16_to_extF80 f16_to_f128 \
 +              f32_to_f16 f32_to_f64 \
 +              f32_to_extF80 \
 +              f64_to_f16 f64_to_f32 \
 +              extF80_to_f16 extF80_to_f32 \
 +              extF80_to_f64 extF80_to_f128 \
 +              f128_to_f16, \
 +              float-to-float)
 +
 +# Conversion Routines: Int and Uint to Float
  # FIXME: i32_to_extF80 (broken), i64_to_extF80 (broken)
 -#        ui32_to_f128 (not implemented), extF80_roundToInt (broken)
 -#
 -check-softfloat-conv: $(FP_TEST_BIN)
 +#        ui32_to_f128 (not implemented)
 +check-softfloat-conv-to-float: $(FP_TEST_BIN)
        $(call test-softfloat, \
                i32_to_f16 i64_to_f16 \
                i32_to_f32 i64_to_f32 \
                ui32_to_f16 ui64_to_f16 \
                ui32_to_f32 ui64_to_f32 \
                ui32_to_f64 ui64_to_f64 \
 +              ui32_to_extF80 ui64_to_extF80 \
                ui64_to_f128, uint-to-float)
 +
 +# Conversion Routines: Float to integers
 +# FIXME: extF80_roundToInt (broken)
 +check-softfloat-conv-to-int: $(FP_TEST_BIN)
        $(call test-softfloat, \
                f16_to_i32 f16_to_i32_r_minMag \
                f32_to_i32 f32_to_i32_r_minMag \
                f16_to_ui32 f16_to_ui32_r_minMag \
                f32_to_ui32 f32_to_ui32_r_minMag \
                f64_to_ui32 f64_to_ui32_r_minMag \
 +              extF80_to_ui32 extF80_to_ui32_r_minMag \
                f128_to_ui32 f128_to_ui32_r_minMag \
                f16_to_ui64 f16_to_ui64_r_minMag \
                f32_to_ui64 f32_to_ui64_r_minMag \
                f64_to_ui64 f64_to_ui64_r_minMag \
 +              extF80_to_ui64 extF80_to_ui64_r_minMag \
                f128_to_ui64 f128_to_ui64_r_minMag, \
                float-to-uint)
        $(call test-softfloat, \
                f64_roundToInt f128_roundToInt, \
                round-to-integer)
  
 +.PHONY: check-softfloat-conv
 +check-softfloat-conv: check-softfloat-conv-f2f
 +check-softfloat-conv: check-softfloat-conv-to-float
 +check-softfloat-conv: check-softfloat-conv-to-int
 +
  # Generic rule for all float operations
  #
 -# Some patterns are overidden due to broken or missing tests.
 +# Some patterns are overridden due to broken or missing tests.
  # Hopefully these can be removed over time.
  
  check-softfloat-%: $(FP_TEST_BIN)
  SF_COMPARE_OPS=eq eq_signaling le le_quiet lt_quiet
  SF_COMPARE_RULES=$(patsubst %,check-softfloat-%, $(SF_COMPARE_OPS))
  
 -# FIXME: extF80_le_quiet (broken)
 -check-softfloat-le_quiet: $(FP_TEST_BIN)
 -      $(call test-softfloat,                          \
 -              f16_le_quiet f32_le_quiet f64_le_quiet  \
 -              f128_le_quiet,                          \
 -              le_quiet)
 -
  # FIXME: extF80_lt_quiet (broken)
  check-softfloat-lt_quiet: $(FP_TEST_BIN)
        $(call test-softfloat,                          \