mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
ppc/spapr: remove deprecated machine pseries-2.7
Commit 1392617d35
intended to tag pseries-2.1 - 2.11 machines as
deprecated with reasons mentioned in its commit log.
Removing pseries-2.7 specific code with this patch for now.
While at it, also remove pre-2.8-migration and pci/mmio hacks introduced
for backward compatibility.
Suggested-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
This commit is contained in:
parent
73700ec309
commit
445d3facff
6 changed files with 7 additions and 187 deletions
|
@ -5203,81 +5203,6 @@ static void spapr_machine_2_8_class_options(MachineClass *mc)
|
|||
|
||||
DEFINE_SPAPR_MACHINE(2, 8);
|
||||
|
||||
/*
|
||||
* pseries-2.7
|
||||
*/
|
||||
|
||||
static bool phb_placement_2_7(SpaprMachineState *spapr, uint32_t index,
|
||||
uint64_t *buid, hwaddr *pio,
|
||||
hwaddr *mmio32, hwaddr *mmio64,
|
||||
unsigned n_dma, uint32_t *liobns, Error **errp)
|
||||
{
|
||||
/* Legacy PHB placement for pseries-2.7 and earlier machine types */
|
||||
const uint64_t base_buid = 0x800000020000000ULL;
|
||||
const hwaddr phb_spacing = 0x1000000000ULL; /* 64 GiB */
|
||||
const hwaddr mmio_offset = 0xa0000000; /* 2 GiB + 512 MiB */
|
||||
const hwaddr pio_offset = 0x80000000; /* 2 GiB */
|
||||
const uint32_t max_index = 255;
|
||||
const hwaddr phb0_alignment = 0x10000000000ULL; /* 1 TiB */
|
||||
|
||||
uint64_t ram_top = MACHINE(spapr)->ram_size;
|
||||
hwaddr phb0_base, phb_base;
|
||||
int i;
|
||||
|
||||
/* Do we have device memory? */
|
||||
if (MACHINE(spapr)->device_memory) {
|
||||
/* Can't just use maxram_size, because there may be an
|
||||
* alignment gap between normal and device memory regions
|
||||
*/
|
||||
ram_top = MACHINE(spapr)->device_memory->base +
|
||||
memory_region_size(&MACHINE(spapr)->device_memory->mr);
|
||||
}
|
||||
|
||||
phb0_base = QEMU_ALIGN_UP(ram_top, phb0_alignment);
|
||||
|
||||
if (index > max_index) {
|
||||
error_setg(errp, "\"index\" for PAPR PHB is too large (max %u)",
|
||||
max_index);
|
||||
return false;
|
||||
}
|
||||
|
||||
*buid = base_buid + index;
|
||||
for (i = 0; i < n_dma; ++i) {
|
||||
liobns[i] = SPAPR_PCI_LIOBN(index, i);
|
||||
}
|
||||
|
||||
phb_base = phb0_base + index * phb_spacing;
|
||||
*pio = phb_base + pio_offset;
|
||||
*mmio32 = phb_base + mmio_offset;
|
||||
/*
|
||||
* We don't set the 64-bit MMIO window, relying on the PHB's
|
||||
* fallback behaviour of automatically splitting a large "32-bit"
|
||||
* window into contiguous 32-bit and 64-bit windows
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void spapr_machine_2_7_class_options(MachineClass *mc)
|
||||
{
|
||||
SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
|
||||
static GlobalProperty compat[] = {
|
||||
{ TYPE_SPAPR_PCI_HOST_BRIDGE, "mem_win_size", "0xf80000000", },
|
||||
{ TYPE_SPAPR_PCI_HOST_BRIDGE, "mem64_win_size", "0", },
|
||||
{ TYPE_POWERPC_CPU, "pre-2.8-migration", "on", },
|
||||
{ TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-2.8-migration", "on", },
|
||||
};
|
||||
|
||||
spapr_machine_2_8_class_options(mc);
|
||||
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3");
|
||||
mc->default_machine_opts = "modern-hotplug-events=off";
|
||||
compat_props_add(mc->compat_props, hw_compat_2_7, hw_compat_2_7_len);
|
||||
compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
|
||||
smc->phb_placement = phb_placement_2_7;
|
||||
}
|
||||
|
||||
DEFINE_SPAPR_MACHINE(2, 7);
|
||||
|
||||
static void spapr_machine_register_types(void)
|
||||
{
|
||||
type_register_static(&spapr_machine_info);
|
||||
|
|
|
@ -1814,30 +1814,15 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
assert(sphb->index != (uint32_t)-1); /* checked in spapr_phb_pre_plug() */
|
||||
|
||||
if (sphb->mem64_win_size != 0) {
|
||||
if (sphb->mem_win_size > SPAPR_PCI_MEM32_WIN_SIZE) {
|
||||
error_setg(errp, "32-bit memory window of size 0x%"HWADDR_PRIx
|
||||
" (max 2 GiB)", sphb->mem_win_size);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 64-bit window defaults to identity mapping */
|
||||
sphb->mem64_win_pciaddr = sphb->mem64_win_addr;
|
||||
} else if (sphb->mem_win_size > SPAPR_PCI_MEM32_WIN_SIZE) {
|
||||
/*
|
||||
* For compatibility with old configuration, if no 64-bit MMIO
|
||||
* window is specified, but the ordinary (32-bit) memory
|
||||
* window is specified as > 2GiB, we treat it as a 2GiB 32-bit
|
||||
* window, with a 64-bit MMIO window following on immediately
|
||||
* afterwards
|
||||
*/
|
||||
sphb->mem64_win_size = sphb->mem_win_size - SPAPR_PCI_MEM32_WIN_SIZE;
|
||||
sphb->mem64_win_addr = sphb->mem_win_addr + SPAPR_PCI_MEM32_WIN_SIZE;
|
||||
sphb->mem64_win_pciaddr =
|
||||
SPAPR_PCI_MEM_WIN_BUS_OFFSET + SPAPR_PCI_MEM32_WIN_SIZE;
|
||||
sphb->mem_win_size = SPAPR_PCI_MEM32_WIN_SIZE;
|
||||
if (sphb->mem_win_size > SPAPR_PCI_MEM32_WIN_SIZE) {
|
||||
error_setg(errp, "32-bit memory window of size 0x%"HWADDR_PRIx
|
||||
" (max 2 GiB)", sphb->mem_win_size);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 64-bit window defaults to identity mapping */
|
||||
sphb->mem64_win_pciaddr = sphb->mem64_win_addr;
|
||||
|
||||
if (spapr_pci_find_phb(spapr, sphb->buid)) {
|
||||
SpaprPhbState *s;
|
||||
|
||||
|
@ -2066,8 +2051,6 @@ static Property spapr_phb_properties[] = {
|
|||
(1ULL << 12) | (1ULL << 16)
|
||||
| (1ULL << 21) | (1ULL << 24)),
|
||||
DEFINE_PROP_UINT32("numa_node", SpaprPhbState, numa_node, -1),
|
||||
DEFINE_PROP_BOOL("pre-2.8-migration", SpaprPhbState,
|
||||
pre_2_8_migration, false),
|
||||
DEFINE_PROP_BOOL("pcie-extended-configuration-space", SpaprPhbState,
|
||||
pcie_ecs, true),
|
||||
DEFINE_PROP_BOOL("pre-5.1-associativity", SpaprPhbState,
|
||||
|
@ -2105,20 +2088,6 @@ static int spapr_pci_pre_save(void *opaque)
|
|||
gpointer key, value;
|
||||
int i;
|
||||
|
||||
if (sphb->pre_2_8_migration) {
|
||||
sphb->mig_liobn = sphb->dma_liobn[0];
|
||||
sphb->mig_mem_win_addr = sphb->mem_win_addr;
|
||||
sphb->mig_mem_win_size = sphb->mem_win_size;
|
||||
sphb->mig_io_win_addr = sphb->io_win_addr;
|
||||
sphb->mig_io_win_size = sphb->io_win_size;
|
||||
|
||||
if ((sphb->mem64_win_size != 0)
|
||||
&& (sphb->mem64_win_addr
|
||||
== (sphb->mem_win_addr + sphb->mem_win_size))) {
|
||||
sphb->mig_mem_win_size += sphb->mem64_win_size;
|
||||
}
|
||||
}
|
||||
|
||||
g_free(sphb->msi_devs);
|
||||
sphb->msi_devs = NULL;
|
||||
sphb->msi_devs_num = g_hash_table_size(sphb->msi);
|
||||
|
@ -2165,13 +2134,6 @@ static int spapr_pci_post_load(void *opaque, int version_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool pre_2_8_migration(void *opaque, int version_id)
|
||||
{
|
||||
SpaprPhbState *sphb = opaque;
|
||||
|
||||
return sphb->pre_2_8_migration;
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_spapr_pci = {
|
||||
.name = "spapr_pci",
|
||||
.version_id = 2,
|
||||
|
@ -2181,11 +2143,6 @@ static const VMStateDescription vmstate_spapr_pci = {
|
|||
.post_load = spapr_pci_post_load,
|
||||
.fields = (const VMStateField[]) {
|
||||
VMSTATE_UINT64_EQUAL(buid, SpaprPhbState, NULL),
|
||||
VMSTATE_UINT32_TEST(mig_liobn, SpaprPhbState, pre_2_8_migration),
|
||||
VMSTATE_UINT64_TEST(mig_mem_win_addr, SpaprPhbState, pre_2_8_migration),
|
||||
VMSTATE_UINT64_TEST(mig_mem_win_size, SpaprPhbState, pre_2_8_migration),
|
||||
VMSTATE_UINT64_TEST(mig_io_win_addr, SpaprPhbState, pre_2_8_migration),
|
||||
VMSTATE_UINT64_TEST(mig_io_win_size, SpaprPhbState, pre_2_8_migration),
|
||||
VMSTATE_STRUCT_ARRAY(lsi_table, SpaprPhbState, PCI_NUM_PINS, 0,
|
||||
vmstate_spapr_pci_lsi, SpaprPciLsi),
|
||||
VMSTATE_INT32(msi_devs_num, SpaprPhbState),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue