From owner-svn-src-all@FreeBSD.ORG Tue Apr 15 20:53:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82D71E41; Tue, 15 Apr 2014 20:53:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FD481B76; Tue, 15 Apr 2014 20:53:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FKrsBq030117; Tue, 15 Apr 2014 20:53:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FKrsPF030116; Tue, 15 Apr 2014 20:53:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404152053.s3FKrsPF030116@svn.freebsd.org> From: John Baldwin Date: Tue, 15 Apr 2014 20:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264516 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 20:53:54 -0000 Author: jhb Date: Tue Apr 15 20:53:53 2014 New Revision: 264516 URL: http://svnweb.freebsd.org/changeset/base/264516 Log: Don't spindown the BSP if it executes hlt with the APIC disabled. A guest that doesn't use the APIC at all can trigger this, plus the BSP always needs to execute as it should trigger a reset, etc. Reviewed by: tychon Modified: head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Apr 15 20:41:55 2014 (r264515) +++ head/sys/amd64/vmm/vmm.c Tue Apr 15 20:53:53 2014 (r264516) @@ -1036,10 +1036,12 @@ vm_handle_hlt(struct vm *vm, int vcpuid, msleep_spin(vcpu, &vcpu->mtx, "vmidle", timo); } else { /* - * Spindown the vcpu if the apic is disabled and it - * had entered the halted state. + * Spindown the vcpu if the APIC is disabled and it + * had entered the halted state, but never spin + * down the BSP. */ - spindown = 1; + if (vcpuid != 0) + spindown = 1; } vcpu_require_state_locked(vcpu, VCPU_FROZEN); vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t);