Re: [Xen-devel] [PATCH 07/13] libx86: Introduce a helper to serialise msr_{domain, vcpu}_policy objects

2018-07-05 Thread Jan Beulich
>>> On 04.07.18 at 18:56,  wrote:
> On 04/07/18 10:16, Jan Beulich wrote:
>>
>>> @@ -325,6 +325,13 @@ typedef struct xen_cpuid_leaf {
>>>  } xen_cpuid_leaf_t;
>>>  DEFINE_XEN_GUEST_HANDLE(xen_cpuid_leaf_t);
>>>  
>>> +typedef struct xen_msr_entry {
>>> +uint32_t idx;
>>> +uint32_t flags; /* Reserved MBZ. */
>> ... it remains unclear in this patch whose responsibility it is to clear this
>> field. I wonder whether copy_msr_to_buffer() should make sure of this.
> 
> copy_msr_to_buffer() does explicitly zero this field.
> 
>> +const xen_msr_entry_t ent = { .idx = idx, .val = val };
> 
> guarantees that the flags field is 0.

Oh, I'm sorry - so it does. I had searched the patch for instances of
"flags" only ...

Jan



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

Re: [Xen-devel] [PATCH 07/13] libx86: Introduce a helper to serialise msr_{domain, vcpu}_policy objects

2018-07-04 Thread Andrew Cooper
On 04/07/18 10:16, Jan Beulich wrote:
>
>> @@ -325,6 +325,13 @@ typedef struct xen_cpuid_leaf {
>>  } xen_cpuid_leaf_t;
>>  DEFINE_XEN_GUEST_HANDLE(xen_cpuid_leaf_t);
>>  
>> +typedef struct xen_msr_entry {
>> +uint32_t idx;
>> +uint32_t flags; /* Reserved MBZ. */
> ... it remains unclear in this patch whose responsibility it is to clear this
> field. I wonder whether copy_msr_to_buffer() should make sure of this.

copy_msr_to_buffer() does explicitly zero this field.

> +const xen_msr_entry_t ent = { .idx = idx, .val = val };

guarantees that the flags field is 0.

FWIW, an earlier version of this series has an AVAILABLE bit specified
in the flags field, but attempting to the marshalling code work sensibly
is why I eventually decided to write c/s 2df1d2ba132ff "x86/msr: Drop
{MISC_ENABLES,PLATFORM_INFO}.available" as an alternative fix for the
problem.

~Andrew

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

Re: [Xen-devel] [PATCH 07/13] libx86: Introduce a helper to serialise msr_{domain, vcpu}_policy objects

2018-07-04 Thread Jan Beulich
>>> On 03.07.18 at 22:55,  wrote:
> From: Roger Pau Monné 
> 
> As with CPUID, the an architectural form is used for representing the MSR

Stray "the".

Apart from that same remark(s) as for the respective CPUID change,
plus ...

> @@ -325,6 +325,13 @@ typedef struct xen_cpuid_leaf {
>  } xen_cpuid_leaf_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_cpuid_leaf_t);
>  
> +typedef struct xen_msr_entry {
> +uint32_t idx;
> +uint32_t flags; /* Reserved MBZ. */

... it remains unclear in this patch whose responsibility it is to clear this
field. I wonder whether copy_msr_to_buffer() should make sure of this.

Jan


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