From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Alistair Francis" <alistair.francis@wdc.com>,
"Bob Eshleman" <bobbyeshleman@gmail.com>,
"Connor Davis" <connojdavis@gmail.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH for 4.20? v4 1/3] xen/riscv: implement software page table walking
Date: Wed, 19 Feb 2025 15:33:37 +0100 [thread overview]
Message-ID: <45cc5337-be6b-4bfb-b968-56dc98bad249@gmail.com> (raw)
In-Reply-To: <5c56ef1f-1a13-4a2e-9317-0cc90e93d479@suse.com>
[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]
On 2/19/25 12:14 PM, Jan Beulich wrote:
> On 12.02.2025 17:50, Oleksii Kurochko wrote:
>> --- a/xen/arch/riscv/pt.c
>> +++ b/xen/arch/riscv/pt.c
>> @@ -185,6 +185,68 @@ static int pt_next_level(bool alloc_tbl, pte_t **table, unsigned int offset)
>> return XEN_TABLE_NORMAL;
>> }
>>
>> +/*
>> + * _pt_walk() performs software page table walking and returns the pte_t of
>> + * a leaf node or the leaf-most not-present pte_t if no leaf node is found
>> + * for further analysis.
>> + *
>> + * Additionally, _pt_walk() returns the level of the found pte by using
>> + * `pte_level` argument.
>> + * `pte_level` is optional, set `pte_level`=NULL if a caller doesn't need
>> + * the level of the found pte.
> How about this, reducing redundancy a little?
>
> * _pt_walk() can optionally return the level of the found pte. Pass NULL
> * for `pte_level` if this information isn't needed.
>
>> +pte_t pt_walk(vaddr_t va, unsigned int *pte_level)
>> +{
>> + pte_t *entry = _pt_walk(va, pte_level);
>> + pte_t pte = *entry;
>> +
>> + unmap_table(entry);
>> +
>> + return pte;
>> +}
> "entry" especially in this context is ambiguous. I would expect a variable of
> this name to be of type pte_t, not pte_t *. How about "ptep"?
Agree with both your suggestions, it would be better to use `ptep instead of `entry`
and rephrase the comment.
>
> Preferably with these adjustments, which I'd be fine making while committing,
> Reviewed-by: Jan Beulich<jbeulich@suse.com>
>
> Considering the 4.20? tag you'll need to decide whether you still want this
> in before the release.
Considering that it is still needed a new version for patch3 of this patch series and
that the mentioned issues aren't affected no one, lets consider the full patch series for
4.21.
Thanks.
~ Oleksii
[-- Attachment #2: Type: text/html, Size: 2622 bytes --]
next prev parent reply other threads:[~2025-02-19 14:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 16:50 [PATCH for 4.20? v4 0/3] Fixes for vmap_to_mfn() and pt_mapping_level Oleksii Kurochko
2025-02-12 16:50 ` [PATCH for 4.20? v4 1/3] xen/riscv: implement software page table walking Oleksii Kurochko
2025-02-19 11:14 ` Jan Beulich
2025-02-19 14:33 ` Oleksii Kurochko [this message]
2025-02-12 16:50 ` [PATCH for 4.20? v4 2/3] xen/riscv: update defintion of vmap_to_mfn() Oleksii Kurochko
2025-02-19 11:17 ` Jan Beulich
2025-02-12 16:50 ` [PATCH for 4.20? v4 3/3] xen/riscv: update mfn calculation in pt_mapping_level() Oleksii Kurochko
2025-02-19 11:28 ` Jan Beulich
2025-02-19 14:46 ` Oleksii Kurochko
2025-02-19 15:05 ` Jan Beulich
2025-02-19 15:09 ` Oleksii Kurochko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45cc5337-be6b-4bfb-b968-56dc98bad249@gmail.com \
--to=oleksii.kurochko@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bobbyeshleman@gmail.com \
--cc=connojdavis@gmail.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.