From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v2 1/2] kvm: x86: Fix racy event propagation in kmv timer Date: Tue, 9 Jun 2009 10:59:07 -0300 Message-ID: <20090609135907.GA8016@amt.cnet> References: <4A2E2B3B.5020408@siemens.com> <4A2E657D.5090405@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm-devel To: Jan Kiszka Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48638 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761748AbZFIN7m (ORCPT ); Tue, 9 Jun 2009 09:59:42 -0400 Content-Disposition: inline In-Reply-To: <4A2E657D.5090405@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jun 09, 2009 at 03:37:01PM +0200, Jan Kiszka wrote: > v2 as requested in private discussion: Broken into two pieces, and the > second one will not change the original semantic. > > --------------> > > Minor issue that likely had no practical relevance: The kvm timer > function so far incremented the pending counter and then may reset it > again to 1 in case reinjection was disabled. This opened a small racy > window with the corresponding VCPU loop that may have happened to run on > another (real) CPU and already consumed the value. > > Fix it by skipping the incrementation in case pending is already > 0. > This opens a different race windows, but may only rarely cause lost > events in case we do not care about them anyway (!reinject). > > Signed-off-by: Jan Kiszka ACK both, thanks.