From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754838Ab1LMNwL (ORCPT ); Tue, 13 Dec 2011 08:52:11 -0500 Received: from www.linutronix.de ([62.245.132.108]:57464 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752971Ab1LMNwH (ORCPT ); Tue, 13 Dec 2011 08:52:07 -0500 Date: Tue, 13 Dec 2011 14:52:01 +0100 (CET) From: Thomas Gleixner To: Avi Kivity cc: Ingo Molnar , Pekka Enberg , LKML , Sasha Levin Subject: Re: [patch 0/3] kvm tool: Serial emulation overhaul In-Reply-To: <4EE72FCB.3070109@redhat.com> Message-ID: References: <20111210132220.083204833@linutronix.de> <20111211103047.GA19299@elte.hu> <20111211155347.GA1297@elte.hu> <20111212172059.GC23870@elte.hu> <20111212192135.GA18876@elte.hu> <4EE72FCB.3070109@redhat.com> User-Agent: Alpine 2.02 (LFD 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Dec 2011, Avi Kivity wrote: > On 12/13/2011 02:59 AM, Thomas Gleixner wrote: > > > > Why the heck is a paravirtualized guest using an local APIC timer > > emulation, instead of a paravirtualized clock event device? > > > > Just look at the trace. That's insane. We enter the guest for 2us to > > come back and handle the APIC_EOI for 11us. Then we go back to the > > guest for 9us and spend again 11us for handling a write to APIC_TMICT. > > > > That's 11us guest vs. 22us host time. > > Run your guest with x2apic enabled, the timing will be very different. And what magic do I have to use to make that happen other than having x2apic support enabled in the kernel? Or do I need a certain kernel version for host and guest to make that work? > The problem with paravirt clockevents is that if/when the APIC becomes > virtualized, then guests which were started with the paravirt > clockevents don't get accelerated when they are migrated onto newer > hardware. This problem has bitten us several times in the past; if you > want to see how it looks when applied on a large scale look at Xen - > they have a paravirt-the-fsck-out-of-everything mode and a full virt > mode (which should be way faster these days); the two aren't > compatible. Of course back when they started, they didn't have a > choice, but we do. Well, I can see the migration pain for life migration and I agree that paravirt the world and some more is a horror as well. Though there is a midground between everything and being smart about certain aspects. The whole APIC timer calibration and the back and forth conversion is definitely nothing which falls into the category of smart. Thanks, tglx