From patchwork Fri Apr 10 12:56:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 6195291 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D513EBF4A6 for ; Fri, 10 Apr 2015 12:59:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBB60203FB for ; Fri, 10 Apr 2015 12:59:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 843A020411 for ; Fri, 10 Apr 2015 12:59:15 +0000 (UTC) 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 1YgYUM-00010p-Ui; Fri, 10 Apr 2015 12:56:50 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YgYUF-0000p6-TX for linux-arm-kernel@lists.infradead.org; Fri, 10 Apr 2015 12:56:44 +0000 Received: by widdi4 with SMTP id di4so127055706wid.0 for ; Fri, 10 Apr 2015 05:56:21 -0700 (PDT) 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; bh=+XV6aa7RJstLCpzGiQRpa2Q6DIJEisyE3BF3JD5Wivc=; b=acSkiGVCT+On6zwScTR7JfzJryPOPeYcUZj0SCazy2Dx7Tyj4/TPTB0QTf+tUivdBR fIEHGQ9/L91+YJEEQv6SEa4JVAvNfaRdMqThzcqW42ekNnGAjK182ckhVcrF2bWV5xIW dzeyjmWGofdXKVv7jY/nD9Gy5FQoOWnvmAV6RDPmbQjkAIqR4SqIrJ1Wku87hI/QeB0t O0rRw00O2n0RXG0ttIsf+s2SatMXpBeSisJ+IPP+BSgeu6x97JFUP+UB8p46gzfE1SE7 XoH1Xz08U7pPKT7rwT01f3yTyibmVIbMRPO+vCc0mSvBB4s80vGp+fAVB9yzRJ4vALh9 uaqA== X-Gm-Message-State: ALoCoQmz6Cw33HzEBtXT5+Zqd+LMU+sLKYqtPEez6l3JU+CzwOMPUkIZymI0v250cQxkl8glSzeG X-Received: by 10.194.121.136 with SMTP id lk8mr2738782wjb.49.1428670581894; Fri, 10 Apr 2015 05:56:21 -0700 (PDT) Received: from ards-macbook-pro.local ([84.78.25.50]) by mx.google.com with ESMTPSA id q10sm2835995wjr.41.2015.04.10.05.56.19 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Apr 2015 05:56:21 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, matt.fleming@intel.com, roy.franz@linaro.org, leif.lindholm@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] efi: stub: use a pool allocation for the cmdline Date: Fri, 10 Apr 2015 14:56:09 +0200 Message-Id: <1428670569-23089-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150410_055644_161364_F27ACA84 X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: x86@kernel.org, Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This changes the allocation for the ASCII-converted command line to use an ordinary memory pool rather than a separate page based allocation. Pool allocations are generally preferred over page based allocations due to the fact that they cause less fragmentation, but in the particular case of arm64, where page allocations are rounded up to 64 KB and where this allocation happens to be the only explicit low allocation, it results in the lowest 64 KB of memory to always be taken up by this particular allocation. So allocate from the EFI_LOADER_DATA pool instead. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/efi-stub-helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c index f07d4a67fa76..c95a567ca132 100644 --- a/drivers/firmware/efi/libstub/efi-stub-helper.c +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c @@ -684,7 +684,8 @@ char *efi_convert_cmdline(efi_system_table_t *sys_table_arg, options_bytes++; /* NUL termination */ - status = efi_low_alloc(sys_table_arg, options_bytes, 0, &cmdline_addr); + status = efi_call_early(allocate_pool, EFI_LOADER_DATA, + options_bytes, (void **)&cmdline_addr); if (status != EFI_SUCCESS) return NULL;