qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] c618e3: hw/ppc/spapr_drc.c: change spapr_drc_


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] c618e3: hw/ppc/spapr_drc.c: change spapr_drc_needed to use...
Date: Fri, 08 Sep 2017 07:40:53 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: c618e300eb2276996e7004100686768cf1445128
      
https://github.com/qemu/qemu/commit/c618e300eb2276996e7004100686768cf1445128
  Author: Daniel Henrique Barboza <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_drc.c

  Log Message:
  -----------
  hw/ppc/spapr_drc.c: change spapr_drc_needed to use drc->dev

This patch makes a small fix in 'spapr_drc_needed' to change how we detect
if a DRC has a device attached. Previously it used dr_entity_sense for this,
which  works for physical DRCs.

However, for logical DRCs, it didn't cover the case where a logical DRC has
a drc->dev but the state is LOGICAL_UNUSABLE (e.g. a hotplugged CPU before
CAS). In this case, the dr_entity_sense of this DRC returns UNUSABLE and the
code was considering that there were no dev attached, making spapr_drc_needed
return 'false' when in fact we would like to migrate the DRC.

Changing it to check for drc->dev instead works for all DRC types.

Signed-off-by: Daniel Henrique Barboza <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 56258174238eb25df629a53a96e1ac16a32dc7d4
      
https://github.com/qemu/qemu/commit/56258174238eb25df629a53a96e1ac16a32dc7d4
  Author: Daniel Henrique Barboza <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

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

  Log Message:
  -----------
  hw/ppc: clear pending_events on machine reset

The sPAPR machine isn't clearing up the pending events QTAILQ on
machine reboot. This allows for unprocessed hotplug/epow events
to persist in the queue after reset and, when reasserting the IRQs in
check_exception later on, these will be being processed by the OS.

This patch implements a new function called 'spapr_clear_pending_events'
that clears up the pending_events QTAILQ. This helper is then called
inside ppc_spapr_reset to clear up the events queue, preventing
old/deprecated events from persisting after a reset.

Signed-off-by: Daniel Henrique Barboza <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 10f12e6450407b18b4d5a6b50d3852dcfd7fff75
      
https://github.com/qemu/qemu/commit/10f12e6450407b18b4d5a6b50d3852dcfd7fff75
  Author: Daniel Henrique Barboza <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

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

  Log Message:
  -----------
  hw/ppc: CAS reset on early device hotplug

This patch is a follow up on the discussions made in patch
"hw/ppc: disable hotplug before CAS is completed" that can be
found at [1].

At this moment, we do not support CPU/memory hotplug in early
boot stages, before CAS. When a hotplug occurs, the event is logged
in an internal RTAS event log queue and an IRQ pulse is fired. In
regular conditions, the guest handles the interrupt by executing
check_exception, fetching the generated hotplug event and enabling
the device for use.

In early boot, this IRQ isn't caught (SLOF does not handle hotplug
events), leaving the event in the rtas event log queue. If the guest
executes check_exception due to another hotplug event, the re-assertion
of the IRQ ends up de-queuing the first hotplug event as well. In short,
a device hotplugged before CAS is considered coldplugged by SLOF.
This leads to device misbehavior and, in some cases, guest kernel
Ooops when trying to unplug the device.

A proper fix would be to turn every device hotplugged before CAS
as a colplugged device. This is not trivial to do with the current
code base though - the FDT is written in the guest memory at
ppc_spapr_reset and can't be retrieved without adding extra state
(fdt_size for example) that will need to managed and migrated. Adding
the hotplugged DT in the middle of CAS negotiation via the updated DT
tree works with CPU devs, but panics the guest kernel at boot. Additional
analysis would be necessary for LMBs and PCI devices. There are
questions to be made in QEMU/SLOF/kernel level about how we can make
this change in a sustainable way.

With Linux guests, a fix would be the kernel executing check_exception
at boot time, de-queueing the events that happened in early boot and
processing them. However, even if/when the newer kernels start
fetching these events at boot time, we need to take care of older
kernels that won't be doing that.

