Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1799367pxa; Thu, 6 Aug 2020 16:41:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/9P62O2amcxIjg14gj4YM5djxivIUdjpOr3kELLPmUiaeLFw1iSikQEpTagZjUCpf4Ase X-Received: by 2002:a17:906:288d:: with SMTP id o13mr6473355ejd.199.1596757300708; Thu, 06 Aug 2020 16:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596757300; cv=none; d=google.com; s=arc-20160816; b=AgtvDe9qgGXF2rpyhhv9GOs+vj6p+1ga0xIDWWTpqDzFHzNXIHnSUh6fGtW70mlWeC LStJHWmiqXLgeXhL6Z40JHDMd4YOSwiz+m/zfEI+TIUr72nuV4DT9gRHdifv3a+OT1wS RM9YsRXd0LbZGoyx5oO+6fRMepadryI/aTumNaNciBSNc6n1RB0uExuydO7U7IiEnD3e Oo9o+W7a/9AhgfiDrMPzXb4fZRZuwd7COPTczVMSHEKKiRUhnr1DZqqM37ngp5XFLxyK mQ6MT1okdRznhuDvhdbucwtWk66bAdbXBwfuhGaE0RqOK/PkY28JPXitT94q31nHtprg +u/A== 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=5/PbUOdFNvLbRCjWWev6nnC+DBak5mXQz8gymsqcFpQ=; b=tg5Vs2oYBFkDvia/l04eW8YlYBuWKbfsD/UsVrwEK21b65Wl8mfJBknYPh0kJCaHnX x7XnwG/2F0ZVhOXLbh9ul35pRgZL6kPA0XcCDgoBlHd7SlqxX9f0EEs8chZdRr8mkOSe FCiLQo/WfWxdPd/Mn+TtGRtkKUCL6i3EI9USkNdv+XK31BxUfPz+xKy5eTBbOvoD1jrn bfrckWab4cWeaGXBYNfLpxfvQHF1ipAX5A2DeId+bmZ/Luig61NZba+4Jvi3jxZ6wwTF Sw2bS6WXM5ZcABW2lQ/MCBnyFXtWGJdci2X3JkbwXycyR8DlAfabxREwrI1VW+i8n5aN ihOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=PbNSAidf; 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 g3si4052991edr.531.2020.08.06.16.41.18; Thu, 06 Aug 2020 16:41:40 -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=PbNSAidf; 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 S1727051AbgHFXkK (ORCPT + 99 others); Thu, 6 Aug 2020 19:40:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbgHFXiz (ORCPT ); Thu, 6 Aug 2020 19:38:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C83DC061756; Thu, 6 Aug 2020 16:38:55 -0700 (PDT) Date: Thu, 06 Aug 2020 23:38:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1596757133; 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=5/PbUOdFNvLbRCjWWev6nnC+DBak5mXQz8gymsqcFpQ=; b=PbNSAidfc9AWzSg5G+jYvavC4dqg4LtLLTyEFLYDP3gGssPcxfgeEtjPZK3Fj6NeQid1SK xKOFSz0WI9muYrmy+ugLQ3b1QE8MO0VGj2Qf8/4ItxE3kt4KM2WFZcAJBa+RwxkBpbPt83 P9cGLHvpP9WWRn6LMhNkVaVB6gStqo/ZQDahh9NneCmjt5UKpDQ/XhPNa6HbdOMqoTQGO+ 9zCGYDIpF+qknY3tQmAlz/b3cnRwubNvn2wPEeBkhkOe4tx8BzlQ2scBR8v5/7rY211m8g /UYNIFVgObJm6ETqpfbgszaz4vS/Gb0sr4yoehlCgscESSD1EJ1flBqTJZ8zoQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1596757133; 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=5/PbUOdFNvLbRCjWWev6nnC+DBak5mXQz8gymsqcFpQ=; b=AWsyZ/POUp413RqGwZsM5k7Bhc9z6wIU+xBUUzU7/oCqVPdx10huICL/A0bGQix/CKMG0A lkVJNFXk8qd2NZAg== 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: Small cleanup of find_random_phys_addr() Cc: Arvind Sankar , Ingo Molnar , x86 , LKML In-Reply-To: <20200728225722.67457-18-nivedita@alum.mit.edu> References: <20200728225722.67457-18-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <159675713306.3192.18348861057543480095.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: 4268b4da572f8bde8bc2f3243927ff5795687a6f Gitweb: https://git.kernel.org/tip/4268b4da572f8bde8bc2f3243927ff5795687a6f Author: Arvind Sankar AuthorDate: Tue, 28 Jul 2020 18:57:18 -04:00 Committer: Ingo Molnar CommitterDate: Fri, 31 Jul 2020 11:08:17 +02:00 x86/kaslr: Small cleanup of find_random_phys_addr() Just a trivial rearrangement to do all the processing together, and only have one call to slots_fetch_random() in the source. Signed-off-by: Arvind Sankar Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200728225722.67457-18-nivedita@alum.mit.edu --- arch/x86/boot/compressed/kaslr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index ce34a05..ecdf33d 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -813,10 +813,9 @@ static unsigned long find_random_phys_addr(unsigned long minimum, return 0; } - if (process_efi_entries(minimum, image_size)) - return slots_fetch_random(); + if (!process_efi_entries(minimum, image_size)) + process_e820_entries(minimum, image_size); - process_e820_entries(minimum, image_size); return slots_fetch_random(); }