From patchwork Sun Sep 10 11:21:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 812122 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lISHHo7v"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xqpyy5233z9sDB for ; Sun, 10 Sep 2017 21:40:42 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 74F02C21F8C; Sun, 10 Sep 2017 11:31:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E4009C21F04; Sun, 10 Sep 2017 11:29:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BE801C21F0F; Sun, 10 Sep 2017 11:23:50 +0000 (UTC) Received: from mail-qt0-f195.google.com (mail-qt0-f195.google.com [209.85.216.195]) by lists.denx.de (Postfix) with ESMTPS id BD07BC21F3E for ; Sun, 10 Sep 2017 11:23:41 +0000 (UTC) Received: by mail-qt0-f195.google.com with SMTP id q8so4090472qtb.1 for ; Sun, 10 Sep 2017 04:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rRpS4m7+k9Kgg68zb96oaEj5ZZmnh1UimVhSWh7Vh34=; b=lISHHo7vdGyKqJ1RmbKU3PSerbKbyOAdN42q7xFac8dR3InrhiO+z/X8+0ANCO7oxJ TPVrkNvsc7bOHFak2twJxJl7s9v+CWU+Wu+lzrzdQ+5JLZUcSsrpJtLz3/OuMLL4Y/QF GbWYD/5xVUGdtlj4P/tdyQUrbQ0xg4JOTF7MM40Ca5wHxvJnIGwTRQ/o6UJSPD7h0gGa ZDTtcz4tlpoFG/FXh+6A4rI62UTiysyS/yMpMQdwOtO3Z36DylbeJh7lRQpxa5d0Xm7O vXsj2g0oc/JdfK2PUW++CPI/VAxold6mHORMy8zcTJ7ZIS1VxuRq3FlZHj4TXjXJLtZD eK7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rRpS4m7+k9Kgg68zb96oaEj5ZZmnh1UimVhSWh7Vh34=; b=l4vT3MmR2V3NJO1hSm+0PrJ5k4/OXHQhGVBa9bwQr3+N3onm+yBJlmQTCwmw35s36Q 1u/dWDkPNdXF+v6qPf821gS2ACtMWB/HsAGlP+Hb0KH1y2iJNOaj7yDfbOQQWKxWAlAC u/nJdLQfv165cGM5y5Y/GDM0Z1bMCE3P0qTa+mKX1THp/3sVZCJbWu3EaOyiEH1EudfI m7juSG05HYpCrYd/fdF31RZs0HMuXbWusiAhGM41GMW+7XXPY6akJdjaiomrkRE4LehT Dwbgdtmyx1HyYfeqjNnkQ8ACiGjodaCz9JXeeU9SRgdOpvLBCIqMO3q+Kv8Q6etoTOZt u+zg== X-Gm-Message-State: AHPjjUheHdgAH+sQ8hYOcHSYto240xErPFUQKLSp4ouXWjOhNhDNYVqm oSQskkT3mKMcNkc4Ryw= X-Google-Smtp-Source: AOwi7QDlxRYAyJzSKiDr3NrcDpGCqQIozbHO4GT7Zojc7m1aJK8FJrYJauqXC8IbWp0wzneZFdZXuQ== X-Received: by 10.200.24.187 with SMTP id s56mr2032516qtj.64.1505042620546; Sun, 10 Sep 2017 04:23:40 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id f4sm4491825qte.76.2017.09.10.04.23.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Sep 2017 04:23:39 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Sun, 10 Sep 2017 07:21:39 -0400 Message-Id: <20170910112149.21358-23-robdclark@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170910112149.21358-1-robdclark@gmail.com> References: <20170910112149.21358-1-robdclark@gmail.com> Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 13/21] efi_loader: make pool allocations cacheline aligned X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This avoids printf() spam about file reads (such as loading an image) into unaligned buffers (and the associated memcpy()). And generally seems like a good idea. Signed-off-by: Rob Clark --- lib/efi_loader/efi_memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 9e079f1fa3..1f0b9d0449 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -43,7 +43,7 @@ void *efi_bounce_buffer; */ struct efi_pool_allocation { u64 num_pages; - char data[]; + char data[] __attribute__((aligned(ARCH_DMA_MINALIGN))); }; /* @@ -356,7 +356,8 @@ efi_status_t efi_allocate_pool(int pool_type, unsigned long size, { efi_status_t r; efi_physical_addr_t t; - u64 num_pages = (size + sizeof(u64) + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT; + u64 num_pages = (size + sizeof(struct efi_pool_allocation) + + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT; if (size == 0) { *buffer = NULL;