public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"mhaeuser@posteo.de" <mhaeuser@posteo.de>,
	Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [edk2-devel] [RFT PATCH v2 4/6] UefiCpuPkg/CpuExceptionHandlerLib: Remove needless runtime fixups
Date: Fri, 31 Mar 2023 05:08:09 +0000	[thread overview]
Message-ID: <MN6PR11MB8244BEA056260F00599A89918C8F9@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <27110.1680213890563417738@groups.io>

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]


diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionH=
andlerAsm.nasm b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHan=
dlerAsm.nasm
similarity index 92%
rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHa=
ndlerAsm.nasm
rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm=
.nasm
index 957478574253e619..10af4cfcdb6b1ea2 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerA=
sm.nasm
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
@@ -59,7 +59,7 @@ AsmIdtVectorBegin:
%rep 256=0D
push strict dword %[Vector] ; This instruction pushes sign-extended=
8-byte value on stack=0D
push rax=0D
- mov rax, strict qword 0 ; mov rax, ASM_PFX(CommonInterruptE=
ntry)=0D
+ mov rax, ASM_PFX(CommonInterruptEntry)=0D

I'm fairly certain this can be a relative reference, as the code doesn't seem to be copied away (as opposed to HookAfterStubHeaderBegin). If true, this would save 256 relocs, which sounds quite nice. Would you mind verifying? Thanks!

Marvin,

You are right the mov can be replaced with “lea”. But, we need to analyze if using lea, the size of each idt stub is fixed or variant (today the size is fixed, so StubSize = TotalSize / 256).

Another thing we need to evaluate is the impact to “Hook after” feature because “hook after” stub is very like the idt stub.

I think we can firstly use Ard’s solution. Later to evaluate to eliminate unnecessary absolute reference.

Thanks,

Ray

[-- Attachment #2: Type: text/html, Size: 3494 bytes --]

  reply	other threads:[~2023-03-31  5:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 21:20 [RFT PATCH v2 0/6] UefiCpuPkg, OvmfPkf: Simplify CpuExceptionHandlerLib Ard Biesheuvel
2023-03-30 21:20 ` [RFT PATCH v2 1/6] BaseTools/tools_def XCODE: Link X64 with -read_only_relocs suppress Ard Biesheuvel
2023-03-30 21:54   ` [edk2-devel] " Marvin Häuser
2023-03-31  7:39     ` Ard Biesheuvel
2023-03-31  8:29       ` Marvin Häuser
2023-03-31  8:59         ` Ard Biesheuvel
2023-03-31  9:27           ` Marvin Häuser
2023-03-31  9:36             ` Ard Biesheuvel
2023-03-31 10:35               ` Marvin Häuser
2023-03-31 10:52               ` Gerd Hoffmann
2023-03-31 10:58                 ` Ard Biesheuvel
2023-03-31 11:00                 ` Marvin Häuser
2023-03-31  9:16         ` Gerd Hoffmann
2023-03-31 14:58         ` Rebecca Cran
2023-03-31 15:08           ` Marvin Häuser
2023-03-30 21:20 ` [RFT PATCH v2 2/6] BaseTools/tools_def CLANGDWARF: Permit text relocations Ard Biesheuvel
2023-03-30 21:20 ` [RFT PATCH v2 3/6] UefiCpuPkg/CpuExceptionHandlerLib: Use single SEC/PEI version Ard Biesheuvel
2023-03-31  4:21   ` Ni, Ray
2023-03-31  7:40     ` [edk2-devel] " Ard Biesheuvel
2023-03-31  8:01       ` Ni, Ray
2023-03-30 21:20 ` [RFT PATCH v2 4/6] UefiCpuPkg/CpuExceptionHandlerLib: Remove needless runtime fixups Ard Biesheuvel
2023-03-30 22:04   ` [edk2-devel] " Marvin Häuser
2023-03-31  5:08     ` Ni, Ray [this message]
2023-03-31  8:06       ` Marvin Häuser
2023-03-31  4:22   ` Ni, Ray
2023-03-30 21:21 ` [RFT PATCH v2 5/6] OvmfPkg: Drop special Xcode5 version of exception handler library Ard Biesheuvel
2023-03-31  0:37   ` [edk2-devel] " Yao, Jiewen
2023-03-30 21:21 ` [RFT PATCH v2 6/6] UefiCpuPkg/CpuExceptionHandlerLib: Drop special XCODE5 version Ard Biesheuvel
2023-03-31  4:23   ` [edk2-devel] " Ni, Ray

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=MN6PR11MB8244BEA056260F00599A89918C8F9@MN6PR11MB8244.namprd11.prod.outlook.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