From: Wei Yang <richard.weiyang@gmail.com>
To: hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Wei Yang <richard.weiyang@gmail.com>
Subject: [PATCH] x86/boot: reduce one instruction by adding delta to gdtr's base address
Date: Tue, 1 Nov 2016 15:49:24 +0000 [thread overview]
Message-ID: <1478015364-5547-1-git-send-email-richard.weiyang@gmail.com> (raw)
%ebp contains the address where it is loaded and gdtr's base address is
already set to "gdt" in compilation. It is fine to get the correct base
address by adding the delta to gdtr's base address.
This patch fixes the gdtr's base address by adding delta to it and saves
one instruction.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
arch/x86/boot/compressed/head_64.S | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index efdfba2..4d85e60 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -119,8 +119,7 @@ ENTRY(startup_32)
*/
/* Load new GDT with the 64bit segments using 32bit descriptor */
- leal gdt(%ebp), %eax
- movl %eax, gdt+2(%ebp)
+ addl %ebp, gdt+2(%ebp)
lgdt gdt(%ebp)
/* Enable PAE mode */
--
2.5.0
next reply other threads:[~2016-11-01 15:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-01 15:49 Wei Yang [this message]
2016-11-07 8:53 ` [tip:x86/boot] x86/boot: Simplify the GDTR calculation assembly code a bit tip-bot for Wei Yang
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=1478015364-5547-1-git-send-email-richard.weiyang@gmail.com \
--to=richard.weiyang@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®