All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Sergey Dyasli" <sergey.dyasli@citrix.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Ian Jackson" <Ian.Jackson@eu.citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v2 09/13] libx86: Introduce a helper to deserialise cpuid_policy objects
Date: Mon, 16 Jul 2018 10:57:32 +0100	[thread overview]
Message-ID: <20180716095732.4t3wmcn4nzrzh7fj@citrix.com> (raw)
In-Reply-To: <1531512194-6865-10-git-send-email-andrew.cooper3@citrix.com>

On Fri, Jul 13, 2018 at 09:03:10PM +0100, Andrew Cooper wrote:
> As with the serialise side, Xen's copy_from_guest API is used, with a
> compatibility wrapper for the userspace build.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Sergey Dyasli <sergey.dyasli@citrix.com>
> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
> 
> v2:
>  * Rewrite copy_from_buffer_offset() to avoid multiple evaluation of its
>    arguments.
>  * Expand boundary justifications.
> ---
>  xen/common/libx86/cpuid.c      | 94 ++++++++++++++++++++++++++++++++++++++++++
>  xen/common/libx86/private.h    | 14 +++++++
>  xen/include/xen/libx86/cpuid.h | 11 +++++
>  3 files changed, 119 insertions(+)
> 
> diff --git a/xen/common/libx86/cpuid.c b/xen/common/libx86/cpuid.c
> index cf7dbd3..73cd574 100644
> --- a/xen/common/libx86/cpuid.c
> +++ b/xen/common/libx86/cpuid.c
> @@ -123,6 +123,100 @@ int x86_cpuid_copy_to_buffer(const struct cpuid_policy *p,
>      return 0;
>  }
>  
> +
>  /*
>   * Local variables:
>   * mode: C
> diff --git a/xen/common/libx86/private.h b/xen/common/libx86/private.h
> index e874fb6..dc451d0 100644
> --- a/xen/common/libx86/private.h
> +++ b/xen/common/libx86/private.h
> @@ -12,6 +12,7 @@
>  #include <asm/msr-index.h>
>  
>  #define copy_to_buffer_offset copy_to_guest_offset
> +#define copy_from_buffer_offset copy_from_guest_offset
>  
>  #else
>  
> @@ -44,6 +45,19 @@ static inline bool test_bit(unsigned int bit, const void *vaddr)
>      0;                                                  \
>  })
>  
> +/* memcpy(), but with copy_from_guest_offset()'s API. */
> +#define copy_from_buffer_offset(dst, src, index, nr)    \
> +({                                                      \
> +    const typeof(*(dst)) *src_ = (src);                 \

Same issue as previous patch here. Also enforcing dst_ and src_ are of
the same type would be good.

Otherwise:

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-07-16  9:57 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 20:03 [PATCH v2 00/13] x86: CPUID and MSR policy marshalling support Andrew Cooper
2018-07-13 20:03 ` [PATCH v2 01/13] x86/msr: Drop stale comment for vcpu_msrs.spec_ctrl Andrew Cooper
2018-07-16  7:21   ` Jan Beulich
2018-07-16  9:37   ` Roger Pau Monné
2018-07-16 11:02     ` Andrew Cooper
2018-07-13 20:03 ` [PATCH v2 02/13] libx86: Introduce libx86/cpuid.h Andrew Cooper
2018-07-16  9:23   ` Jan Beulich
2018-07-16 10:22     ` Andrew Cooper
2018-07-16 10:51       ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 03/13] libx86: generate cpuid-autogen.h in the libx86 include dir Andrew Cooper
2018-07-16  9:31   ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 04/13] libx86: Share struct cpuid_policy with userspace Andrew Cooper
2018-07-16  9:38   ` Jan Beulich
2018-07-16  9:51     ` Andrew Cooper
2018-07-16 10:04       ` Jan Beulich
2018-07-16 10:16         ` Andrew Cooper
2018-07-16 10:24           ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 05/13] libx86: introduce a libx86 shared library Andrew Cooper
2018-07-16  9:02   ` Wei Liu
2018-07-16 10:17   ` Jan Beulich
2018-07-16 10:35     ` Andrew Cooper
2018-07-16 10:52       ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 06/13] libx86: Introduce libx86/msr.h and share msr_policy with userspace Andrew Cooper
2018-07-16  9:41   ` Roger Pau Monné
2018-07-16 10:19   ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects Andrew Cooper
2018-07-16  9:18   ` Wei Liu
2018-07-16  9:45     ` Jan Beulich
2018-07-16 10:39       ` Andrew Cooper
2018-07-16 10:55         ` Jan Beulich
2018-07-16 10:45   ` Jan Beulich
2018-07-17 10:02     ` Andrew Cooper
2018-07-17 11:58       ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 08/13] libx86: Introduce a helper to serialise msr_policy objects Andrew Cooper
2018-07-16  9:24   ` Wei Liu
2018-07-16 10:47   ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 09/13] libx86: Introduce a helper to deserialise cpuid_policy objects Andrew Cooper
2018-07-16  9:57   ` Wei Liu [this message]
2018-07-17 10:09     ` Andrew Cooper
2018-07-13 20:03 ` [PATCH v2 10/13] libx86: introduce a helper to deserialise msr_policy objects Andrew Cooper
2018-07-16 10:07   ` Wei Liu
2018-07-16 11:36   ` Jan Beulich
2018-07-17 10:17     ` Andrew Cooper
2018-07-17 12:01       ` Jan Beulich
2018-07-17 16:06         ` Andrew Cooper
2018-07-17 16:23           ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 11/13] x86: Introduce struct cpu_policy to refer to a group of individual policies Andrew Cooper
2018-07-16  9:55   ` Roger Pau Monné
2018-07-16 10:32   ` Wei Liu
2018-07-16 12:04   ` Jan Beulich
2018-07-16 12:16     ` Andrew Cooper
2018-07-16 12:29       ` Jan Beulich
2018-07-16 13:15         ` Andrew Cooper
2018-07-16 13:23           ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 12/13] x86/sysctl: Implement XEN_SYSCTL_get_cpu_policy Andrew Cooper
2018-07-16 10:16   ` Roger Pau Monné
2018-07-16 10:58     ` Andrew Cooper
2018-07-16 11:04       ` Jan Beulich
2018-07-16 11:54   ` Jan Beulich
2018-07-17 16:50     ` Andrew Cooper
2018-07-18  6:45       ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 13/13] x86/domctl: Implement XEN_DOMCTL_get_cpu_policy Andrew Cooper
2018-07-16 10:26   ` Roger Pau Monné
2018-07-17 17:08     ` Andrew Cooper
2018-07-16 12:00   ` Jan Beulich
2018-07-30  2:14   ` Chao Gao
2018-08-17 21:22   ` Daniel De Graaf
2018-07-30  2:46 ` [PATCH v2 00/13] x86: CPUID and MSR policy marshalling support Chao Gao

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=20180716095732.4t3wmcn4nzrzh7fj@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=sergey.dyasli@citrix.com \
    --cc=xen-devel@lists.xen.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.