This patch works around the situation by issuing a CAS reset if a hotplugged
device is detected during CAS:

- the DRC conditions that warrant a CAS reset is the same as those that
triggers a DRC migration - the DRC must have a device attached and
the DRC state is not equal to its ready_state. With that in mind, this
patch makes use of 'spapr_drc_needed' to determine if a CAS reset
is needed.

- In the middle of CAS negotiations, the function
'spapr_hotplugged_dev_before_cas' goes through all the DRCs to see
if there are any DRC that requires a reset, using spapr_drc_needed. If
that happens, returns '1' in 'spapr_h_cas_compose_response' which will set
spapr->cas_reboot to true, causing the machine to reboot.

No changes are made for coldplug devices.

[1] http://lists.nongnu.org/archive/html/qemu-devel/2017-08/msg02855.html

Signed-off-by: Daniel Henrique Barboza <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 5c3d70e9701402e2755cf5d43f62a305ade4def2
      
https://github.com/qemu/qemu/commit/5c3d70e9701402e2755cf5d43f62a305ade4def2
  Author: Greg Kurz <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_pci.c

  Log Message:
  -----------
  spapr_pci: use memory_region_add_subregion() with DMA windows

Passing a null priority to memory_region_add_subregion_overlap() is
strictly equivalent to calling memory_region_add_subregion().

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: a205a053dcfd89c7ab57aef48d26cd9349388933
      
https://github.com/qemu/qemu/commit/a205a053dcfd89c7ab57aef48d26cd9349388933
  Author: Greg Kurz <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_iommu.c

  Log Message:
  -----------
  spapr_iommu: use g_strdup_printf() instead of snprintf()

Passing a stack allocated buffer of arbitrary length to snprintf()
without checking the return value can cause the resultant strings
to be silently truncated.

Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: f5babeacc4abccbb32f318278135a43477bdaa20
      
https://github.com/qemu/qemu/commit/f5babeacc4abccbb32f318278135a43477bdaa20
  Author: Greg Kurz <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_drc.c

  Log Message:
  -----------
  spapr_drc: use g_strdup_printf() instead of snprintf()

Passing a stack allocated buffer of arbitrary length to snprintf()
without checking the return value can cause the resultant strings
to be silently truncated.

Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: a931ad137aabd4e798d9bd411d81fcf800e50529
      
https://github.com/qemu/qemu/commit/a931ad137aabd4e798d9bd411d81fcf800e50529
  Author: Greg Kurz <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_iommu.c

  Log Message:
  -----------
  spapr_iommu: convert TCE table object to realize()

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: dba95ebbf88a8b8f10f4691946b4406e4acc4f0f
      
https://github.com/qemu/qemu/commit/dba95ebbf88a8b8f10f4691946b4406e4acc4f0f
  Author: Greg Kurz <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_pci.c

  Log Message:
  -----------
  spapr_pci: parent the MSI memory region to the PHB

This memory region should be owned by the PHB. This ensures the PHB
cannot be finalized as long as the the region is guest visible, or
used by a CPU or a device.

Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 379ae096f7ee7c8ae15886eeb4361008ac6ba1c4
      
https://github.com/qemu/qemu/commit/379ae096f7ee7c8ae15886eeb4361008ac6ba1c4
  Author: Greg Kurz <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_drc.c

  Log Message:
  -----------
  spapr_drc: add unrealize method to physical DRC class

When hot-unplugging a PHB, all its PCI DRC connectors get unrealized. This
patch adds an unrealize method to the physical DRC class, in order to undo
registrations performed in realize_physical().

Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: f3f41030346832af62737d69d15fd8d6dab9ba79
      
https://github.com/qemu/qemu/commit/f3f41030346832af62737d69d15fd8d6dab9ba79
  Author: Michael Roth <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_drc.c

  Log Message:
  -----------
  spapr_drc: pass object ownership to parent/owner

DRC objects attach themselves to an owner as a child
property. unref afterward to allow them to be finalized
when their owner is finalized.

Signed-off-by: Michael Roth <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 8dc9785ca0ff4e1c2268eb70a8156ed9696f97be
      
