Skip to content
Snippets Groups Projects
  1. Feb 16, 2021
  2. Feb 15, 2021
  3. Feb 10, 2021
  4. Feb 09, 2021
  5. Feb 08, 2021
    • David Gibson's avatar
      spapr: Add PEF based confidential guest support · 6c8ebe30
      David Gibson authored
      
      Some upcoming POWER machines have a system called PEF (Protected
      Execution Facility) which uses a small ultravisor to allow guests to
      run in a way that they can't be eavesdropped by the hypervisor.  The
      effect is roughly similar to AMD SEV, although the mechanisms are
      quite different.
      
      Most of the work of this is done between the guest, KVM and the
      ultravisor, with little need for involvement by qemu.  However qemu
      does need to tell KVM to allow secure VMs.
      
      Because the availability of secure mode is a guest visible difference
      which depends on having the right hardware and firmware, we don't
      enable this by default.  In order to run a secure guest you need to
      create a "pef-guest" object and set the confidential-guest-support
      property to point to it.
      
      Note that this just *allows* secure guests, the architecture of PEF is
      such that the guest still needs to talk to the ultravisor to enter
      secure mode.  Qemu has no direct way of knowing if the guest is in
      secure mode, and certainly can't know until well after machine
      creation time.
      
      To start a PEF-capable guest, use the command line options:
          -object pef-guest,id=pef0 -machine confidential-guest-support=pef0
      
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      6c8ebe30
  6. Feb 05, 2021
  7. Dec 19, 2020
    • Markus Armbruster's avatar
      migration: Replace migration's JSON writer by the general one · 3ddba9a9
      Markus Armbruster authored
      
      Commit 8118f095 "migration: Append JSON description of migration
      stream" needs a JSON writer.  The existing qobject_to_json() wasn't a
      good fit, because it requires building a QObject to convert.  Instead,
      migration got its very own JSON writer, in commit 190c882c "QJSON:
      Add JSON writer".  It tacitly limits numbers to int64_t, and strings
      contents to characters that don't need escaping, unlike
      qobject_to_json().
      
      The previous commit factored the JSON writer out of qobject_to_json().
      Replace migration's JSON writer by it.
      
      Cc: Juan Quintela <quintela@redhat.com>
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201211171152.146877-17-armbru@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      3ddba9a9
    • Eric Blake's avatar
      qapi: Use QAPI_LIST_PREPEND() where possible · 54aa3de7
      Eric Blake authored
      
      Anywhere we create a list of just one item or by prepending items
      (typically because order doesn't matter), we can use
      QAPI_LIST_PREPEND().  But places where we must keep the list in order
      by appending remain open-coded until later patches.
      
      Note that as a side effect, this also performs a cleanup of two minor
      issues in qga/commands-posix.c: the old code was performing
       new = g_malloc0(sizeof(*ret));
      which 1) is confusing because you have to verify whether 'new' and
      'ret' are variables with the same type, and 2) would conflict with C++
      compilation (not an actual problem for this file, but makes
      copy-and-paste harder).
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20201113011340.463563-5-eblake@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      [Straightforward conflicts due to commit a8aa94b5 "qga: update
      schema for guest-get-disks 'dependents' field" and commit a10b453a
      "target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c"
      resolved.  Commit message tweaked.]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      54aa3de7
  8. Dec 14, 2020
  9. Nov 24, 2020
  10. Nov 15, 2020
  11. Nov 13, 2020
    • Kevin Wolf's avatar
      hmp: Pass monitor to mon_get_cpu_env() · e7cff9c6
      Kevin Wolf authored
      
      mon_get_cpu_env() is indirectly called monitor_parse_arguments() where
      the current monitor isn't set yet. Instead of using monitor_cur_env(),
      explicitly pass the Monitor pointer to the function.
      
      Without this fix, an HMP command like "x $pc" crashes like this:
      
        #0  0x0000555555caa01f in mon_get_cpu_sync (mon=0x0, synchronize=true) at ../monitor/misc.c:270
        #1  0x0000555555caa141 in mon_get_cpu (mon=0x0) at ../monitor/misc.c:294
        #2  0x0000555555caa158 in mon_get_cpu_env () at ../monitor/misc.c:299
        #3  0x0000555555b19739 in monitor_get_pc (mon=0x555556ad2de0, md=0x5555565d2d40 <monitor_defs+1152>, val=0) at ../target/i386/monitor.c:607
        #4  0x0000555555cadbec in get_monitor_def (mon=0x555556ad2de0, pval=0x7fffffffc208, name=0x7fffffffc220 "pc") at ../monitor/misc.c:1681
        #5  0x000055555582ec4f in expr_unary (mon=0x555556ad2de0) at ../monitor/hmp.c:387
        #6  0x000055555582edbb in expr_prod (mon=0x555556ad2de0) at ../monitor/hmp.c:421
        #7  0x000055555582ee79 in expr_logic (mon=0x555556ad2de0) at ../monitor/hmp.c:455
        #8  0x000055555582eefe in expr_sum (mon=0x555556ad2de0) at ../monitor/hmp.c:484
        #9  0x000055555582efe8 in get_expr (mon=0x555556ad2de0, pval=0x7fffffffc418, pp=0x7fffffffc408) at ../monitor/hmp.c:511
        #10 0x000055555582fcd4 in monitor_parse_arguments (mon=0x555556ad2de0, endp=0x7fffffffc890, cmd=0x555556675b50 <hmp_cmds+7920>) at ../monitor/hmp.c:876
        #11 0x00005555558306a8 in handle_hmp_command (mon=0x555556ad2de0, cmdline=0x555556ada452 "$pc") at ../monitor/hmp.c:1087
        #12 0x000055555582df14 in monitor_command_cb (opaque=0x555556ad2de0, cmdline=0x555556ada450 "x $pc", readline_opaque=0x0) at ../monitor/hmp.c:47
      
      After this fix, nothing is left in monitor_parse_arguments() that can
      indirectly call monitor_cur(), so the fix is complete.
      
      Fixes: ff04108a
      Reported-by: default avatarlichun <lichun@ruijie.com.cn>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20201113114326.97663-4-kwolf@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      e7cff9c6
    • Kevin Wolf's avatar
      hmp: Pass monitor to MonitorDef.get_value() · 43cf067f
      Kevin Wolf authored
      
      All of these callbacks use mon_get_cpu_env(). Pass the Monitor
      pointer to them it in preparation for adding a monitor argument to
      mon_get_cpu_env().
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20201113114326.97663-3-kwolf@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      43cf067f
  12. Nov 05, 2020
  13. Oct 27, 2020
    • zhaolichang's avatar
      ppc/: fix some comment spelling errors · 136fbf65
      zhaolichang authored
      
      I found that there are many spelling errors in the comments of qemu/target/ppc.
      I used spellcheck to check the spelling errors and found some errors in the folder.
      
      Signed-off-by: default avatarzhaolichang <zhaolichang@huawei.com>
      Reviewed-by: default avatarDavid Edmondson <david.edmondson@oracle.com>
      Message-Id: <20201009064449.2336-3-zhaolichang@huawei.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      136fbf65
    • Greg Kurz's avatar
      target/ppc: Fix kvmppc_load_htab_chunk() error reporting · 0a06e4d6
      Greg Kurz authored
      
      If kvmppc_load_htab_chunk() fails, its return value is propagated up
      to vmstate_load(). It should thus be a negative errno, not -1 (which
      maps to EPERM and would lure the user into thinking that the problem
      is necessarily related to a lack of privilege).
      
      Return the error reported by KVM or ENOSPC in case of short write.
      While here, propagate the error message through an @errp argument
      and have the caller to print it with error_report_err() instead
      of relying on fprintf().
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <160371604713.305923.5264900354159029580.stgit@bahia.lan>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      0a06e4d6
    • Greg Kurz's avatar
      spapr: Unrealize vCPUs with qdev_unrealize() · f1023d21
      Greg Kurz authored
      
      Since we introduced CPU hot-unplug in sPAPR, we don't unrealize the
      vCPU objects explicitly. Instead, we let QOM handle that for us under
      object_property_del_all() when the CPU core object is finalized. The
      only thing we do is calling cpu_remove_sync() to tear the vCPU thread
      down.
      
      This happens to work but it is ugly because:
      - we call qdev_realize() but the corresponding qdev_unrealize() is
        buried deep in the QOM code
      - we call cpu_remove_sync() to undo qemu_init_vcpu() called by
        ppc_cpu_realize() in target/ppc/translate_init.c.inc
      - the CPU init and teardown paths aren't really symmetrical
      
      The latter didn't bite us so far but a future patch that greatly
      simplifies the CPU core realize path needs it to avoid a crash
      in QOM.
      
      For all these reasons, have ppc_cpu_unrealize() to undo the changes
      of ppc_cpu_realize() by calling cpu_remove_sync() at the right place,
      and have the sPAPR CPU core code to call qdev_unrealize().
      
      This requires to add a missing stub because translate_init.c.inc is
      also compiled for user mode.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <160279671236.1808373.14732005038172874990.stgit@bahia.lan>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      f1023d21
  14. Oct 08, 2020
  15. Sep 22, 2020
    • Daniel P. Berrangé's avatar
      qom: simplify object_find_property / object_class_find_property · efba1595
      Daniel P. Berrangé authored
      
      When debugging QEMU it is often useful to put a breakpoint on the
      error_setg_internal method impl.
      
      Unfortunately the object_property_add / object_class_property_add
      methods call object_property_find / object_class_property_find methods
      to check if a property exists already before adding the new property.
      
      As a result there are a huge number of calls to error_setg_internal
      on startup of most QEMU commands, making it very painful to set a
      breakpoint on this method.
      
      Most callers of object_find_property and object_class_find_property,
      however, pass in a NULL for the Error parameter. This simplifies the
      methods to remove the Error parameter entirely, and then adds some
      new wrapper methods that are able to raise an Error when needed.
      
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20200914135617.1493072-1-berrange@redhat.com>
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      efba1595
  16. Sep 18, 2020
  17. Sep 09, 2020
  18. Sep 01, 2020
Loading