qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 484d77: spapr/xive: Turn some sanity checks i


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 484d77: spapr/xive: Turn some sanity checks into assertions
Date: Mon, 14 Dec 2020 10:49:29 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 484d774c3a5cefd7991ff2bee9bd70977bcb9a67
      
https://github.com/qemu/qemu/commit/484d774c3a5cefd7991ff2bee9bd70977bcb9a67
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/intc/spapr_xive.c

  Log Message:
  -----------
  spapr/xive: Turn some sanity checks into assertions

The sPAPR XIVE device is created by the machine in spapr_irq_init().
The latter overrides any value provided by the user with -global for
the "nr-irqs" and "nr-ends" properties with strictly positive values.

It seems reasonable to assume these properties should never be 0,
which wouldn't make much sense by the way.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201120174646.619395-2-groug@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 0b66209d9f8d35ba0f894b14ac00996b5ecf547c
      
https://github.com/qemu/qemu/commit/0b66209d9f8d35ba0f894b14ac00996b5ecf547c
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/intc/xics_kvm.c
    M hw/ppc/spapr_irq.c
    M include/hw/ppc/xics_spapr.h

  Log Message:
  -----------
  spapr/xics: Drop unused argument to xics_kvm_has_broken_disconnect()

Never used from the start.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201120174646.619395-6-groug@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 9e4dc0a1c2743cb115ebdb32258a78b328c05205
      
https://github.com/qemu/qemu/commit/9e4dc0a1c2743cb115ebdb32258a78b328c05205
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr_pci.c

  Log Message:
  -----------
  spapr: Do PCI device hotplug sanity checks at pre-plug only

The PHB acts as the hotplug handler for PCI devices. It does some
sanity checks on DR enablement, PCI bridge chassis numbers and
multifunction. These checks are currently performed at plug time,
but they would best sit in a pre-plug handler in order to error
out as early as possible.

Create a spapr_pci_pre_plug() handler and move all the checking
there. Add a check that the associated DRC doesn't already have
an attached device. This is equivalent to the slot availability
check performed by do_pci_register_device() upon realization of
the PCI device.

This allows to pass &error_abort to spapr_drc_attach() and to end
up with a plug handler that doesn't need to report errors anymore.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201120234208.683521-2-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: ea042c53f4d9e48e7b3c84f5d0eb70a84aa34413
      
https://github.com/qemu/qemu/commit/ea042c53f4d9e48e7b3c84f5d0eb70a84aa34413
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr.c
    M hw/ppc/spapr_nvdimm.c
    M include/hw/ppc/spapr_nvdimm.h

  Log Message:
  -----------
  spapr: Do NVDIMM/PC-DIMM device hotplug sanity checks at pre-plug only

Pre-plug of a memory device, be it an NVDIMM or a PC-DIMM, ensures
that the memory slot is available and that addresses don't overlap
with existing memory regions. The corresponding DRCs in the LMB
and PMEM namespaces are thus necessarily attachable at plug time.

Pass &error_abort to spapr_drc_attach() in spapr_add_lmbs() and
spapr_add_nvdimm(). This allows to greatly simplify error handling
on the plug path.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201120234208.683521-3-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: f5598c92b84047c395836985715ff62c856ff2fe
      
https://github.com/qemu/qemu/commit/f5598c92b84047c395836985715ff62c856ff2fe
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr.c
    M include/hw/ppc/spapr.h

  Log Message:
  -----------
  spapr: Make PHB placement functions and spapr_pre_plug_phb() return status

Read documentation in "qapi/error.h" and changelog of commit
e3fe3988d785 ("error: Document Error API usage rules") for
rationale.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201120234208.683521-7-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 9a07069958705f426180829f807f0b84ec295b93
      
https://github.com/qemu/qemu/commit/9a07069958705f426180829f807f0b84ec295b93
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  spapr: Do PHB hoplug sanity check at pre-plug

We currently detect that a PHB index is already in use at plug time.
But this can be decteted at pre-plug in order to error out earlier.

This allows to pass &error_abort to spapr_drc_attach() and to end
up with a plug handler that doesn't need to report errors anymore.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201120234208.683521-8-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: ac96807b0245f08d969a8faf0c8c754514bb6c10
      
https://github.com/qemu/qemu/commit/ac96807b0245f08d969a8faf0c8c754514bb6c10
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  spapr: Do TPM proxy hotplug sanity checks at pre-plug

There can be only one TPM proxy at a time. This is currently
checked at plug time. But this can be detected at pre-plug in
order to error out earlier.

This allows to get rid of error handling in the plug handler.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201120234208.683521-9-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: cf77e27f1e16d8eca761e5c966ea80291254a32c
      