https://github.com/qemu/qemu/commit/8dc9785ca0ff4e1c2268eb70a8156ed9696f97be
  Author: Michael Roth <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_iommu.c

  Log Message:
  -----------
  spapr_iommu: pass object ownership to parent/owner

TCE table objects attach themselves to an owner as a child
property. unref afterward to allow them to be finalized
when their owner is finalized.

Signed-off-by: Michael Roth <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: ea359d20e606cca317d02f8289f72aecff659895
      
https://github.com/qemu/qemu/commit/ea359d20e606cca317d02f8289f72aecff659895
  Author: Greg Kurz <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_iommu.c

  Log Message:
  -----------
  spapr_iommu: unregister vmstate at unrealize time

Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: e2676b169754c3956bad421a8c80982e651b1b4c
      
https://github.com/qemu/qemu/commit/e2676b169754c3956bad421a8c80982e651b1b4c
  Author: Greg Kurz <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  spapr: add pseries-2.11 machine type

Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 6d536570198460743d01a7dc08deda56deee66ab
      
https://github.com/qemu/qemu/commit/6d536570198460743d01a7dc08deda56deee66ab
  Author: Sam Bobroff <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/e500.c

  Log Message:
  -----------
  e500: Use cpu_index instead of vcpu_dt_id

The e500 platform code uses the function ppc_get_vcpu_dt_id() to get
an id to put in its device tree.  Which seems like it makes sense, but
ppc_get_vcpu_dt_id() is actually badly named - it only differs from
cpu_index in cases where you're running on KVM HV and the host's
number of threads differs from the guests.  Since KVM HV only supports
PAPR, not e500, it doesn't make sense to use it here.

Simply use the cpu_index instead (which is 'i' in this context
because qemu_get_cpu(i) returns the cpu with cpu_index == i).

Signed-off-by: Sam Bobroff <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
[dwg: Rewrote commit message]
Signed-off-by: David Gibson <address@hidden>


  Commit: 81210c2009296261879af5d58a3a499815031765
      
https://github.com/qemu/qemu/commit/81210c2009296261879af5d58a3a499815031765
  Author: Sam Bobroff <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/ppc.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_hcall.c
    M hw/ppc/spapr_rtas.c
    M target/ppc/cpu.h
    M target/ppc/kvm.c
    M target/ppc/translate_init.c

  Log Message:
  -----------
  ppc: spapr: Rename cpu_dt_id to vcpu_id

This field actually records the VCPU ID used by KVM and, although the
value is also used in the device tree it is primarily the VCPU ID so
rename it as such.

Signed-off-by: Sam Bobroff <address@hidden>
[dwg: Updated comment missed in cpu.h]
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 2e886fb39168942ab03b91062e715946e4af8436
      
https://github.com/qemu/qemu/commit/2e886fb39168942ab03b91062e715946e4af8436
  Author: Sam Bobroff <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/ppc.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_hcall.c
    M hw/ppc/spapr_rtas.c
    M include/hw/ppc/spapr.h
    M target/ppc/cpu.h
    M target/ppc/kvm.c

  Log Message:
  -----------
  ppc: spapr: Make VCPU ID handling private to SPAPR

The concept of a VCPU ID that differs from the CPU's index
(cpu->cpu_index) exists only within SPAPR machines so, move the
functions ppc_get_vcpu_id() and ppc_get_cpu_by_vcpu_id() into spapr.c
and rename them appropriately.

Signed-off-by: Sam Bobroff <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 3f330293bace409fc172201f27084784c697f8f8
      
https://github.com/qemu/qemu/commit/3f330293bace409fc172201f27084784c697f8f8
  Author: KONRAD Frederic <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/cpu.h

  Log Message:
  -----------
  booke206: fix booke206_tlbnps for mav 2.0

This fixes booke206_tlbnps for MAV 2.0 by checking the MMUCFG register and
return directly the right tlbnps instead of computing it from non existing
field.

Signed-off-by: KONRAD Frederic <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: c449d8ba42f5c374e9fa0d1b08766c9a0d040ad2
      
