Alexey Kardashevskiy <a...@ozlabs.ru> writes: > The PAPR+ specification defines a ibm,client-architecture-support (CAS) > RTAS call which purpose is to provide a negotiation mechanism for > the guest and the hypervisor to work out the best compatibility parameters. > During the negotiation process, the guest provides an array of various > options and capabilities which it supports, the hypervisor adjusts > the device tree and (optionally) reboots the guest. > > At the moment the Linux guest calls CAS method at early boot so SLOF > gets called. SLOF allocates a memory buffer for the device tree changes > and calls a custom KVMPPC_H_CAS hypercall. QEMU parses the options, > composes a diff for the device tree, copies it to the buffer provided > by SLOF and returns to SLOF. SLOF updates the device tree and returns > control to the guest kernel. Only then the Linux guest parses the device > tree so it is possible to avoid unnecessary reboot in most cases. > > The device tree diff is a header with the update format version > (defined as 0 in this patch)
That is 1 in the code. > @@ -562,6 +563,31 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base, > return fdt; > } > > +int spapr_h_cas_compose_response(target_ulong addr, target_ulong size) > +{ > + void *fdt; > + sPAPRDeviceTreeUpdateHeader hdr = { .version_id = 1 }; > + Regards Nikunj