From: "Orzel, Michal" <michal.orzel@amd.com>
To: Julien Grall <julien@xen.org>,
Ayan Kumar Halder <ayan.kumar.halder@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 v3 2/5] xen/arm: Move some of the functions to common file
Date: Mon, 31 Mar 2025 10:28:38 +0200 [thread overview]
Message-ID: <8be0fc7a-1c28-4630-a4aa-d897af81383b@amd.com> (raw)
In-Reply-To: <4d57c061-ec16-4467-8bd1-08a40161ab0e@xen.org>
On 30/03/2025 23:06, Julien Grall wrote:
>
>
> Hi Ayan,
>
> On 30/03/2025 19:03, Ayan Kumar Halder wrote:
>> Added a new file prepare_xen_region.inc to hold the common earlyboot MPU regions
>> configurations across arm64 and arm32.
>
> While I understand the desire to consolidate the code, I am quite
> unconvinced this should be done for assembly code. A few examples below why.
>
> I would be interested to hear the view of the other Arm maintainers.
I think consolidating the code is ok as long as we don't go to extremes.
Consolidation should be done for things only where it makes really sense
(macros, helpers). For example, in places where we don't predict that given
implementation might be different due to certain arch optimizations, etc. (like
you mentioned for mov_w). If we worry that it'll be difficult to asses what to
make common, I might suggest to consolidate only common macros.
In case of this patch, I think we could have a single implementation for
prepare_xen_region and fail_insufficient_regions, whereas enable_boot_cpu should
be implementation specific. I also think that a common .inc file is a good place
for storing stubs such as enable_secondary_cpu_mm(). One day, if let's say arm64
decide to add support for SMP, it will add it's own implementation, leaving the
stub only for arm32.
>
>>
>> prepare_xen_region, enable_boot_cpu, fail_insufficient_regions() will be used by
>> both arm32 and arm64. Thus, they have been moved to prepare_xen_region.inc.
>>
>> REGION_* are moved to arm64/sysregs.h. Introduced LOAD_SYSREG and STORE_SYSREG
That's not a good name as it makes me think it's ldr/str.
>> to read/write to the system registers from the common asm file. One could not
>> reuse READ_SYSREG and WRITE_SYSREG as they have been defined to be invoked from
>> C files.
Therefore {READ/WRTIE}_SYSREG_ASM() could be used to denote ASM only usage.
~Michal
next prev parent reply other threads:[~2025-03-31 8:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-30 18:03 [PATCH v3 0/5] Enable early bootup of Armv8-R AArch32 systems Ayan Kumar Halder
2025-03-30 18:03 ` [PATCH v3 1/5] xen/arm32: Move MM specific registers to enable_mmu Ayan Kumar Halder
2025-03-30 18:03 ` [PATCH v3 2/5] xen/arm: Move some of the functions to common file Ayan Kumar Halder
2025-03-30 21:06 ` Julien Grall
2025-03-31 8:28 ` Orzel, Michal [this message]
2025-03-31 12:38 ` Ayan Kumar Halder
2025-03-31 13:04 ` Julien Grall
2025-03-30 18:03 ` [PATCH v3 3/5] xen/arm32: Create the same boot-time MPU regions as arm64 Ayan Kumar Halder
2025-03-30 18:03 ` [PATCH v3 4/5] xen/arm32: Allow ARM_PA_BITS_40 only if !MPU Ayan Kumar Halder
2025-03-30 21:07 ` Julien Grall
2025-03-30 18:03 ` [PATCH v3 5/5] xen/arm32: mpu: Stubs to build MPU for arm32 Ayan Kumar Halder
2025-03-30 21:11 ` Julien Grall
2025-04-03 16:35 ` Ayan Kumar Halder
2025-03-31 10:13 ` [PATCH v3 0/5] Enable early bootup of Armv8-R AArch32 systems Orzel, Michal
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=8be0fc7a-1c28-4630-a4aa-d897af81383b@amd.com \
--to=michal.orzel@amd.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=ayan.kumar.halder@amd.com \
--cc=bertrand.marquis@arm.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.