From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: KVM: x86: do not execute halted vcpus (resend) Date: Wed, 10 Sep 2008 21:42:05 +0300 Message-ID: <48C814FD.5070507@qumranet.com> References: <20080908182347.GA8457@dmt.cnet> <48C68502.9010500@qumranet.com> <48C7B7BA.70405@qumranet.com> <20080910183716.GA6373@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Marcelo Tosatti Return-path: Received: from il.qumranet.com ([212.179.150.194]:32438 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750889AbYIJSoa (ORCPT ); Wed, 10 Sep 2008 14:44:30 -0400 In-Reply-To: <20080910183716.GA6373@dmt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: >> Actually it does reproduce. If you reboot twice, the second reboot will >> hang during reset (with cs:ip = f000:fff0). Plain Windows XP. >> > > OK, easily reproducible by adding a sleep at the start of > qemu_kvm_system_reset. > > The problem is that the vcpu HLT's between the KBD ioport write and the > actual system reset by the IO thread. By then time there will be no > event that takes it out of STATE_HALTED. > > The following fixes it, however older userspace will remain borked. > Alternative is to special case f000:fff0 in-kernel. What is preferred? > > Special-case the kvm_set_sregs ioctl with cs:eip f000:fff0 (and cr0.pe=0 for good measure). -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.