Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5990465ybv; Wed, 12 Feb 2020 04:06:53 -0800 (PST) X-Google-Smtp-Source: APXvYqwO6gvBI3K26CIyecps9449EqHDr7MADabJknDk7fHiqYIH+cd4Qn2byx5I+hGD3ktaC4+m X-Received: by 2002:a9d:7e8c:: with SMTP id m12mr9247134otp.346.1581509213546; Wed, 12 Feb 2020 04:06:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581509213; cv=none; d=google.com; s=arc-20160816; b=AapaXvxS62O/lxIIh0OqNZJ7kALJ0fhX5VHO1UkUlyYLktR30V0z3LJVKXNHi08KO8 QseI2FKbjVvbDWiZnBsDshoc07YNn9m9/fId+78yD9x7LUnjf/lGf8uoEuzKOXULI5Zc Dn0Qb4cQtZIZqSl/uuJZFoPc5r7+epmK7gU1J8Ozu+/OKPxaNpHbdDjzjnfyyhyCnp7A b4Ji50SfiGfxQwAHFe+VhaefpEPMxJVzRjSv8IX9+NJhK4RaonUCfSLTRR53zlxxehaQ j6l/Vx1KzdbaRMInVdBykG6s1L/jsEk99ito+MXpTBzpu91nfFq0ezCtRNsQDAVt21TH pIXQ== 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=Iy1l4hcAwKpaAYt/BFrZcqytR9YFY56hB49N8PSHOy0=; b=GhssgmEReR8MrT7c/tqplOY2IAIjQ0bGasIDzlnqHjQxfbjyAUH+oS/43ydtdMw0F4 x0rWz3wyYrMZ2F8qm/PPP7vi8FcoaSOp0tnyb+IAL2x4Pu/8m/aPAwSPHTo++sI7OJso ABK1PSUd08eX13QqK1F6d5kf9m3NUFUTWTfCDXSmtFj1YXA4dJiJH1PWTJfcY45k7CoZ Gh7YL701AxNX1I2BqNPfQ6qohbn1qpSXrO2YaNnCizV75ktf4szzypa9b9EVFmGOeqBP sJRLgbD7UgAIH8Tra1VSdPVAAZy33WHipz72h36/ytzw5Gnc5WmPR8S9KeGNnHwY1gxp 7n6g== 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 h8si3078036oib.104.2020.02.12.04.06.41; Wed, 12 Feb 2020 04:06:53 -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 S1728429AbgBLMEw (ORCPT + 99 others); Wed, 12 Feb 2020 07:04:52 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:48419 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728452AbgBLMEn (ORCPT ); Wed, 12 Feb 2020 07:04:43 -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 1j1qkw-0003Zu-UF; Wed, 12 Feb 2020 13:04:39 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 8B67D1C2005; Wed, 12 Feb 2020 13:04:37 +0100 (CET) Date: Wed, 12 Feb 2020 12:04:37 -0000 From: "tip-bot2 for Arvind Sankar" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/boot/compressed/64: Use 32-bit (zero-extended) MOV for z_output_len Cc: Arvind Sankar , Borislav Petkov , x86 , LKML In-Reply-To: <20200211173333.1722739-1-nivedita@alum.mit.edu> References: <20200211173333.1722739-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <158150907715.411.11504187337643136234.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/boot branch of tip: Commit-ID: a86255fe5258714e1f7c1bdfe95f08e4d098d450 Gitweb: https://git.kernel.org/tip/a86255fe5258714e1f7c1bdfe95f08e4d098d450 Author: Arvind Sankar AuthorDate: Tue, 11 Feb 2020 12:33:33 -05:00 Committer: Borislav Petkov CommitterDate: Wed, 12 Feb 2020 11:15:31 +01:00 x86/boot/compressed/64: Use 32-bit (zero-extended) MOV for z_output_len z_output_len is the size of the decompressed payload (i.e. vmlinux + vmlinux.relocs) and is generated as an unsigned 32-bit quantity by mkpiggy.c. The current movq $z_output_len, %r9 instruction generates a sign-extended move to %r9. Using movl $z_output_len, %r9d will instead zero-extend into %r9, which is appropriate for an unsigned 32-bit quantity. This is also what is already done for z_input_len, the size of the compressed payload. [ bp: Also, z_output_len cannot be a 64-bit quantity because it participates in: init_size: .long INIT_SIZE # kernel initialization size through INIT_SIZE which is a 32-bit quantity determined by the .long directive (vs .quad for 64-bit). Furthermore, if it really must be a 64-bit quantity, then the insn must be MOVABS which can accommodate a 64-bit immediate and which the toolchain does not generate automatically. ] Signed-off-by: Arvind Sankar Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200211173333.1722739-1-nivedita@alum.mit.edu --- arch/x86/boot/compressed/head_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index d1220de..68f31c4 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -482,7 +482,7 @@ SYM_FUNC_START_LOCAL_NOALIGN(.Lrelocated) leaq input_data(%rip), %rdx /* input_data */ movl $z_input_len, %ecx /* input_len */ movq %rbp, %r8 /* output target address */ - movq $z_output_len, %r9 /* decompressed length, end of relocs */ + movl $z_output_len, %r9d /* decompressed length, end of relocs */ call extract_kernel /* returns kernel location in %rax */ popq %rsi