https://github.com/qemu/qemu/commit/c449d8ba42f5c374e9fa0d1b08766c9a0d040ad2
  Author: KONRAD Frederic <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/cpu.h
    M target/ppc/mmu_helper.c

  Log Message:
  -----------
  booke206: fix tlbnps for fixed size TLB

Some OS don't populate the TSIZE field when using a fixed size TLB which result
in a 1KB TLB. When the TLB is a fixed size TLB the TSIZE field should be
ignored.

Fix this wrong behavior with MAV 2.0.

Signed-off-by: KONRAD Frederic <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: d21ee6331e18c768fc141540912ec871e3bea393
      
https://github.com/qemu/qemu/commit/d21ee6331e18c768fc141540912ec871e3bea393
  Author: KONRAD Frederic <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/translate_init.c

  Log Message:
  -----------
  booke206: allow to specify an mmucfg value at the init

This allows to init the MMUCFG SPR with a non NULL value.

Signed-off-by: KONRAD Frederic <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 54a50dae93fa3c0b0bd6188ecf1777474d55648e
      
https://github.com/qemu/qemu/commit/54a50dae93fa3c0b0bd6188ecf1777474d55648e
  Author: KONRAD Frederic <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/cpu-models.c
    M target/ppc/cpu-models.h
    M target/ppc/translate_init.c

  Log Message:
  -----------
  ppc64: introduce e6500

This introduces e6500 core.

Signed-off-by: KONRAD Frederic <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: f5509b6bebc68fc781f0823e628fead884fd69d4
      
https://github.com/qemu/qemu/commit/f5509b6bebc68fc781f0823e628fead884fd69d4
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_iommu.c

  Log Message:
  -----------
  spapr_iommu: Realloc guest visible TCE table when hot(un)plugging vfio-pci

This replaces g_malloc() with spapr_tce_alloc_table() as this is
the standard way of allocating tables and this allows moving the table
back to KVM when unplugging a VFIO PCI device and VFIO TCE acceleration
support is not present in the KVM.

Although spapr_tce_alloc_table() is expected to fail with EBUSY
if called when previous fd is not closed yet, in practice we will not
see it because cap_spapr_vfio is false at the moment.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 517284a77171af6f5676678aea15030ea1887842
      
https://github.com/qemu/qemu/commit/517284a77171af6f5676678aea15030ea1887842
  Author: BALATON Zoltan <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/ppc405_uc.c
    M hw/ppc/ppc4xx_devs.c
    M include/hw/ppc/ppc4xx.h

  Log Message:
  -----------
  ppc4xx: Move MAL from ppc405_uc to ppc4xx_devs

This device appears in other SoCs as well not just in 405 ones

Signed-off-by: BALATON Zoltan <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 0453428047527ac778489a927b66d591ff3c450c
      
https://github.com/qemu/qemu/commit/0453428047527ac778489a927b66d591ff3c450c
  Author: BALATON Zoltan <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/ppc405_uc.c
    M hw/ppc/ppc4xx_devs.c
    M include/hw/ppc/ppc4xx.h

  Log Message:
  -----------
  ppc4xx: Make MAL emulation more generic

Allow MAL with more RX and TX channels as found in newer versions.

Signed-off-by: BALATON Zoltan <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 65ca801bf4837237f37f867c7fd49c3054d78091
      
https://github.com/qemu/qemu/commit/65ca801bf4837237f37f867c7fd49c3054d78091
  Author: BALATON Zoltan <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/Makefile.objs
    M hw/ppc/ppc405.h
    M hw/ppc/ppc405_uc.c
    A hw/ppc/ppc4xx_i2c.c

  Log Message:
  -----------
  ppc4xx: Split off 4xx I2C emulation from ppc405_uc to its own file

This device appears in other SoCs as well not just in 405 ones and
subsequent patches will modify it, so move it out of ppc405_uc.c in
preparation

Signed-off-by: BALATON Zoltan <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 3b09bb0fb9bc03f3897da4940ba2fb808c00c038
      
