Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2044700imm; Mon, 16 Jul 2018 00:48:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdITmcC96qaeEtqcipMz1T/k71NU2+yhDDeIim2xYd7+74eLS2vhoVD/jPJr9vblEmHqkQm X-Received: by 2002:a17:902:9893:: with SMTP id s19-v6mr6071556plp.130.1531727296924; Mon, 16 Jul 2018 00:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727296; cv=none; d=google.com; s=arc-20160816; b=zClC1PbHb1If11xV1JSumAv9bbsKybxVCKm0NiLZisQIxg3KMlwFN08lxs/NmdPWSV DBPQDBS9wJJwiNLF3Q12iLwE/bWZv54jru2aSHUiGCp65O1ExIYfz7j1LZAmM/tcQx1P tB7jZ+to9znhvaztnxIsHBwKj1xBDI/MEa7wNhoey8IZh6Gxq5yxoi7eOUdxuz8GlHvV QGdZjwE4p8ePhghhrlalY0mysopbKwUu82rS+cEelOzuwTlm/1ZU7ZaUC9/CVBHpdDJI 07NDhoSK4OR4PpfgTzvWL4HDyYco0V7h6MjcZ14BIAdQKpM998LKMjRlCwJGgHjb/4GS xjmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=GzbX5yJ3phIN5ArKWbTEsVqNFHIn6E4su5JkyVGp+8A=; b=vHcut3UN6MkjeUvXEIeYc1AUPYGZxZ+YZyM2XLeKlclRczGrVwrTmzC6M5CZMGxwll L/98/OIbm8Axj3W0pORto4ZLUaZVy3UtEDGn+TMqQn95xlJF4NhaXdsrM/sOnm3hWBpS kREgDTZrb9yHS/P6NkVRpY9t/36QBeqCIVSLRohf1r2ix9+N08XTjI/Rea2gRvpmd3pd EnFdKE34DpFCv0OJizvkb2hpCLxSZxMZD6qUTW7ncSL+MHdOHsdVDbZjHdzVMPdvHGln MQ2FiRrwraPuwEdDqoxJnpEW9wp0tbzftHIUXlzjN8guBWTTtIPPH7CVOHf3OXZoi5vJ Thyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10-v6si31674199pfg.258.2018.07.16.00.48.02; Mon, 16 Jul 2018 00:48:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389522AbeGPIMw (ORCPT + 99 others); Mon, 16 Jul 2018 04:12:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51356 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728470AbeGPIMv (ORCPT ); Mon, 16 Jul 2018 04:12:51 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1C86FCEE; Mon, 16 Jul 2018 07:45:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Gerst , Alexander Kuleshov , Borislav Petkov , Alexander Popov , Andrey Ryabinin , Andy Lutomirski , Andy Lutomirski , Borislav Petkov , Denys Vlasenko , "H. Peter Anvin" , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , "Srivatsa S. Bhat" , "Matt Helsley (VMware)" , Alexey Makhalov , Bo Gan Subject: [PATCH 4.4 28/43] x86/boot: Simplify kernel load address alignment check Date: Mon, 16 Jul 2018 09:36:33 +0200 Message-Id: <20180716073514.984005719@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073511.796555857@linuxfoundation.org> References: <20180716073511.796555857@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexander Kuleshov commit a4733143085d6c782ac1e6c85778655b6bac1d4e upstream 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 Signed-off-by: Srivatsa S. Bhat Reviewed-by: Matt Helsley (VMware) Reviewed-by: Alexey Makhalov Reviewed-by: Bo Gan Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/head_64.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- 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 /*