Skip to content

Commit 6ee55e1

Browse files
committed
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>
2 parents b307a31 + 611ac0a commit 6ee55e1

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

hw/net/fsl_etsec/rings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static void process_tx_bd(eTSEC *etsec,
259259
|| etsec->regs[MACCFG2].value & MACCFG2_PADCRC) {
260260

261261
/* Padding and CRC (Padding implies CRC) */
262-
tx_padding_and_crc(etsec, 64);
262+
tx_padding_and_crc(etsec, 60);
263263

264264
} else if (etsec->first_bd.flags & BD_TX_TC
265265
|| etsec->regs[MACCFG2].value & MACCFG2_CRC_EN) {

hw/ppc/e500.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ static int create_devtree_etsec(SysBusDevice *sbdev, PlatformDevtreeData *data)
237237
qemu_fdt_setprop_string(fdt, node, "model", "eTSEC");
238238
qemu_fdt_setprop(fdt, node, "local-mac-address", etsec->conf.macaddr.a, 6);
239239
qemu_fdt_setprop_cells(fdt, node, "fixed-link", 0, 1, 1000, 0, 0);
240+
qemu_fdt_setprop_cells(fdt, node, "#size-cells", 1);
241+
qemu_fdt_setprop_cells(fdt, node, "#address-cells", 1);
240242

241243
qemu_fdt_add_subnode(fdt, group);
242244
qemu_fdt_setprop_cells(fdt, group, "reg", mmio0, 0x1000);

hw/ppc/spapr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3660,6 +3660,9 @@ static void spapr_memory_unplug(HotplugHandler *hotplug_dev, DeviceState *dev)
36603660
SpaprMachineState *spapr = SPAPR_MACHINE(hotplug_dev);
36613661
SpaprDimmState *ds = spapr_pending_dimm_unplugs_find(spapr, PC_DIMM(dev));
36623662

3663+
/* We really shouldn't get this far without anything to unplug */
3664+
g_assert(ds);
3665+
36633666
pc_dimm_unplug(PC_DIMM(dev), MACHINE(hotplug_dev));
36643667
qdev_unrealize(dev);
36653668
spapr_pending_dimm_unplugs_remove(spapr, ds);

include/hw/ppc/spapr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ struct SpaprMachineState {
168168
SpaprResizeHpt resize_hpt;
169169
void *htab;
170170
uint32_t htab_shift;
171-
uint64_t patb_entry; /* Process tbl registed in H_REGISTER_PROCESS_TABLE */
171+
uint64_t patb_entry; /* Process tbl registed in H_REGISTER_PROC_TBL */
172172
SpaprPendingHpt *pending_hpt; /* in-progress resize */
173173

174174
hwaddr rma_size;

target/ppc/kvm.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,24 +1815,37 @@ static int read_cpuinfo(const char *field, char *value, int len)
18151815
return ret;
18161816
}
18171817

1818-
uint32_t kvmppc_get_tbfreq(void)
1818+
static uint32_t kvmppc_get_tbfreq_procfs(void)
18191819
{
18201820
char line[512];
18211821
char *ns;
1822-
uint32_t retval = NANOSECONDS_PER_SECOND;
1822+
uint32_t tbfreq_fallback = NANOSECONDS_PER_SECOND;
1823+
uint32_t tbfreq_procfs;
18231824

18241825
if (read_cpuinfo("timebase", line, sizeof(line))) {
1825-
return retval;
1826+
return tbfreq_fallback;
18261827
}
18271828

18281829
ns = strchr(line, ':');
18291830
if (!ns) {
1830-
return retval;
1831+
return tbfreq_fallback;
18311832
}
18321833

1833-
ns++;
1834+
tbfreq_procfs = atoi(++ns);
1835+
1836+
/* 0 is certainly not acceptable by the guest, return fallback value */
1837+
return tbfreq_procfs ? tbfreq_procfs : tbfreq_fallback;
1838+
}
1839+
1840+
uint32_t kvmppc_get_tbfreq(void)
1841+
{
1842+
static uint32_t cached_tbfreq;
1843+
1844+
if (!cached_tbfreq) {
1845+
cached_tbfreq = kvmppc_get_tbfreq_procfs();
1846+
}
18341847

1835-
return atoi(ns);
1848+
return cached_tbfreq;
18361849
}
18371850

18381851
bool kvmppc_get_host_serial(char **value)

0 commit comments

Comments
 (0)