From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: kvm-60: kexec in guest crashes the host Date: Wed, 27 Feb 2008 16:02:53 +0200 Message-ID: <47C56D8D.4060803@qumranet.com> References: <20080219102547.GA30701@localdomain> <47BAFDB7.6070204@qumranet.com> <20080219164610.GA3182@localdomain> <47BBEE58.4010801@qumranet.com> <20080220104838.GA15252@localdomain> <47C55CC4.9010004@qumranet.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040906070205050100080508" Cc: kvm-devel@lists.sourceforge.net To: Dan Aloni Return-path: In-Reply-To: <47C55CC4.9010004@qumranet.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------040906070205050100080508 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Avi Kivity wrote: > Dan Aloni wrote: > >> On Wed, Feb 20, 2008 at 11:09:44AM +0200, Avi Kivity wrote: >> >> >>> Dan Aloni wrote: >>> >>> >>>> It happens at 100% of the times I invoke kexec. >>>> >>>> >>>> >>>> >>> Can you provide a commandline which triggers this? I'm completely >>> ignorant wrt kexec. >>> >>> >> I managed to verify that this problem can be reproduced with the >> 2.6.16.60 tree. >> >> Also, it's worth to note that with '-no-kvm' the kexec procedure works >> successfully and the second kernel executes. >> >> Please use the .config that that I attached to this mail, and also apply >> the patch I supplied (it fixes a build problem that 2.6.16 has with the >> newer binutils versions and x86_64). I use gcc-4.1.2 to build the kernel. >> >> Once you have the bzImage of that guest kernel, use a root filesystem >> and boot it straight into /bin/bash. >> >> Now, assuming that your guest rootfs has kexec-utils package installed, >> do the following: >> >> mount -t proc proc /proc >> kexec -l bzImage --command-line='ro root=/dev/hda1 init=/bin/bash' >> kexec -e >> >> BTW, if you use the serial console with the '-nographic' switch, then >> you might want to use kexec a little differently: >> >> kexec -l bzImage --command-line='ro root=/dev/hda1 init=/bin/bash console=ttyS0,115200' --serial=ttyS0 --serial-baud=115200 >> >> > > I managed to reproduce it (FC6 kernel kexecing itself). It is Intel > specific. > > The attached patch fixes the problem for me. -- error compiling committee.c: too many arguments to function --------------040906070205050100080508 Content-Type: text/x-patch; name="kexec-host-crash-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kexec-host-crash-fix.patch" diff --git a/kernel/vmx.c b/kernel/vmx.c index 7ce02d2..ccc8174 100644 --- a/kernel/vmx.c +++ b/kernel/vmx.c @@ -1356,6 +1356,7 @@ static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer) msr->data = efer & ~EFER_LME; } + vmx_load_host_state(vmx); setup_msrs(vmx); } --------------040906070205050100080508 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ --------------040906070205050100080508 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------040906070205050100080508--