From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH 0/8] KVM updates for 2.6.20-rc2 Date: Thu, 28 Dec 2006 12:23:56 +0100 Message-ID: <20061228112356.GA14386@elte.hu> References: <45939755.7010603@qumranet.com> <20061228103345.GA4708@elte.hu> <4593A4B7.2070404@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel Return-path: To: Avi Kivity Content-Disposition: inline In-Reply-To: <4593A4B7.2070404-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org * Avi Kivity wrote: > >NOTE: this is not a worry for upstream kernel, it is caused by > >PREEMPT_RT scheduling in previously atomic APIs like kunmap(). But > >KVM used to work pretty nicely in -rt and this problem got introduced > >fairly recently, related to some big-page changes IIRC. > > This is not a recent change. The x86 emulator is fetching an > instruction or a memory operand. well, the fact that it's somehow ending up in highmem and thus the kmap becomes nontrivial could be a recent change maybe? > > Any suggestions of how to best fix this in -rt? Basically, it would > > be nice to decouple KVM from get_cpu/preempt_disable type of > > interfaces as much as possible, to make it fully preemptible. > > kvm on intel uses hidden cpu registers, so it can't be migrated as a > normal process. [...] oh, granted. My suggestion would be to make it more atomic - not to break the physical attachment of a KVM context to a physical CPU (which is unbreakable, obviously). > [...] We'd need a hook on context switch to check if we migrated to > another cpu, issue an ipi to unload the registers on the previous cpu, > and reload the registers on the current cpu. The hook would need to > be protected from context switches. See vmx.c:vmx_vcpu_load() for the > gory details. The actual launch would require a small non-preemptible > section as well, on both intel and AMD. actually, another, possibly better approach would be to attach a KVM context to tasks, automatically loaded/unloaded upon switch_to(). No need to do IPIs. Would this be fast enough? Ingo ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV