From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 1/3] x86/mem_access: Make the mem_access ops generic Date: Fri, 11 Apr 2014 10:53:18 +0100 Message-ID: <5347BB8E.4090201@citrix.com> References: <1397188179-14606-1-git-send-email-aravindp@cisco.com> <1397188179-14606-2-git-send-email-aravindp@cisco.com> <5347B769.5040106@citrix.com> <5347D67E0200007800007E8B@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WYY9G-0001wn-LW for xen-devel@lists.xenproject.org; Fri, 11 Apr 2014 09:53:26 +0000 In-Reply-To: <5347D67E0200007800007E8B@nat28.tlf.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: xen-devel@lists.xenproject.org, Tim Deegan , Keir Fraser , Aravindh Puthiyaparambil List-Id: xen-devel@lists.xenproject.org On 11/04/14 10:48, Jan Beulich wrote: >>>> On 11.04.14 at 11:35, wrote: >> On 11/04/14 04:49, Aravindh Puthiyaparambil wrote: >>> --- a/xen/arch/x86/mm/mem_access.c >>> +++ b/xen/arch/x86/mm/mem_access.c >>> @@ -21,31 +21,98 @@ >>> */ >>> >>> >>> +#include >>> +#include >>> +#include >>> #include >>> #include >>> +#include >>> >>> >>> -int mem_access_memop(struct domain *d, xen_mem_event_op_t *meo) >>> +#define ACCESS_op_mask 0xff >>> + >>> +int mem_access_memop(XEN_GUEST_HANDLE_PARAM(void) arg, unsigned long >> start_iter) >>> { >>> - int rc; >>> + long rc; >> int function and long rc? The function wants promoting to long. > No, what makes it out of the function fits in an "int", Why does that matter? It is a recipe for accidental truncation with future changes (and certainly not the first example in Xen). All hypercall handlers should be returning longs, and leaving it to the compat layer to apply correct truncation if needed. ~Andrew