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: Mon, 20 Apr 2009 19:53:53 +0200 Message-ID: <200904201953.53815.goretux@gmail.com> References: <200903241822.11529.goretux@gmail.com> <200904071926.30643.goretux@gmail.com> <200904141424.01608.goretux@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE To: kvm@vger.kernel.org, Avi Kivity Return-path: Received: from mail-bw0-f163.google.com ([209.85.218.163]:51562 "EHLO mail-bw0-f163.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbZDTRx6 convert rfc822-to-8bit (ORCPT ); Mon, 20 Apr 2009 13:53:58 -0400 Received: by bwz7 with SMTP id 7so1345875bwz.37 for ; Mon, 20 Apr 2009 10:53:56 -0700 (PDT) In-Reply-To: <200904141424.01608.goretux@gmail.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Hi, I reviewed my code (modify some things and add missing features) and ma= de more=20 tests, but I'm stuck with the same problem. Nonetheless, all the tests I've done seem to freeze my machine when fil= es are=20 used. When I try the commands "echo", "pwd" in the console (X is not started)= , the=20 machine behaves nicely. When I try completion (with double-tab) on a co= mmand,=20 it also works. But, when I try for instance "more help.c", the machine=20 freezes, likewise when I try "more hel"+double-tab. I really would appreciate some help on this. Please, could you tell me what I could check (because I already checked= a lot=20 of things and can't figure out what happens)? I would also give you all= the=20 information you need. (Recall: When loaded, my module use VT-x to go on vmx root operation, t= hen it=20 creates a vmcs in order to execute the OS inside a VM.) Thanks in advance for your response. Eric Lacombe Le mardi 14 avril 2009 14:24:01 Eric Lacombe, vous avez =E9crit : > Hi, > > I analysed some of my logs and see that sometimes, two successive VM-= exits > handle exactly the same instruction (a wrmsr with the same MSR ID and > data), like below. Is it not strange ? and could it help to focus on = the > problem I have (the freeze of the machine). > > I can understand that you have no time to spend on my problem, but co= uld > someone give me some ideas on what I could check/print/... in order t= o fix > my problem. > > Thanks in advance, > > Eric Lacombe > > I also join the complete log file from which is extracted this sample= =2E > > ## Hytux: VM-EXIT (#000024) ## > Hytux: interruptibility_state=3D0, activity_state=3D0 > Hytux: EXIT_REASON =3D 0x20, EXIT_QUALIF =3D 0x0 > Hytux: INTR_INFO is not valid > Hytux: instruction_len=3D0x2 > Hytux[000024]: handle_wrmsr: ecx=3D0xc0000100 (MSR id), data=3D0x7f83= 583e56e0 > ## GUEST REGISTERS DUMP ## > ---------------------------------------------------------- > GRFLAGS(VMCS): 0x0000000000000002 GRSP(VMCS): 0xffff88007854da18 > GRIP(VMCS): 0xffffffff80209c07 > HRFLAGS: 0x0000000000000086 HRSP: 0xffff88006d5cd000 > ---------------------------------------------------------- > rax: 0x00007f83583e56e0 rbx: 0xffff88007d127280 rcx: 0x00000000c00001= 00 > rdx: 0x0000000000007f83 > rsi: 0x0000000000000000 rdi: 0xffff88007d03e050 rbp: 0xffff88007d03e0= 50 > rsp: 0xffff88007854da18 > r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0xffff88007d38c640= r11: > 0x0000000000000001 > r12: 0x0000000000000000 r13: 0xffff8800790786c0 r14: 0xffffffff80818f= a0 > r15: 0x0000000000000000 > ---------------------------------------------------------- > cr2: 0x0000000000615618 cr3(VMCS): 0x0000000078532000 > ---------------------------------------------------------- > ## Hytux: VM-EXIT (#000025) ## > Hytux: interruptibility_state=3D0, activity_state=3D0 > Hytux: EXIT_REASON =3D 0x20, EXIT_QUALIF =3D 0x0 > Hytux: INTR_INFO is not valid > Hytux: instruction_len=3D0x2 > Hytux[000025]: handle_wrmsr: ecx=3D0xc0000100 (MSR id), data=3D0x7f83= 583e56e0 > ## GUEST REGISTERS DUMP ## > ---------------------------------------------------------- > GRFLAGS(VMCS): 0x0000000000000002 GRSP(VMCS): 0xffff88007854da18 > GRIP(VMCS): 0xffffffff80209c07 > HRFLAGS: 0x0000000000000086 HRSP: 0xffff88006d5cd000 > ---------------------------------------------------------- > rax: 0x00007f83583e56e0 rbx: 0xffff88007d127280 rcx: 0x00000000c00001= 00 > rdx: 0x0000000000007f83 > rsi: 0x0000000000000000 rdi: 0xffff88007d03e050 rbp: 0xffff88007d03e0= 50 > rsp: 0xffff88007854da18 > r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0xffff88007d38c640= r11: > 0xffffffff80241868 > r12: 0x0000000000000000 r13: 0xffff880079590980 r14: 0xffffffff80818f= a0 > r15: 0x0000000000000000 > ---------------------------------------------------------- > cr2: 0x0000000000615618 cr3(VMCS): 0x0000000078532000 > ---------------------------------------------------------- > > Le Tuesday 7 April 2009 19:26:30 Eric Lacombe, vous avez =E9crit : > > Hello, > > > > I forgot to mention that my module only supports a single processor > > (that's why I run a kernel with SMP disabled). > > > > I was able to run my module on two different machines (both are > > core2-based) and that led to the same outcome: both machines freeze > > without any bad printk messages :/ > > > > I join another log file where the guest registers are always dumped= for > > each VM-exit. The log file begins with the loading of the module an= d ends > > when the system crash. > > > > Could someone look at it please and maybe have an hint on what occu= rs ? > > > > If you need other information, just ask me and I will fulfil your n= eeds. > > > > Best regards, > > > > Eric > > > > Le mardi 24 mars 2009 18:22:11 Eric Lacombe, vous avez =E9crit : > > > Hello, > > > > > > I work on the implementation of a "particular" hypervisor for my = PhD > > > and I face a problem I have not resolved yet. Let me explain it. > > > > > > I have a module that when it is loaded triggers vmx mode, and loa= d the > > > current running kernel in a VM. The code seems to work at some ex= tents. > > > For the moment, I just handle the mandatory vm-exit (with my CPU:= cr3, > > > msr). I log information of each VM-exit (if I my module is loaded= with > > > my debug parameter), and see CR3 accesses, wrmsr execution, etc. > > > After some time the machine freeze, there is no information logge= d by > > > printk. The sysrq key do not work anymore (at least do not print > > > information on the console) but some interrupt handling seems to = work > > > as the num-lock key of the keyboard causes the LED to light up (o= nly > > > with X started). > > > > > > Also, after loading the module (without X started), the machine s= ucceed > > > in executing a command like "echo test", but if I try a "ls" the > > > machine instantaneously freezes, and no special logging is perfor= med > > > (my hypervisor does not printk a problem on the console). When I = load > > > the module from X, the machine freezes before I can execute a com= mand > > > (however a lot of vm-exit are still logged). > > > > > > I will be very glad if you have any idea of what occurs here ;) > > > For that purpose, I join an output from my module from the loadin= g > > > process to the system crash, when running under X. > > > Notes: - I only dump guest register contents for the first 10 vm-= exit. > > > - I use the netconsole provided by the kernel to get the logs. > > > > > > If you need more information, just ask me. > > > > > > Thanks in advance, > > > > > > Eric Lacombe > > > > > > PS: as I am not subscribed to the list, please do not forget to i= nclude > > > my address.