From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Michal Orzel" <michal.orzel@amd.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 7/8] xen/common: dom0less: introduce common domain-build.c
Date: Tue, 22 Apr 2025 17:36:45 +0200 [thread overview]
Message-ID: <54f90f7f-cbce-47bd-96d0-d395aa698db8@gmail.com> (raw)
In-Reply-To: <6010658f-9e29-40d9-902c-890cb27a2a4b@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2401 bytes --]
On 4/22/25 5:26 PM, Oleksii Kurochko wrote:
>
>
> On 4/17/25 4:45 PM, Jan Beulich wrote:
>> On 14.04.2025 17:56, Oleksii Kurochko wrote:
>>> --- a/xen/include/xen/fdt-domain-build.h
>>> +++ b/xen/include/xen/fdt-domain-build.h
>>> @@ -5,6 +5,7 @@
>>> #include <xen/bootfdt.h>
>>> #include <xen/device_tree.h>
>>> #include <xen/fdt-kernel.h>
>>> +#include <xen/mm.h>
>>> #include <xen/types.h>
>>>
>>> #if __has_include(<asm/domain_build.h>)
>>> @@ -32,7 +33,37 @@ int make_memory_node(const struct kernel_info *kinfo, int addrcells,
>>> int sizecells, const struct membanks *mem);
>>> int make_timer_node(const struct kernel_info *kinfo);
>>>
>>> -unsigned int get_allocation_size(paddr_t size);
>>> +
>>> +static inline int get_allocation_size(paddr_t size)
>>> +{
>>> + /*
>>> + * get_order_from_bytes returns the order greater than or equal to
>>> + * the given size, but we need less than or equal. Adding one to
>>> + * the size pushes an evenly aligned size into the next order, so
>>> + * we can then unconditionally subtract 1 from the order which is
>>> + * returned.
>>> + */
>>> + return get_order_from_bytes(size + 1) - 1;
>>> +}
>>> +
>>> +typedef unsigned long (*copy_to_guest_phys_cb)(struct domain *d,
>>> + paddr_t gpa,
>>> + void *buf,
>> This very much looks like the latest now, when the code is made common,
>> it wants to be const void *. Even if this may require another prereq
>> patch.
>>
>> However, instead of using a function pointer, couldn't the now common
>> code call copy_to_guest_phys_flush_dcache() conditionally upon
>> IS_ENABLED(CONFIG_<whatever>)?
> I thought about having IS_ENABLED(CONFIG_ARM) as, at the moment, this is necessary to
> be called only for Arm as guest domain on Arm could be ran with cache disabled so to be sure
> that DTB, kernel and initrd is fully in RAM this function should be called.
>
> For RISC-V, it isn't possible case as guest domain won't run with cache disabled.
Here I meant flush_dcache() part of copy_to_guest_phys_flush_dcache().
~ Oleksii
>> Or provide a weak
>> copy_to_guest_phys_flush_dcache() which would simply call
>> copy_to_guest_phys()?
> Could it be a weak function with empty implementation?
> Is copy_to_guest_phys() implemented for other archs?
[-- Attachment #2: Type: text/html, Size: 3419 bytes --]
next prev parent reply other threads:[~2025-04-22 15:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-14 15:56 [PATCH v2 0/8] Move parts of Arm's Dom0less to common code Oleksii Kurochko
2025-04-14 15:56 ` [PATCH v2 1/8] xen/arm: drop declaration of handle_device_interrupts() Oleksii Kurochko
2025-04-17 7:38 ` Orzel, Michal
2025-04-22 14:31 ` Oleksii Kurochko
2025-04-22 14:32 ` Orzel, Michal
2025-04-14 15:56 ` [PATCH v2 2/8] xen/common: dom0less: make some parts of Arm's CONFIG_DOM0LESS common Oleksii Kurochko
2025-04-17 8:08 ` Orzel, Michal
2025-04-17 8:11 ` Jan Beulich
2025-04-22 15:08 ` Oleksii Kurochko
2025-04-14 15:56 ` [PATCH v2 3/8] asm-generic: move parts of Arm's asm/kernel.h to common code Oleksii Kurochko
2025-04-14 15:56 ` [PATCH v2 4/8] arm/static-shmem.h: drop inclusion of asm/setup.h Oleksii Kurochko
2025-04-14 15:56 ` [PATCH v2 5/8] asm-generic: move some parts of Arm's domain_build.h to common Oleksii Kurochko
2025-04-17 14:36 ` Jan Beulich
2025-04-22 15:12 ` Oleksii Kurochko
2025-04-22 15:43 ` Jan Beulich
2025-04-14 15:56 ` [PATCH v2 6/8] xen/common: dom0less: introduce common kernel.c Oleksii Kurochko
2025-04-14 15:56 ` [PATCH v2 7/8] xen/common: dom0less: introduce common domain-build.c Oleksii Kurochko
2025-04-17 14:45 ` Jan Beulich
2025-04-22 15:26 ` Oleksii Kurochko
2025-04-22 15:36 ` Oleksii Kurochko [this message]
2025-04-22 15:53 ` Jan Beulich
2025-04-14 15:56 ` [PATCH v2 8/8] xen/common: dom0less: introduce common dom0less-build.c Oleksii Kurochko
2025-05-01 0:55 ` [PATCH v2 0/8] Move parts of Arm's Dom0less to common code Stefano Stabellini
2025-05-01 14:23 ` 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=54f90f7f-cbce-47bd-96d0-d395aa698db8@gmail.com \
--to=oleksii.kurochko@gmail.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.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.