From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Sheng" Subject: Re: [PATCH] KVM: Fix QEmu interrupted HLT emulation Date: Thu, 11 Sep 2008 16:54:27 +0800 Message-ID: <200809111654.27302.sheng.yang@intel.com> References: <200807302155.19732.sheng.yang@intel.com> <200807311352.10657.sheng.yang@intel.com> <48C8DBDD.9040605@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mga11.intel.com ([192.55.52.93]:3728 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751939AbYIKIym (ORCPT ); Thu, 11 Sep 2008 04:54:42 -0400 In-Reply-To: <48C8DBDD.9040605@qumranet.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Thursday 11 September 2008 16:50:37 Avi Kivity wrote: > Yang, Sheng wrote: > > From: Sheng Yang > > Date: Thu, 31 Jul 2008 13:43:58 +0800 > > Subject: [PATCH] KVM: Fix QEmu interrupted HLT emulation > > > > QEmu can interrupt VCPU from HLT emulation without setting mp_state to > > MP_STATE_RUNNABLE, when it kick vcpus which are doing HLT emulation to > > do something like "stop" or "info cpus". Here are two issues of this > > behaviour: > > > > First, if vcpu exit to QEmu with MP_STATE_HALTED, it would keep in > > this state later for vcpu_run(), which is eerie... > > > > Second, a practical problem: bios load AP boot up code to 0x10000 > > (now), and AP is running HLT there. But later grub load it's stage2 > > code to the same address. Then if the halting vcpu was forced exit to > > QEmu in grub, and come back for vcpu_run later, it can't execute HLT > > instruction anymore, just because the bios code is not there, > > and it would follow a piece of code of grub, which would cause > > completely chaos... > > > > The second issue directly lead to guest crash or SMP linux can't boot > > up AP later if we "stop" or "info cpus" in grub. Though I also sent a > > patch for BIOS, it's necessary to get correct behavior here. > > Going over my backlog it looks like I missed this. But I think > Marcelo's rework obsoletes this patch? Yeah, long ago... So I also drop this patch. -- regards Yang, Sheng