From: Tim Deegan Subject: Re: [PATCH RFC V4 1/5] xen: Emulate with no writes Date: Thu, 28 Aug 2014 13:53:10 +0200 Message-ID: <20140828115310.GG60905@deinos.phlegethon.org> References: <1407151825-3843-1-git-send-email-rcojocaru@bitdefender.com> <53DFB0440200007800029111@mail.emea.novell.com> <53E0F54A.6090801@bitdefender.com> <53E117C902000078000298CC@mail.emea.novell.com> <53E1EA58.2010001@bitdefender.com> <53E208760200007800029AFF@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <53E208760200007800029AFF@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: kevin.tian@intel.com, ian.campbell@citrix.com, Razvan Cojocaru , stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org At 09:50 +0100 on 06 Aug (1407315030), Jan Beulich wrote: > >>> On 06.08.14 at 10:42, wrote: > > On 08/05/2014 06:43 PM, Jan Beulich wrote: > >> it. And quite different from your case - you want the instruction to > >> behave normally _except_ for the memory write as I understood so far > >> (albeit it still escapes me how in the end correct behavior can result). > > > > The scenario in such cases is quite special: the decision to emulate > > without writing is usually made for things such as rootkits, and > > allowing a rogue application to go ahead with a write generally means > > allowing it to do bad things - so in that case the alternative is > > preferable. > > In which case dropping the side effects of such instructions may > well be the right thing too, in which case the trivial implementations > you provided would be okay, but you'd have to go further and also > disallow port and MMIO reads. +1. A related point - you might want to emulate ther read and test parts of cmpxchg (but OTOH the sorts of things that CMPXCHG is used for are likely to misbehave badly with the write discarded anyway.) Tim.