https://github.com/qemu/qemu/commit/3b09bb0fb9bc03f3897da4940ba2fb808c00c038
  Author: BALATON Zoltan <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/ppc405.h
    M hw/ppc/ppc405_uc.c
    M hw/ppc/ppc4xx_i2c.c
    A include/hw/i2c/ppc4xx_i2c.h

  Log Message:
  -----------
  ppc4xx_i2c: QOMify

Signed-off-by: BALATON Zoltan <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 44a935d8c3f09089e740a89b5af5d71c134b93df
      
https://github.com/qemu/qemu/commit/44a935d8c3f09089e740a89b5af5d71c134b93df
  Author: BALATON Zoltan <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M default-configs/ppc-softmmu.mak
    M default-configs/ppc64-softmmu.mak
    M default-configs/ppcemb-softmmu.mak
    M hw/i2c/Makefile.objs
    A hw/i2c/ppc4xx_i2c.c
    M hw/ppc/Makefile.objs
    R hw/ppc/ppc4xx_i2c.c

  Log Message:
  -----------
  ppc4xx_i2c: Move to hw/i2c

Signed-off-by: BALATON Zoltan <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 97c2acb5504ee0ab0a5efc39a06f9783220dba90
      
https://github.com/qemu/qemu/commit/97c2acb5504ee0ab0a5efc39a06f9783220dba90
  Author: BALATON Zoltan <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/ppc405.h
    M hw/ppc/ppc405_uc.c

  Log Message:
  -----------
  ppc4xx: Export ECB and PLB emulation

Make these device models available outside ppc405_uc.c for reuse in
460EX emulation. They are left in their current place for now because
they are used mostly unchanged and I'm not sure these correctly model
the components in 440 SoCs (but they seem to be good enough). These
functions could be moved in a subsequent clean up series when this is
confirmed.

Signed-off-by: BALATON Zoltan <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 2363d5ee231bf047479422d56d3b85b7d37a7c23
      
https://github.com/qemu/qemu/commit/2363d5ee231bf047479422d56d3b85b7d37a7c23
  Author: Thomas Huth <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_cpu_core.c
    M scripts/device-crash-test

  Log Message:
  -----------
  hw/ppc/spapr_cpu_core: Add a proper check for spapr machine

QEMU currently crashes when the user tries to add a spapr-cpu-core
on a non-pseries machine:

$ qemu-system-ppc64 -S -machine ppce500,accel=tcg \
              -device POWER5+_v2.1-spapr-cpu-core
hw/ppc/spapr_cpu_core.c:178:spapr_cpu_core_realize_child:
Object 0x55cee1f55160 is not an instance of type spapr-machine
Aborted (core dumped)

So let's add a proper check for the correct machine time with
a more friendly error message here.

Reported-by: Eduardo Habkost <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 280503ee9d7833a793770d732dda5358659825e9
      
https://github.com/qemu/qemu/commit/280503ee9d7833a793770d732dda5358659825e9
  Author: Thomas Huth <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/nvram/spapr_nvram.c

  Log Message:
  -----------
  hw/nvram/spapr_nvram: Device can not be created by the users

Trying to add a spapr-nvram device currently aborts QEMU like this:

