From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOCjH-0006Oj-2H for qemu-devel@nongnu.org; Tue, 26 Jan 2016 18:08:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOCjG-0000WK-28 for qemu-devel@nongnu.org; Tue, 26 Jan 2016 18:08:55 -0500 References: <1452104533-8516-5-git-send-email-mark.cave-ayland@ilande.co.uk> <568F235B.1010506@ozlabs.ru> <568FC5FF.9070606@ilande.co.uk> <569302E7.4080404@ozlabs.ru> <20160111045519.GE22925@voom.redhat.com> <56935D3A.1030709@ilande.co.uk> <20160112024421.GH22925@voom.redhat.com> <56993062.4030604@ilande.co.uk> <20160118045113.GL9301@voom.fritz.box> <56A5B712.9070808@ilande.co.uk> <20160125111008.GG32205@voom.redhat.com> <56A7F3B7.3080908@ilande.co.uk> From: Mark Cave-Ayland Message-ID: <56A7FC70.6020007@ilande.co.uk> Date: Tue, 26 Jan 2016 23:08:32 +0000 MIME-Version: 1.0 In-Reply-To: <56A7F3B7.3080908@ilande.co.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Migrating decrementer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: quintela@redhat.com, Alexey Kardashevskiy , agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, amit.shah@redhat.com On 26/01/16 22:31, Mark Cave-Ayland wrote: > For a typical savevm/loadvm pair I see something like this: > > savevm: > > tb->guest_timebase = 26281306490558 > qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) = 7040725511 > > loadvm: > > cpu_get_host_ticks() = 26289847005259 > tb_off_adj = -8540514701 > qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) = 7040725511 > cpu_ppc_get_tb() = -15785159386 > > But as cpu_ppc_get_tb() uses QEMU_CLOCK_VIRTUAL for vmclk we end up with > a negative number for the timebase since the virtual clock is dwarfed by > the number of TSC ticks calculated for tb_off_adj. This will work on a > PPC host though since cpu_host_get_ticks() is also derived from the > timebase. Ah... the magic of signed numbers. Here's another attempt but this time with cpu_ppc_get_tb() printed unsigned: savevm: tb->guest_timebase = 2597350923332 qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) = 4199081744 cpu_ppc_get_tb() = 69704756 loadvm: cpu_get_host_ticks() = 2606380782824 tb_off_adj = -9029859492 qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) = 4199081744 cpu_ppc_get_tb() = 18446744064749396880 This implies that the cpu_ppc_get_tb() value post-migration is far too low - presumably because tb_env->tb_freq is only 16MHz compared to the actual TSC rate? ATB, Mark.