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

Re: [PATCH v2 3/3] docs/doxygen: doxygen documentation for grant_table.h


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Mon, 26 Apr 2021 16:40:02 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TMIkCg9QqaEkIQuG694JzwGAJwB2d7CoeYJw3aDOIgE=; b=mP8l8FNeAAsdy09HLp1wSjbYQhnRFyAoPyS5vTouGY6oVSateCroF+/u8tPKZgs8S/hANhgjcJDHwUGvBmL0Vi5K8naWKG0nV8PZvVnTB2ZW2gtob3Nr6sVruJImtQ12/v3KRYkUXonzn1bkVYgDiAl3hSMvpT4pMet1mxL/ViMPkVjXBtaCaCVFtxiO88IrI60qYA96xG2/6s+ZYyw6nhPYVeKN5MTYLbzbgCBUOVUNrWvMUNpVEamnlt7MCu7EeHtFm9gaqJ0QzxipuXtSX1tasUOkgztcXovgkT57gBGyEIzJaZ1csndiYepnpFZYnMOE65gvVJ/rAFKnhvRn9g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YOzm2TSlSjx6sXM02v7yGoXntZs6sYpdvsSK5TBleIps3ULWI9xBDC1RkUBLU+I/VXfIxhEhoRi16897S24V5Ajf4iHG5FBeQy6vgBwoPJuuVagVFEHiSot0grel2s9B0mHeYQEgLupp3xg6viP6gGgE4mHu4W2yCS6rwVtewcbSiEKar+3/zA0td4OEAfGh863zsslRuJdrtn8YDZfpuxwNjgJViSboPz7pUhcVuU858y2LHN4q8wI1IK9pQPf+LW2n+vahdhT5SWI8DBa2of9vYMyEoufHP0NqE6gBvODVPuGcBeqqIbD1PkH2DeqqVh0A+P2EYgDenNFZN7TtDg==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>, wei.chen@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 26 Apr 2021 15:40:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;


> On 22 Apr 2021, at 09:06, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 22.04.2021 09:39, Luca Fancellu wrote:
>>> On 20 Apr 2021, at 11:27, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>> On 20.04.2021 11:42, Luca Fancellu wrote:
>>>>> On 20 Apr 2021, at 10:14, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>>> On 20.04.2021 10:46, Luca Fancellu wrote:
>>>>>>> On 19 Apr 2021, at 12:05, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>>>>> On 19.04.2021 11:12, Luca Fancellu wrote:
>>>>>>>> - */
>>>>>>>> -
>>>>>>>> -/*
>>>>>>>> - * Reference to a grant entry in a specified domain's grant table.
>>>>>>>> - */
>>>>>>>> -typedef uint32_t grant_ref_t;
>>>>>>> 
>>>>>>> Why does this get moved ...
>>>>>>> 
>>>>>>>> -
>>>>>>>> -/*
>>>>>>>> + *
>>>>>>>> * A grant table comprises a packed array of grant entries in one or 
>>>>>>>> more
>>>>>>>> * page frames shared between Xen and a guest.
>>>>>>>> + *
>>>>>>>> * [XEN]: This field is written by Xen and read by the sharing guest.
>>>>>>>> + *
>>>>>>>> * [GST]: This field is written by the guest and read by Xen.
>>>>>>>> + *
>>>>>>>> + * @addtogroup grant_table Grant Tables
>>>>>>>> + * @{
>>>>>>>> */
>>>>>>>> 
>>>>>>>> -/*
>>>>>>>> - * Version 1 of the grant table entry structure is maintained purely
>>>>>>>> - * for backwards compatibility.  New guests should use version 2.
>>>>>>>> +/**
>>>>>>>> + * Reference to a grant entry in a specified domain's grant table.
>>>>>>>> */
>>>>>>>> +typedef uint32_t grant_ref_t;
>>>>>>> 
>>>>>>> ... here, past a comment unrelated to it?
>>>>>> 
>>>>>> The comment “Version 1 of the grant table entry […]” was moved on top of 
>>>>>> the struct grant_entry_v1, in this way
>>>>>> Doxygen associate the comment to that structure.
>>>>>> 
>>>>>> The comment “Reference to a grant entry in a specified domain's grant 
>>>>>> table.” Is moved on top of typedef uint32_t grant_ref_t
>>>>>> for the same reason above
>>>>> 
>>>>> But it's the other comment ("A grant table comprises ...") that I
>>>>> was asking about.
>>>> 
>>>> I thought it was part of the brief about grant tables, am I wrong? For 
>>>> that reason I moved it.
>>> 
>>> Well, the comment talks about grant table entries (the layout of which
>>> gets defined immediately below, as visible in the original patch), not
>>> grant references.
>> 
>> Hi Jan,
>> 
>> Of course this can be reverted back if it is wrong. 
>> 
>> I’ve prepared a page with the output of all my commits (some of them are not 
>> yet in the ML),
>> so anyone can have a look on what is the output and how can sphinx+doxygen 
>> improve
>> the quality of the documentation.
>> 
>> Here: 
>> 
>> https://luca.fancellu.gitlab.io/xen-docs/hypercall-interfaces/arm64.html
> 
> The doc looks fine in this regard, but the C header should remain
> properly ordered as well.