$ ppc64-softmmu/qemu-system-ppc64  -device spapr-nvram
qemu-system-ppc64: hw/ppc/spapr_rtas.c:407: spapr_rtas_register:
 Assertion `!rtas_table[token].name' failed.
Aborted (core dumped)

This NVRAM device registers RTAS calls during its realize function
and thus can only be used once - and that's internally from spapr.c.
So let's mark the device with user_creatable = false to avoid that
the users can crash their QEMU this way.

Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: cc7b35b169e96600c09947a31c610c84a3eda3ff
      
https://github.com/qemu/qemu/commit/cc7b35b169e96600c09947a31c610c84a3eda3ff
  Author: Greg Kurz <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_hcall.c

  Log Message:
  -----------
  spapr: fallback to raw mode if best compat mode cannot be set during CAS

KVM PR doesn't allow to set a compat mode. This causes ppc_set_compat_all()
to fail and we return H_HARDWARE to the guest right away.

This is excessive: even if we favor compat mode since commit 152ef803ceb19,
we should at least fallback to raw mode if the guest supports it.

This patch modifies cas_check_pvr() so that it also reports that the real
PVR was found in the table supplied by the guest. Note that this is only
makes sense if raw mode isn't explicitely disabled (ie, the user didn't
set the machine "max-cpu-compat" property). If this is the case, we can
simply ignore ppc_set_compat_all() failures, and let the guest run in raw
mode.

Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: fa98fbfcdfcb980b4a690b8bc93ab597935087b1
      
https://github.com/qemu/qemu/commit/fa98fbfcdfcb980b4a690b8bc93ab597935087b1
  Author: Sam Bobroff <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr.c
    M include/hw/ppc/spapr.h
    M target/ppc/kvm.c
    M target/ppc/kvm_ppc.h
    M target/ppc/translate_init.c

  Log Message:
  -----------
  PPC: KVM: Support machine option to set VSMT mode

KVM now allows writing to KVM_CAP_PPC_SMT which has previously been
read only. Doing so causes KVM to act, for that VM, as if the host's
SMT mode was the given value. This is particularly important on Power
9 systems because their default value is 1, but they are able to
support values up to 8.

This patch introduces a way to control this capability via a new
machine property called VSMT ("Virtual SMT"). If the value is not set
on the command line a default is chosen that is, when possible,
compatible with legacy systems.

Note that the intialization of KVM_CAP_PPC_SMT has changed slightly
because it has changed (in KVM) from a global capability to a
VM-specific one. This won't cause a problem on older KVMs because VM
capabilities fall back to global ones.

Signed-off-by: Sam Bobroff <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: bf1457bdbb736a54eb2eb70bc531e11eb468de7e
      
https://github.com/qemu/qemu/commit/bf1457bdbb736a54eb2eb70bc531e11eb468de7e
  Author: Thomas Huth <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    R target/ppc/STATUS

  Log Message:
  -----------
  target/ppc: Remove old STATUS file

The target/ppc/STATUS file has seen its last real update 10 years
ago - so the information in there is not up to date anymore. Since
nobody seems to care about this file, let's simply remove it.

Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: c9137065814609111ec0ed29246388f4ad086732
      
https://github.com/qemu/qemu/commit/c9137065814609111ec0ed29246388f4ad086732
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/cpu-models.c
    M target/ppc/cpu.h
    M target/ppc/kvm.c
    M target/ppc/kvm_ppc.h
    M target/ppc/translate_init.c

  Log Message:
  -----------
  ppc: use macros to make cpu type name from string literal

Replace
  "-" TYPE_POWERPC_CPU
when composing cpu type name from cpu model string literal
and the same pattern in format strings with
 POWERPC_CPU_TYPE_SUFFIX and POWERPC_CPU_TYPE_NAME(model)
macroses like we do in x86.

Later POWERPC_CPU_TYPE_NAME() will be used to define default
cpu type per machine type and as bonus it will be consistent
and easy grep-able pattern across all other targets that I'm
plannig to treat the same way.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: c5354f54aa60d98c54ea5170a2064a1023e69967
      
https://github.com/qemu/qemu/commit/c5354f54aa60d98c54ea5170a2064a1023e69967
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_cpu_core.c
    M target/ppc/cpu-models.c
    M target/ppc/kvm.c
    M target/ppc/translate_init.c

  Log Message:
  -----------
  ppc: make cpu_model translation to type consistent

PPC handles -cpu FOO rather incosistently,
i.e. it does case-insensitive matching of FOO to
a CPU type (see: ppc_cpu_compare_class_name) but
handles alias names as case-sensitive, as result:

 # qemu-system-ppc64 -M mac99 -cpu g3
 qemu-system-ppc64: unable to find CPU model ' kN�U'

 # qemu-system-ppc64 -cpu 970MP_V1.1
 qemu-system-ppc64: Unable to find sPAPR CPU Core definition

while

 # qemu-system-ppc64 -M mac99 -cpu G3
 # qemu-system-ppc64 -cpu 970MP_v1.1

start up just fine.

Considering we can't take case-insensitive matching away,
make it case-insensitive for  all alias/type/core_type
lookups.

As side effect it allows to remove duplicate core types
which are the same except of using different cased letters in name.

Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 6ea707e9d1fb1a5680c091895fc042aac9a4bd74
      
https://github.com/qemu/qemu/commit/6ea707e9d1fb1a5680c091895fc042aac9a4bd74
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/cpu-models.c
    M target/ppc/cpu-models.h

  Log Message:
  -----------
  ppc: make cpu alias point only to real cpu models

alias pointing to another alias forces lookup code to
do recurrsive translation till real cpu model is reached.

Drop this nonsence and make each alias point to cpu model
that has corresponding CPU type. It will allow to drop
recurrsion in cpu model translation code and actually
make ppc_cpu_aliases[] content use PowerPCCPUAlias
fields properly
(i.e. alias goes into .alias and model goes into .model)

While at it add TODO defines around aliases that point to
cpu models excluded by the same TODO defines.

Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 03c9141d75eac39b7897c4a670eb71103da9986f
      
https://github.com/qemu/qemu/commit/03c9141d75eac39b7897c4a670eb71103da9986f
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/translate_init.c

  Log Message:
  -----------
  ppc: replace inter-function cyclic dependency/recurssion with 2 simple lookups

previous patches cleaned up cpu model/alias naming which
allows to simplify cpu model/alias to cpu type lookup a bit
byt removing recurssion and dependency of ppc_cpu_class_by_name() /
ppc_cpu_class_by_alias() on each other.
Besides of simplifying code it reduces it by ~15LOC.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: b376db777563ec6f9fd57255506418b500151a3d
      
https://github.com/qemu/qemu/commit/b376db777563ec6f9fd57255506418b500151a3d
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/translate_init.c

  Log Message:
  -----------
  ppc: simplify cpu model lookup by PVR

Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 2527cb9109f5bac0a6c3260927923a6c06c0fe11
      
https://github.com/qemu/qemu/commit/2527cb9109f5bac0a6c3260927923a6c06c0fe11
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/cpu-models.h
    M target/ppc/kvm.c
    M target/ppc/translate_init.c

  Log Message:
  -----------
  ppc: drop caching ObjectClass from PowerPCCPUAlias

Caching there practically doesn't give any benefits
and that at slow path druring querying supported CPU list.
But it introduces non conventional path of where from
comes used CPU type name (kvm_ppc_register_host_cpu_type).

Taking in account that kvm_ppc_register_host_cpu_type()
fixes up models the aliases point to, it's sufficient to
make ppc_cpu_class_by_name() translate cpu alias to
correct cpu type name.
So drop PowerPCCPUAlias::oc field + ppc_cpu_class_by_alias()
and let ppc_cpu_class_by_name() do conversion to cpu type name,
which simplifies code a little bit saving ~20LOC and trouble
wondering why ppc_cpu_class_by_alias() is necessary.

Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: aef779605779579afbafffaba1e3a06ea89c3bdd
      
https://github.com/qemu/qemu/commit/aef779605779579afbafffaba1e3a06ea89c3bdd
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M target/ppc/cpu-models.c

  Log Message:
  -----------
  ppc: remove non implemented cpu models

Remove cpu models that aren't implemented and are not
compiled/tested since they are under TODO ifdef
which isn't defined in sources.

If someone really needs a removed model he/she should add
as regular one with corresponding implementation.

Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 7cca3e466eb0baa36d1cc29d5aeb5da74a260711
      
https://github.com/qemu/qemu/commit/7cca3e466eb0baa36d1cc29d5aeb5da74a260711
  Author: Sam Bobroff <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/ppc/spapr_cpu_core.c
    M target/ppc/translate_init.c

  Log Message:
  -----------
  ppc: spapr: Move VCPU ID calculation into sPAPR

Move the calculation of a CPU's VCPU ID out of the generic PPC code
(ppc_cpu_realizefn()) and into sPAPR specific code
(spapr_cpu_core_realize()) where it belongs.

Unfortunately, due to the way things are ordered, we still need to
default the VCPU ID in ppc_cpu_realizfn() but at least doing that
doesn't require any interaction with sPAPR.

Signed-off-by: Sam Bobroff <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: a1ae46d1b4f2a95ad5d3da8d15bc6403bcdbb24a
      
https://github.com/qemu/qemu/commit/a1ae46d1b4f2a95ad5d3da8d15bc6403bcdbb24a
  Author: Peter Maydell <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M default-configs/ppc-softmmu.mak
    M default-configs/ppc64-softmmu.mak
    M default-configs/ppcemb-softmmu.mak
    M hw/i2c/Makefile.objs
    A hw/i2c/ppc4xx_i2c.c
    M hw/nvram/spapr_nvram.c
    M hw/ppc/e500.c
    M hw/ppc/ppc.c
    M hw/ppc/ppc405.h
    M hw/ppc/ppc405_uc.c
    M hw/ppc/ppc4xx_devs.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_cpu_core.c
    M hw/ppc/spapr_drc.c
    M hw/ppc/spapr_events.c
    M hw/ppc/spapr_hcall.c
    M hw/ppc/spapr_iommu.c
    M hw/ppc/spapr_pci.c
    M hw/ppc/spapr_rtas.c
    A include/hw/i2c/ppc4xx_i2c.h
    M include/hw/ppc/ppc4xx.h
    M include/hw/ppc/spapr.h
    M include/hw/ppc/spapr_drc.h
    M scripts/device-crash-test
    R target/ppc/STATUS
    M target/ppc/cpu-models.c
    M target/ppc/cpu-models.h
    M target/ppc/cpu.h
    M target/ppc/kvm.c
    M target/ppc/kvm_ppc.h
    M target/ppc/mmu_helper.c
    M target/ppc/translate_init.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.11-20170908' 
into staging

ppc patch queue 2017-09-08

This is the first batch of ppc related patches for qemu-2.11, and it's
accumulated quite a few things.  Includes:

  * A cleanup to handling of ppc cpu models from Igor
  * First parts of fixes to handling of guest vs. host SMT modes from
    Sam Bobroff
  * Preliminary patches towards supporting the Sam460 board from
    Balaton Zoltan
  * Several fixes for hotplug logic
  * Assorted other fixes and cleanups

# gpg: Signature made Fri 08 Sep 2017 06:28:42 BST
# gpg:                using RSA key 0x6C38CACA20D9B392
# gpg: Good signature from "David Gibson <address@hidden>"
# gpg:                 aka "David Gibson (Red Hat) <address@hidden>"
# gpg:                 aka "David Gibson (ozlabs.org) <address@hidden>"
# gpg:                 aka "David Gibson (kernel.org) <address@hidden>"
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-2.11-20170908: (40 commits)
  ppc: spapr: Move VCPU ID calculation into sPAPR
  ppc: remove non implemented cpu models
  ppc: drop caching ObjectClass from PowerPCCPUAlias
  ppc: simplify cpu model lookup by PVR
  ppc: replace inter-function cyclic dependency/recurssion with 2 simple lookups
  ppc: make cpu alias point only to real cpu models
  ppc: make cpu_model translation to type consistent
  ppc: use macros to make cpu type name from string literal
  target/ppc: Remove old STATUS file
  PPC: KVM: Support machine option to set VSMT mode
  spapr: fallback to raw mode if best compat mode cannot be set during CAS
  hw/nvram/spapr_nvram: Device can not be created by the users
  hw/ppc/spapr_cpu_core: Add a proper check for spapr machine
  ppc4xx: Export ECB and PLB emulation
  ppc4xx_i2c: Move to hw/i2c
  ppc4xx_i2c: QOMify
  ppc4xx: Split off 4xx I2C emulation from ppc405_uc to its own file
  ppc4xx: Make MAL emulation more generic
  ppc4xx: Move MAL from ppc405_uc to ppc4xx_devs
  spapr_iommu: Realloc guest visible TCE table when hot(un)plugging vfio-pci
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/74bbfe024da8...a1ae46d1b4f2

reply via email to

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