1. 17 6月, 2019 4 次提交
  2. 12 6月, 2019 1 次提交
    • M
      Include qemu-common.h exactly where needed · a8d25326
      Markus Armbruster 提交于
      No header includes qemu-common.h after this commit, as prescribed by
      qemu-common.h's file comment.
      Signed-off-by: NMarkus 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
  3. 23 5月, 2019 1 次提交
  4. 05 3月, 2019 1 次提交
  5. 06 2月, 2019 5 次提交
  6. 05 2月, 2019 1 次提交
    • L
      elf: Add optional function ptr to load_elf() to parse ELF notes · 4366e1db
      Liam Merwick 提交于
      This patch adds an optional function pointer, 'elf_note_fn', to
      load_elf() which causes load_elf() to additionally parse any
      ELF program headers of type PT_NOTE and check to see if the ELF
      Note is of the type specified by the 'translate_opaque' arg.
      If a matching ELF Note is found then the specfied function pointer
      is called to process the ELF note.
      
      Passing a NULL function pointer results in ELF Notes being skipped.
      
      The first consumer of this functionality is the PVHboot support
      which needs to read the XEN_ELFNOTE_PHYS32_ENTRY ELF Note while
      loading the uncompressed kernel binary in order to discover the
      boot entry address for the x86/HVM direct boot ABI.
      Signed-off-by: NLiam Merwick <liam.merwick@oracle.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4366e1db
  7. 01 2月, 2019 1 次提交
  8. 07 1月, 2019 1 次提交
  9. 13 12月, 2018 1 次提交
  10. 24 10月, 2018 1 次提交
  11. 24 8月, 2018 1 次提交
  12. 15 8月, 2018 1 次提交
  13. 29 6月, 2018 1 次提交
    • E
      hw/arm/virt: Silence dtc /memory warning · e2eb3d29
      Eric Auger 提交于
      When running dtc on the guest /proc/device-tree we get the
      following warning: Warning (unit_address_vs_reg): Node /memory
      has a reg or ranges property, but no unit name".
      
      Let's fix that by adding the unit address to the node name. We also
      don't create the /memory node anymore in create_fdt(). We directly
      create it in load_dtb. /chosen still needs to be created in create_fdt
      as the uart needs it. In case the user provided his own dtb, we nop
      all memory nodes found in root and create new one(s).
      Signed-off-by: NEric Auger <eric.auger@redhat.com>
      Message-id: 1530044492-24921-4-git-send-email-eric.auger@redhat.com
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      e2eb3d29
  14. 31 5月, 2018 1 次提交
    • I
      arm: fix qemu crash on startup with -bios option · 60b8fe49
      Igor Mammedov 提交于
      When QEMU is started with following CLI
       -machine virt,gic-version=3,accel=kvm -cpu host -bios AAVMF_CODE.fd
      it crashes with abort at
       accel/kvm/kvm-all.c:2164:
       KVM_SET_DEVICE_ATTR failed: Group 6 attr 0x000000000000c665: Invalid argument
      
      Which is caused by implicit dependency of kvm_arm_gicv3_reset() on
      arm_gicv3_icc_reset() where the later is called by CPU reset
      reset callback.
      
      However commit:
       3b77f6c3 arm/boot: split load_dtb() from arm_load_kernel()
      broke CPU reset callback registration in case
      
        arm_load_kernel()
            ...
            if (!info->kernel_filename || info->firmware_loaded)
      
      branch is taken, i.e. it's sufficient to provide a firmware
      or do not provide kernel on CLI to skip cpu reset callback
      registration, where before offending commit the callback
      has been registered unconditionally.
      
      Fix it by registering the callback right at the beginning of
      arm_load_kernel() unconditionally instead of doing it at the end.
      
      NOTE:
       we probably should eliminate that dependency anyways as well as
       separate arch CPU reset parts from arm_load_kernel() into CPU
       itself, but that refactoring that I probably would have to do
       anyways later for CPU hotplug to work.
      Reported-by: NAuger Eric <eric.auger@redhat.com>
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NEric Auger <eric.auger@redhat.com>
      Tested-by: NEric Auger <eric.auger@redhat.com>
      Message-id: 1527070950-208350-1-git-send-email-imammedo@redhat.com
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      60b8fe49
  15. 11 5月, 2018 1 次提交
    • I
      arm/boot: split load_dtb() from arm_load_kernel() · 3b77f6c3
      Igor Mammedov 提交于
      load_dtb() depends on arm_load_kernel() to figure out place
      in RAM where it should be loaded, but it's not required for
      arm_load_kernel() to work. Sometimes it's neccesary for
      devices added with -device/device_add to be enumerated in
      DTB as well, which's lead to [1] and surrounding commits to
      add 2 more machine_done notifiers with non obvious ordering
      to make dynamic sysbus devices initialization happen in
      the right order.
      
      However instead of moving whole arm_load_kernel() in to
      machine_done, it's sufficient to move only load_dtb() into
      virt_machine_done() notifier and remove ArmLoadKernelNotifier/
      /PlatformBusFDTNotifierParams notifiers, which saves us ~90LOC
      and simplifies code flow quite a bit.
      Later would allow to consolidate DTB generation within one
      function for 'mach-virt' board and make it reentrant so it
      could generate updated DTB in device hotplug secenarios.
      
      While at it rename load_dtb() to arm_load_dtb() since it's
      public now.
      
      Add additional field skip_dtb_autoload to struct arm_boot_info
      to allow manual DTB load later in mach-virt and to avoid touching
      all other boards to explicitly call arm_load_dtb().
      
       1) (ac9d32e3 hw/arm/boot: arm_load_kernel implemented as a machine init done notifier)
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NAndrew Jones <drjones@redhat.com>
      Message-id: 1525691524-32265-4-git-send-email-imammedo@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      3b77f6c3
  16. 05 5月, 2018 1 次提交
  17. 26 4月, 2018 1 次提交
  18. 10 4月, 2018 1 次提交
  19. 20 3月, 2018 2 次提交
    • P
      hw/arm/boot: If booting a kernel in EL2, set SCR_EL3.HCE · bda816f0
      Peter Maydell 提交于
      If we're directly booting a Linux kernel and the CPU supports both
      EL3 and EL2, we start the kernel in EL2, as it expects. We must also
      set the SCR_EL3.HCE bit in this situation, so that the HVC
      instruction is enabled rather than UNDEFing. Otherwise at least some
      kernels will panic when trying to initialize KVM in the guest.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 20180313153458.26822-4-peter.maydell@linaro.org
      bda816f0
    • P
      hw/arm/boot: assert that secure_boot and secure_board_setup are false for AArch64 · 43118f43
      Peter Maydell 提交于
      Add some assertions that if we're about to boot an AArch64 kernel,
      the board code has not mistakenly set either secure_boot or
      secure_board_setup. It doesn't make sense to set secure_boot,
      because all AArch64 kernels must be booted in non-secure mode.
      
      It might in theory make sense to set secure_board_setup, but
      we don't currently support that, because only the AArch32
      bootloader[] code calls this hook; bootloader_aarch64[] does not.
      Since we don't have a current need for this functionality, just
      assert that we don't try to use it. If it's needed we'll add
      it later.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 20180313153458.26822-3-peter.maydell@linaro.org
      43118f43
  20. 10 3月, 2018 2 次提交
    • M
      arm: avoid heap-buffer-overflow in load_aarch64_image · 27640407
      Marc-André Lureau 提交于
      Spotted by ASAN:
      
      elmarco@boraha:~/src/qemu/build (master *%)$ QTEST_QEMU_BINARY=aarch64-softmmu/qemu-system-aarch64 tests/boot-serial-test
      /aarch64/boot-serial/virt: ** (process:19740): DEBUG: 18:39:30.275: foo /tmp/qtest-boot-serial-cXaS94D
      =================================================================
      ==19740==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000069648 at pc 0x7f1d2201cc54 bp 0x7fff331f6a40 sp 0x7fff331f61e8
      READ of size 4 at 0x603000069648 thread T0
          #0 0x7f1d2201cc53  (/lib64/libasan.so.4+0xafc53)
          #1 0x55bc86685ee3 in load_aarch64_image /home/elmarco/src/qemu/hw/arm/boot.c:894
          #2 0x55bc86687217 in arm_load_kernel_notify /home/elmarco/src/qemu/hw/arm/boot.c:1047
          #3 0x55bc877363b5 in notifier_list_notify /home/elmarco/src/qemu/util/notify.c:40
          #4 0x55bc869331ea in qemu_run_machine_init_done_notifiers /home/elmarco/src/qemu/vl.c:2716
          #5 0x55bc8693bc39 in main /home/elmarco/src/qemu/vl.c:4679
          #6 0x7f1d1652c009 in __libc_start_main (/lib64/libc.so.6+0x21009)
          #7 0x55bc86255cc9 in _start (/home/elmarco/src/qemu/build/aarch64-softmmu/qemu-system-aarch64+0x1ae5cc9)
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      27640407
    • M
      arm: fix load ELF error leak · 36f876ce
      Marc-André Lureau 提交于
      Spotted by ASAN:
      QTEST_QEMU_BINARY=aarch64-softmmu/qemu-system-aarch64 tests/boot-serial-test
      
      Direct leak of 48 byte(s) in 1 object(s) allocated from:
          #0 0x7ff8a9b0ca38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
          #1 0x7ff8a8ea7f75 in g_malloc0 ../glib/gmem.c:124
          #2 0x55fef3d99129 in error_setv /home/elmarco/src/qemu/util/error.c:59
          #3 0x55fef3d99738 in error_setg_internal /home/elmarco/src/qemu/util/error.c:95
          #4 0x55fef323acb2 in load_elf_hdr /home/elmarco/src/qemu/hw/core/loader.c:393
          #5 0x55fef2d15776 in arm_load_elf /home/elmarco/src/qemu/hw/arm/boot.c:830
          #6 0x55fef2d16d39 in arm_load_kernel_notify /home/elmarco/src/qemu/hw/arm/boot.c:1022
          #7 0x55fef3dc634d in notifier_list_notify /home/elmarco/src/qemu/util/notify.c:40
          #8 0x55fef2fc3182 in qemu_run_machine_init_done_notifiers /home/elmarco/src/qemu/vl.c:2716
          #9 0x55fef2fcbbd1 in main /home/elmarco/src/qemu/vl.c:4679
          #10 0x7ff89dfed009 in __libc_start_main (/lib64/libc.so.6+0x21009)
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      36f876ce
  21. 02 3月, 2018 1 次提交
  22. 09 2月, 2018 2 次提交
  23. 07 2月, 2018 1 次提交
    • A
      hw/arm: Replace fprintf(stderr, "*\n" with error_report() · c0dbca36
      Alistair Francis 提交于
      Replace a large number of the fprintf(stderr, "*\n" calls with
      error_report(). The functions were renamed with these commands and then
      compiler issues where manually fixed.
      
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      
      Some lines where then manually tweaked to pass checkpatch.
      
      The 'qemu: ' prefix was manually removed from the hw/arm/boot.c file.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: qemu-arm@nongnu.org
      
      Conversions that aren't followed by exit() dropped, because they might
      be inappropriate.
      
      Also trim trailing punctuation from error messages.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20180203084315.20497-3-armbru@redhat.com>
      c0dbca36
  24. 21 4月, 2017 1 次提交
  25. 28 11月, 2016 1 次提交
  26. 18 10月, 2016 1 次提交
  27. 12 5月, 2016 1 次提交
  28. 21 4月, 2016 1 次提交
  29. 23 3月, 2016 1 次提交
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  30. 04 3月, 2016 1 次提交