Skip to content
Snippets Groups Projects
  1. Nov 05, 2020
    • Greg Kurz's avatar
      spapr: Convert hpt_prepare_thread() to use qemu_try_memalign() · f29b959d
      Greg Kurz authored
      
      HPT resizing is asynchronous: the guest first kicks off the creation of a
      new HPT, then it waits for that new HPT to be actually created and finally
      it asks the current HPT to be replaced by the new one.
      
      In the case of a userland allocated HPT, this currently relies on calling
      qemu_memalign() which aborts on OOM and never returns NULL. Since we seem
      to have path to report the failure to the guest with an H_NO_MEM return
      value, use qemu_try_memalign() instead of qemu_memalign().
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <160398563636.32380.1747166034877173994.stgit@bahia.lan>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      f29b959d
    • Greg Kurz's avatar
      spapr: Drop dead code in spapr_reallocate_hpt() · 184b813e
      Greg Kurz authored
      
      Sometimes QEMU needs to allocate the HPT in userspace, namely with TCG
      or PR KVM. This is performed with qemu_memalign() because of alignment
      requirements. Like glib's allocators, its behaviour is to abort on OOM
      instead of returning NULL.
      
      This could be changed to qemu_try_memalign(), but in the specific case
      of spapr_reallocate_hpt(), the outcome would be to terminate QEMU anyway
      since no HPT means no MMU for the guest. Drop the dead code instead.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <160398562892.32380.15006707861753544263.stgit@bahia.lan>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      184b813e
    • Chen Qun's avatar
      target/ppc/excp_helper: Add a fallthrough for fix compiler warning · 295397f5
      Chen Qun authored
      
      When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warning:
      ../target/ppc/excp_helper.c: In function ‘powerpc_excp’:
      ../target/ppc/excp_helper.c:529:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
        529 |         msr |= env->error_code;
            |         ~~~~^~~~~~~~~~~~~~~~~~
      ../target/ppc/excp_helper.c:530:5: note: here
        530 |     case POWERPC_EXCP_HDECR:     /* Hypervisor decrementer exception         */
            |     ^~~~
      
      Add the corresponding "fall through" comment to fix it.
      
      Reported-by: default avatarEuler Robot <euler.robot@huawei.com>
      Signed-off-by: default avatarChen Qun <kuhn.chenqun@huawei.com>
      Message-Id: <20201028055107.2170401-1-kuhn.chenqun@huawei.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      295397f5
  2. Nov 04, 2020
  3. Nov 03, 2020
Loading