From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Lacombe Subject: Re: [x86] - technical questions about HV implementation on Intel VT Date: Tue, 21 Apr 2009 13:16:06 +0200 Message-ID: <200904211316.06778.goretux@gmail.com> References: <200903241822.11529.goretux@gmail.com> <200904201953.53815.goretux@gmail.com> <49ECBD5D.4080205@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mail-bw0-f163.google.com ([209.85.218.163]:49954 "EHLO mail-bw0-f163.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352AbZDULQM convert rfc822-to-8bit (ORCPT ); Tue, 21 Apr 2009 07:16:12 -0400 Received: by bwz7 with SMTP id 7so1698070bwz.37 for ; Tue, 21 Apr 2009 04:16:09 -0700 (PDT) In-Reply-To: <49ECBD5D.4080205@redhat.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Thanks a lot for your answer ;) Le lundi 20 avril 2009 20:22:21 Avi Kivity, vous avez =E9crit : > Eric Lacombe wrote: [...] > echo and pwd are part of bash, so they are probably in memory. I gue= ss > once you go to disk things fail. > > Try to boot the entire OS from initramfs (and keep it there). I will try this but maybe what follows say that the problem is elsewher= e. [...] > > (Recall: When loaded, my module use VT-x to go on vmx root operatio= n, > > then it creates a vmcs in order to execute the OS inside a VM.) > > I imagine you have interrupts working properly? Does 'watch -d cat > /proc/interrupts' give the expected results (run it before you enter = vmx > to load it into cache)? I made many times this test: 1. I run on a first console 'watch -n0,2 -d cat /proc/interrupts' 2. I load from another console my module (that is modified at the begin= ning of=20 its init step with the addition of a schedule_timeout_uninterruptible()= ) 3. I switch to the first console and wait for schedule_timeout to retur= n And when my module does its stuff, the machine freezes... Maybe my modu= le =20 "implies" a deadlock in the VFS after a VM-entry? Note: in my module, I do not intercept (in the VM-execution controls) e= xternal=20 interruptions nor exception. I also check in the documentation the "VMX aborts" but it does not seem= to be=20 my problem --- the freeze occurs when I do not use MSR load/store areas= as=20 well as when I use them. Note: now, I just load/store the Kernel_GS_BASE MSR to cover swapgs, ev= en if=20 it is not actually necessary for my module. (Besides, I intercept rdmsr= /wrmsr=20 as can be seen in the logs, and modify accordingly the VMCS when needed= ). > > Are you virtualizing memory, or does the guest manipulate page tables > directly? The guest manipulates directly page tables in my current module. I just handle two cases of cr3 access ("mov from" and "mov to") by just= =20 carrying out the "mov" in the guest registers. Best regards Eric Lacombe