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: Wed, 29 Apr 2009 18:13:47 +0200 Message-ID: <200904291813.48212.goretux@gmail.com> References: <200903241822.11529.goretux@gmail.com> <200904211316.06778.goretux@gmail.com> <200904291650.16079.goretux@gmail.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]:55681 "EHLO mail-bw0-f163.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752151AbZD2QN4 convert rfc822-to-8bit (ORCPT ); Wed, 29 Apr 2009 12:13:56 -0400 Received: by bwz7 with SMTP id 7so1272189bwz.37 for ; Wed, 29 Apr 2009 09:13:50 -0700 (PDT) In-Reply-To: <200904291650.16079.goretux@gmail.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Yeah, I got it! All seems to work well now ;) It was simply the host_cr3 field that I did not correctly fill... When I started to write my module, I used the cr3 of the current proces= s to=20 fill the host_cr3 VMCS field .... big mistake !!! as the process (insmo= d) dies=20 after loading my module, the corresponding page where my host_cr3 field= points=20 is then invalid. And that's why when I tried to execute a command that = is not=20 a built-in command (which induced more allocations), the system went cr= azy, as=20 my host_cr3 page was then used for something else... Thank you anyway to have spent some time on my problem. Best regards, Eric Le mercredi 29 avril 2009 16:50:15 Eric Lacombe, vous avez =E9crit : > Hi, > > Le mardi 21 avril 2009 13:16:06 Eric Lacombe, vous avez =E9crit : > > 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= guess > > > 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 else= where. > > I setup a minimal initramfs with busybox and my module inside. > The init script in the initramfs only mount /proc /sys, populate /dev > (busybox mdev), then execute the busybox shell. > > Then when I insmod'ed my module, I had to cope with an exit reason at= the > very first entry (through vmlaunch) to the VM. > This was because of the host and guest fs_selector VMCS fields, whose= TI > and RPL bits were not 0. > > After fixing that (setting TI and RPL bits to 0, instead of using dir= ectly > fs and gs values), the vmlaunch succeed, and I got quite the same beh= aviour > as when the system boots with the rootfs pointing to the hard disk, i= =2Ee. > the system works for "echo", "pwd", ... but freezes after a ls for ex= ample. > > I say "quite", as I sometime got a freeze after a "echo something". > So the problem is definitely not a problem with files on the hard dis= k... > > Do you have some new hints on what could go wrong? > And what could I try to resolve this problem? > > I really need to resolve that thing, and all assistance is more than > greatly welcome ;) > > Thanks in advance for your response and the time you have already spe= nt to > help me. > > Eric Lacombe