diff mbox series

[06/17] xen/x86: mm: Fix the comment on top put_page_from_l2e() to use 'mfn'

Message ID 20200322161418.31606-7-julien@xen.org (mailing list archive)
State New, archived
Headers show
Series Bunch of typesafe conversion | expand

Commit Message

Julien Grall March 22, 2020, 4:14 p.m. UTC
From: Julien Grall <jgrall@amazon.com>

We are using the 'mfn' to refer to machine frame. As this function deal
with 'mfn', replace 'pfn' with 'mfn'.

Signed-off-by: Julien Grall <jgrall@amazon.com>

---

I am not entirely sure to understand the comment on top of the
function, so this change may be wrong.
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Beulich March 26, 2020, 3:51 p.m. UTC | #1
On 22.03.2020 17:14, julien@xen.org wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> We are using the 'mfn' to refer to machine frame. As this function deal
> with 'mfn', replace 'pfn' with 'mfn'.
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> ---
> 
> I am not entirely sure to understand the comment on top of the
> function, so this change may be wrong.

Looking at the history of the function, ...

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -1321,7 +1321,7 @@ static int put_data_pages(struct page_info *page, bool writeable, int pt_shift)
>  }
>  
>  /*
> - * NB. Virtual address 'l2e' maps to a machine address within frame 'pfn'.
> + * NB. Virtual address 'l2e' maps to a machine address within frame 'mfn'.
>   * Note also that this automatically deals correctly with linear p.t.'s.
>   */
>  static int put_page_from_l2e(l2_pgentry_t l2e, mfn_t l2mfn, unsigned int flags)

... it used to be

static int put_page_from_l2e(l2_pgentry_t l2e, unsigned long pfn)

When the rename occurred (in the context of or as a follow-up to an
XSA iirc), the comment adjustment was apparently missed. With the
referenced name matching that of the function argument (l2mfn)
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan
Julien Grall April 18, 2020, 10:54 a.m. UTC | #2
Hi Jan,

On 26/03/2020 15:51, Jan Beulich wrote:
> On 22.03.2020 17:14, julien@xen.org wrote:
>> From: Julien Grall <jgrall@amazon.com>
>>
>> We are using the 'mfn' to refer to machine frame. As this function deal
>> with 'mfn', replace 'pfn' with 'mfn'.
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
>>
>> ---
>>
>> I am not entirely sure to understand the comment on top of the
>> function, so this change may be wrong.
> 
> Looking at the history of the function, ...
> 
>> --- a/xen/arch/x86/mm.c
>> +++ b/xen/arch/x86/mm.c
>> @@ -1321,7 +1321,7 @@ static int put_data_pages(struct page_info *page, bool writeable, int pt_shift)
>>   }
>>   
>>   /*
>> - * NB. Virtual address 'l2e' maps to a machine address within frame 'pfn'.
>> + * NB. Virtual address 'l2e' maps to a machine address within frame 'mfn'.
>>    * Note also that this automatically deals correctly with linear p.t.'s.
>>    */
>>   static int put_page_from_l2e(l2_pgentry_t l2e, mfn_t l2mfn, unsigned int flags)
> 
> ... it used to be
> 
> static int put_page_from_l2e(l2_pgentry_t l2e, unsigned long pfn)
> 
> When the rename occurred (in the context of or as a follow-up to an
> XSA iirc), the comment adjustment was apparently missed. With the
> referenced name matching that of the function argument (l2mfn)
> Acked-by: Jan Beulich <jbeulich@suse.com>

I will update the reference to use 'l2mfn' and also add a word that the 
comment was adjusted in ea51977a7aa5e645680a7194550fbceb59004ccf.

Cheers,
diff mbox series

Patch

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index aa0bf3d0ee..65bc03984d 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1321,7 +1321,7 @@  static int put_data_pages(struct page_info *page, bool writeable, int pt_shift)
 }
 
 /*
- * NB. Virtual address 'l2e' maps to a machine address within frame 'pfn'.
+ * NB. Virtual address 'l2e' maps to a machine address within frame 'mfn'.
  * Note also that this automatically deals correctly with linear p.t.'s.
  */
 static int put_page_from_l2e(l2_pgentry_t l2e, mfn_t l2mfn, unsigned int flags)