mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'pull-ppc-20230205' of https://gitlab.com/danielhb/qemu into staging
ppc patch queue for 2023-02-05: This queue includes patches that aren't PPC specific but benefit/impact PPC machines, such as the changes to guestperf.py, mv64361 and sm501. As for PPC specific changes we have e500 and PNV_PHB5 fixes. # -----BEGIN PGP SIGNATURE----- # # iIwEABYKADQWIQQX6/+ZI9AYAK8oOBk82cqW3gMxZAUCY99+yRYcZGFuaWVsaGI0 # MTNAZ21haWwuY29tAAoJEDzZypbeAzFkOQsA/1UxMHen/3tW908shrRMwS7WSzDa # 4x0tU4L+bMpEfgVJAQDeKIyIbdajtv4v2XfZyQ9flfUo64cY0xze+T+SDW+fBw== # =eB7g # -----END PGP SIGNATURE----- # gpg: Signature made Sun 05 Feb 2023 10:02:49 GMT # gpg: using EDDSA key 17EBFF9923D01800AF2838193CD9CA96DE033164 # gpg: issuer "danielhb413@gmail.com" # gpg: Good signature from "Daniel Henrique Barboza <danielhb413@gmail.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 17EB FF99 23D0 1800 AF28 3819 3CD9 CA96 DE03 3164 * tag 'pull-ppc-20230205' of https://gitlab.com/danielhb/qemu: hw/display/sm501: Code style fix hw/display/sm501: Remove unneeded casts from void pointer hw/display/sm501: Remove parenthesis around constant macro definitions hw/ppc/pegasos2: Fix a typo in a comment ppc/pnv/pci: Fix PHB xscom registers memory region name ppc/pnv/pci: Update PHB5 version register ppc/pnv/pci: Remove duplicate definition of PNV_PHB5_DEVICE_ID ppc/pnv/pci: Cleanup PnvPHBPecState structure hw/ppc/e500.c: Attach eSDHC unimplemented region to ccsr_addr_space hw/ppc/e500.c: Avoid hardcoding parent device in create_devtree_etsec() hw/ppc/e500{, plat}: Drop redundant checks for presence of platform bus hw/ppc: Set machine->fdt in e500 machines hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn ppc/pegasos2: Improve readability of VIA south bridge creation tests/migration: add support for ppc64le for guestperf.py tests/migration: add sysprof-capture-4 as dependency for stress binary Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+206
-205
File diff suppressed because it is too large
Load Diff
@@ -72,11 +72,6 @@ struct MV64361PCIState {
|
||||
uint64_t remap[5];
|
||||
};
|
||||
|
||||
static int mv64361_pcihost_map_irq(PCIDevice *pci_dev, int n)
|
||||
{
|
||||
return (n + PCI_SLOT(pci_dev->devfn)) % PCI_NUM_PINS;
|
||||
}
|
||||
|
||||
static void mv64361_pcihost_set_irq(void *opaque, int n, int level)
|
||||
{
|
||||
MV64361PCIState *s = opaque;
|
||||
@@ -97,7 +92,7 @@ static void mv64361_pcihost_realize(DeviceState *dev, Error **errp)
|
||||
g_free(name);
|
||||
name = g_strdup_printf("pci.%d", s->index);
|
||||
h->bus = pci_register_root_bus(dev, name, mv64361_pcihost_set_irq,
|
||||
mv64361_pcihost_map_irq, dev,
|
||||
pci_swizzle_map_irq_fn, dev,
|
||||
&s->mem, &s->io, 0, 4, TYPE_PCI_BUS);
|
||||
g_free(name);
|
||||
pci_create_simple(h->bus, 0, TYPE_MV64361_PCI_BRIDGE);
|
||||
|
||||
@@ -1497,7 +1497,7 @@ static void pnv_phb4_xscom_realize(PnvPHB4 *phb)
|
||||
PHB4_PEC_PCI_STK_REGS_COUNT);
|
||||
|
||||
/* PHB pass-through */
|
||||
snprintf(name, sizeof(name), "xscom-pec-%d.%d-pci-phb-%d",
|
||||
snprintf(name, sizeof(name), "xscom-pec-%d.%d-phb-%d",
|
||||
pec->chip_id, pec->index, stack_no);
|
||||
pnv_xscom_region_init(&phb->phb_regs_mr, OBJECT(phb),
|
||||
&pnv_phb4_xscom_ops, phb, name, 0x40);
|
||||
|
||||
+16
-8
@@ -241,7 +241,7 @@ static int create_devtree_etsec(SysBusDevice *sbdev, PlatformDevtreeData *data)
|
||||
int irq0 = platform_bus_get_irqn(pbus, sbdev, 0);
|
||||
int irq1 = platform_bus_get_irqn(pbus, sbdev, 1);
|
||||
int irq2 = platform_bus_get_irqn(pbus, sbdev, 2);
|
||||
gchar *node = g_strdup_printf("/platform/ethernet@%"PRIx64, mmio0);
|
||||
gchar *node = g_strdup_printf("%s/ethernet@%"PRIx64, data->node, mmio0);
|
||||
gchar *group = g_strdup_printf("%s/queue-group", node);
|
||||
void *fdt = data->fdt;
|
||||
|
||||
@@ -643,9 +643,8 @@ static int ppce500_load_device_tree(PPCE500MachineState *pms,
|
||||
}
|
||||
g_free(soc);
|
||||
|
||||
if (pms->pbus_dev) {
|
||||
platform_bus_create_devtree(pms, fdt, mpic);
|
||||
}
|
||||
platform_bus_create_devtree(pms, fdt, mpic);
|
||||
|
||||
g_free(mpic);
|
||||
|
||||
pmc->fixup_devtree(fdt);
|
||||
@@ -659,9 +658,14 @@ done:
|
||||
if (!dry_run) {
|
||||
qemu_fdt_dumpdtb(fdt, fdt_size);
|
||||
cpu_physical_memory_write(addr, fdt, fdt_size);
|
||||
|
||||
/* Set machine->fdt for 'dumpdtb' QMP/HMP command */
|
||||
g_free(machine->fdt);
|
||||
machine->fdt = fdt;
|
||||
} else {
|
||||
g_free(fdt);
|
||||
}
|
||||
ret = fdt_size;
|
||||
g_free(fdt);
|
||||
|
||||
out:
|
||||
g_free(pci_map);
|
||||
@@ -1018,9 +1022,13 @@ void ppce500_init(MachineState *machine)
|
||||
|
||||
/* eSDHC */
|
||||
if (pmc->has_esdhc) {
|
||||
create_unimplemented_device("esdhc",
|
||||
pmc->ccsrbar_base + MPC85XX_ESDHC_REGS_OFFSET,
|
||||
MPC85XX_ESDHC_REGS_SIZE);
|
||||
dev = qdev_new(TYPE_UNIMPLEMENTED_DEVICE);
|
||||
qdev_prop_set_string(dev, "name", "esdhc");
|
||||
qdev_prop_set_uint64(dev, "size", MPC85XX_ESDHC_REGS_SIZE);
|
||||
s = SYS_BUS_DEVICE(dev);
|
||||
sysbus_realize_and_unref(s, &error_fatal);
|
||||
memory_region_add_subregion(ccsr_addr_space, MPC85XX_ESDHC_REGS_OFFSET,
|
||||
sysbus_mmio_get_region(s, 0));
|
||||
|
||||
/*
|
||||
* Compatible with:
|
||||
|
||||
+3
-6
@@ -46,13 +46,10 @@ static void e500plat_machine_device_plug_cb(HotplugHandler *hotplug_dev,
|
||||
DeviceState *dev, Error **errp)
|
||||
{
|
||||
PPCE500MachineState *pms = PPCE500_MACHINE(hotplug_dev);
|
||||
MachineClass *mc = MACHINE_GET_CLASS(pms);
|
||||
|
||||
if (pms->pbus_dev) {
|
||||
MachineClass *mc = MACHINE_GET_CLASS(pms);
|
||||
|
||||
if (device_is_dynamic_sysbus(mc, dev)) {
|
||||
platform_bus_link_device(pms->pbus_dev, SYS_BUS_DEVICE(dev));
|
||||
}
|
||||
if (device_is_dynamic_sysbus(mc, dev)) {
|
||||
platform_bus_link_device(pms->pbus_dev, SYS_BUS_DEVICE(dev));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -102,7 +102,8 @@ static void pegasos2_init(MachineState *machine)
|
||||
CPUPPCState *env;
|
||||
MemoryRegion *rom = g_new(MemoryRegion, 1);
|
||||
PCIBus *pci_bus;
|
||||
PCIDevice *dev, *via;
|
||||
Object *via;
|
||||
PCIDevice *dev;
|
||||
I2CBus *i2c_bus;
|
||||
const char *fwname = machine->firmware ?: PROM_FILENAME;
|
||||
char *filename;
|
||||
@@ -159,19 +160,18 @@ static void pegasos2_init(MachineState *machine)
|
||||
pci_bus = mv64361_get_pci_bus(pm->mv, 1);
|
||||
|
||||
/* VIA VT8231 South Bridge (multifunction PCI device) */
|
||||
via = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, 0), true,
|
||||
TYPE_VT8231_ISA);
|
||||
via = OBJECT(pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, 0),
|
||||
true, TYPE_VT8231_ISA));
|
||||
object_property_add_alias(OBJECT(machine), "rtc-time",
|
||||
object_resolve_path_component(OBJECT(via),
|
||||
"rtc"),
|
||||
object_resolve_path_component(via, "rtc"),
|
||||
"date");
|
||||
qdev_connect_gpio_out(DEVICE(via), 0,
|
||||
qdev_get_gpio_in_named(pm->mv, "gpp", 31));
|
||||
|
||||
dev = PCI_DEVICE(object_resolve_path_component(OBJECT(via), "ide"));
|
||||
dev = PCI_DEVICE(object_resolve_path_component(via, "ide"));
|
||||
pci_ide_create_devs(dev);
|
||||
|
||||
dev = PCI_DEVICE(object_resolve_path_component(OBJECT(via), "pm"));
|
||||
dev = PCI_DEVICE(object_resolve_path_component(via, "pm"));
|
||||
i2c_bus = I2C_BUS(qdev_get_child_bus(DEVICE(dev), "i2c"));
|
||||
spd_data = spd_data_generate(DDR, machine->ram_size);
|
||||
smbus_eeprom_init_one(i2c_bus, 0x57, spd_data);
|
||||
@@ -564,7 +564,7 @@ static void dt_isa(PCIBus *bus, PCIDevice *d, FDTInfo *fi)
|
||||
qemu_fdt_setprop_string(fi->fdt, fi->path, "device_type", "isa");
|
||||
qemu_fdt_setprop_string(fi->fdt, fi->path, "name", "isa");
|
||||
|
||||
/* addional devices */
|
||||
/* additional devices */
|
||||
g_string_printf(name, "%s/lpt@i3bc", fi->path);
|
||||
qemu_fdt_add_subnode(fi->fdt, name->str);
|
||||
qemu_fdt_setprop_cell(fi->fdt, name->str, "clock-frequency", 0);
|
||||
|
||||
@@ -173,8 +173,6 @@ struct PnvPhb4PecState {
|
||||
uint32_t index;
|
||||
uint32_t chip_id;
|
||||
|
||||
MemoryRegion *system_memory;
|
||||
|
||||
/* Nest registers, excuding per-stack */
|
||||
#define PHB4_PEC_NEST_REGS_COUNT 0xf
|
||||
uint64_t nest_regs[PHB4_PEC_NEST_REGS_COUNT];
|
||||
@@ -216,8 +214,7 @@ struct PnvPhb4PecClass {
|
||||
#define PNV_PHB5(obj) \
|
||||
OBJECT_CHECK(PnvPhb4, (obj), TYPE_PNV_PHB5)
|
||||
|
||||
#define PNV_PHB5_VERSION 0x000000a500000001ull
|
||||
#define PNV_PHB5_DEVICE_ID 0x0652
|
||||
#define PNV_PHB5_VERSION 0x000000a500000002ull
|
||||
|
||||
#define TYPE_PNV_PHB5_PEC "pnv-phb5-pec"
|
||||
#define PNV_PHB5_PEC(obj) \
|
||||
|
||||
@@ -281,6 +281,26 @@ class Engine(object):
|
||||
resp = src.command("stop")
|
||||
paused = True
|
||||
|
||||
def _is_ppc64le(self):
|
||||
_, _, _, _, machine = os.uname()
|
||||
if machine == "ppc64le":
|
||||
return True
|
||||
return False
|
||||
|
||||
def _get_guest_console_args(self):
|
||||
if self._is_ppc64le():
|
||||
return "console=hvc0"
|
||||
else:
|
||||
return "console=ttyS0"
|
||||
|
||||
def _get_qemu_serial_args(self):
|
||||
if self._is_ppc64le():
|
||||
return ["-chardev", "stdio,id=cdev0",
|
||||
"-device", "spapr-vty,chardev=cdev0"]
|
||||
else:
|
||||
return ["-chardev", "stdio,id=cdev0",
|
||||
"-device", "isa-serial,chardev=cdev0"]
|
||||
|
||||
def _get_common_args(self, hardware, tunnelled=False):
|
||||
args = [
|
||||
"noapic",
|
||||
@@ -289,8 +309,10 @@ class Engine(object):
|
||||
"noreplace-smp",
|
||||
"cgroup_disable=memory",
|
||||
"pci=noearly",
|
||||
"console=ttyS0",
|
||||
]
|
||||
|
||||
args.append(self._get_guest_console_args())
|
||||
|
||||
if self._debug:
|
||||
args.append("debug")
|
||||
else:
|
||||
@@ -308,12 +330,12 @@ class Engine(object):
|
||||
"-kernel", self._kernel,
|
||||
"-initrd", self._initrd,
|
||||
"-append", cmdline,
|
||||
"-chardev", "stdio,id=cdev0",
|
||||
"-device", "isa-serial,chardev=cdev0",
|
||||
"-m", str((hardware._mem * 1024) + 512),
|
||||
"-smp", str(hardware._cpus),
|
||||
]
|
||||
|
||||
argv.extend(self._get_qemu_serial_args())
|
||||
|
||||
if self._debug:
|
||||
argv.extend(["-device", "sga"])
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
sysprof = dependency('sysprof-capture-4', required: false)
|
||||
|
||||
stress = executable(
|
||||
'stress',
|
||||
files('stress.c'),
|
||||
dependencies: [glib],
|
||||
dependencies: [glib, sysprof],
|
||||
link_args: ['-static'],
|
||||
build_by_default: false,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user