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

Re: [Xen-devel] [PATCH 2/4] SVM: infer type in VMCB_ACCESSORS()



On 05/31/2017 07:56 AM, Jan Beulich wrote:
>>>> On 31.05.17 at 13:25, <andrew.cooper3@xxxxxxxxxx> wrote:
>> On 31/05/17 08:21, Jan Beulich wrote:
>>> Prevent accidental mistakes by not requiring explicit types to be
>>> specified in the macro invocations.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> I am not a fan of these accessors being macro-generated; I've lost count
>> of the number of times I've tried greping for one of them, just to
>> finally remember that they can't be searched for. 
>>
>> OTOH, this change doesn't make that problem worse, and does fix one
>> issue in the current setup.  One comment however...
>>
>>>  /* Updates are all via hvm_set_segment_register(). */
>>> -/* VMCB_ACCESSORS(svm_segment_register_t, gdtr, dt) */
>>> -/* VMCB_ACCESSORS(svm_segment_register_t, idtr, dt) */
>>> -/* VMCB_ACCESSORS(svm_segment_register_t, cs, seg) */
>>> -/* VMCB_ACCESSORS(svm_segment_register_t, ds, seg) */
>>> -/* VMCB_ACCESSORS(svm_segment_register_t, es, seg) */
>>> -/* VMCB_ACCESSORS(svm_segment_register_t, ss, seg) */
>>> -VMCB_ACCESSORS(u8, cpl, seg)
>>> -VMCB_ACCESSORS(u64, cr2, cr2)
>>> -VMCB_ACCESSORS(u64, debugctlmsr, lbr)
>>> -VMCB_ACCESSORS(u64, lastbranchfromip, lbr)
>>> -VMCB_ACCESSORS(u64, lastbranchtoip, lbr)
>>> -VMCB_ACCESSORS(u64, lastintfromip, lbr)
>>> -VMCB_ACCESSORS(u64, lastinttoip, lbr)
>>> +/* VMCB_ACCESSORS(gdtr, dt) */
>>> +/* VMCB_ACCESSORS(idtr, dt) */
>>> +/* VMCB_ACCESSORS(cs, seg) */
>>> +/* VMCB_ACCESSORS(ds, seg) */
>>> +/* VMCB_ACCESSORS(es, seg) */
>>> +/* VMCB_ACCESSORS(ss, seg) */
>> I'd just drop these entirely.  I can't see any need for them to be
>> introduced, but even if a need does arise, its not like they are hard to
>> introduce from first principles.
> No problem, but I'll wait to see the SVM maintainers' opinion(s).


I don't have an opinion one way or the other. Either way looks fine to me.

-boris


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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