From patchwork Wed Apr 18 13:40:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 133630 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp5895954ljb; Wed, 18 Apr 2018 06:44:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx48uy34UZgKaefkbVLV9JcCkofGj9/NmdhJ8WgaCAXrRTesD7n0sPKBsSDaIoDhO1NUNMQgI X-Received: by 10.80.231.5 with SMTP id a5mr3243436edn.109.1524059053568; Wed, 18 Apr 2018 06:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524059053; cv=none; d=google.com; s=arc-20160816; b=d8E9HU6I56rquuDZ79vgOg+E+Vz2Wu/QNK1RRrkG68oJuchXTnAvg6ACLyFWM6zoD6 2QnXTVAd8vMTxs7F+N9vV+a6nSz1GU8M9W+f4dRH6BetNJrGw6UKElY6zQoKqd0aV5mW 8L4FstxgfIgv0L0pXqnWvFUkkS4KQ1OLbFVKg0tRdwzPifYHkx0wIOdXW+4NNRZbvv3/ gqIRs5nemSPYwkeXxdRUP5PzS+ESS8EE8im9AzT8KgQoyxG8bKecQmzbgs1jVjIYEeah rKRP8qTpKuHeA5oaFye1rZXyb3o+TtHqyGozz0o2Ty5mj7KzPeaLhgGKXaxDCFIG3cmR 6RVg== 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=ypZb0+VgieESpGBlbk8C9qNnu1rD7KIEZMTr1MIxDBXRktZeDEP16PJ5y9gsPBFSw7 lTzjPhhQ1Xw+k3FqRVZFfwxgTOJY8V2YLALkA8kroT2vJwYqsq0bs5x4Oq0aofKTNAeF +zBdqcNsOYSLT5JdgDuTHPYKK3qOYsOXVlK3g+nk9VM8ofCJcl67lyOKdw/GxsMnFOhs FqvKAjXvzrYGBtibJdy7t5MHvj5zph8SPj8hXc/vtxrGcf7NvLeObakia9yjfccK+p/j mNKMfQIltv1/B1lM/VyJNGOFMPfmk8cdJvXQX6IDEgvjTLiOzyADCESmk5uvSbCx/F0I aEWA== 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 k31si1354968ede.236.2018.04.18.06.44.13; Wed, 18 Apr 2018 06:44:13 -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 16323C21EE3; Wed, 18 Apr 2018 13:42:38 +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 05596C21F1C; Wed, 18 Apr 2018 13:40:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BD433C21D4A; Wed, 18 Apr 2018 13:40:35 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 37A6AC21C8B for ; Wed, 18 Apr 2018 13:40:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 072FDAF5D; Wed, 18 Apr 2018 13:40:35 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Wed, 18 Apr 2018 15:40:27 +0200 Message-Id: <20180418134030.55127-6-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180418134030.55127-1-agraf@suse.de> References: <20180418134030.55127-1-agraf@suse.de> Cc: Heinrich Schuchardt , Greentime Hu Subject: [U-Boot] [PATCH 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