Received: from eggs.gnu.org ([2001:4830:134:3::10]:44331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmEYn-0003bM-BT for qemu-devel@nongnu.org; Sun, 18 May 2014 23:48:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmEYc-0003Az-Hh for qemu-devel@nongnu.org; Sun, 18 May 2014 23:48:21 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:42788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmEYb-0003AJ-OL for qemu-devel@nongnu.org; Sun, 18 May 2014 23:48:10 -0400 Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 May 2014 13:48:03 +1000 From: Nikunj A Dadhania In-Reply-To: <1400153291-20759-7-git-send-email-aik@ozlabs.ru> References: <1400153291-20759-1-git-send-email-aik@ozlabs.ru> <1400153291-20759-7-git-send-email-aik@ozlabs.ru> Date: Mon, 19 May 2014 09:17:57 +0530 Message-ID: <87lhtywhsi.fsf@abhimanyu.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 6/9] spapr: Add ibm, client-architecture-support call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org Alexey Kardashevskiy 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