Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1799082pxa; Thu, 6 Aug 2020 16:41:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw13PV9cvZgJ2FeFMAZI/F/nKZbcB+8lmDrjgpFetedx/iF8cbsXKF/aXkHgkIS9SFLvRur X-Received: by 2002:a17:906:a116:: with SMTP id t22mr6924401ejy.353.1596757266436; Thu, 06 Aug 2020 16:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596757266; cv=none; d=google.com; s=arc-20160816; b=pfW5F9RERI3uaafkjXiB4CJpOvt0mWrgs4PdOvj61rHM7UzhBNIpr4Hpqyrwf3haWX trt06qEL4KD6j1+X4UCyOjuRXcD0/3y4mct7M5zsnOS+SIRzM3LkbSh3fkQ7bWmrjohS f/gqeY3gz7Sv6gan4AZLnZogcuxyT77hFEpnbyTXwYOoJcLe4LgNgURIoG2fltD9BbFq nntxmU4gAa/OaqLgfa4qtW61hyi2vFdJl6WqH0Jztz45lpdA0Y5lUvVqttk/d8HD8TTo nEJO2VEIqSIkKK8M3iv5dDXsNN5qdwVZAfSyaZm/X+Xw/TB06D5BhbJyH0ug1ayGtaPL 757g== 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=Qr987amBZwdnITURmE65nMl6RZWE9Vvv/+AZTeUYqj0=; b=Dpa6OHDSxIEriE8dLf+w3fb3ZtpdEfeKA+HC+g0RXVn2nAy5Amp8kjqCcYRsvMTfg+ BRMvqHoaRlClxCrwizD20ZQheSO0KsGBc/UCQifixtkqZiJVYSNIdhcznglH/MFn581M sVpHorHkM6oZzBRwoE+KS+hmtlN6pKka7fflBRW4OUlmfZLlSCsz4q/UTMnO5/wa255V MNy5xCusqlbibsCyHbm3W4sn/kdhicO3Mv0LJzu23GiyJiMLPH/ouvSze8j+KBcgX2mL Q48kWTBb60hScdN7bbwdrJnS/G4z5TDUb0AyM/lL5hRnl7UXd8JwOoJwPJV6teXR1AHR OvwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b="DAAGpn/z"; dkim=neutral (no key) header.i=@linutronix.de header.b=KT176TXh; 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 si17si4137462ejb.599.2020.08.06.16.40.43; Thu, 06 Aug 2020 16:41:06 -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="DAAGpn/z"; dkim=neutral (no key) header.i=@linutronix.de header.b=KT176TXh; 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 S1726956AbgHFXjf (ORCPT + 99 others); Thu, 6 Aug 2020 19:39:35 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:60984 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbgHFXjD (ORCPT ); Thu, 6 Aug 2020 19:39:03 -0400 Date: Thu, 06 Aug 2020 23:39:00 -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=Qr987amBZwdnITURmE65nMl6RZWE9Vvv/+AZTeUYqj0=; b=DAAGpn/zFU9XUKjA17apPVl6tkZ15PxzCCg0EFOpDKHHVif2fCjXplT/D/jqwhHh5uQdaP 6e1ZV4OBDhQFsjg31YDnS4/Ta6mf2JCB7/dghhxV1Rq2HnQwdprvm6ptC62MscA0Vv0zyS V/XwtiycAk070SWPRVMnds6++qBcE0cANcQByeqxx9ZmLiSCsUuj3AjoXkJUf8I8OloC79 EtmTksb+Kv9dzITNIFgtv9x6ryWXOw7ftAlzgQS185STztRf58kkxhgCNb2BHyN1rQD8K9 6IswqJFLY7ZigGdmTwfReDRGpvKuJMs6cXWS6C41cT6cdJWUmqJ9OMtq75i8gg== 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=Qr987amBZwdnITURmE65nMl6RZWE9Vvv/+AZTeUYqj0=; b=KT176TXhwShaaIEF7jUzFoD/ZXcDBKALQNwpOfzMMi9nU3UsL/gFx5uyroHljmJYpWSdKS yd71d83h2o1X/3AA== 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: Drop redundant cur_entry from __process_mem_region() Cc: Arvind Sankar , Ingo Molnar , x86 , LKML In-Reply-To: <20200728225722.67457-7-nivedita@alum.mit.edu> References: <20200728225722.67457-7-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <159675714018.3192.1265605139963105539.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: 3f9412c73053a5be311607e42560c1303a873be7 Gitweb: https://git.kernel.org/tip/3f9412c73053a5be311607e42560c1303a873be7 Author: Arvind Sankar AuthorDate: Tue, 28 Jul 2020 18:57:07 -04:00 Committer: Ingo Molnar CommitterDate: Fri, 31 Jul 2020 11:08:17 +02:00 x86/kaslr: Drop redundant cur_entry from __process_mem_region() cur_entry is only used as cur_entry.start + cur_entry.size, which is always equal to end. Signed-off-by: Arvind Sankar Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200728225722.67457-7-nivedita@alum.mit.edu --- arch/x86/boot/compressed/kaslr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index 848346f..f2454ee 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -624,7 +624,6 @@ static void __process_mem_region(struct mem_vector *entry, { struct mem_vector region, overlap; unsigned long start_orig, end; - struct mem_vector cur_entry; /* Ignore entries entirely below our minimum. */ if (entry->start + entry->size < minimum) @@ -634,11 +633,9 @@ static void __process_mem_region(struct mem_vector *entry, end = min(entry->size + entry->start, mem_limit); if (entry->start >= end) return; - cur_entry.start = entry->start; - cur_entry.size = end - entry->start; - region.start = cur_entry.start; - region.size = cur_entry.size; + region.start = entry->start; + region.size = end - entry->start; /* Give up if slot area array is full. */ while (slot_area_index < MAX_SLOT_AREA) { @@ -652,7 +649,7 @@ static void __process_mem_region(struct mem_vector *entry, region.start = ALIGN(region.start, CONFIG_PHYSICAL_ALIGN); /* Did we raise the address above the passed in memory entry? */ - if (region.start > cur_entry.start + cur_entry.size) + if (region.start > end) return; /* Reduce size by any delta from the original address. */