Re: [Xen-devel] [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects

2018-07-17 Thread Jan Beulich
>>> On 17.07.18 at 12:02, wrote: > On 16/07/18 11:45, Jan Beulich wrote: > On 13.07.18 at 22:03, wrote: >>> +int x86_cpuid_copy_to_buffer(const struct cpuid_policy *p, >>> + cpuid_leaf_buffer_t leaves, >>> + uint32_t *nr_entries_p) >>>

Re: [Xen-devel] [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects

2018-07-17 Thread Andrew Cooper
On 16/07/18 11:45, Jan Beulich wrote: On 13.07.18 at 22:03, wrote: >> +int x86_cpuid_copy_to_buffer(const struct cpuid_policy *p, >> + cpuid_leaf_buffer_t leaves, >> + uint32_t *nr_entries_p) >> +{ >> +const uint32_t nr_entries =

Re: [Xen-devel] [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects

2018-07-16 Thread Jan Beulich
>>> On 16.07.18 at 12:39, wrote: > On 16/07/18 10:45, Jan Beulich wrote: > On 16.07.18 at 11:18, wrote: >>> On Fri, Jul 13, 2018 at 09:03:08PM +0100, Andrew Cooper wrote: +#include #include #include #include @@ -23,6 +28,19 @@ static inline bool

Re: [Xen-devel] [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects

2018-07-16 Thread Jan Beulich
>>> On 13.07.18 at 22:03, wrote: > +int x86_cpuid_copy_to_buffer(const struct cpuid_policy *p, > + cpuid_leaf_buffer_t leaves, > + uint32_t *nr_entries_p) > +{ > +const uint32_t nr_entries = *nr_entries_p; > +uint32_t curr_entry = 0,

Re: [Xen-devel] [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects

2018-07-16 Thread Andrew Cooper
On 16/07/18 10:45, Jan Beulich wrote: On 16.07.18 at 11:18, wrote: >> On Fri, Jul 13, 2018 at 09:03:08PM +0100, Andrew Cooper wrote: >>> +#include >>> #include >>> #include >>> #include >>> @@ -23,6 +28,19 @@ static inline bool test_bit(unsigned int bit, const void >> *vaddr) >>>

Re: [Xen-devel] [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects

2018-07-16 Thread Jan Beulich
>>> On 16.07.18 at 11:18, wrote: > On Fri, Jul 13, 2018 at 09:03:08PM +0100, Andrew Cooper wrote: >> +#include >> #include >> #include >> #include >> @@ -23,6 +28,19 @@ static inline bool test_bit(unsigned int bit, const void > *vaddr) >> return addr[bit / 8] & (1u << (bit % 8)); >>

Re: [Xen-devel] [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects

2018-07-16 Thread Wei Liu
On Fri, Jul 13, 2018 at 09:03:08PM +0100, Andrew Cooper wrote: > +#include > #include > #include > #include > @@ -23,6 +28,19 @@ static inline bool test_bit(unsigned int bit, const void > *vaddr) > return addr[bit / 8] & (1u << (bit % 8)); > } > > +/* memcpy(), but with

[Xen-devel] [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects

2018-07-13 Thread Andrew Cooper
The serialised form is made up of the leaf, subleaf and data tuple. As this is the architectural form, it is expected not to change going forwards. The serialisation of the Xen/Viridian leaves isn't fully implemented yet. It is just enough to be bug-compatible with the current DOMCTL_set_cpuid