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: 47040 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 17E2A21416 for ; Fri, 10 Apr 2015 12:58:43 +0000 (UTC) Received: by wgtl5 with SMTP id l5sf4224372wgt.1 for ; Fri, 10 Apr 2015 05:58:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=d8JIlAmz9A6hDzPPG5UkbpojTbDuX9AzGuMY/fvE7LY=; b=c7LyUPqEtWHHSd72covW35MCRrtp1EPXzeOtQkcZHfwbkyVvl6y7wjOdMVwV3YHcHX c9PhvxdaCSPsE74a4R9jmCr56D0fiXLU3Nw9K5zxNGd34//fCDEbSprMFjkZH+IHt+/W CBCUUbOAP0hRFKM0VvbFgDQjRTfl4eNesBYOEnQmNeLqtcPcFAmo8RQFL7QnlFd/Rh78 /hN5eHQ2nZKQZ2NCan+tl13sAgo6bnZ1CojTgPnBs6dXvAlJG4wvkEK8FdcVAJmmCcVB A9FcfvVnha/QT0/iqN8EdZm+FOZJD6ABzGi2jEcsCGBl5W5MnUDRxVJOBc25Typp/+8P y4zw== X-Gm-Message-State: ALoCoQkkOe8+OGXGN/mv5quWaphwSJTXhzy4d0RELlugqyXqCOt+3YIpdI5IXPECOGa6rZR3IREx X-Received: by 10.180.105.226 with SMTP id gp2mr1478596wib.1.1428670722433; Fri, 10 Apr 2015 05:58:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.240 with SMTP id jr16ls457605lab.69.gmail; Fri, 10 Apr 2015 05:58:42 -0700 (PDT) X-Received: by 10.112.119.234 with SMTP id kx10mr1373001lbb.35.1428670722273; Fri, 10 Apr 2015 05:58:42 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id zk8si1432691lbb.62.2015.04.10.05.58.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Apr 2015 05:58:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbqq2 with SMTP id qq2so12973361lbb.3 for ; Fri, 10 Apr 2015 05:58:42 -0700 (PDT) X-Received: by 10.152.19.199 with SMTP id h7mr1409247lae.32.1428670722129; Fri, 10 Apr 2015 05:58:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp1082197lbt; Fri, 10 Apr 2015 05:58:41 -0700 (PDT) X-Received: by 10.66.177.238 with SMTP id ct14mr2392408pac.121.1428670720192; Fri, 10 Apr 2015 05:58:40 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id de9si2839573pdb.176.2015.04.10.05.58.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Apr 2015 05:58:40 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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-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 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.172 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.172 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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;