From owner-svn-src-all@FreeBSD.ORG Tue May 6 15:52:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BC96229; Tue, 6 May 2014 15:52:31 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B000917F; Tue, 6 May 2014 15:52:30 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id w8so5469630qac.10 for ; Tue, 06 May 2014 08:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nel9Uvs9rYhglTBiWnH4OZ4B1zUd3bkpkF6LWdNncQA=; b=ybQZjE6dGAv6KDxkBoWhjjisFfxra6AbmAVyf9dJ5+yNyjecqJOY4tJ+kxc0ruijdi Nz6bCdsZUpn8KY2vkuB0wextP5iXAKqODrvks89BxcabyzoP9mm8a0uhWUVuiL/NK3i8 1rFciNG9OlMc3XNcpDs85v0bG2mgmAMaUrDiyWJliXMkNL50V+HD3XcP6nBdVEwZKdY/ kbeuID/huVwRGUZqKUxIP5c/djoTC8FOtdes4glaKBWU798/ue+ik1YbuSE4qltPb9nN sDZgq2g2LPxuXYuZlIRrZF36I8at0xbW8S2mkU0e/Jd9w1eJ0cOargalK6vkVxlADpH+ 3a4g== MIME-Version: 1.0 X-Received: by 10.224.126.9 with SMTP id a9mr56566542qas.39.1399391549890; Tue, 06 May 2014 08:52:29 -0700 (PDT) Received: by 10.140.50.235 with HTTP; Tue, 6 May 2014 08:52:29 -0700 (PDT) In-Reply-To: <536860D3.5030205@freebsd.org> References: <201405051619.s45GJPr6074677@svn.freebsd.org> <536860D3.5030205@freebsd.org> Date: Tue, 6 May 2014 08:52:29 -0700 Message-ID: Subject: Re: svn commit: r265364 - head/sys/amd64/vmm From: Neel Natu To: Julian Elischer Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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, 06 May 2014 15:52:31 -0000 Hi Julian, On Mon, May 5, 2014 at 9:10 PM, Julian Elischer wrote: > On 5/6/14, 12:19 AM, Neel Natu wrote: >> >> Author: neel >> Date: Mon May 5 16:19:24 2014 >> New Revision: 265364 >> URL: http://svnweb.freebsd.org/changeset/base/265364 >> >> Log: >> Virtual machine halt detection is turned on by default. Allow it to be >> disabled via the tunable 'hw.vmm.halt_detection'. > > So this can only be changed at boot time for the host? not even as a sysctl? The tunable can be set any time before loading vmm.ko: - If you load vmm.ko at boot time then it needs to be set via loader.conf. - If you load vmm.ko after the host is booted then it can be set via kenv(1). > Why is that? It is the easiest way to change the default without any additional complexity. > Why can this not be done from the App? It can be done but I don't think it would be used much. best Neel > >> Modified: >> head/sys/amd64/vmm/vmm.c >> >> Modified: head/sys/amd64/vmm/vmm.c >> >> ============================================================================== >> --- head/sys/amd64/vmm/vmm.c Mon May 5 15:59:31 2014 (r265363) >> +++ head/sys/amd64/vmm/vmm.c Mon May 5 16:19:24 2014 (r265364) >> @@ -189,6 +189,16 @@ static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcp >> SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL); >> +/* >> + * Halt the guest if all vcpus are executing a HLT instruction with >> + * interrupts disabled. >> + */ >> +static int halt_detection_enabled = 1; >> +TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled); >> +SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN, >> + &halt_detection_enabled, 0, >> + "Halt VM if all vcpus execute HLT with interrupts disabled"); >> + >> static int vmm_ipinum; >> SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CTLFLAG_RD, &vmm_ipinum, 0, >> "IPI vector used for vcpu notifications"); >> @@ -1047,7 +1057,7 @@ vm_handle_hlt(struct vm *vm, int vcpuid, >> if (intr_disabled) { >> wmesg = "vmhalt"; >> VCPU_CTR0(vm, vcpuid, "Halted"); >> - if (!vcpu_halted) { >> + if (!vcpu_halted && halt_detection_enabled) { >> vcpu_halted = 1; >> CPU_SET_ATOMIC(vcpuid, &vm->halted_cpus); >> } >> >> >> >