From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Jan Beulich" <jbeulich@suse.com>,
xen-devel@lists.xenproject.org,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>
Subject: Re: [PATCH v1 1/5] console: add relocation hook
Date: Tue, 10 Jun 2025 15:01:27 +0200 [thread overview]
Message-ID: <aEgsqOghLiYMQ3M0@mail-itl> (raw)
In-Reply-To: <480626d3-550a-4836-adc3-0af96d7e1fd7@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 2695 bytes --]
On Tue, Jun 10, 2025 at 01:54:04PM +0100, Andrew Cooper wrote:
> On 10/06/2025 8:52 am, Jan Beulich wrote:
> > On 06.06.2025 17:54, Marek Marczykowski-Górecki wrote:
> >> On Fri, Jun 06, 2025 at 08:26:33AM +0200, Jan Beulich wrote:
> >>> On 05.06.2025 18:08, Marek Marczykowski-Górecki wrote:
> >>>> On Thu, Jun 05, 2025 at 06:05:02PM +0200, Jan Beulich wrote:
> >>>>> On 05.06.2025 16:51, Marek Marczykowski-Górecki wrote:
> >>>>>> On Thu, Jun 05, 2025 at 04:42:53PM +0200, Jan Beulich wrote:
> >>>>>>> Why is it that this ring is dependent upon Xen's position? If the ring was
> >>>>>>> dynamically allocated, it wouldn't change position when Xen is moved.
> >>>>>> The console is setup quite early, I don't think I can allocate memory at
> >>>>>> this stage, no?
> >>>>> But you allocate before Xen is moved, I suppose.
> >>>> Well, I have those buffers in BSS exactly to avoid the need to allocate
> >>>> them (or rather: have bootloader allocate them for me).
> >>> Yet them remaining in .bss is now getting in the way. Imo moving them to
> >>> .init.* and adding proper allocation is going to be easier than the hook-
> >>> ary you are proposing.
> >> So, when would you propose to allocate them? Wouldn't that be yet
> >> another hook?
> > Exactly one, yes. Given Andrew's earlier reply my understanding was that to
> > get things correct in your proposed model would end up requiring more than
> > one. However, the point in time where move_xen() is called is still too
> > early to allocate memory a (somewhat) normal way - even the boot allocator
> > gets seeded only later. So I guess console_init_preirq() may need to inform
> > its caller how much memory is going to be needed later on (and what address
> > constraints there are, if any). Then a suitable chunk would need setting
> > aside kind of like it's done for kexec. That address would then need to be
> > passed into the new hook.
>
> How about initialising the console using _va(_pa(xxx)) of the Xen
> datastructures?
>
> Xen is mapped into the directmap (pagetable handling depends on this),
> so these pointers will work right from the very outset, and will
> (intentionally) refer to the old position.
>
> After relocation (specifically, before we free the old Xen image), we
> can drain in-flight requests and update the pointers.
Ah, you mean to use directmap to access the ring pages. Yes, that should
work, and should be enough to not need the pre-relocate hook. The post
relocate would still be needed though (none of existing console init
hooks fits this purpose). I'll try that approach.
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-06-10 13:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-25 14:15 [PATCH v1 0/5] Fix XHCI console on legacy MB2 boot Marek Marczykowski-Górecki
2025-05-25 14:15 ` [PATCH v1 1/5] console: add relocation hook Marek Marczykowski-Górecki
2025-05-26 15:08 ` Andrew Cooper
2025-05-26 15:39 ` Marek Marczykowski-Górecki
2025-06-05 14:42 ` Jan Beulich
2025-06-05 14:51 ` Marek Marczykowski-Górecki
2025-06-05 16:05 ` Jan Beulich
2025-06-05 16:08 ` Marek Marczykowski-Górecki
2025-06-06 6:26 ` Jan Beulich
2025-06-06 15:54 ` Marek Marczykowski-Górecki
2025-06-10 7:52 ` Jan Beulich
2025-06-10 12:54 ` Andrew Cooper
2025-06-10 13:01 ` Marek Marczykowski-Górecki [this message]
2025-05-25 14:15 ` [PATCH v1 2/5] drivers/char: Handle Xen relocation in the XHCI console driver Marek Marczykowski-Górecki
2025-05-25 14:15 ` [PATCH v1 3/5] drivers/char: make dbc_uart_dump() a bit more useful Marek Marczykowski-Górecki
2025-06-10 12:46 ` Jan Beulich
2025-05-25 14:15 ` [PATCH v1 4/5] drivers/char: remove outdated comment in xhci driver Marek Marczykowski-Górecki
2025-06-05 14:43 ` Jan Beulich
2025-05-25 14:15 ` [PATCH v1 5/5] console: support multiple serial console simultaneously Marek Marczykowski-Górecki
2025-06-10 12:48 ` Jan Beulich
2025-06-10 13:49 ` Marek Marczykowski-Górecki
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=aEgsqOghLiYMQ3M0@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--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.