From patchwork Fri Apr 22 16:48:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 66464 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp826786qge; Fri, 22 Apr 2016 09:50:07 -0700 (PDT) X-Received: by 10.66.90.163 with SMTP id bx3mr29896290pab.59.1461343807425; Fri, 22 Apr 2016 09:50:07 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id hz1si8524443pad.46.2016.04.22.09.50.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Apr 2016 09:50:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ateGa-0002ZW-AT; Fri, 22 Apr 2016 16:49:16 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ateG1-0001mQ-BQ for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2016 16:48:43 +0000 Received: by mail-wm0-x234.google.com with SMTP id e201so24595863wme.0 for ; Fri, 22 Apr 2016 09:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=260bVJ9Igs1w9y4Hy5ro7WyoS/pZwpHbxCOwESuRBBI=; b=IdR+GpqmGO543iTQOVrUy/E7yK1OJoFnf/2REchChoAmQ877pFySg/l1mvVWu6+srA AsSB314iTygtU7k4F769UNEaweeJh96Sy82AsWwsqt+aZwmKX7Xt+uAfVr29Nrv5zAUP c46GE8HTWzZYEdM6LmCJ8mCIU3U268REEi0tc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=260bVJ9Igs1w9y4Hy5ro7WyoS/pZwpHbxCOwESuRBBI=; b=A5dSr//xQXvwxdshRX/i3hnaLd0p2AmkBgPNYkkIKIGZ+sPBownUlk0IUWpBzSTBfC qFr3vCLZA0Zos5QKMZGQyXEgIHmgPXQNM5849OAu2XIxB/zqZM2ClsdQhjxVFoxTZnQj EmziQU2NaY26PiCSRDfKMpD0D6tZm4fktIexAF/gFfsy3k90dYL0W+0wD1CcfRQYbwfA 4s2QIHlx1VPwT82a+tGiK9bwZYQkcplNjcHJ5Hakv6IxrNnf8Hp6/R+yOkPvy7j3kZo3 tav47KjYSTNnuMDaa1DdOOXuv5RUlNSZds4FfkDnYvTT9Mg7Q/QngSZjZF0WQcPwEvRJ O+PQ== X-Gm-Message-State: AOPr4FWdW25OkpaaAVN7IQGbI1vBsMlo29e4yvJhABqh2UCts9AwyxxTgzwDUZD5Tkv0Ovm5 X-Received: by 10.28.138.196 with SMTP id m187mr4718741wmd.61.1461343699698; Fri, 22 Apr 2016 09:48:19 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id h8sm4256015wmd.2.2016.04.22.09.48.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Apr 2016 09:48:19 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, linux@arm.linux.org.uk Subject: [PATCH v2 3/6] arm64: ptdump: fold string literals into address_markers[] and pte_bits[] Date: Fri, 22 Apr 2016 18:48:05 +0200 Message-Id: <1461343688-8552-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1461343688-8552-1-git-send-email-ard.biesheuvel@linaro.org> References: <1461343688-8552-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160422_094841_659707_A7EB0805 X-CRM114-Status: GOOD ( 14.64 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:234 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: will.deacon@arm.com, keescook@chromium.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Replace the indirect string references in struct addr_marker and struct prot_bits with char array fields. Under a relocatable kernel, this not only saves 8 bytes in the absolute address that we no longer have to record, it also saves 24 bytes of init data (the size of a RELA entry) since this address no longer requires relocation processing at boot. Signed-off-by: Ard Biesheuvel --- I am aware that this is a drop in the ocean, but I thought I'd include it anyway, since many people may not even realize that this issue exists in the first place. --- arch/arm64/mm/dump.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c index 8404190fe2bd..024f803e2fb4 100644 --- a/arch/arm64/mm/dump.c +++ b/arch/arm64/mm/dump.c @@ -30,7 +30,7 @@ struct addr_marker { unsigned long start_address; - const char *name; + char name[32]; }; static const struct addr_marker address_markers[] = { @@ -51,7 +51,7 @@ static const struct addr_marker address_markers[] = { { VMEMMAP_START + VMEMMAP_SIZE, "vmemmap end" }, #endif { PAGE_OFFSET, "Linear Mapping" }, - { -1, NULL }, + { -1 }, }; /* @@ -69,10 +69,10 @@ struct pg_state { }; struct prot_bits { - u64 mask; - u64 val; - const char *set; - const char *clear; + u64 mask; + u64 val; + char set[16]; + char clear[8]; }; static const struct prot_bits pte_bits[] = { @@ -184,7 +184,7 @@ static void dump_prot(struct pg_state *st, const struct prot_bits *bits, else s = bits->clear; - if (s) + if (*s) seq_printf(st->seq, " %s", s); } }