From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH V3 1/3] xen/mem_access: Support for memory-content hiding Date: Tue, 7 Jul 2015 16:21:01 +0300 Message-ID: <559BD23D.7090006@bitdefender.com> References: <1436197873-4559-1-git-send-email-rcojocaru@bitdefender.com> <1436197873-4559-2-git-send-email-rcojocaru@bitdefender.com> <559AC880.3070406@bitdefender.com> <559B8989.3030001@bitdefender.com> <559BCF7C.9010001@bitdefender.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: "Lengyel, Tamas" Cc: Jun Nakajima , Wei Liu , kevin.tian@intel.com, keir@xen.org, Ian Campbell , Stefano Stabellini , George Dunlap , Andrew Cooper , eddie.dong@intel.com, Xen-devel , Aravind.Gopalakrishnan@amd.com, Jan Beulich , suravee.suthikulpanit@amd.com, boris.ostrovsky@oracle.com, Ian Jackson List-Id: xen-devel@lists.xenproject.org On 07/07/2015 04:15 PM, Lengyel, Tamas wrote: > > > On Tue, Jul 7, 2015 at 9:09 AM, Razvan Cojocaru > > wrote: > > So VM_EVENT_FLAG_FOREIGN (1 << 1), and then MEM_ACCESS_EMULATE (1 << 6). > Now you're adding VM_EVENT_FLAG_TOGGLE_SINGLESTEP (1 << 2), and if we're > not very careful, slowly but surely the VM_EVENT_FLAG_ constants will > crawl towards (1 << 6) and start overlapping with MEM_ACCESS_EMULATE, > MEM_ACCESS_EMULATE_NOWRITE and so on, because they're not clearly > #defined right after the rest of the VM_EVENT_FLAG_ ones, are called > MEM_ACCESS_ just like the mem_access event specific flags, > and they use bit shifts relative to the MEM_ACCESS_ ones as well. This > is in part what has caused my confusion here. > > What do you think? > > Thanks, > Razvan > > > Well, this is clearly an oversight that we need to fix. MEM_ACCESS_* > flags should be only set on the mem_access flags field. Right, if there are no objections, I'll just submit a small patch (in a few minutes) that moves MEM_ACCESS_EMULATE and MEM_ACCESS_EMULATE_NOWRITE up near the VM_EVENT_FLAG_ constants, and renames them VM_EVENT_FLAG_EMULATE and VM_EVENT_FLAG_EMULATE_NOWRITE. It seems like this would be a pretty straightforward change, so I assume it's likely to go in fast. Thanks, Razvan