aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-03-31 13:14:18 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-03-31 13:14:18 +0100
commit6ee55e1d10c25c2f6bf5ce2084ad2327e17affa5 (patch)
treed4a1b05ad673e5b28378b6831cf77f10e2a5cc32
parentb307a3174ffc293d4af9a0f03d9f78ae63327157 (diff)
parent611ac0a60fdcc7422bf42ef9b467abf4fdbea1a2 (diff)
downloadqemu-6ee55e1d10c25c2f6bf5ce2084ad2327e17affa5.zip
qemu-6ee55e1d10c25c2f6bf5ce2084ad2327e17affa5.tar.gz
qemu-6ee55e1d10c25c2f6bf5ce2084ad2327e17affa5.tar.bz2
Merge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.0-20210331' into staging
ppc patch queue for 2021-03-31 Here's another set of patches for the ppc target and associated machine types. I'd hoped to send this closer to the hard freeze, but got caught up for some time chasing what looked like a strange regression, before finally concluding it was due to unrelated failures on the CI. This is just a handful of fairly straightforward fixes, plus one performance improvement that's simple and beneficial enough that I'm considering it a "performance bug fix". # gpg: Signature made Wed 31 Mar 2021 07:22:17 BST # 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-20210331: hw/net: fsl_etsec: Tx padding length should exclude CRC spapr: Fix typo in the patb_entry comment spapr: Assert DIMM unplug state in spapr_memory_unplug() target/ppc/kvm: Cache timebase frequency hw/ppc: e500: Add missing #address-cells and #size-cells in the eTSEC node Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/net/fsl_etsec/rings.c2
-rw-r--r--hw/ppc/e500.c2
-rw-r--r--hw/ppc/spapr.c3
-rw-r--r--include/hw/ppc/spapr.h2
-rw-r--r--target/ppc/kvm.c25
5 files changed, 26 insertions, 8 deletions
diff --git a/hw/net/fsl_etsec/rings.c b/hw/net/fsl_etsec/rings.c
index d6be0d7..8f08446 100644
--- a/hw/net/fsl_etsec/rings.c
+++ b/hw/net/fsl_etsec/rings.c
@@ -259,7 +259,7 @@ static void process_tx_bd(eTSEC *etsec,
|| etsec->regs[MACCFG2].value & MACCFG2_PADCRC) {
/* Padding and CRC (Padding implies CRC) */
- tx_padding_and_crc(etsec, 64);
+ tx_padding_and_crc(etsec, 60);
} else if (etsec->first_bd.flags & BD_TX_TC
|| etsec->regs[MACCFG2].value & MACCFG2_CRC_EN) {
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 1d94485..79467ac 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -237,6 +237,8 @@ static int create_devtree_etsec(SysBusDevice *sbdev, PlatformDevtreeData *data)
qemu_fdt_setprop_string(fdt, node, "model", "eTSEC");
qemu_fdt_setprop(fdt, node, "local-mac-address", etsec->conf.macaddr.a, 6);
qemu_fdt_setprop_cells(fdt, node, "fixed-link", 0, 1, 1000, 0, 0);
+ qemu_fdt_setprop_cells(fdt, node, "#size-cells", 1);
+ qemu_fdt_setprop_cells(fdt, node, "#address-cells", 1);
qemu_fdt_add_subnode(fdt, group);
qemu_fdt_setprop_cells(fdt, group, "reg", mmio0, 0x1000);
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d56418c..73a06df 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3660,6 +3660,9 @@ static void spapr_memory_unplug(HotplugHandler *hotplug_dev, DeviceState *dev)
SpaprMachineState *spapr = SPAPR_MACHINE(hotplug_dev);
SpaprDimmState *ds = spapr_pending_dimm_unplugs_find(spapr, PC_DIMM(dev));
+ /* We really shouldn't get this far without anything to unplug */
+ g_assert(ds);
+
pc_dimm_unplug(PC_DIMM(dev), MACHINE(hotplug_dev));
qdev_unrealize(dev);
spapr_pending_dimm_unplugs_remove(spapr, ds);
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 47cebaf..bf7cab7 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -168,7 +168,7 @@ struct SpaprMachineState {
SpaprResizeHpt resize_hpt;
void *htab;
uint32_t htab_shift;
- uint64_t patb_entry; /* Process tbl registed in H_REGISTER_PROCESS_TABLE */
+ uint64_t patb_entry; /* Process tbl registed in H_REGISTER_PROC_TBL */
SpaprPendingHpt *pending_hpt; /* in-progress resize */
hwaddr rma_size;
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 298c1f8..104a308 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -1815,24 +1815,37 @@ static int read_cpuinfo(const char *field, char *value, int len)
return ret;
}
-uint32_t kvmppc_get_tbfreq(void)
+static uint32_t kvmppc_get_tbfreq_procfs(void)
{
char line[512];
char *ns;
- uint32_t retval = NANOSECONDS_PER_SECOND;
+ uint32_t tbfreq_fallback = NANOSECONDS_PER_SECOND;
+ uint32_t tbfreq_procfs;
if (read_cpuinfo("timebase", line, sizeof(line))) {
- return retval;
+ return tbfreq_fallback;
}
ns = strchr(line, ':');
if (!ns) {
- return retval;
+ return tbfreq_fallback;
}
- ns++;
+ tbfreq_procfs = atoi(++ns);
+
+ /* 0 is certainly not acceptable by the guest, return fallback value */
+ return tbfreq_procfs ? tbfreq_procfs : tbfreq_fallback;
+}
+
+uint32_t kvmppc_get_tbfreq(void)
+{
+ static uint32_t cached_tbfreq;
+
+ if (!cached_tbfreq) {
+ cached_tbfreq = kvmppc_get_tbfreq_procfs();
+ }
- return atoi(ns);
+ return cached_tbfreq;
}
bool kvmppc_get_host_serial(char **value)