[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v9 1/7] x86/domctl: generalize the restore of vMCE parameters

>>> Haozhong Zhang <haozhong.zhang@xxxxxxxxx> 07/12/17 4:05 AM >>>
>+static int vcpu_set_vmce(struct vcpu *v,
>+                         const struct xen_domctl_ext_vcpucontext *evc)
>+    /*
>+     * Sizes of vMCE parameters used by the current and past versions
>+     * of Xen in descending order. If vMCE parameters are extended,
>+     * remember to add the old size to this array by VMCE_SIZE().
>+     */
>+#define VMCE_SIZE(field) \
>+    (offsetof(typeof(evc->vmce), field) + sizeof(evc->vmce.field))
>+    static const unsigned int valid_sizes[] = {
>+        sizeof(evc->vmce),
>+        VMCE_SIZE(caps),
>+    };
>+#undef VMCE_SIZE
>+    struct hvm_vmce_vcpu vmce = { };
>+    unsigned int evc_vmce_size =
>+        min(evc->size - offsetof(typeof(*evc), mcg_cap), sizeof(evc->vmce));

I should have noticed this earlier, and I'll try to remember to adjust this 
committing: Instead of mcg_cap we really should be using vmce here, as the
former is there solely for backward compatibility purposes (which this
expression doesn't relate to directly).


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.