Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1799164pxa; Thu, 6 Aug 2020 16:41:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzFZb87ouQb8ZL0RSOreAa9Nu7l7dhI71yn+lbqJxdwADwaGq/liF6ot2R7nllc6Nu/8oM X-Received: by 2002:a17:906:bce9:: with SMTP id op9mr6881969ejb.462.1596757274091; Thu, 06 Aug 2020 16:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596757274; cv=none; d=google.com; s=arc-20160816; b=tqi9bhYNTNAOdlld3O8PVk8xWKSbyBoJrSNJNeHYqbc0CTAwAO8K/1kAhgphlNiLDB SuAMGc6HTLXqABEDJ88SbVMYvpcqMrVuYL/HpTkKTr15/hktu7JpUs6fouvyJpmtWiz1 wnv2r2n6xfHUlDozfPTbUwx6vm91VQJap6ApKUtRESNaSApkgJD/isB+6aA5nTeCf6SM 4jTXb3C6HOMnDT5UgdGSkAUA8fXqhHh80pL+4aVC0oag5L5UheS+AnZ6GGRBCAE2sDr/ 5PLmgwarU7j1zSqGl4xC3bbpWzVI4wO+I25qs/f47rRbnDO9RGahsExL7HhyF2xGHhVH QeCA== 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:dkim-signature :dkim-signature:date; bh=GIGrTTZO8Vb6uguCHq7CReG5mB4gQDWIPh2rz0ZRPps=; b=ibYAqyynqTtF1xoOLg7Y3qjbRyTdHYjAhrjgQqATw0hQ8qUFNqHN6VSW8sEx+CJ7Za P141cw8yOyMWcDRcVHquZj06qiDzx2heU8/gOGLtbrwsonrjMwO0cMyJekWPNDPvmnQN gKAr1JLZee/df7Mh6jHeq6VeNDsawlRGHAFC0WH6+0ZMF2FJ3Uz91HKmiGctRMfohL3t qZpukh4emZY9kRitXnXXF9rJbo7xoQYRzjBiezuNZRUyDlw+0ryIjE4UrhX7uV3otjlG ILAGobpwl89qLBah3fHQjdSLFJ/q/zBVh7t5YZpOrrd4e0Yye7cygQmmh6pW6CQmF8lU X9aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=WGVHDR7m; dkim=neutral (no key) header.i=@vger.kernel.org; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si4490010edx.135.2020.08.06.16.40.51; Thu, 06 Aug 2020 16:41:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=WGVHDR7m; dkim=neutral (no key) header.i=@vger.kernel.org; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726887AbgHFXjp (ORCPT + 99 others); Thu, 6 Aug 2020 19:39:45 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:60936 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726634AbgHFXjC (ORCPT ); Thu, 6 Aug 2020 19:39:02 -0400 Date: Thu, 06 Aug 2020 23:38:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1596757140; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GIGrTTZO8Vb6uguCHq7CReG5mB4gQDWIPh2rz0ZRPps=; b=WGVHDR7mYrK3xuLf0IN3ZHC3AIPLhO+y4bPGyuSJxgOsWKnmzCU5Vo4FNKf02ghyIlFT6U NYRu/RImwPIcJp0ZqZtPb+9+/Y5LG/meq7cyBVSrUoSzQtB5bA9OgW4yjCRGDZavPkZ8yY j0z6hiiZ8zAqEGJaiBTwCDW3j0LOy6xz3oUxeRwqvHP6x7wSgvQif/gSOxg+5f6ZvZCkSm WV/MZRQcDavtTdVVObpuZ4m0/YO5BTseLQZJqGwHWjuUGasL6xXstpGgZ/GPwYxDW6hcXy 86ZFGjk1iLN3KRrJ6FYW/rY3R1v5XPFOtixvIEeMUNTylgyTiMmaGYWRDWAs/g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1596757140; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GIGrTTZO8Vb6uguCHq7CReG5mB4gQDWIPh2rz0ZRPps=; b=zRgfygqie4KZ4cgy03Ge3KzHNj6g+rDT7Qn7/sygl6lU9fXeuE1vTOsheE7txKnbU+JXeQ MeyGHuHoiH2fDWAA== From: "tip-bot2 for Arvind Sankar" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/kaslr] x86/kaslr: Eliminate 'start_orig' local variable from __process_mem_region() Cc: Arvind Sankar , Ingo Molnar , x86 , LKML In-Reply-To: <20200728225722.67457-8-nivedita@alum.mit.edu> References: <20200728225722.67457-8-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <159675713954.3192.11679980179045433723.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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/kaslr branch of tip: Commit-ID: ee435ee6490d147c1b9963cc8b331665e4cea634 Gitweb: https://git.kernel.org/tip/ee435ee6490d147c1b9963cc8b331665e4cea634 Author: Arvind Sankar AuthorDate: Tue, 28 Jul 2020 18:57:08 -04:00 Committer: Ingo Molnar CommitterDate: Fri, 31 Jul 2020 11:08:17 +02:00 x86/kaslr: Eliminate 'start_orig' local variable from __process_mem_region() Set the region.size within the loop, which removes the need for start_orig. Signed-off-by: Arvind Sankar Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200728225722.67457-8-nivedita@alum.mit.edu --- arch/x86/boot/compressed/kaslr.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index f2454ee..e978c35 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -623,7 +623,7 @@ static void __process_mem_region(struct mem_vector *entry, unsigned long image_size) { struct mem_vector region, overlap; - unsigned long start_orig, end; + unsigned long end; /* Ignore entries entirely below our minimum. */ if (entry->start + entry->size < minimum) @@ -635,12 +635,9 @@ static void __process_mem_region(struct mem_vector *entry, return; region.start = entry->start; - region.size = end - entry->start; /* Give up if slot area array is full. */ while (slot_area_index < MAX_SLOT_AREA) { - start_orig = region.start; - /* Potentially raise address to minimum location. */ if (region.start < minimum) region.start = minimum; @@ -653,7 +650,7 @@ static void __process_mem_region(struct mem_vector *entry, return; /* Reduce size by any delta from the original address. */ - region.size -= region.start - start_orig; + region.size = end - region.start; /* Return if region can't contain decompressed kernel */ if (region.size < image_size) @@ -679,7 +676,6 @@ static void __process_mem_region(struct mem_vector *entry, return; /* Clip off the overlapping region and start over. */ - region.size -= overlap.start - region.start + overlap.size; region.start = overlap.start + overlap.size; } }