Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp519582ybl; Thu, 23 Jan 2020 03:06:12 -0800 (PST) X-Google-Smtp-Source: APXvYqy6LkyisEamX2kO2sQOc9STrA3y1kZqJ77jllOYEPD0SoLnR5PDpERBu4kNGNLYlOn1pJ1t X-Received: by 2002:a9d:69ce:: with SMTP id v14mr11301107oto.248.1579777572185; Thu, 23 Jan 2020 03:06:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579777572; cv=none; d=google.com; s=arc-20160816; b=ljv5x9IE6qYoyDJkzkvecXbWQepnvqewB1JUfBri/tAXJJOS7gElnKeWUxtPWrQWnE ZrSvla72zM3L/MdZw/UjV2vWP6IqhWdJh8URWeF1oPUh/3Lgn8V2CzWp44slOyGEs4HO W5knifImS/DZGQqtq2pMzkSWqWlHpkqKG3MuWwRliAoVoScl6QygkYU1sz0SsH6kxZts 3Ts2axbYwmt+KBet/RxOmyoTpxkWuBIUmG+znHeenVWUE5R6nOpsvm8ogtfNVv1ykqlg gzoPYwRz70fRGt+cYWJHCol9LLKMUwmU2p+Td5hg7TOgSMpzHKZu29Mqq9jwG+JtPIcy Syaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=rJZjUrGpSfelmbj/0rOloRICK9h6ljPsbmeLrZaHq/Q=; b=CzIkW73sZt3jo4E2PctaJffSInH1bqqNFuw8qj9sRK7L1Wg0sYGgAuVrM5tB5bhkT9 KVQ8UoQftJw8VMHdo3PaozowGSge3pHyd9q2i1S+YuWkqIlBj3xyIhNmb0xf9bi5HddD g3WZ+1pCCXtVtLej1G23V7oZrUY6qZKH9W7fv1jaTAW6c3o4GFcY7yTkwew7un+h1z1n FmpWA4oWfbu1pT9gcAGjohJklOw4A34kPSkscwkeBvPrcciiBS6LO2V0mYHWboG7o47b wJEI5WwA33uHv408ZpNVRW+/BjxAEM1/iCmRsPF56e82vwIkpuiMV3fkhRnG5qlAfEDi S5sQ== 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 v14si985244oto.127.2020.01.23.03.06.00; Thu, 23 Jan 2020 03:06:12 -0800 (PST) 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 S1727141AbgAWLEx (ORCPT + 99 others); Thu, 23 Jan 2020 06:04:53 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:39685 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbgAWLEx (ORCPT ); Thu, 23 Jan 2020 06:04:53 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iuaI3-0006g1-Fk; Thu, 23 Jan 2020 12:04:47 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id F04A61C1A13; Thu, 23 Jan 2020 12:04:46 +0100 (CET) Date: Thu, 23 Jan 2020 11:04:46 -0000 From: "tip-bot2 for Arvind Sankar" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/asm] x86/boot: Simplify calculation of output address Cc: Arvind Sankar , Borislav Petkov , x86 , LKML In-Reply-To: <20200107194436.2166846-1-nivedita@alum.mit.edu> References: <20200107194436.2166846-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <157977748674.396.4073029577161163163.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/asm branch of tip: Commit-ID: 183ef7adf4ed638ac0fb0c3c9a71fc00e8512b61 Gitweb: https://git.kernel.org/tip/183ef7adf4ed638ac0fb0c3c9a71fc00e8512b61 Author: Arvind Sankar AuthorDate: Tue, 07 Jan 2020 14:44:34 -05:00 Committer: Borislav Petkov CommitterDate: Thu, 23 Jan 2020 11:58:43 +01:00 x86/boot: Simplify calculation of output address Condense the calculation of decompressed kernel start a little. Committer notes: before: ebp = ebx - (init_size - _end) after: eax = (ebx + _end) - init_size where in both ebx contains the temporary address the kernel is moved to for in-place decompression. The before and after difference in register state is %eax and %ebp but that is immaterial because the compressed image is not built with -mregparm, i.e., all arguments of the following extract_kernel() call are passed on the stack. Signed-off-by: Arvind Sankar Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200107194436.2166846-1-nivedita@alum.mit.edu --- arch/x86/boot/compressed/head_32.S | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index f2dfd6d..1cc55c7 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S @@ -240,11 +240,9 @@ SYM_FUNC_START_LOCAL_NOALIGN(.Lrelocated) /* push arguments for extract_kernel: */ pushl $z_output_len /* decompressed length, end of relocs */ - movl BP_init_size(%esi), %eax - subl $_end, %eax - movl %ebx, %ebp - subl %eax, %ebp - pushl %ebp /* output address */ + leal _end(%ebx), %eax + subl BP_init_size(%esi), %eax + pushl %eax /* output address */ pushl $z_input_len /* input_len */ leal input_data(%ebx), %eax