Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.0-2021…
Browse files Browse the repository at this point in the history
…0331' 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 <[email protected]>" [full]
# gpg:                 aka "David Gibson (Red Hat) <[email protected]>" [full]
# gpg:                 aka "David Gibson (ozlabs.org) <[email protected]>" [full]
# gpg:                 aka "David Gibson (kernel.org) <[email protected]>" [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 <[email protected]>
  • Loading branch information
pm215 committed Mar 31, 2021
2 parents b307a31 + 611ac0a commit 6ee55e1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hw/net/fsl_etsec/rings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions hw/ppc/e500.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions hw/ppc/spapr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion include/hw/ppc/spapr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
25 changes: 19 additions & 6 deletions target/ppc/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6ee55e1

Please sign in to comment.