Skip to content
Snippets Groups Projects
  1. Jun 08, 2021
  2. Jun 05, 2021
  3. Mar 18, 2021
  4. Dec 10, 2020
  5. 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
    • Kevin Wolf's avatar
      hmp: Pass monitor to mon_get_cpu() · 2fc5d01b
      Kevin Wolf authored
      
      mon_get_cpu() is indirectly called monitor_parse_arguments() where
      the current monitor isn't set yet. Instead of using monitor_cur(),
      explicitly pass the Monitor pointer to the function.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20201113114326.97663-2-kwolf@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      2fc5d01b
  6. Oct 09, 2020
  7. Oct 06, 2020
  8. Sep 29, 2020
  9. Sep 16, 2020
  10. Jun 01, 2020
  11. Mar 09, 2020
  12. Mar 06, 2020
  13. Feb 17, 2020
  14. Dec 18, 2019
  15. Aug 16, 2019
    • Markus Armbruster's avatar
      Include hw/qdev-properties.h less · a27bd6c7
      Markus Armbruster authored
      
      In my "build everything" tree, changing hw/qdev-properties.h triggers
      a recompile of some 2700 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      Many places including hw/qdev-properties.h (directly or via hw/qdev.h)
      actually need only hw/qdev-core.h.  Include hw/qdev-core.h there
      instead.
      
      hw/qdev.h is actually pointless: all it does is include hw/qdev-core.h
      and hw/qdev-properties.h, which in turn includes hw/qdev-core.h.
      Replace the remaining uses of hw/qdev.h by hw/qdev-properties.h.
      
      While there, delete a few superfluous inclusions of hw/qdev-core.h.
      
      Touching hw/qdev-properties.h now recompiles some 1200 objects.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Daniel P. Berrangé" <berrange@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20190812052359.30071-22-armbru@redhat.com>
      a27bd6c7
    • Markus Armbruster's avatar
      include: Make headers more self-contained · ec150c7e
      Markus Armbruster authored
      Back in 2016, we discussed[1] rules for headers, and these were
      generally liked:
      
      1. Have a carefully curated header that's included everywhere first.  We
         got that already thanks to Peter: osdep.h.
      
      2. Headers should normally include everything they need beyond osdep.h.
         If exceptions are needed for some reason, they must be documented in
         the header.  If all that's needed from a header is typedefs, put
         those into qemu/typedefs.h instead of including the header.
      
      3. Cyclic inclusion is forbidden.
      
      This patch gets include/ closer to obeying 2.
      
      It's actually extracted from my "[RFC] Baby steps towards saner
      headers" series[2], which demonstrates a possible path towards
      checking 2 automatically.  It passes the RFC test there.
      
      [1] Message-ID: <87h9g8j57d.fsf@blackfin.pond.sub.org>
          https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
      [2] Message-Id: <20190711122827.18970-1-armbru@redhat.com>
          https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html
      
      
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-2-armbru@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      ec150c7e
  16. Jul 02, 2019
  17. Jun 18, 2019
    • Kevin Wolf's avatar
      monitor: Replace monitor_init() with monitor_init_{hmp, qmp}() · fbfc29e3
      Kevin Wolf authored
      
      Most callers know which monitor type they want to have. Instead of
      calling monitor_init() with flags that can describe both types of
      monitors, make monitor_init_{hmp,qmp}() public interfaces that take
      specific bools instead of flags and call these functions directly.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20190613153405.24769-15-kwolf@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      fbfc29e3
    • Kevin Wolf's avatar
      monitor: Split out monitor/monitor.c · 1d95db74
      Kevin Wolf authored
      
      Move the monitor core infrastructure from monitor/misc.c to
      monitor/monitor.c. This is code that can be shared for all targets, so
      compile it only once.
      
      What remains in monitor/misc.c after this patch is mostly monitor
      command implementations (which could move to hmp-cmds.c or qmp-cmds.c
      later) and code that requires a system emulator or is even
      target-dependent (including HMP command completion code).
      
      The amount of function and particularly extern variables in
      monitor_int.h is probably a bit larger than it needs to be, but this way
      no non-trivial code modifications are needed. The interfaces between all
      monitor parts can be cleaned up later.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20190613153405.24769-13-kwolf@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      [Superfluous #include dropped]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      1d95db74
  18. Jun 17, 2019
  19. Jun 12, 2019
    • Markus Armbruster's avatar
      Include qemu-common.h exactly where needed · a8d25326
      Markus Armbruster authored
      
      No header includes qemu-common.h after this commit, as prescribed by
      qemu-common.h's file comment.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-5-armbru@redhat.com>
      [Rebased with conflicts resolved automatically, except for
      include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c
      block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c
      target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h
      target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h
      target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h
      target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and
      net/tap-bsd.c fixed up]
      a8d25326
  20. Apr 18, 2019
Loading