From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: Fix QEmu interrupted HLT emulation Date: Thu, 11 Sep 2008 11:50:37 +0300 Message-ID: <48C8DBDD.9040605@qumranet.com> References: <200807302155.19732.sheng.yang@intel.com> <200807311247.21350.sheng.yang@intel.com> <200807311352.10657.sheng.yang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: "Yang, Sheng" Return-path: Received: from il.qumranet.com ([212.179.150.194]:35542 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751905AbYIKIxE (ORCPT ); Thu, 11 Sep 2008 04:53:04 -0400 In-Reply-To: <200807311352.10657.sheng.yang@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: 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? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.