From patchwork Thu Apr 19 15:49:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 133831 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp789655ljf; Thu, 19 Apr 2018 08:50:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx49OkIFzcvFP+2cBh+yU5F0Nv0Tcv3yPuYSR3BYgH4OfOuLTmmS5N4cyYEDQBr9NId4HXsl4 X-Received: by 10.80.167.4 with SMTP id h4mr9344963edc.239.1524153056160; Thu, 19 Apr 2018 08:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524153056; cv=none; d=google.com; s=arc-20160816; b=uXVQ/krk09Xew+ClrrxWuDvss0KJ/8q05FMvHV6v3pAQoca0qn/4OZMzL058pVQtCo /Ko4X7IHVspuw51XwuObilEySQTiCPg9QjNSSyG52oOsgOe/05R37q41R17MdoxoY2Pb aSDl7blrVrNQWQk/ezovpTcNfLwiSPIRV8Rkdy9SqbTlR6xtWDqsQyqWcP/uD6M5DHjh m3oJSX0Mxe7nJvfXiOTaUYjkAUCqH8yaDtwNfr5YYrvXraxlJ2Ef9ipCuaBcRLDwf6ZS 4QY0XNGcET5FsYi84lVchlaiLZ3MILqvbfGQXMDq2fsGMfOYnDm9Ff5r4Kck9GAmWe6V 3j1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=c4Hh2FYtgzpa9xq5L/AfFgsVJ14/BVeinvb9ERXYdzo=; b=U2sb3z/uC+KsUAoEsU/cHAC8Mz5biozsuDeIF+3ItEZ3C9gYpzWaUsjsT+jTm0XPbM VmC8aJ3c7owYbqvwimK71DL3wqDoWOEWd3P1733NFZg8KaLVGKb0bbAZmzABe1M/ph1U jx+BqqqvekdeEwWO/1tgWB+wryUG66Wje/tOQZZHa1XAre4x61pB3C/HKUd6y3YJXoIS tdPnxrnwBMYo3+UyOG2SWKcBMfB76WqA2otev2DGOVqNErOFCFll/2PvJzm99RvyBnR3 hhk9LKkb7BdzuuKomdqmgWE2wgNDmO+H4mZ2Gi2+j0Sv/yDtGPYn6qjYr8KlaBOMc83L bH1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r2si3295468edk.294.2018.04.19.08.50.55; Thu, 19 Apr 2018 08:50:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 9DB70C21D8A; Thu, 19 Apr 2018 15:50:23 +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=RCVD_IN_DNSWL_BLOCKED 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 1CA48C21FDD; Thu, 19 Apr 2018 15:49:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C5154C21F91; Thu, 19 Apr 2018 15:49:26 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id BD152C21F94 for ; Thu, 19 Apr 2018 15:49:25 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3549BAF84; Thu, 19 Apr 2018 15:49:25 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 19 Apr 2018 17:49:20 +0200 Message-Id: <20180419154923.70719-6-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180419154923.70719-1-agraf@suse.de> References: <20180419154923.70719-1-agraf@suse.de> Cc: Heinrich Schuchardt , schwab@suse.de, Greentime Hu Subject: [U-Boot] [PATCH v2 5/8] efi_loader: Use EFI_CACHELINE_SIZE in the image loader too 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" We were using our EFI_CACHELINE_SIZE define only in the runtime service code, but left the image loader to use plain CONFIG_SYS_CACHELINE_SIZE. This patch moves EFI_CACHELINE_SIZE into efi_loader.h and converts the image loader to use it. Signed-off-by: Alexander Graf --- include/efi_loader.h | 7 +++++++ lib/efi_loader/efi_image_loader.c | 2 +- lib/efi_loader/efi_runtime.c | 7 ------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index 17f9d3d1ef..0b1b3df55a 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -76,6 +76,13 @@ const char *__efi_nesting_dec(void); ##__VA_ARGS__); \ }) +#ifdef CONFIG_SYS_CACHELINE_SIZE +#define EFI_CACHELINE_SIZE CONFIG_SYS_CACHELINE_SIZE +#else +/* Just use the greatest cache flush alignment requirement I'm aware of */ +#define EFI_CACHELINE_SIZE 128 +#endif + extern struct efi_runtime_services efi_runtime_services; extern struct efi_system_table systab; diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c index d5fbba3138..2476a97a6a 100644 --- a/lib/efi_loader/efi_image_loader.c +++ b/lib/efi_loader/efi_image_loader.c @@ -290,7 +290,7 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info) /* Flush cache */ flush_cache((ulong)efi_reloc, - ALIGN(virt_size, CONFIG_SYS_CACHELINE_SIZE)); + ALIGN(virt_size, EFI_CACHELINE_SIZE)); invalidate_icache_all(); /* Populate the loaded image interface bits */ diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index 8558124c0a..573a5d6ac1 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -30,13 +30,6 @@ static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void); static efi_status_t __efi_runtime EFIAPI efi_device_error(void); static efi_status_t __efi_runtime EFIAPI efi_invalid_parameter(void); -#ifdef CONFIG_SYS_CACHELINE_SIZE -#define EFI_CACHELINE_SIZE CONFIG_SYS_CACHELINE_SIZE -#else -/* Just use the greatest cache flush alignment requirement I'm aware of */ -#define EFI_CACHELINE_SIZE 128 -#endif - #if defined(CONFIG_ARM64) #define R_RELATIVE 1027 #define R_MASK 0xffffffffULL