Skip to content
Snippets Groups Projects
  1. Jun 01, 2018
  2. May 25, 2018
  3. Mar 19, 2018
    • Igor Mammedov's avatar
      Use cpu_create(type) instead of cpu_init(cpu_model) · 2278b939
      Igor Mammedov authored
      
      With all targets defining CPU_RESOLVING_TYPE, refactor
      cpu_parse_cpu_model(type, cpu_model) to parse_cpu_model(cpu_model)
      so that callers won't have to know internal resolving cpu
      type. Place it in exec.c so it could be called from both
      target independed vl.c and *-user/main.c.
      
      That allows us to stop abusing cpu type from
        MachineClass::default_cpu_type
      as resolver class in vl.c which were confusing part of
      cpu_parse_cpu_model().
      
      Also with new parse_cpu_model(), the last users of cpu_init()
      in null-machine.c and bsd/linux-user targets could be switched
      to cpu_create() API and cpu_init() API will be removed by
      follow up patch.
      
      With no longer users left remove MachineState::cpu_model field,
      new code should use MachineState::cpu_type instead and
      leave cpu_model parsing to generic code in vl.c.
      
      Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1518000027-274608-5-git-send-email-imammedo@redhat.com>
      [ehabkost: Fix bsd-user build error]
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      2278b939
  4. Mar 12, 2018
    • Thomas Huth's avatar
      Polish the version strings containing the package version · 7e563bfb
      Thomas Huth authored
      Since commit 67a1de0d there is no space anymore between the
      version number and the parentheses when running configure with
      --with-pkgversion=foo :
      
       $ qemu-system-s390x --version
       QEMU emulator version 2.11.50(foo)
      
      But the space is included when building without that option
      when building from a git checkout:
      
       $ qemu-system-s390x --version
       QEMU emulator version 2.11.50 (v2.11.0-1494-gbec9c64-dirty)
      
      The same confusion exists with the "query-version" QMP command.
      Let's fix this by introducing a proper QEMU_FULL_VERSION definition
      that includes the space and parentheses, while the QEMU_PKGVERSION
      should just cleanly contain the package version string itself.
      Note that this also changes the behavior of the "query-version" QMP
      command (the space and parentheses are not included there anymore),
      but that's supposed to be OK since the strings there are not meant
      to be parsed by other tools.
      
      Fixes: 67a1de0d
      Buglink: https://bugs.launchpad.net/qemu/+bug/1673373
      
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <1518692807-25859-1-git-send-email-thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7e563bfb
  5. Dec 18, 2017
  6. Oct 24, 2017
    • Emilio G. Cota's avatar
      tcg: introduce regions to split code_gen_buffer · e8feb96f
      Emilio G. Cota authored
      
      This is groundwork for supporting multiple TCG contexts.
      
      The naive solution here is to split code_gen_buffer statically
      among the TCG threads; this however results in poor utilization
      if translation needs are different across TCG threads.
      
      What we do here is to add an extra layer of indirection, assigning
      regions that act just like pages do in virtual memory allocation.
      (BTW if you are wondering about the chosen naming, I did not want
      to use blocks or pages because those are already heavily used in QEMU).
      
      We use a global lock to serialize allocations as well as statistics
      reporting (we now export the size of the used code_gen_buffer with
      tcg_code_size()). Note that for the allocator we could just use
      a counter and atomic_inc; however, that would complicate the gathering
      of tcg_code_size()-like stats. So given that the region operations are
      not a fast path, a lock seems the most reasonable choice.
      
      The effectiveness of this approach is clear after seeing some numbers.
      I used the bootup+shutdown of debian-arm with '-tb-size 80' as a benchmark.
      Note that I'm evaluating this after enabling per-thread TCG (which
      is done by a subsequent commit).
      
      * -smp 1, 1 region (entire buffer):
          qemu: flush code_size=83885014 nb_tbs=154739 avg_tb_size=357
          qemu: flush code_size=83884902 nb_tbs=153136 avg_tb_size=363
          qemu: flush code_size=83885014 nb_tbs=152777 avg_tb_size=364
          qemu: flush code_size=83884950 nb_tbs=150057 avg_tb_size=373
          qemu: flush code_size=83884998 nb_tbs=150234 avg_tb_size=373
          qemu: flush code_size=83885014 nb_tbs=154009 avg_tb_size=360
          qemu: flush code_size=83885014 nb_tbs=151007 avg_tb_size=370
          qemu: flush code_size=83885014 nb_tbs=151816 avg_tb_size=367
      
      That is, 8 flushes.
      
      * -smp 8, 32 regions (80/32 MB per region) [i.e. this patch]:
      
          qemu: flush code_size=76328008 nb_tbs=141040 avg_tb_size=356
          qemu: flush code_size=75366534 nb_tbs=138000 avg_tb_size=361
          qemu: flush code_size=76864546 nb_tbs=140653 avg_tb_size=361
          qemu: flush code_size=76309084 nb_tbs=135945 avg_tb_size=375
          qemu: flush code_size=74581856 nb_tbs=132909 avg_tb_size=375
          qemu: flush code_size=73927256 nb_tbs=135616 avg_tb_size=360
          qemu: flush code_size=78629426 nb_tbs=142896 avg_tb_size=365
          qemu: flush code_size=76667052 nb_tbs=138508 avg_tb_size=368
      
      Again, 8 flushes. Note how buffer utilization is not 100%, but it
      is close. Smaller region sizes would yield higher utilization,
      but we want region allocation to be rare (it acquires a lock), so
      we do not want to go too small.
      
      * -smp 8, static partitioning of 8 regions (10 MB per region):
          qemu: flush code_size=21936504 nb_tbs=40570 avg_tb_size=354
          qemu: flush code_size=11472174 nb_tbs=20633 avg_tb_size=370
          qemu: flush code_size=11603976 nb_tbs=21059 avg_tb_size=365
          qemu: flush code_size=23254872 nb_tbs=41243 avg_tb_size=377
          qemu: flush code_size=28289496 nb_tbs=52057 avg_tb_size=358
          qemu: flush code_size=43605160 nb_tbs=78896 avg_tb_size=367
          qemu: flush code_size=45166552 nb_tbs=82158 avg_tb_size=364
          qemu: flush code_size=63289640 nb_tbs=116494 avg_tb_size=358
          qemu: flush code_size=51389960 nb_tbs=93937 avg_tb_size=362
          qemu: flush code_size=59665928 nb_tbs=107063 avg_tb_size=372
          qemu: flush code_size=38380824 nb_tbs=68597 avg_tb_size=374
          qemu: flush code_size=44884568 nb_tbs=79901 avg_tb_size=376
          qemu: flush code_size=50782632 nb_tbs=90681 avg_tb_size=374
          qemu: flush code_size=39848888 nb_tbs=71433 avg_tb_size=372
          qemu: flush code_size=64708840 nb_tbs=119052 avg_tb_size=359
          qemu: flush code_size=49830008 nb_tbs=90992 avg_tb_size=362
          qemu: flush code_size=68372408 nb_tbs=123442 avg_tb_size=368
          qemu: flush code_size=33555560 nb_tbs=59514 avg_tb_size=378
          qemu: flush code_size=44748344 nb_tbs=80974 avg_tb_size=367
          qemu: flush code_size=37104248 nb_tbs=67609 avg_tb_size=364
      
      That is, 20 flushes. Note how a static partitioning approach uses
      the code buffer poorly, leading to many unnecessary flushes.
      
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      e8feb96f
    • Emilio G. Cota's avatar
      tcg: define tcg_init_ctx and make tcg_ctx a pointer · b1311c4a
      Emilio G. Cota authored
      
      Groundwork for supporting multiple TCG contexts.
      
      The core of this patch is this change to tcg/tcg.h:
      
      > -extern TCGContext tcg_ctx;
      > +extern TCGContext tcg_init_ctx;
      > +extern TCGContext *tcg_ctx;
      
      Note that for now we set *tcg_ctx to whatever TCGContext is passed
      to tcg_context_init -- in this case &tcg_init_ctx.
      
      Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      b1311c4a
  7. Sep 19, 2017
  8. Aug 08, 2017
    • Eric Blake's avatar
      maint: Include bug-reporting info in --help output · f5048cb7
      Eric Blake authored
      
      These days, many programs are including a bug-reporting address,
      or better yet, a link to the project web site, at the tail of
      their --help output.  However, we were not very consistent at
      doing so: only qemu-nbd and qemu-qa mentioned anything, with the
      latter pointing to an individual person instead of the project.
      
      Add a new #define that sets up a uniform string, mentioning both
      bug reporting instructions and overall project details, and which
      a downstream vendor could tweak if they want bugs to go to a
      downstream database.  Then use it in all of our binaries which
      have --help output.
      
      The canned text intentionally references http:// instead of https://
      because our https website currently causes certificate errors in
      some browsers.  That can be tweaked later once we have resolved the
      web site issued.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20170803163353.19558-5-eblake@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f5048cb7
  9. Jul 21, 2017
  10. Jul 14, 2017
  11. Jul 04, 2017
  12. May 07, 2017
  13. Mar 28, 2017
  14. Mar 20, 2017
  15. Mar 19, 2017
  16. Oct 31, 2016
    • Alex Bennée's avatar
      translate-all: add DEBUG_LOCKING asserts · 301e40ed
      Alex Bennée authored
      
      This adds asserts to check the locking on the various translation
      engines structures. There are two sets of structures that are protected
      by locks.
      
      The first the l1map and PageDesc structures used to track which
      translation blocks are associated with which physical addresses. In
      user-mode this is covered by the mmap_lock.
      
      The second case are TB context related structures which are protected by
      tb_lock which is also user-mode only.
      
      Currently the asserts do nothing in SoftMMU mode but this will change
      for MTTCG.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
      Message-Id: <20161027151030.20863-4-alex.bennee@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      301e40ed
  17. Oct 24, 2016
  18. Oct 12, 2016
    • Daniel P. Berrangé's avatar
      trace: provide mechanism for registering trace events · fe4db84d
      Daniel P. Berrangé authored
      
      Remove the notion of there being a single global array
      of trace events, by introducing a method for registering
      groups of events.
      
      The module_call_init() needs to be invoked at the start
      of any program that wants to make use of the trace
      support. Currently this covers system emulators qemu-nbd,
      qemu-img and qemu-io.
      
      [Squashed the following fix from Daniel P. Berrange
      <berrange@redhat.com>:
      
      linux-user/bsd-user: initialize trace events subsystem
      
      The bsd-user/linux-user programs make use of the CPU emulation
      code and this now requires that the trace events subsystem
      is enabled, otherwise it'll crash trying to allocate an empty
      trace events bitmap for the CPU object.
      
      --Stefan]
      
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarLluís Vilanova <vilanova@ac.upc.edu>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1475588159-30598-14-git-send-email-berrange@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      fe4db84d
  19. Oct 07, 2016
  20. Sep 28, 2016
  21. Sep 27, 2016
  22. Aug 24, 2016
  23. Aug 11, 2016
  24. Aug 01, 2016
    • Sean Bruno's avatar
      Fix bsd-user build errors after 8642c1b8 · ded554cd
      Sean Bruno authored
      
        LINK  sparc-bsd-user/qemu-sparc
      bsd-user/main.o: In function `cpu_loop':
      /home/sbruno/bsd/qemu/bsd-user/main.c:515: undefined reference to `cpu_sparc_exec'
      c++: error: linker command failed with exit code 1 (use -v to see invocation)
      gmake[1]: *** [Makefile:197: qemu-sparc] Error 1
      gmake: *** [Makefile:204: subdir-sparc-bsd-user] Error 2
      
        LINK  i386-bsd-user/qemu-i386
      bsd-user/main.o: In function `cpu_loop':
      /home/sbruno/bsd/qemu/bsd-user/main.c:174: undefined reference to `cpu_x86_exec'
      c++: error: linker command failed with exit code 1 (use -v to see invocation)
      gmake[1]: *** [Makefile:197: qemu-i386] Error 1
      gmake: *** [Makefile:204: subdir-i386-bsd-user] Error 2
      
      Signed-off-by: default avatarSean Bruno <sbruno@freebsd.org>
      Message-id: 20160729160235.64525-1-sbruno@freebsd.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      ded554cd
  25. Jul 26, 2016
  26. Jul 18, 2016
  27. Jul 17, 2016
  28. Jul 12, 2016
  29. Jun 28, 2016
  30. Jun 20, 2016
    • Markus Armbruster's avatar
      log: Fix qemu_set_log_filename() error handling · daa76aa4
      Markus Armbruster authored
      
      When qemu_set_log_filename() detects an invalid file name, it reports
      an error, closes the log file (if any), and starts logging to stderr
      (unless daemonized or nothing is being logged).
      
      This is wrong.  Asking for an invalid log file on the command line
      should be fatal.  Asking for one in the monitor should fail without
      messing up an existing logfile.
      
      Fix by converting qemu_set_log_filename() to Error.  Pass it
      &error_fatal, except for hmp_logfile report errors.
      
      This also permits testing without a subprocess, so do that.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1466011636-6112-4-git-send-email-armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      daa76aa4
  31. Jun 16, 2016
  32. May 23, 2016
Loading