Hi Jan,

I’ve pushed outside the v3 addressing your comment

> 
>>>>>>>> @@ -243,23 +258,27 @@ union grant_entry_v2 {
>>>>>>>>   * In that case, the frame field has the same semantics as the
>>>>>>>>   * field of the same name in the V1 entry structure.
>>>>>>>>   */
>>>>>>>> +    /** @cond skip anonymous struct/union for doxygen */
>>>>>>>>  struct {
>>>>>>>>      grant_entry_header_t hdr;
>>>>>>>>      uint32_t pad0;
>>>>>>>>      uint64_t frame;
>>>>>>>>  } full_page;
>>>>>>>> +    /** @endcond */
>>>>>>>> 
>>>>>>>>  /*
>>>>>>>>   * If the grant type is GTF_grant_access and GTF_sub_page is set,
>>>>>>>>   * @domid is allowed to access bytes [@page_off,@page_off+@length)
>>>>>>>>   * in frame @frame.
>>>>>>>>   */
>>>>>>>> +    /** @cond skip anonymous struct/union for doxygen */
>>>>>>>>  struct {
>>>>>>>>      grant_entry_header_t hdr;
>>>>>>>>      uint16_t page_off;
>>>>>>>>      uint16_t length;
>>>>>>>>      uint64_t frame;
>>>>>>>>  } sub_page;
>>>>>>>> +    /** @endcond */
>>>>>>>> 
>>>>>>>>  /*
>>>>>>>>   * If the grant is GTF_transitive, @domid is allowed to use the
>>>>>>>> @@ -270,12 +289,14 @@ union grant_entry_v2 {
>>>>>>>>   * The current version of Xen does not allow transitive grants
>>>>>>>>   * to be mapped.
>>>>>>>>   */
>>>>>>>> +    /** @cond skip anonymous struct/union for doxygen */
>>>>>>>>  struct {
>>>>>>>>      grant_entry_header_t hdr;
>>>>>>>>      domid_t trans_domid;
>>>>>>>>      uint16_t pad0;
>>>>>>>>      grant_ref_t gref;
>>>>>>>>  } transitive;
>>>>>>>> +    /** @endcond */
>>>>>>> 
>>>>>>> While already better than the introduction of strange struct tags,
>>>>>>> I'm still not convinced we want this extra clutter (sorry). Plus -
>>>>>>> don't these additions mean the sub-structures then won't be
>>>>>>> represented in the generated doc, rendering it (partly) useless?
>>>>>> 
>>>>>> Are you suggesting to remove the structure from docs?
>>>>> 
>>>>> Just yet I'm not suggesting anything here - I was merely guessing at
>>>>> the effect of "@cond" and the associated "skip ..." to mean that this
>>>>> construct makes doxygen skip the enclosed section. If that's not the
>>>>> effect, then maybe the comment wants rewording? (And then - what does
>>>>> @cond mean?)
>>>> 
>>>> Yes you were right, in the documentation the structure grant_entry_v2 
>>>> won’t display the
>>>> anonymous union.
>>> 
>>> In which case I'm now completely unclear about your prior question.
>> 
>> We have to choose just if the struct is useful even if it’s partially 
>> documented or if
>> it’s better to hide it completely from the docs since it can’t be fully 
>> documented.
> 
> I've never suggested to hide it completely (aiui doing so would
> mean widening the scope of the @cond, i.e. there would still be
> extra clutter). Instead I was trying to suggest to make sure the
> struct gets fully documented despite the absence of struct tags.

In the v3 I preprocess the header to give a name to the anonymous struct so 
that it appears in the
docs without touching the header.

Cheers,
Luca

> 
> Jan




 


Rackspace

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