https://github.com/qemu/qemu/commit/cf77e27f1e16d8eca761e5c966ea80291254a32c
  Author: Chen Qun <kuhn.chenqun@huawei.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M target/ppc/mmu_helper.c

  Log Message:
  -----------
  target/ppc: replaced the TODO with LOG_UNIMP and add break for silence 
warnings

When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warning:
target/ppc/mmu_helper.c: In function ‘dump_mmu’:
target/ppc/mmu_helper.c:1351:12: warning: this statement may fall through 
[-Wimplicit-fallthrough=]
 1351 |         if (ppc64_v3_radix(env_archcpu(env))) {
      |            ^
target/ppc/mmu_helper.c:1358:5: note: here
 1358 |     default:
      |     ^~~~~~~

Use "qemu_log_mask(LOG_UNIMP**)" instead of the TODO comment.
And add the break statement to fix it.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20201116024810.2415819-8-kuhn.chenqun@huawei.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: b2bd5b20fd1854cdbfee87553855163081a6c531
      
https://github.com/qemu/qemu/commit/b2bd5b20fd1854cdbfee87553855163081a6c531
  Author: Chen Qun <kuhn.chenqun@huawei.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/ppc.c

  Log Message:
  -----------
  ppc: Add a missing break for PPC6xx_INPUT_TBEN

When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warning:
hw/ppc/ppc.c: In function ‘ppc6xx_set_irq’:
hw/ppc/ppc.c:118:16: warning: this statement may fall through 
[-Wimplicit-fallthrough=]
  118 |             if (level) {
      |                ^
hw/ppc/ppc.c:123:9: note: here
  123 |         case PPC6xx_INPUT_INT:
      |         ^~~~

According to the discussion, a break statement needs to be added here.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20201116024810.2415819-7-kuhn.chenqun@huawei.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 3278aa49d559ca191ff10735d363bd367d81fabf
      
https://github.com/qemu/qemu/commit/3278aa49d559ca191ff10735d363bd367d81fabf
  Author: Giuseppe Musacchio <thatlemon@gmail.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M target/ppc/fpu_helper.c

  Log Message:
  -----------
  ppc/translate: Fix unordered f64/f128 comparisons

According to the PowerISA v3.1 reference, Table 68 "Actions for xscmpudp
- Part 1: Compare Unordered", whenever one of the two operands is a NaN
the SO bit is set while the other three bits are cleared.

Apply the same change to xscmpuqp.

The respective ordered counterparts are unaffected.

Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Message-Id: <20201112230130.65262-2-thatlemon@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 132954a8307635c08c8e3c4d63d4af9fa865a459
      
https://github.com/qemu/qemu/commit/132954a8307635c08c8e3c4d63d4af9fa865a459
  Author: Giuseppe Musacchio <thatlemon@gmail.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M target/ppc/fpu_helper.c

  Log Message:
  -----------
  ppc/translate: Turn the helper macros into functions

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201112230130.65262-3-thatlemon@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: bc92c260f6f0da73d3bdee5e1c2bf38d6f22e20a
      
https://github.com/qemu/qemu/commit/bc92c260f6f0da73d3bdee5e1c2bf38d6f22e20a
  Author: Giuseppe Musacchio <thatlemon@gmail.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M target/ppc/fpu_helper.c

  Log Message:
  -----------
  ppc/translate: Delay NaN checking after comparison

Since we always perform a comparison between the two operands avoid
checking for NaN unless the result states they're unordered.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201112230130.65262-4-thatlemon@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 91699dbf30a94dea2575ae193412c364c7f3a5fd
      
https://github.com/qemu/qemu/commit/91699dbf30a94dea2575ae193412c364c7f3a5fd
  Author: Giuseppe Musacchio <thatlemon@gmail.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M target/ppc/fpu_helper.c

  Log Message:
  -----------
  ppc/translate: Raise exceptions after setting the cc

The PowerISA reference states that the comparison operators update the
FPCC, CR and FPSCR and, if VE=1, jump to the exception handler.

Moving the exception-triggering code after the CC update sequence solves
the problem.

Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201112230130.65262-5-thatlemon@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: bcb0b7b1a1c05707304f80ca6f523d557816f85c
      
https://github.com/qemu/qemu/commit/bcb0b7b1a1c05707304f80ca6f523d557816f85c
  Author: Giuseppe Musacchio <thatlemon@gmail.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M target/ppc/translate/vsx-impl.c.inc

  Log Message:
  -----------
  ppc/translate: Rewrite gen_lxvdsx to use gvec primitives

Make the implementation match the lxvwsx one.
The code is now shorter smaller and potentially faster as the
translation will use the host SIMD capabilities if available.

No functional change.

Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Message-Id: 
<a463dea379da4cb3a22de49c678932f74fb15dd7.1604912739.git.thatlemon@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 728aa6f6ffd8cf21d9485eff7ac1926b00155ed2
      
https://github.com/qemu/qemu/commit/728aa6f6ffd8cf21d9485eff7ac1926b00155ed2
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/trace-events

  Log Message:
  -----------
  hw/ppc/spapr_tpm_proxy: Fix hexadecimal format string specifier

The '%u' conversion specifier is for decimal notation.
When prefixing a format with '0x', we want the hexadecimal
specifier ('%x').

Inspired-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20201103112558.2554390-4-philmd@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 4e960974d4ee66bc03ed6ef4b1b1eb6234039417
      
https://github.com/qemu/qemu/commit/4e960974d4ee66bc03ed6ef4b1b1eb6234039417
  Author: Cédric Le Goater <clg@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/intc/spapr_xive.c
    M hw/intc/spapr_xive_kvm.c
    M hw/intc/trace-events
    M hw/intc/xive.c

  Log Message:
  -----------
  xive: Add trace events

I have been keeping those logging messages in an ugly form for
while. Make them clean !

Beware not to activate all of them, this is really verbose.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20201123163717.1368450-1-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 1b4ab51493f4e656a211bbb109f4cb621c598443
      
https://github.com/qemu/qemu/commit/1b4ab51493f4e656a211bbb109f4cb621c598443
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  spapr: Fix pre-2.10 dummy ICP hack

This hack registers dummy VMState entries of ICPs in order to
support migration of old pseries machine types that used to
create all smp.max_cpus possible ICPs at machine init.

Part of the work is to unregister the dummy entries when plugging
an actual vCPU core, and to register them back when unplugging the
core. The code that unregisters the dummy ICPs in spapr_core_plug()
is misplaced: if ppc_set_compat() fails afterwards, the hotplug
operation will be cancelled and the dummy ICPs won't be registered
back since the unplug handler isn't called.

Unregister the dummy ICPs at the end of spapr_core_plug().

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201201113728.885700-2-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 376412135d2b6d8eddf915479885638e7425bc4e
      
https://github.com/qemu/qemu/commit/376412135d2b6d8eddf915479885638e7425bc4e
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  spapr: Abort if ppc_set_compat() fails for hot-plugged CPUs

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: Greg Kurz <groug@kaod.org>
Message-Id: <20201201113728.885700-3-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: f9b43958b99ea0cc65d0857e073bda381372242c
      
https://github.com/qemu/qemu/commit/f9b43958b99ea0cc65d0857e073bda381372242c
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  spapr: Simplify error path of spapr_core_plug()

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: Greg Kurz <groug@kaod.org>
Message-Id: <20201201113728.885700-4-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: bc370a659a33865f8b55332f6363c45896bae56d
      
https://github.com/qemu/qemu/commit/bc370a659a33865f8b55332f6363c45896bae56d
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr.c
    M hw/ppc/spapr_drc.c
    M hw/ppc/spapr_nvdimm.c
    M hw/ppc/spapr_pci.c
    M include/hw/ppc/spapr_drc.h

  Log Message:
  -----------
  spapr: spapr_drc_attach() cannot fail

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: Greg Kurz <groug@kaod.org>
Message-Id: <20201201113728.885700-5-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: f518be3aa35b0505eec36c36f4f8736906250681
      
https://github.com/qemu/qemu/commit/f518be3aa35b0505eec36c36f4f8736906250681
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M docs/system/deprecated.rst
    M target/ppc/translate_init.c.inc

  Log Message:
  -----------
  target/ppc: Remove "compat" property of server class POWER CPUs

This property has been deprecated since QEMU 5.0 by commit 22062e54bb68.
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: Greg Kurz <groug@kaod.org>
Message-Id: <20201201131103.897430-1-groug@kaod.org>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 711dfb2423a85fba91884b5a90a8c0712c152ce2
      
https://github.com/qemu/qemu/commit/711dfb2423a85fba91884b5a90a8c0712c152ce2
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/ppc.c

  Log Message:
  -----------
  hw/ppc: Do not re-read the clock on pre_save if doing savevm

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 d14f33976282). Extend the logic to do the same
with savevm.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1893787
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <160693010619.1111945.632640981169395440.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: ba477e64612d573495ebc5c930831526b73af987
      
https://github.com/qemu/qemu/commit/ba477e64612d573495ebc5c930831526b73af987
  Author: David Gibson <david@gibson.dropbear.id.au>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Add Greg Kurz as co-maintainer for ppc

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: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Greg Kurz <groug@kaod.org>


  Commit: ef0efa1a045635388eedc75377dc6493c0eed826
      
https://github.com/qemu/qemu/commit/ef0efa1a045635388eedc75377dc6493c0eed826
  Author: Gan Qixin <ganqixin@huawei.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/e500.c

  Log Message:
  -----------
  ppc/e500: Free irqs array to avoid memleak

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: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Gan Qixin <ganqixin@huawei.com>
Message-Id: <20201204075822.359832-1-ganqixin@huawei.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: d55dfd446cd58b36f1b58d178039d7657a50e803
      
https://github.com/qemu/qemu/commit/d55dfd446cd58b36f1b58d178039d7657a50e803
  Author: Stephane Duverger <stephane.duverger@free.fr>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M target/ppc/translate.c

  Log Message:
  -----------
  ppc/translate: Use POWERPC_MMU_64 to detect 64-bit MMU models

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: 5f2a6254522b ("ppc: Don't set access_type on all load/stores on hash64")
Signed-off-by: Stephane Duverger <stephane.duverger@free.fr>
[groug: - extended patch to address another misuse of POWERPC_MMU_64B
        - updated title and changelog accordingly]
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201209173536.1437351-2-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: d57d72a874e6b6b7bea70fd7024fb217d4b51b52
      
https://github.com/qemu/qemu/commit/d57d72a874e6b6b7bea70fd7024fb217d4b51b52
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M target/ppc/cpu-qom.h
    M target/ppc/excp_helper.c
    M target/ppc/machine.c
    M target/ppc/mmu-hash64.c
    M target/ppc/mmu_helper.c
    M target/ppc/translate.c
    M target/ppc/translate_init.c.inc

  Log Message:
  -----------
  target/ppc: Introduce an mmu_is_64bit() helper

Callers don't really need to know how 64-bit MMU model enums are
computed. Hide this in a helper.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201209173536.1437351-3-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: c4c81d7d51dd220fc9957aaf3da3a6eee906bbbb
      
https://github.com/qemu/qemu/commit/c4c81d7d51dd220fc9957aaf3da3a6eee906bbbb
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr_hcall.c
    M hw/ppc/spapr_pci.c
    M include/hw/ppc/spapr.h

  Log Message:
  -----------
  spapr: Pass sPAPR machine state down to spapr_pci_switch_vga()

This allows to drop a user of qdev_get_machine().

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201209170052.1431440-4-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 56cca10eb56f259dd7b479bbb2c66a87560e3146
      
https://github.com/qemu/qemu/commit/56cca10eb56f259dd7b479bbb2c66a87560e3146
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr_pci.c

  Log Message:
  -----------
  spapr: Don't use qdev_get_machine() in spapr_msi_write()

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: Greg Kurz <groug@kaod.org>
Message-Id: <20201209170052.1431440-5-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 0ff6b52094a7aa0cd5e989624d77e206e904916c
      
https://github.com/qemu/qemu/commit/0ff6b52094a7aa0cd5e989624d77e206e904916c
  Author: Greg Kurz <groug@kaod.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr_events.c

  Log Message:
  -----------
  spapr: Pass sPAPR machine state to some RTAS events handling functions

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: Greg Kurz <groug@kaod.org>
Message-Id: <20201209170052.1431440-6-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>


  Commit: 07b10bc42cc83a49acaa783383a69fb59d7ff71a
      
https://github.com/qemu/qemu/commit/07b10bc42cc83a49acaa783383a69fb59d7ff71a
  Author: Daniel Henrique Barboza <danielhb413@gmail.com>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  spapr.c: set a 'kvm-type' default value instead of relying on NULL

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: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20201210145517.1532269-2-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>


  Commit: 37f04b71a9cd62ca0f2d24a70fe843619ad45cd0
      
https://github.com/qemu/qemu/commit/37f04b71a9cd62ca0f2d24a70fe843619ad45cd0
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-12-14 (Mon, 14 Dec 2020)

  Changed paths:
    M MAINTAINERS
    M docs/system/deprecated.rst
    M hw/intc/spapr_xive.c
    M hw/intc/spapr_xive_kvm.c
    M hw/intc/trace-events
    M hw/intc/xics_kvm.c
    M hw/intc/xive.c
    M hw/ppc/e500.c
    M hw/ppc/ppc.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_drc.c
    M hw/ppc/spapr_events.c
    M hw/ppc/spapr_hcall.c
    M hw/ppc/spapr_irq.c
    M hw/ppc/spapr_nvdimm.c
    M hw/ppc/spapr_pci.c
    M hw/ppc/trace-events
    M include/hw/ppc/spapr.h
    M include/hw/ppc/spapr_drc.h
    M include/hw/ppc/spapr_nvdimm.h
    M include/hw/ppc/xics_spapr.h
    M target/ppc/cpu-qom.h
    M target/ppc/excp_helper.c
    M target/ppc/fpu_helper.c
    M target/ppc/machine.c
    M target/ppc/mmu-hash64.c
    M target/ppc/mmu_helper.c
    M target/ppc/translate.c
    M target/ppc/translate/vsx-impl.c.inc
    M target/ppc/translate_init.c.inc

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.0-20201214' 
into staging

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: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/a930cadd83b4...37f04b71a9cd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]