Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1800199pxa; Thu, 6 Aug 2020 16:43:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXCJN1d3xRUY+tq59h6ikpwYdts+VP771TAyzi2jQAkC/B8dSWHqvS9tsxfuOnf7/fOgYU X-Received: by 2002:a50:9316:: with SMTP id m22mr6636460eda.178.1596757399122; Thu, 06 Aug 2020 16:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596757399; cv=none; d=google.com; s=arc-20160816; b=vKA/S8nu/aBhRCUmIslOekSiWa7NSuuqaWR+M/sjVbIVQw5RXC/kT9LIJ1hOaYoOfJ mEWf4Hi8bsqSd7C1M65EEnGSDoOolGt2LdiHsJUVdUccSQFZCOF2eH4S99bITOIMbQnH +j3Q4y9x493y2LQQAjAjaa7snLKj1MgLDbUYczl7ZnMAMzH/lDYslOqHIE/m07DpaDsZ Hvpp6nsdGbT+4mccxJxdLu3rNpsmIXc6aOarkWWu0qAryDKegTyp6cWqWcxUxwefHpDH 1L98YjJDiwhYkSgF7nQW+b81FW9+ONjAq/17nmwPCkzijN3Ud/xVvBpcbkCziVsqnTD6 Y1uw== 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=eXjoTKFCZ+Y/MWw/mqSyAJJ5aTDFDN/BMU0AUdWPDUk=; b=jkHE5sNjstWm+u6tM2qtL6E3PAiO4T5uUxweP5B28zIROJ3Ja7WXIDff3rS2ziYJJN KqL1LDdD9nTH2g3W3ycfOVz8dlT+m8tzuoKpVzyJpUnXs9VXNrgEvNFlUbxLGMYK8XFM bShWyDRMsP84Kbi6A024b2KUc7y4ZHsPXJnY6a2SUbz2LOF87oQHSoFDfqYakN9U4XNa iiOZ8/bjP0DFGQGr/LYH0jxf3q0bZQQfKs2BYfjpom7MpTPTK3JBXtfJXw9sKtkZVg+p JQefQM3FIOwf7ourOYgUp0kS4ZKWTi6SNUyHaym/JH8/4+RoGN8CfhjqQu6RnbZOfxtB Uqpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=k+Qg19D2; dkim=neutral (no key) header.i=@linutronix.de header.b="3aR/53vW"; 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 ce15si4479099edb.201.2020.08.06.16.42.56; Thu, 06 Aug 2020 16:43:19 -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=k+Qg19D2; dkim=neutral (no key) header.i=@linutronix.de header.b="3aR/53vW"; 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 S1727003AbgHFXjw (ORCPT + 99 others); Thu, 6 Aug 2020 19:39:52 -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 S1726604AbgHFXi7 (ORCPT ); Thu, 6 Aug 2020 19:38:59 -0400 Date: Thu, 06 Aug 2020 23:38:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1596757137; 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=eXjoTKFCZ+Y/MWw/mqSyAJJ5aTDFDN/BMU0AUdWPDUk=; b=k+Qg19D2vX5oaDEgRrOSK9NMYreIk6OVDc8NeaUEf5DiBpLL0D3/XcbPQPrOD91URIVQit mrwJwwDkb69/Rk//43DnjEY/UhZk+4yL3n3QDBkBdrkB7OzZZxkmM1uXWce+TG2w0WigEn EM7qdA028b+1f5QucJj9Jz42gd+gBOA0vxxjzmVtbnQiqcEjjJeZ1WzBMtFiIOth67jEyh EBYSlIVYBdHlIsIvG5rOV9ogGyC7082wsjbaHOpEeHt7+Yfc6cK881wiS4Bd3no8uPtX0f VDgohjJ36GVPuroLTFsB8ZYxVexZi4vmV1FSYxSkgEFO4asnTDUECoqz7V3bnA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1596757137; 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=eXjoTKFCZ+Y/MWw/mqSyAJJ5aTDFDN/BMU0AUdWPDUk=; b=3aR/53vW0DM1zbIj0V74y4mbzn17eC144fQQ0+OiE/6qmo5RVTjBfyYjmP/bzyiHroQ8+Z egSYxKbqCwTtJHAg== 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: Short-circuit gb_huge_pages on x86-32 Cc: Arvind Sankar , Ingo Molnar , x86 , LKML In-Reply-To: <20200728225722.67457-12-nivedita@alum.mit.edu> References: <20200728225722.67457-12-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <159675713698.3192.5462555690750286629.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: 50def2693a900dfb1d91872056dc8164245820fc Gitweb: https://git.kernel.org/tip/50def2693a900dfb1d91872056dc8164245820fc Author: Arvind Sankar AuthorDate: Tue, 28 Jul 2020 18:57:12 -04:00 Committer: Ingo Molnar CommitterDate: Fri, 31 Jul 2020 11:08:17 +02:00 x86/kaslr: Short-circuit gb_huge_pages on x86-32 32-bit does not have GB pages, so don't bother checking for them. Using the IS_ENABLED() macro allows the compiler to completely remove the gb_huge_pages code. Signed-off-by: Arvind Sankar Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200728225722.67457-12-nivedita@alum.mit.edu --- arch/x86/boot/compressed/kaslr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index 0df513e..3727e97 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -303,7 +303,7 @@ static void handle_mem_options(void) if (!strcmp(param, "memmap")) { mem_avoid_memmap(PARSE_MEMMAP, val); - } else if (strstr(param, "hugepages")) { + } else if (IS_ENABLED(CONFIG_X86_64) && strstr(param, "hugepages")) { parse_gb_huge_pages(param, val); } else if (!strcmp(param, "mem")) { char *p = val; @@ -551,7 +551,7 @@ process_gb_huge_pages(struct mem_vector *region, unsigned long image_size) struct mem_vector tmp; int i = 0; - if (!max_gb_huge_pages) { + if (!IS_ENABLED(CONFIG_X86_64) || !max_gb_huge_pages) { store_slot_info(region, image_size); return; }