From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz4Lk-00028Y-74 for qemu-devel@nongnu.org; Mon, 23 Jun 2014 09:32:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz4Lc-00034S-Vq for qemu-devel@nongnu.org; Mon, 23 Jun 2014 09:31:56 -0400 Message-ID: <53A82C43.8010807@suse.de> Date: Mon, 23 Jun 2014 15:31:47 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1403529992-30766-1-git-send-email-aik@ozlabs.ru> In-Reply-To: <1403529992-30766-1-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] spapr: Fix RTAS token numbers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Michael Roth , Nikunj A Dadhania On 23.06.14 15:26, Alexey Kardashevskiy wrote: > At the moment spapr_rtas_register() allocates a new token number for every > new RTAS callback so numbers are not fixed and depend on the number of > supported RTAS handlers and the exact order of spapr_rtas_register() calls. > These tokens are copied into the device tree and remain the same during > the guest lifetime. > > When we start another guest to receive a migration, it calls > spapr_rtas_register() as well. If the number of RTAS handlers or their > order is different in QEMU on source and destination sides, the "/rtas" > node in the device tree will differ. Since migration overwrites the device > tree (as it overwrites the entire RAM), the actual RTAS config on > the destination side gets broken. > > This defines global contant values for every RTAS token which QEMU > is using today. > > This changes spapr_rtas_register() to accept a token number instead of > allocating one. This changes all users of spapr_rtas_register(). > > This changes XICS-KVM not to cache tokens registered with KVM as they > constant now. > > This makes TOKEN_BASE global as RTAS_XXX use TOKEN_BASE as > a base. TOKEN_MAX is moved and renamed too and its value is changed > to the last token + 1. Boundary checks for token values are adjusted. > > This reserves token numbers for "os-term" handlers and PCI hotplug > which we are working on. > > Cc: Michael Roth > Cc: Nikunj A Dadhania > Signed-off-by: Alexey Kardashevskiy Very nice. I'll apply it as soon as patchworks has it ;). Alex