From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932537AbcA3NWG (ORCPT ); Sat, 30 Jan 2016 08:22:06 -0500 Received: from terminus.zytor.com ([198.137.202.10]:39018 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754429AbcA3NWD (ORCPT ); Sat, 30 Jan 2016 08:22:03 -0500 Date: Sat, 30 Jan 2016 05:20:52 -0800 From: tip-bot for Alexander Kuleshov Message-ID: Cc: ryabinin.a.a@gmail.com, mingo@kernel.org, alpopov@ptsecurity.com, linux-kernel@vger.kernel.org, luto@kernel.org, luto@amacapital.net, brgerst@gmail.com, bp@alien8.de, dvlasenk@redhat.com, peterz@infradead.org, kuleshovmail@gmail.com, torvalds@linux-foundation.org, tglx@linutronix.de, hpa@zytor.com, bp@suse.de Reply-To: mingo@kernel.org, ryabinin.a.a@gmail.com, alpopov@ptsecurity.com, luto@kernel.org, linux-kernel@vger.kernel.org, brgerst@gmail.com, luto@amacapital.net, dvlasenk@redhat.com, bp@alien8.de, peterz@infradead.org, torvalds@linux-foundation.org, kuleshovmail@gmail.com, hpa@zytor.com, tglx@linutronix.de, bp@suse.de In-Reply-To: <1453842730-28463-11-git-send-email-bp@alien8.de> References: <1453531828-19291-1-git-send-email-kuleshovmail@gmail.com> <1453842730-28463-11-git-send-email-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/boot] x86/boot: Simplify kernel load address alignment check Git-Commit-ID: a4733143085d6c782ac1e6c85778655b6bac1d4e 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 Commit-ID: a4733143085d6c782ac1e6c85778655b6bac1d4e Gitweb: http://git.kernel.org/tip/a4733143085d6c782ac1e6c85778655b6bac1d4e Author: Alexander Kuleshov AuthorDate: Tue, 26 Jan 2016 22:12:10 +0100 Committer: Ingo Molnar CommitDate: Sat, 30 Jan 2016 11:22:48 +0100 x86/boot: Simplify kernel load address alignment check We are using %rax as temporary register to check the kernel address alignment. We don't really have to since the TEST instruction does not clobber the destination operand. Suggested-by: Brian Gerst Signed-off-by: Alexander Kuleshov Signed-off-by: Borislav Petkov Cc: Alexander Popov Cc: Andrey Ryabinin Cc: Andy Lutomirski Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1453531828-19291-1-git-send-email-kuleshovmail@gmail.com Link: http://lkml.kernel.org/r/1453842730-28463-11-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/head_64.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index ffdc0e8..7c21029 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -76,9 +76,7 @@ startup_64: subq $_text - __START_KERNEL_map, %rbp /* Is the address not 2M aligned? */ - movq %rbp, %rax - andl $~PMD_PAGE_MASK, %eax - testl %eax, %eax + testl $~PMD_PAGE_MASK, %ebp jnz bad_address /*