PPC: mpc8544ds: Add hypervisor node
When running a PPC guest with KVM that can do PV operations, we need to indicate the guest which instructions to use for a hypercall and that it is running as KVM guest. This logic was available on openbios based machines already. This patch also adds said functionality to the mpc8544ds machine. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Scott Wood <scottwood@freescale.com>
This commit is contained in:
parent
b9e17a3453
commit
5de6b46db5
|
@ -82,7 +82,8 @@ out:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int mpc8544_load_device_tree(target_phys_addr_t addr,
|
static int mpc8544_load_device_tree(CPUState *env,
|
||||||
|
target_phys_addr_t addr,
|
||||||
uint32_t ramsize,
|
uint32_t ramsize,
|
||||||
target_phys_addr_t initrd_base,
|
target_phys_addr_t initrd_base,
|
||||||
target_phys_addr_t initrd_size,
|
target_phys_addr_t initrd_size,
|
||||||
|
@ -94,6 +95,7 @@ static int mpc8544_load_device_tree(target_phys_addr_t addr,
|
||||||
char *filename;
|
char *filename;
|
||||||
int fdt_size;
|
int fdt_size;
|
||||||
void *fdt;
|
void *fdt;
|
||||||
|
uint8_t hypercall[16];
|
||||||
|
|
||||||
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
|
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
|
@ -157,6 +159,13 @@ static int mpc8544_load_device_tree(target_phys_addr_t addr,
|
||||||
|
|
||||||
mpc8544_copy_soc_cell(fdt, buf, "clock-frequency");
|
mpc8544_copy_soc_cell(fdt, buf, "clock-frequency");
|
||||||
mpc8544_copy_soc_cell(fdt, buf, "timebase-frequency");
|
mpc8544_copy_soc_cell(fdt, buf, "timebase-frequency");
|
||||||
|
|
||||||
|
/* indicate KVM hypercall interface */
|
||||||
|
qemu_devtree_setprop_string(fdt, "/hypervisor", "compatible",
|
||||||
|
"linux,kvm");
|
||||||
|
kvmppc_get_hypercall(env, hypercall, sizeof(hypercall));
|
||||||
|
qemu_devtree_setprop(fdt, "/hypervisor", "hcall-instructions",
|
||||||
|
hypercall, sizeof(hypercall));
|
||||||
} else {
|
} else {
|
||||||
const uint32_t freq = 400000000;
|
const uint32_t freq = 400000000;
|
||||||
|
|
||||||
|
@ -330,7 +339,7 @@ static void mpc8544ds_init(ram_addr_t ram_size,
|
||||||
cpu_abort(env, "Compiled without FDT support - can't load kernel\n");
|
cpu_abort(env, "Compiled without FDT support - can't load kernel\n");
|
||||||
#endif
|
#endif
|
||||||
dt_base = (kernel_size + DTC_LOAD_PAD) & ~DTC_PAD_MASK;
|
dt_base = (kernel_size + DTC_LOAD_PAD) & ~DTC_PAD_MASK;
|
||||||
if (mpc8544_load_device_tree(dt_base, ram_size,
|
if (mpc8544_load_device_tree(env, dt_base, ram_size,
|
||||||
initrd_base, initrd_size, kernel_cmdline) < 0) {
|
initrd_base, initrd_size, kernel_cmdline) < 0) {
|
||||||
fprintf(stderr, "couldn't load device tree\n");
|
fprintf(stderr, "couldn't load device tree\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Binary file not shown.
|
@ -125,4 +125,7 @@
|
||||||
chosen {
|
chosen {
|
||||||
linux,stdout-path = "/soc8544@e0000000/serial@4500";
|
linux,stdout-path = "/soc8544@e0000000/serial@4500";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hypervisor {
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue