diff --git a/hw/net/fsl_etsec/rings.c b/hw/net/fsl_etsec/rings.c index d6be0d7d18d..8f084464155 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 1d94485ac83..79467ac5123 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 d56418ca294..73a06df3b1b 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 47cebaf3acb..bf7cab7a2ce 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 298c1f882c6..104a308abb5 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)