Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752520AbcKGIzz (ORCPT ); Mon, 7 Nov 2016 03:55:55 -0500 Received: from terminus.zytor.com ([198.137.202.10]:43666 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977AbcKGIzv (ORCPT ); Mon, 7 Nov 2016 03:55:51 -0500 Date: Mon, 7 Nov 2016 00:53:20 -0800 From: tip-bot for Wei Yang Message-ID: Cc: luto@kernel.org, torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, bp@alien8.de, brgerst@gmail.com, dvlasenk@redhat.com, tglx@linutronix.de, richard.weiyang@gmail.com, jpoimboe@redhat.com Reply-To: dvlasenk@redhat.com, tglx@linutronix.de, richard.weiyang@gmail.com, jpoimboe@redhat.com, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, bp@alien8.de, peterz@infradead.org, brgerst@gmail.com, luto@kernel.org, torvalds@linux-foundation.org In-Reply-To: <1478015364-5547-1-git-send-email-richard.weiyang@gmail.com> References: <1478015364-5547-1-git-send-email-richard.weiyang@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/boot] x86/boot: Simplify the GDTR calculation assembly code a bit Git-Commit-ID: 064025f7ea1ebcd9bbb99cfa9492a803e8b01d36 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1720 Lines: 45 Commit-ID: 064025f7ea1ebcd9bbb99cfa9492a803e8b01d36 Gitweb: http://git.kernel.org/tip/064025f7ea1ebcd9bbb99cfa9492a803e8b01d36 Author: Wei Yang AuthorDate: Tue, 1 Nov 2016 15:49:24 +0000 Committer: Ingo Molnar CommitDate: Mon, 7 Nov 2016 08:33:59 +0100 x86/boot: Simplify the GDTR calculation assembly code a bit This patch calculates the GDTR's base address via a single instruction. ( 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. ) Signed-off-by: Wei Yang Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1478015364-5547-1-git-send-email-richard.weiyang@gmail.com Signed-off-by: Ingo Molnar --- 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 */