From: Ian Campbell Subject: Re: [PATCH 2/2] Xen/mem_event: Prevent underflow of vcpu pause counts Date: Fri, 18 Jul 2014 10:42:18 +0100 Message-ID: <1405676538.13883.1.camel@kazak.uk.xensource.com> References: <1405602637-8321-1-git-send-email-andrew.cooper3@citrix.com> <1405602637-8321-3-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andres Lagar Cavilla Cc: Andrew Cooper , Tim Deegan , Jan Beulich , Xen-devel List-Id: xen-devel@lists.xenproject.org On Thu, 2014-07-17 at 14:38 -0400, Andres Lagar Cavilla wrote: > + BUG_ON(test_and_set_bool(v->paused_for_mem_event) != 0); > This is a problem. It relies on a vcpu being able to cause a single > mem event during a vmexit. I don't think that can be guaranteed. While > I can't pinpoint the exact conversation from years ago, it is not hard > to imagine scenarios in which an mmio emulation can touch multiple > pages. Since some x86 instructions can have both its input and output in memory it's not hard to imagine both being MMIO, at least if you were trying to break things... Ian.