From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [RFC][KVM] Adding a signal mask to KVM_RUN Date: Fri, 02 Mar 2007 09:23:05 +1100 Message-ID: <1172787785.10271.55.camel@localhost.localdomain> References: <45E6EC49.9050308@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , linux-kernel To: Avi Kivity Return-path: In-Reply-To: <45E6EC49.9050308-atKUWr5tajBWk0Htik3J/w@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 On Thu, 2007-03-01 at 17:07 +0200, Avi Kivity wrote: > I'd like to add a signal mask to kvm, so that when the guest executes, > the signal mask is temporarily set to some user specified value. This > allows signals to be used as a way to interrupt the guest, but without > requiring signal delivery to the userspace handler (which is what makes > signals expensive). Hi Avi! lguest uses SIGUSR1 for similar reasons (console input, incoming packet). Basically it forks and the child does a select, then sends SIGUSR1 to the parent whenever the select returns, to pop the parent out of the kernel/guest. It's nasty in another respect: the race between checking signal and entering kernel. (Hence my child sends SIGUSR1 whenever select returns, but it runs at v. low prio so it usually only sends one before the parent clears the fd). My original code passed an fd into the kernel: whenever the fd was readable, the lg module returned to userspace. This avoids the race, but might be more awkward to use. I shied away from a complete select/poll-style mask which would have done exactly what I wanted, but perhaps this should be considered. Rusty. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV