From: Michal Orzel <michal.orzel@amd.com>
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
<sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
<Volodymyr_Babchuk@epam.com>, <julien@xen.org>,
<jbeulich@suse.com>
Cc: <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3 1/4] xen: arm: Add a new helper update_boot_mapping()
Date: Wed, 14 Aug 2024 14:50:07 +0200 [thread overview]
Message-ID: <d1144ab4-a342-452b-bd03-a67409657fa7@amd.com> (raw)
In-Reply-To: <20240813171356.46760-2-ayan.kumar.halder@amd.com>
Hi Ayan,
On 13/08/2024 19:13, Ayan Kumar Halder wrote:
> update_boot_mapping() invokes update_identity_mapping() for the MMU specific
> code.
> Later when the MPU code is added, update_boot_mapping() would invoke the
> equivalent.
>
> The common code now invokes update_boot_mapping() instead of
> update_identity_mapping(). So, that there is clear abstraction between the
> common and MMU/MPU specific logic.
>
> This is in continuation to commit
> f661a20aa880: "Extract MMU-specific MM code".
>
> update_identity_mapping() is now marked as static as it is called within
> xen/arch/arm/arm64/mmu/mm.c only. Also, updated the prototype to
> update_boot_mapping() which is now invoked from other files.
>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
> Changes from :-
>
> v1 - 1. Introduced update_boot_mapping() which invokes
> update_identity_mapping() in MMU specific code.
>
> v2 - 1. Make update_identity_mapping() static and update the prototype.
>
> xen/arch/arm/arm64/mmu/mm.c | 7 ++++++-
> xen/arch/arm/arm64/smpboot.c | 6 +++---
> xen/arch/arm/include/asm/arm64/mm.h | 2 +-
> 3 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
> index 293acb67e0..1afbbeda5a 100644
> --- a/xen/arch/arm/arm64/mmu/mm.c
> +++ b/xen/arch/arm/arm64/mmu/mm.c
> @@ -111,7 +111,7 @@ void __init arch_setup_page_tables(void)
> prepare_runtime_identity_mapping();
> }
>
> -void update_identity_mapping(bool enable)
> +static void update_identity_mapping(bool enable)
> {
> paddr_t id_addr = virt_to_maddr(_start);
> int rc;
> @@ -125,6 +125,11 @@ void update_identity_mapping(bool enable)
> BUG_ON(rc);
> }
>
> +void update_boot_mapping(bool enable)
> +{
> + update_identity_mapping(enable);
> +}
> +
> extern void switch_ttbr_id(uint64_t ttbr);
>
> typedef void (switch_ttbr_fn)(uint64_t ttbr);
> diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
> index a225fae64d..789f352ab6 100644
> --- a/xen/arch/arm/arm64/smpboot.c
> +++ b/xen/arch/arm/arm64/smpboot.c
> @@ -112,18 +112,18 @@ int arch_cpu_up(int cpu)
> if ( !smp_enable_ops[cpu].prepare_cpu )
> return -ENODEV;
>
> - update_identity_mapping(true);
> + update_boot_mapping(true);
>
> rc = smp_enable_ops[cpu].prepare_cpu(cpu);
> if ( rc )
> - update_identity_mapping(false);
> + update_boot_mapping(false);
>
> return rc;
> }
>
> void arch_cpu_up_finish(void)
> {
> - update_identity_mapping(false);
> + update_boot_mapping(false);
> }
>
> /*
> diff --git a/xen/arch/arm/include/asm/arm64/mm.h b/xen/arch/arm/include/asm/arm64/mm.h
> index e0bd23a6ed..ac8d1f5c78 100644
> --- a/xen/arch/arm/include/asm/arm64/mm.h
> +++ b/xen/arch/arm/include/asm/arm64/mm.h
> @@ -21,7 +21,7 @@ void arch_setup_page_tables(void);
> * Note that nested call (e.g. enable=true, enable=true) is not
> * supported.
> */
> -void update_identity_mapping(bool enable);
> +void update_boot_mapping(bool enable);
The whole point of adding a wrapper was to avoid ambiguity \wrt identity mapping and MPU.
You changed the name of a function but left the comment which is pretty MMU specific. I think
it should be moved to update_identity_mapping.
Apart from that:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
~Michal
next prev parent reply other threads:[~2024-08-14 12:50 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 17:13 [PATCH v3 0/4] xen: arm: Split MMU code in preparation for MPU work (part 2) Ayan Kumar Halder
2024-08-13 17:13 ` [PATCH v3 1/4] xen: arm: Add a new helper update_boot_mapping() Ayan Kumar Halder
2024-08-14 12:50 ` Michal Orzel [this message]
2024-08-20 11:27 ` Ayan Kumar Halder
2024-08-13 17:13 ` [PATCH v3 2/4] xen: make VMAP only support in MMU system Ayan Kumar Halder
2024-08-14 6:37 ` Jan Beulich
2024-08-14 10:55 ` Ayan Kumar Halder
2024-08-14 11:35 ` Jan Beulich
2024-08-14 12:33 ` Ayan Kumar Halder
2024-08-14 13:04 ` Jan Beulich
2024-08-16 9:28 ` Michal Orzel
2024-08-16 16:00 ` Ayan Kumar Halder
2024-08-16 16:40 ` Julien Grall
2024-08-19 9:45 ` Ayan Kumar Halder
2024-08-19 9:55 ` Julien Grall
2024-08-19 9:58 ` Julien Grall
2024-08-20 11:48 ` Ayan Kumar Halder
2024-08-20 12:51 ` Jan Beulich
2024-08-19 11:39 ` Jan Beulich
2024-08-19 12:12 ` Julien Grall
2024-08-19 12:24 ` Jan Beulich
2024-08-19 13:01 ` Julien Grall
2024-08-13 17:13 ` [PATCH v3 3/4] xen: arm: Move the functions of domain_page to MMU specific Ayan Kumar Halder
2024-08-14 12:59 ` Michal Orzel
2024-08-13 17:13 ` [PATCH v3 4/4] xen: arm: Enclose access to EL2 MMU specific registers under CONFIG_MMU Ayan Kumar Halder
2024-08-14 13:07 ` Michal Orzel
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=d1144ab4-a342-452b-bd03-a67409657fa7@amd.com \
--to=michal.orzel@amd.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=ayan.kumar.halder@amd.com \
--cc=bertrand.marquis@arm.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--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.