1. 13 5月, 2019 2 次提交
    • M
      Clean up header guards that don't match their file name · 58ea30f5
      Markus Armbruster 提交于
      Header guard symbols should match their file name to make guard
      collisions less likely.
      
      Cleaned up with scripts/clean-header-guards.pl, followed by some
      renaming of new guard symbols picked by the script to better ones.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190315145123.28030-6-armbru@redhat.com>
      [Rebase to master: update include/hw/net/ne2000-isa.h]
      58ea30f5
    • M
      Clean up includes · bbfff196
      Markus Armbruster 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes, with the changes
      to the following files manually reverted:
      
          contrib/libvhost-user/libvhost-user-glib.h
          contrib/libvhost-user/libvhost-user.c
          contrib/libvhost-user/libvhost-user.h
          linux-user/mips64/cpu_loop.c
          linux-user/mips64/signal.c
          linux-user/sparc64/cpu_loop.c
          linux-user/sparc64/signal.c
          linux-user/x86_64/cpu_loop.c
          linux-user/x86_64/signal.c
          slirp/src/*
          target/s390x/gen-features.c
          tests/fp/platform.h
          tests/migration/s390x/a-b-bios.c
          tests/test-rcu-simpleq.c
          tests/test-rcu-tailq.c
          tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
      
      We're in the process of spinning out slirp/.  tests/fp/platform.h is
      has to include qemu/osdep.h because tests/fp/berkeley-softfloat-3/ and
      tests/fp/berkeley-testfloat-3/ don't.  tests/uefi-test-tools/ is guest
      software.  The remaining reverts are the same as in commit
      b7d89466.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190313162812.8885-1-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [Revert change to tests/fp/platform.h, adjust commit message]
      bbfff196
  2. 09 5月, 2019 1 次提交
  3. 07 5月, 2019 7 次提交
    • M
      qemu-nbd: Look up flag names in array · c4e2aff8
      Max Reitz 提交于
      The existing code to convert flag bits into strings looks a bit strange
      now, and if we ever add more flags, it will look even stranger.  Prevent
      that from happening by making it look up the flag names in an array.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-Id: <20190405191635.25740-1-mreitz@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c4e2aff8
    • C
      osdep: Fix mingw compilation regarding stdio formats · 946376c2
      Cao Jiaxi 提交于
      I encountered the following compilation error on mingw:
      
      /mnt/d/qemu/include/qemu/osdep.h:97:9: error: '__USE_MINGW_ANSI_STDIO' macro redefined [-Werror,-Wmacro-redefined]
       #define __USE_MINGW_ANSI_STDIO 1
              ^
      /mnt/d/llvm-mingw/aarch64-w64-mingw32/include/_mingw.h:433:9: note: previous definition is here
       #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */
      
      It turns out that __USE_MINGW_ANSI_STDIO must be set before any
      system headers are included, not just before stdio.h.
      Signed-off-by: NCao Jiaxi <driver1998@foxmail.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NStefan Weil <sw@weilnetz.de>
      Message-id: 20190503003719.10233-1-driver1998@foxmail.com
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      946376c2
    • C
      QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets · 48bb55bf
      Cao Jiaxi 提交于
      gcc_struct is for x86 only, and it generates an warning on ARM64 Clang/MinGW targets.
      Signed-off-by: NCao Jiaxi <driver1998@foxmail.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Message-id: 20190503003618.10089-1-driver1998@foxmail.com
      [PMM: dropped the slirp change as slirp is now a submodule]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      48bb55bf
    • J
      arm: aspeed: Set SDRAM size · a9df9622
      Joel Stanley 提交于
      We currently use Qemu's default of 128MB. As we know how much ram each
      machine ships with, make it easier on users by setting a default.
      
      It can still be overridden with -m on the command line.
      Signed-off-by: NJoel Stanley <joel@jms.id.au>
      Reviewed-by: NAndrew Jeffery <andrew@aj.id.au>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20190503022958.1394-1-joel@jms.id.au
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a9df9622
    • M
      hw/arm/virt: Support firmware configuration with -blockdev · e0561e60
      Markus Armbruster 提交于
      The ARM virt machines put firmware in flash memory.  To configure it,
      you use -drive if=pflash,unit=0,... and optionally -drive
      if=pflash,unit=1,...
      
      Why two -drive?  This permits setting up one part of the flash memory
      read-only, and the other part read/write.  It also makes upgrading
      firmware on the host easier.  Below the hood, we get two separate
      flash devices, because we were too lazy to improve our flash device
      models to support sector protection.
      
      The problem at hand is to do the same with -blockdev somehow, as one
      more step towards deprecating -drive.
      
      We recently solved this problem for x86 PC machines, in commit
      ebc29e1b.  See the commit message for design rationale.
      
      This commit solves it for ARM virt basically the same way: new machine
      properties pflash0, pflash1 forward to the onboard flash devices'
      properties.  Requires creating the onboard devices in the
      .instance_init() method virt_instance_init().  The existing code to
      pick up drives defined with -drive if=pflash is replaced by code to
      desugar into the machine properties.
      
      There are a few behavioral differences, though:
      
      * The flash devices are always present (x86: only present if
        configured)
      
      * Flash base addresses and sizes are fixed (x86: sizes depend on
        images, mapped back to back below a fixed address)
      
      * -bios configures contents of first pflash (x86: -bios configures ROM
         contents)
      
      * -bios is rejected when first pflash is also configured with -machine
         pflash0=... (x86: bios is silently ignored then)
      
      * -machine pflash1=... does not require -machine pflash0=... (x86: it
         does).
      
      The actual code is a bit simpler than for x86 mostly due to the first
      two differences.
      
      Before the patch, all the action is in create_flash(), called from the
      machine's .init() method machvirt_init():
      
          main()
              machine_run_board_init()
                  machvirt_init()
                      create_flash()
                          create_one_flash() for flash[0]
                              create
                              configure
                                  includes obeying -drive if=pflash,unit=0
                              realize
                              map
                              fall back to -bios
                          create_one_flash() for flash[1]
                              create
                              configure
                                  includes obeying -drive if=pflash,unit=1
                              realize
                              map
                          update FDT
      
      To make the machine properties work, we need to move device creation
      to its .instance_init() method virt_instance_init().
      
      Another complication is machvirt_init()'s computation of
      @firmware_loaded: it predicts what create_flash() will do.  Instead of
      predicting what create_flash()'s replacement virt_firmware_init() will
      do, I decided to have virt_firmware_init() return what it did.
      Requires calling it a bit earlier.
      
      Resulting call tree:
      
          main()
              current_machine = object_new()
                  ...
                      virt_instance_init()
                          virt_flash_create()
                              virt_flash_create1() for flash[0]
                                  create
                                  configure: set defaults
                                  become child of machine [NEW]
                                  add machine prop pflash0 as alias for drive [NEW]
                              virt_flash_create1() for flash[1]
                                  create
                                  configure: set defaults
                                  become child of machine [NEW]
                                  add machine prop pflash1 as alias for drive [NEW]
              for all machine props from the command line: machine_set_property()
                  ...
                      property_set_alias() for machine props pflash0, pflash1
                          ...
                              set_drive() for cfi.pflash01 prop drive
                                  this is how -machine pflash0=... etc set
              machine_run_board_init(current_machine);
                  virt_firmware_init()
                      pflash_cfi01_legacy_drive()
                          legacy -drive if=pflash,unit=0 and =1 [NEW]
                      virt_flash_map()
                          virt_flash_map1() for flash[0]
                              configure: num-blocks
                              realize
                              map
                          virt_flash_map1() for flash[1]
                              configure: num-blocks
                              realize
                              map
                      fall back to -bios
                  virt_flash_fdt()
                      update FDT
      
      You have László to thank for making me explain this in detail.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      Message-id: 20190416091348.26075-4-armbru@redhat.com
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      e0561e60
    • M
      pflash_cfi01: New pflash_cfi01_legacy_drive() · 2d731dbd
      Markus Armbruster 提交于
      Factored out of pc_system_firmware_init() so the next commit can reuse
      it in hw/arm/virt.c.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-id: 20190416091348.26075-3-armbru@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2d731dbd
    • P
      i2c-ddc: move it to hw/display · 6306cae2
      Paolo Bonzini 提交于
      Move it together with the other EDID code.  hw/i2c should only
      include the core and the adapters, not the slaves.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 20190325155923.30987-1-pbonzini@redhat.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      6306cae2
  4. 03 5月, 2019 1 次提交
  5. 02 5月, 2019 2 次提交
  6. 30 4月, 2019 12 次提交
  7. 26 4月, 2019 8 次提交
  8. 25 4月, 2019 2 次提交
  9. 19 4月, 2019 5 次提交
    • M
      include: Move fprintf_function to disas/ · ede9a8a6
      Markus Armbruster 提交于
      The previous commits have eliminated fprintf_function outside
      disassemblers, simplifying code and cleaning up the ugly type-punning
      fprintf_function seems to attract.  Move fprintf_function to
      include/disas/dis-asm.h to reduce the temptation to abuse it.
      
      I considered renaming it to fprintf_ftype (reverting that part of
      commit 6e2d864e, v0.14.0) to get us closer to binutils, but I
      figure the fork is too distant to make this worthwhile.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20190417191805.28198-18-armbru@redhat.com>
      ede9a8a6
    • M
      disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h · 3979fca4
      Markus Armbruster 提交于
      Commit dc99065b (v0.1.0) added dis-asm.h from binutils.
      
      Commit 43d4145a (v0.1.5) inlined bfd.h into dis-asm.h to remove the
      dependency on binutils.
      
      Commit 76cad711 (v1.4.0) moved dis-asm.h to include/disas/bfd.h.
      The new name is confusing when you try to match against (pre GPLv3+)
      binutils.  Rename it back.  Keep it in the same directory, of course.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190417191805.28198-17-armbru@redhat.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      3979fca4
    • M
      monitor: Clean up how monitor_disas() funnels output to monitor · 30cc9831
      Markus Armbruster 提交于
      INIT_DISASSEMBLE_INFO() takes an fprintf()-like callback and a FILE *
      to pass to it.  monitor_disas() passes monitor_fprintf() and the
      current monitor cast to FILE *.  monitor_fprintf() casts it right
      back, and is otherwise identical to monitor_printf().  The
      type-punning is ugly.
      
      Pass qemu_fprintf() and NULL instead.
      
      monitor_fprintf() is now unused; delete it.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20190417191805.28198-16-armbru@redhat.com>
      [Commit message typo corrected]
      30cc9831
    • M
      qom/cpu: Simplify how CPUClass:cpu_dump_state() prints · 90c84c56
      Markus Armbruster 提交于
      CPUClass method dump_statistics() takes an fprintf()-like callback and
      a FILE * to pass to it.  Most callers pass fprintf() and stderr.
      log_cpu_state() passes fprintf() and qemu_log_file.
      hmp_info_registers() passes monitor_fprintf() and the current monitor
      cast to FILE *.  monitor_fprintf() casts it right back, and is
      otherwise identical to monitor_printf().
      
      The callback gets passed around a lot, which is tiresome.  The
      type-punning around monitor_fprintf() is ugly.
      
      Drop the callback, and call qemu_fprintf() instead.  Also gets rid of
      the type-punning, since qemu_fprintf() takes NULL instead of the
      current monitor cast to FILE *.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20190417191805.28198-15-armbru@redhat.com>
      90c84c56
    • M
      qemu-print: New qemu_fprintf(), qemu_vfprintf() · 19aaa4c3
      Markus Armbruster 提交于
      Code that doesn't want to know about current monitor vs. stdout
      vs. stderr takes an fprintf_function callback and a FILE * argument to
      pass to it.  Actual arguments are either fprintf() and stdout or
      stderr, or monitor_fprintf() and the current monitor cast to FILE *.
      monitor_fprintf() casts it right back, and is otherwise identical to
      monitor_printf().  The type-punning is ugly.
      
      New qemu_fprintf() and qemu_vprintf() address this need without type
      punning: they are like fprintf() and vfprintf(), except they print to
      the current monitor when passed a null FILE *.  The next commits will
      put them to use.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20190417191805.28198-14-armbru@redhat.com>
      19aaa4c3