All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Tim Deegan <tim@xen.org>,
	Keir Fraser <keir@xen.org>,
	Aravindh Puthiyaparambil <aravindp@cisco.com>
Subject: Re: [PATCH 1/3] x86/mem_access: Make the mem_access ops generic
Date: Fri, 11 Apr 2014 10:53:18 +0100	[thread overview]
Message-ID: <5347BB8E.4090201@citrix.com> (raw)
In-Reply-To: <5347D67E0200007800007E8B@nat28.tlf.novell.com>

On 11/04/14 10:48, Jan Beulich wrote:
>>>> On 11.04.14 at 11:35, <andrew.cooper3@citrix.com> 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 <xen/sched.h>
>>> +#include <xen/guest_access.h>
>>> +#include <xen/hypercall.h>
>>>  #include <asm/p2m.h>
>>>  #include <asm/mem_event.h>
>>> +#include <xsm/xsm.h>
>>>  
>>>  
>>> -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

  reply	other threads:[~2014-04-11  9:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11  3:49 [PATCH 0/3] Make mem_access APIs and hypercalls generic Aravindh Puthiyaparambil
2014-04-11  3:49 ` [PATCH 1/3] x86/mem_access: Make the mem_access ops generic Aravindh Puthiyaparambil
2014-04-11  8:52   ` Jan Beulich
2014-04-11 20:07     ` Aravindh Puthiyaparambil (aravindp)
2014-04-14  8:01       ` Jan Beulich
2014-04-11  9:35   ` Andrew Cooper
2014-04-11  9:48     ` Jan Beulich
2014-04-11  9:53       ` Andrew Cooper [this message]
2014-04-11 10:04         ` Jan Beulich
2014-04-11  3:49 ` [PATCH 2/3] tools/libxc: Make the mem_access APIs generic Aravindh Puthiyaparambil
2014-04-11  9:45   ` Andrew Cooper
2014-04-11 20:20     ` Aravindh Puthiyaparambil (aravindp)
2014-04-11  3:49 ` [PATCH 3/3] tools/xen-access: Use the new mem_access APIs Aravindh Puthiyaparambil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5347BB8E.4090201@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=aravindp@cisco.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.