From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 10/10] KVM: Adds support for halting in the kernel Date: Thu, 24 May 2007 11:29:51 +0300 Message-ID: <46554CFF.9040101@qumranet.com> References: <20070523130905.23177.11087.stgit@novell1.haskins.net> <20070523131932.23177.38587.stgit@novell1.haskins.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Gregory Haskins Return-path: In-Reply-To: <20070523131932.23177.38587.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Gregory Haskins wrote: > Halting in userspace requires a relatively cumbersome mechanism to signal the > halted VCPU. Implementing halt in kernel should be relatively straight > forward and it eliminates the need for the signaling > > /* > + * The vCPU has executed a HLT instruction with in-kernel mode enabled. > + */ > +static int kvm_vcpu_kern_halt(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) > +{ > + DECLARE_WAITQUEUE(wait, current); > + sigset_t sigblocked, sigsaved; > + int r = 1; > + > + /* > + * Unmask all signals while we wait > + */ > + memset(&sigblocked, 0, sizeof(sigblocked)); > + sigprocmask(SIG_SETMASK, &sigblocked, &sigsved); > We have a specialized signal mask for the kernel, and it is already in effect here. See KVM_SET_SIGNAL_MASK. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/