mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
spapr: Add ibm,processor-radix-AP-encodings to the device tree
Use the new ioctl, KVM_PPC_GET_RMMU_INFO, to fetch radix MMU information from KVM and present the page encodings in the device tree under ibm,processor-radix-AP-encodings. This provides page size information to the guest which is necessary for it to use radix mode. Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com> [dwg: Compile fix for 32-bit targets, style nit fix] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
d6ee2a7c85
commit
c64abd1f9c
5 changed files with 48 additions and 0 deletions
|
@ -459,6 +459,8 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset,
|
|||
sPAPRDRConnector *drc;
|
||||
sPAPRDRConnectorClass *drck;
|
||||
int drc_index;
|
||||
uint32_t radix_AP_encodings[PPC_PAGE_SIZES_MAX_SZ];
|
||||
int i;
|
||||
|
||||
drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_CPU, index);
|
||||
if (drc) {
|
||||
|
@ -544,6 +546,17 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset,
|
|||
_FDT(spapr_fixup_cpu_numa_dt(fdt, offset, cs));
|
||||
|
||||
_FDT(spapr_fixup_cpu_smt_dt(fdt, offset, cpu, compat_smt));
|
||||
|
||||
if (pcc->radix_page_info) {
|
||||
for (i = 0; i < pcc->radix_page_info->count; i++) {
|
||||
radix_AP_encodings[i] =
|
||||
cpu_to_be32(pcc->radix_page_info->entries[i]);
|
||||
}
|
||||
_FDT((fdt_setprop(fdt, offset, "ibm,processor-radix-AP-encodings",
|
||||
radix_AP_encodings,
|
||||
pcc->radix_page_info->count *
|
||||
sizeof(radix_AP_encodings[0]))));
|
||||
}
|
||||
}
|
||||
|
||||
static void spapr_populate_cpus_dt_node(void *fdt, sPAPRMachineState *spapr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue