On 12.01.2023 00:56, Andrew Cooper wrote:
> On 11/01/2023 1:57 pm, Jan Beulich wrote:
>> --- a/xen/arch/x86/mm/shadow/common.c
>> +++ b/xen/arch/x86/mm/shadow/common.c
>> @@ -2264,6 +2264,29 @@ void shadow_prepare_page_type_change(str
>> shadow_remove_all_shadows(d, page_to_mfn(page));
>> }
>>
>> +/*
>> + * Removes v->arch.paging.shadow.shadow_table[].
>> + * Does all appropriate management/bookkeeping/refcounting/etc...
>> + */
>> +static void sh_detach_old_tables(struct vcpu *v)
>> +{
>> + struct domain *d = v->domain;
>> + unsigned int i;
>> +
>> + ////
>> + //// vcpu->arch.paging.shadow.shadow_table[]
>> + ////
>
> Honestly, I don't see what the point of this comment is at all. I'd
> suggest just dropping it as you move the function, which avoids the need
> to debate over C++ comments.
As said in the remark, this style of comments is used elsewhere as well,
to indicate what data structure a certain piece of code in a function is
updating. Earlier on the function here also played with
vcpu->arch.paging.shadow.guest_vtable, at which point having such comments
was certainly not entirely useless.
> Preferably with this done, Acked-by: Andrew Cooper
> <[email protected]>
Thanks. I guess I'll drop it then; should the function become more
involved again, we could clearly resurrect comments in whatever shape is
then deemed best.
Jan