Skip to content
Snippets Groups Projects
  1. Dec 15, 2020
  2. Dec 14, 2020
    • Eduardo Habkost's avatar
      tmp421: Register properties as class properties · 0b43b6e5
      Eduardo Habkost authored
      
      Class properties make QOM introspection simpler and easier, as
      they don't require an object to be instantiated.
      
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20201111183823.283752-4-ehabkost@redhat.com>
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      0b43b6e5
    • Eduardo Habkost's avatar
      vexpress-a15: Register "virtualization" as class property · fdfe5ba4
      Eduardo Habkost authored
      
      Class properties make QOM introspection simpler and easier, as
      they don't require an object to be instantiated.
      
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20201111183823.283752-3-ehabkost@redhat.com>
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      fdfe5ba4
    • Eduardo Habkost's avatar
      vexpress: Register "secure" as class property · 4433bb3d
      Eduardo Habkost authored
      
      Class properties make QOM introspection simpler and easier, as
      they don't require an object to be instantiated.
      
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20201111183823.283752-2-ehabkost@redhat.com>
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      4433bb3d
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.0-20201214' into staging · 37f04b71
      Peter Maydell authored
      
      ppc patch queue 2020-12-14
      
      Here's my first pull request for qemu-6.0, with a bunch of things
      queued over the freeze.  Highlights are:
       * A bunch of cleanups to hotplug error paths from Greg Kurz
       * A number of TCG fixes from new contributor Giuseppe Musacchio
       * Added Greg Kurz as co-maintainer
       * Assorted other bugfixes and cleanups
      
      This supersedes ppc-for-6.0-20201211, the only change are some patch
      authors to better match qemu conventions.
      
      # gpg: Signature made Mon 14 Dec 2020 04:57:09 GMT
      # gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dg-gitlab/tags/ppc-for-6.0-20201214: (30 commits)
        spapr.c: set a 'kvm-type' default value instead of relying on NULL
        spapr: Pass sPAPR machine state to some RTAS events handling functions
        spapr: Don't use qdev_get_machine() in spapr_msi_write()
        spapr: Pass sPAPR machine state down to spapr_pci_switch_vga()
        target/ppc: Introduce an mmu_is_64bit() helper
        ppc/translate: Use POWERPC_MMU_64 to detect 64-bit MMU models
        ppc/e500: Free irqs array to avoid memleak
        MAINTAINERS: Add Greg Kurz as co-maintainer for ppc
        hw/ppc: Do not re-read the clock on pre_save if doing savevm
        target/ppc: Remove "compat" property of server class POWER CPUs
        spapr: spapr_drc_attach() cannot fail
        spapr: Simplify error path of spapr_core_plug()
        spapr: Abort if ppc_set_compat() fails for hot-plugged CPUs
        spapr: Fix pre-2.10 dummy ICP hack
        xive: Add trace events
        hw/ppc/spapr_tpm_proxy: Fix hexadecimal format string specifier
        ppc/translate: Rewrite gen_lxvdsx to use gvec primitives
        ppc/translate: Raise exceptions after setting the cc
        ppc/translate: Delay NaN checking after comparison
        ppc/translate: Turn the helper macros into functions
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      37f04b71
    • Peter Maydell's avatar
      tests/tcg/multiarch/Makefile.target: Disable run-gdbstub-sha1 test · a930cadd
      Peter Maydell authored
      Disable the run-gdbstub-sha1 test: it provokes an internal error
      assertion failure in Ubuntu gdb 8.1.1-0ubuntu1 (Ubuntu gdb
      8.1-0ubuntu3.2 also has this assert but we were previously skipping
      this test because it doesn't support connection over local domain
      sockets) :
      
      timeout 60  /home/petmay01/linaro/qemu-for-merges/tests/guest-debug/run-test.py --gdb /usr/bin/gdb-multiar
      /build/gdb-veKdC1/gdb-8.1.1/gdb/regcache.c:122: internal-error: void* init_regcache_descr(gdbarch*): Asser
      A problem internal to GDB has been detected,
      further debugging may prove unreliable.
      
      This is a bug, please report it.  For instructions, see:
      <http://www.gnu.org/software/gdb/bugs/
      
      >.
      
      Aborted (core dumped)
      /home/petmay01/linaro/qemu-for-merges/tests/tcg/multiarch/Makefile.target:51: recipe for target 'run-gdbst
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 20201214133702.24088-1-peter.maydell@linaro.org
      a930cadd
    • Daniel Henrique Barboza's avatar
      spapr.c: set a 'kvm-type' default value instead of relying on NULL · 07b10bc4
      Daniel Henrique Barboza authored
      
      spapr_kvm_type() is considering 'vm_type=NULL' as a valid input, where
      the function returns 0. This is relying on the current QEMU machine
      options handling logic, where the absence of the 'kvm-type' option
      will be reflected as 'vm_type=NULL' in this function.
      
      This is not robust, and will break if QEMU options code decides to propagate
      something else in the case mentioned above (e.g. an empty string instead
      of NULL).
      
      Let's avoid this entirely by setting a non-NULL default value in case of
      no user input for 'kvm-type'. spapr_kvm_type() was changed to handle 3 fixed
      values of kvm-type: "auto", "hv", and "pr", with "auto" being the default
      if no kvm-type was set by the user. This allows us to always be predictable
      regardless of any enhancements/changes made in QEMU options mechanics.
      
      While we're at it, let's also document in 'kvm-type' description the
      already existing default mode, now named 'auto'. The information provided
      about it is based on how the pseries kernel handles the KVM_CREATE_VM
      ioctl(), where the default value '0' makes the kernel choose an available
      KVM module to use, giving precedence to kvm_hv. This logic is described in
      the kernel source file arch/powerpc/kvm/powerpc.c, function kvm_arch_init_vm().
      
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20201210145517.1532269-2-danielhb413@gmail.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      07b10bc4
    • Greg Kurz's avatar
      spapr: Pass sPAPR machine state to some RTAS events handling functions · 0ff6b520
      Greg Kurz authored
      
      Some functions in hw/ppc/spapr_events.c get a pointer to the machine
      state using qdev_get_machine(). Convert them to get it from their
      caller when possible.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <20201209170052.1431440-6-groug@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      0ff6b520
    • Greg Kurz's avatar
      spapr: Don't use qdev_get_machine() in spapr_msi_write() · 56cca10e
      Greg Kurz authored
      
      spapr_phb_realize() passes the sPAPR machine state as opaque data
      for the I/O callbacks:
      
      memory_region_init_io(&sphb->msiwindow, OBJECT(sphb), &spapr_msi_ops, spapr,
                                                                            ^^^^^
                            "msi", msi_window_size);
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <20201209170052.1431440-5-groug@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      56cca10e
    • Greg Kurz's avatar
      spapr: Pass sPAPR machine state down to spapr_pci_switch_vga() · c4c81d7d
      Greg Kurz authored
      
      This allows to drop a user of qdev_get_machine().
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <20201209170052.1431440-4-groug@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      c4c81d7d
    • Greg Kurz's avatar
      target/ppc: Introduce an mmu_is_64bit() helper · d57d72a8
      Greg Kurz authored
      
      Callers don't really need to know how 64-bit MMU model enums are
      computed. Hide this in a helper.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <20201209173536.1437351-3-groug@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      d57d72a8
    • Stephane Duverger's avatar
      ppc/translate: Use POWERPC_MMU_64 to detect 64-bit MMU models · d55dfd44
      Stephane Duverger authored
      
      The ppc_tr_init_disas_context() function currently checks whether the
      MMU is 64-bit by ANDing its model type with POWERPC_MMU_64B. This is
      wrong : POWERPC_MMU_64B isn't a mask, it is the generic MMU model for
      pre-PowerISA-2.03 64-bit CPUs (ie. PowerPC 970 in QEMU).
      
      Use POWERPC_MMU_64 instead of POWERPC_MMU_64B. This should fix a
      potential bug with some 32-bit CPUs for which 'need_access_type'
      was mis-computed because (POWERPC_MMU_32B & POWERPC_MMU_64B)
      happens to be equal to 1. The end result being a crash in
      ppc_hash32_direct_store() because the access type isn't set:
      
              cpu_abort(cs, "ERROR: instruction should not need "
                       "address translation\n");
      
      This doesn't change anything for 'lazy_tlb_flush' since POWERPC_MMU_32B
      is checked first.
      
      Fixes: 5f2a6254 ("ppc: Don't set access_type on all load/stores on hash64")
      Signed-off-by: default avatarStephane Duverger <stephane.duverger@free.fr>
      [groug: - extended patch to address another misuse of POWERPC_MMU_64B
              - updated title and changelog accordingly]
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <20201209173536.1437351-2-groug@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      d55dfd44
    • Gan Qixin's avatar
      ppc/e500: Free irqs array to avoid memleak · ef0efa1a
      Gan Qixin authored
      
      When running qom-test, a memory leak occurred in the ppce500_init function,
      this patch free irqs array to fix it.
      
      ASAN shows memory leak stack:
      
      Direct leak of 40 byte(s) in 1 object(s) allocated from:
          #0 0xfffc5ceee1f0 in __interceptor_calloc (/lib64/libasan.so.5+0xee1f0)
          #1 0xfffc5c806800 in g_malloc0 (/lib64/libglib-2.0.so.0+0x56800)
          #2 0xaaacf9999244 in ppce500_init qemu/hw/ppc/e500.c:859
          #3 0xaaacf97434e8 in machine_run_board_init qemu/hw/core/machine.c:1134
          #4 0xaaacf9c9475c in qemu_init qemu/softmmu/vl.c:4369
          #5 0xaaacf94785a0 in main qemu/softmmu/main.c:49
      
      Reported-by: default avatarEuler Robot <euler.robot@huawei.com>
      Signed-off-by: default avatarGan Qixin <ganqixin@huawei.com>
      Message-Id: <20201204075822.359832-1-ganqixin@huawei.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      ef0efa1a
    • David Gibson's avatar
      MAINTAINERS: Add Greg Kurz as co-maintainer for ppc · ba477e64
      David Gibson authored
      
      Greg has agreed to be co-maintainer of the ppc target and machines.
      This should avoid repeats of the problem we had in qemu-5.2 where a
      last minute fix was needed while I was on holiday.
      
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: default avatarGreg Kurz <groug@kaod.org>
      ba477e64
    • Greg Kurz's avatar
      hw/ppc: Do not re-read the clock on pre_save if doing savevm · 711dfb24
      Greg Kurz authored
      A guest with enough RAM, eg. 128G, is likely to detect savevm downtime
      and to complain about stalled CPUs. This happens because we re-read
      the timebase just before migrating it and we thus don't account for
      all the time between VM stop and pre-save.
      
      A very similar situation was already addressed for live migration of
      paused guests (commit d14f3397). Extend the logic to do the same
      with savevm.
      
      Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1893787
      
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <160693010619.1111945.632640981169395440.stgit@bahia.lan>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      711dfb24
    • Greg Kurz's avatar
      target/ppc: Remove "compat" property of server class POWER CPUs · f518be3a
      Greg Kurz authored
      
      This property has been deprecated since QEMU 5.0 by commit 22062e54.
      We only kept a legacy hack that internally converts "compat" into the
      official "max-cpu-compat" property of the pseries machine type.
      
      According to our deprecation policy, we could have removed it for QEMU 5.2
      already. Do it now ; since ppc_cpu_parse_featurestr() now just calls the
      generic parent_parse_features handler, drop it as well.
      
      Users are supposed to use the "max-cpu-compat" property of the pseries
      machine type instead.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <20201201131103.897430-1-groug@kaod.org>
      Reviewed-by: default avatarJán Tomko <jtomko@redhat.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      f518be3a
    • Greg Kurz's avatar
      spapr: spapr_drc_attach() cannot fail · bc370a65
      Greg Kurz authored
      
      All users are passing &error_abort already. Document the fact
      that spapr_drc_attach() should only be passed a free DRC, which
      is supposedly the case if appropriate checking is done earlier.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <20201201113728.885700-5-groug@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      bc370a65
    • Greg Kurz's avatar
      spapr: Simplify error path of spapr_core_plug() · f9b43958
      Greg Kurz authored
      
      spapr_core_pre_plug() already guarantees that the slot for the given core
      ID is available. It is thus safe to assume that spapr_find_cpu_slot()
      returns a slot during plug. Turn the error path into an assertion.
      It is also safe to assume that no device is attached to the corresponding
      DRC and that spapr_drc_attach() shouldn't fail.
      
      Pass &error_abort to spapr_drc_attach() and simplify error handling.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <20201201113728.885700-4-groug@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      f9b43958
    • Greg Kurz's avatar
      spapr: Abort if ppc_set_compat() fails for hot-plugged CPUs · 37641213
      Greg Kurz authored
      
      When a CPU is hot-plugged, we set its compat mode to match the boot
      CPU, which was either set by machine reset or by CAS. This is currently
      handled in the plug handler after the core got realized. Potential errors
      of ppc_set_compat() are propagated to the hot-plug logic.
      
      Handling errors this late in the hot-plug sequence is generally frown
      upon. Ideally, we should do sanity checks in a pre-plug handler and pass
      &error_abort to ppc_set_compat() in the plug handler.
      
      We can filter out some error cases of ppc_set_compat() by calling
      ppc_check_compat() at pre-plug. But ppc_set_compat() also sets the
      compat register in KVM, and KVM doesn't provide any API that would
      allow to check valid compat mode settings beforehand.
      
      However, at this point we know that the compat mode was already
      successfully set for the boot CPU. Since this all boils down to
      setting a register with the very same value that was valid
      for the boot CPU, it should definitely not fail for hot-plugged
      CPUS.
      
      Pass &error_abort to ppc_set_compat().
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <20201201113728.885700-3-groug@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      37641213
Loading