From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Frediano Ziglio <frediano.ziglio@cloud.com>,
xen-devel@lists.xenproject.org
Cc: "Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony PERARD" <anthony.perard@vates.tech>
Subject: Re: [PATCH v7 1/5] x86/boot: Rework how 32bit C is linked/included for early boot
Date: Tue, 29 Oct 2024 15:09:23 +0000 [thread overview]
Message-ID: <6fed0353-d9eb-4e48-af49-15841bbfaacf@citrix.com> (raw)
In-Reply-To: <20241029102942.162912-2-frediano.ziglio@cloud.com>
On 29/10/2024 10:29 am, Frediano Ziglio wrote:
> Right now, the two functions which were really too complicated to write
> in asm are compiled as 32bit PIC, linked to a blob and included
> directly, using global asm() to arrange for them to have function semantics.
>
> This is limiting and fragile; the use of data relocations will compile
> fine but malfunction when used, creating hard-to-debug bugs.
>
> Furthermore, we would like to increase the amount of C, to
> deduplicate/unify Xen's boot logic, as well as making it easier to
> follow. Therefore, rework how the 32bit objects are included.
>
> Link all 32bit objects together first. This allows for sharing of logic
> between translation units. Use differential linking and explicit
> imports/exports to confirm that we only have the expected relocations,
> and write the object back out as an assembly file so it can be linked
> again as if it were 64bit, to integrate with the rest of Xen.
>
> This allows for the use of external references (e.g. access to global
> variables) with reasonable assurance of doing so safely.
>
> No functional change.
>
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
next prev parent reply other threads:[~2024-10-29 15:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 10:29 [PATCH v7 0/5] Reuse 32 bit C code more safely Frediano Ziglio
2024-10-29 10:29 ` [PATCH v7 1/5] x86/boot: Rework how 32bit C is linked/included for early boot Frediano Ziglio
2024-10-29 15:09 ` Andrew Cooper [this message]
2024-10-29 10:29 ` [PATCH v7 2/5] x86/boot: Reuse code to relocate trampoline Frediano Ziglio
2024-10-29 10:29 ` [PATCH v7 3/5] x86/boot: Use boot_vid_info variable directly from C code Frediano Ziglio
2024-10-29 10:29 ` [PATCH v7 4/5] x86/boot: Use trampoline_phys " Frediano Ziglio
2024-10-29 10:29 ` [PATCH v7 5/5] x86/boot: Clarify comment Frediano Ziglio
2024-10-29 14:53 ` Roger Pau Monné
2024-10-29 15:07 ` Andrew Cooper
2024-10-29 16:40 ` Frediano Ziglio
2024-10-29 16:44 ` Alejandro Vallejo
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=6fed0353-d9eb-4e48-af49-15841bbfaacf@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=frediano.ziglio@cloud.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--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.