From patchwork Mon Apr 23 05:59:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 133955 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp618540lji; Sun, 22 Apr 2018 23:04:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx49vo9iQKQBTbCXPrXOgTCYrtPrlHUknMNq5iBZ6L+Yiw8fADWK8K9c5Pxb7lOU03JN1qOvG X-Received: by 10.80.147.13 with SMTP id m13mr26136436eda.77.1524463493502; Sun, 22 Apr 2018 23:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524463493; cv=none; d=google.com; s=arc-20160816; b=F82HfSGLRcfBc6qTz0MU/Fe29G3WKnxHPsOVN+n7w3+g5oVfrsa2gupkMCGiwPfwNG LsbreeUf6Uyl5a5xT4oiYBjKm5OjMLRTESWuF7BVCysc6BU7S3uAHQx4+mL5M8w3qQZ+ EItq9kU9YgG9JTl8lvtdepN3QwRb/iKcdursM4MhNAdhU/TXViTKD2beVeQBhHWhJpsK 1In20Ntjf4uN8FmXe1fqq6zOO2GszGgAhOtLNjhp33vG6qH5/Yz5P+zRU0I65NPtmQh5 YciRe5kps+/tx8d8xUm30Y5wZnP/rviEM0pmloTJx+4t5tuTZAu2P5C/dNvAi3tJhsdt jjlA== 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=So4MLjEZMadKgPDQnXYOpPtG9LuVfHq2slSt0gZc9bBDSxYXRjRzTfArcTreI5ST8a LQM/Zme/w+GJp2lFFJqW+1JyK9KNFpR8dfxBKNRqlASuvhwa68/0Hd+IpyVRYRaI2CTI FusJiE+7Vi0k9HJl1mxKIwIWVNDiohykLzSDyMigQflyPkQ9fFwMbUImTJeWEjcujtu7 BqzrE3XN7fd9ofXA3EGPAp/fS/AW+1WHOAqOmabDX69omffqJdWE5zi3D3cL+bG+u7Yt hj4GzVBNrJKSsVysaTeqhtFum8NHGBioj/W2BnRimmbuGqPX8jCDMtWhJN5BgGQ0K4vC QROA== 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 z41si6939941edb.370.2018.04.22.23.04.53; Sun, 22 Apr 2018 23:04:53 -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 08418C21DDC; Mon, 23 Apr 2018 06:00:55 +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 362E1C21DB6; Mon, 23 Apr 2018 06:00:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 32428C21DFA; Mon, 23 Apr 2018 05:59:52 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id D1710C21DB6 for ; Mon, 23 Apr 2018 05:59:51 +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 7599FAE80; Mon, 23 Apr 2018 05:59:51 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Mon, 23 Apr 2018 07:59:47 +0200 Message-Id: <20180423055950.78818-6-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180423055950.78818-1-agraf@suse.de> References: <20180423055950.78818-1-agraf@suse.de> Cc: Heinrich Schuchardt , schwab@suse.de, Greentime Hu Subject: [U-Boot] [PATCH v3 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 Reviewed-by: Heinrich Schuchardt --- 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