From: "Ard Biesheuvel" <ardb@kernel.org>
To: devel@edk2.groups.io, ray.ni@intel.com
Cc: Andrew Fish <afish@apple.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
"Liu, Zhiguang" <zhiguang.liu@intel.com>
Subject: Re: [edk2-devel] Is Xcode5ExceptionHandlerAsm.nasm still needed?
Date: Thu, 30 Mar 2023 12:48:08 +0200 [thread overview]
Message-ID: <CAMj1kXGXCeR7Y1sn0bGUoMaOaSZyWUAqnyqebYnhhFh6QUujYQ@mail.gmail.com> (raw)
In-Reply-To: <MN6PR11MB8244E7D0589C5CE6B1E171758C8E9@MN6PR11MB8244.namprd11.prod.outlook.com>
On Thu, 30 Mar 2023 at 12:16, Ni, Ray <ray.ni@intel.com> wrote:
>
> Andrew,
>
> In UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\, there are two nasm files: ExceptionHandlerAsm.nasm and the other XCODE version.
>
>
>
> The major diff between the two is the second operand in “mov rax, ASM_PFX(CommonInterruptEntry)” is patched at runtime by code, instead of relying on linker/loader to fix it.
>
> Can I know more background why it’s needed for XCODE?
>
>
>
> Given Apple is switching away from X86 CPU, is the XCODE version still needed?
>
>
>
> + Mike because I found another commit by you for bug: 565 – Fix X64 XCODE5/NASM compatibility issue in UefiCpuPkg MpInitLib (tianocore.org).
>
>
Yes, we still need it, also for non-Xcode clang + lld
The problem is that the little code templates use absolute addressing
to refer to the jump targets. This is necessary because these
templates are copied into the vector table, and so they are moved
independently from the code they refer to, and so relative addressing
is not an option here.
One thing I haven't tried yet is to emit the template code into .data
instead of .text, which /should/ be fine given that the template code
is never executed directly, only the copied versions are executed.
next prev parent reply other threads:[~2023-03-30 10:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 10:16 Is Xcode5ExceptionHandlerAsm.nasm still needed? Ni, Ray
2023-03-30 10:48 ` Ard Biesheuvel [this message]
2023-03-30 11:47 ` [edk2-devel] " Ard Biesheuvel
2023-03-30 14:25 ` Ni, Ray
2023-03-30 15:04 ` Ard Biesheuvel
2023-03-30 16:33 ` Ard Biesheuvel
2023-03-30 16:47 ` Ard Biesheuvel
2023-03-30 16:54 ` Rebecca Cran
2023-03-30 17:03 ` Ard Biesheuvel
2023-03-30 15:30 ` Michael D Kinney
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-list 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=CAMj1kXGXCeR7Y1sn0bGUoMaOaSZyWUAqnyqebYnhhFh6QUujYQ@mail.gmail.com \
--to=devel@edk2.groups.io \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox