Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5301043ybv; Tue, 11 Feb 2020 13:03:59 -0800 (PST) X-Google-Smtp-Source: APXvYqyY5byNf9sEe0kXUn3QQDYu65KqRfKYcASOIUOPqQDbIARJiv6Q1WaZ9PX9RqdYQlQ9LKHj X-Received: by 2002:a05:6830:1050:: with SMTP id b16mr6802458otp.140.1581455039374; Tue, 11 Feb 2020 13:03:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581455039; cv=none; d=google.com; s=arc-20160816; b=q9963fstF5LAL4vpiCpNwmAU24mdUDL7rQxE+mF2gzDW7YeyOxwg8Lu/+ti3yrzm7d ggSNT6w72AHewX7jUdzF3cf4qsl/V40JkJCufranSYStQ2T8PA6aFPtAvACSi2IziVFA IE2QcPmOIZaHiLyflGhHz2w7OpBx6v8NrhqZ3P8aWvVke8qOGZdoP8vJv6CsD6149eNd 70R1UwaQF21vBtzz+QID6/4vbd0q94AS3GKjokvhWDWLthU/3jG3iGxBeWvluL/IOT6A KcvVunruj1eKuBb6HLZmQ1SIx9nO/oGQfSQaXegREh2vZk+5i9FGL/UWPuVxcZNQYxRz 7btw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9hy5VYrSpPRzSWsdE9Qh19BgQ81h4mh453g6SqrdWcw=; b=CYm50VJmIk1XkzyngGW1x7DwO37QUPvwWPXXAbJ7nj2oxtoeOnjQ9kgBqW7d13aVMU c9HVKM8yGvaK2GBNYV6T/FWWXKZkOk7kAZ06LlBQyiAHzMoynoBaIXveischal7jYQ2H GLNkiVY30wbytC67IXTcm+L7TUB/2J3IcHF0Nr0SEcp8hdL/dmqvv/jkQvt+SUlBjZWe 0u56yHKnaUAXSRYz2IcAAQ3vKK/Ly+6sawlvA15F+3HSHSbehQFbloYz45tpwyjfjhOf rClfRAFI/BrSFNVfKincQgNWgA3buILvILcOw9c3+NoXIivLo/dheuTV03cvjbygX7wg AkSg== 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 r12si2616088otq.156.2020.02.11.13.03.47; Tue, 11 Feb 2020 13:03:59 -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 S1729630AbgBKRdf (ORCPT + 99 others); Tue, 11 Feb 2020 12:33:35 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:38119 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729031AbgBKRdf (ORCPT ); Tue, 11 Feb 2020 12:33:35 -0500 Received: by mail-qt1-f195.google.com with SMTP id c24so8564125qtp.5 for ; Tue, 11 Feb 2020 09:33:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9hy5VYrSpPRzSWsdE9Qh19BgQ81h4mh453g6SqrdWcw=; b=Zf8OUKnxYvxruI9lBGY+hN7khWeBLlD/UIgs5IGOdZh+mrEC0XF2dhrinM158ZrEk0 VYrtbO6dOe1I8+aueX44F7J7wS7wYJhjJ3s/b3xOfozkt/a8Rrcuahd6z8PotFW4/aaa W/S7XKZPVB2LczFV9ilPlwe83xXyHjfGbvzrEmyUsak7n/J5c0PCx6K4R4Afo2w4fdZO cLqWF+QwsR8VE4jc4q6KCle3YiD3EM4l9RFErNc55be4X8/MwcTiswkHyRrslbRkK3/S UyMQyL0p/qGjzhmwWeE1bEN8JovVjivt2ZtQeWTzasha2SGBsgWxcvEPvijGhyFgqyo9 W3Qw== X-Gm-Message-State: APjAAAUGGPJgKLY0fwUFBFsZby5bDhtioZtemTkFSfsakF5gBtMtv+8w RtuBFelHrBCHVvz9AKu+sBTKVEvu X-Received: by 2002:ac8:3fd7:: with SMTP id v23mr3363918qtk.293.1581442414496; Tue, 11 Feb 2020 09:33:34 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id k15sm2269903qkk.103.2020.02.11.09.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 09:33:34 -0800 (PST) From: Arvind Sankar To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Michael Matz Subject: [PATCH v2] x86/boot: Use 32-bit (zero-extended) move for z_output_len Date: Tue, 11 Feb 2020 12:33:33 -0500 Message-Id: <20200211173333.1722739-1-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200211161739.GE32279@zn.tnic> References: <20200211161739.GE32279@zn.tnic> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 we already do for z_input_len, the size of the compressed payload. Signed-off-by: Arvind Sankar --- v2: Improve commit message 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 1f1f6c8139b3..03369246a4ff 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -484,7 +484,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 -- 2.24.1