All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 3/3] xen/arm64/mmu: head: Replace load_paddr with adr_l where appropriate
Date: Tue, 21 Nov 2023 16:30:29 +0000	[thread overview]
Message-ID: <d015e81d-16cd-4e93-80c9-ba6418a23b1d@xen.org> (raw)
In-Reply-To: <20231121094516.24714-4-michal.orzel@amd.com>

Hi Michal,

On 21/11/2023 09:45, Michal Orzel wrote:
> Macros load_paddr and adr_l are equivalent when used before the MMU is
> enabled, resulting in obtaining physical address of a symbol. The former
> requires to know the physical offset (PA - VA) and can be used both before
> and after the MMU is enabled. In the spirit of using something only when
> truly necessary, replace all instances of load_paddr with adr_l, except

I don't buy this argument. The advantage with using "load_paddr" is that 
it is pretty clear what you get from the call. With "adr_l" you will 
need to check whether the MMU is on or off.

> in create_table_entry macro. Even though there is currently no use of
> load_paddr after MMU is enabled, this macro used to be call in such a
> context and we can't rule out that it won't happen again.
> 
> This way, the logic behind using load_paddr/adr_l is consistent between
> arm32 and arm64, making it easier for developers to determine which one
> to use and when.

Not really. See above. But there is also no documentation stating that 
"load_paddr" should not be used before the MMU is on. And as I said 
above, I find it easier to work with compare to "adr_l".

Cheers,

-- 
Julien Grall


  reply	other threads:[~2023-11-21 16:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21  9:45 [PATCH 0/3] xen/arm64: head: misc cleanup Michal Orzel
2023-11-21  9:45 ` [PATCH 1/3] xen/arm64: head: Move earlyprintk 'hex' string to .rodata.str Michal Orzel
2023-11-21 15:48   ` Luca Fancellu
2023-11-21 16:09   ` Julien Grall
2023-11-21 17:00     ` Michal Orzel
2023-11-21 17:04       ` Julien Grall
2023-11-21 17:18         ` Michal Orzel
2023-11-21 18:31           ` Julien Grall
2023-11-22  7:54             ` Michal Orzel
2023-11-21  9:45 ` [PATCH 2/3] xen/arm64: Move print_reg macro to asm/arm64/macros.h Michal Orzel
2023-11-21 16:05   ` Luca Fancellu
2023-11-21 16:16   ` Julien Grall
2023-11-21 17:02     ` Michal Orzel
2023-11-21  9:45 ` [PATCH 3/3] xen/arm64/mmu: head: Replace load_paddr with adr_l where appropriate Michal Orzel
2023-11-21 16:30   ` Julien Grall [this message]
2023-11-21 18:13     ` Michal Orzel
2023-11-21 18:43       ` Julien Grall
2023-11-22  8:12         ` Michal Orzel
2023-11-21 16:31   ` Luca Fancellu

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=d015e81d-16cd-4e93-80c9-ba6418a23b1d@xen.org \
    --to=julien@xen.org \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=michal.orzel@amd.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.