public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] efi_loader: Always flush in cache line size granularity
Date: Mon, 11 Apr 2016 00:24:58 +0200	[thread overview]
Message-ID: <570AD2BA.609@suse.de> (raw)
In-Reply-To: <1459755138-173508-1-git-send-email-agraf@suse.de>

Am 04.04.2016 um 09:32 schrieb Alexander Graf:
> The cache line flush helpers only work properly when they get aligned
> start and end addresses. Round our flush range to cache line size. It's
> safe because we're guaranteed to flush within a single page which has the
> same cache attributes.
> 
> Reported-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  lib/efi_loader/efi_runtime.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
> index 22bcd08..40acec0 100644
> --- a/lib/efi_loader/efi_runtime.c
> +++ b/lib/efi_loader/efi_runtime.c
> @@ -194,7 +194,8 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
>  #endif
>  
>  		*p = newaddr;
> -		flush_dcache_range((ulong)p, (ulong)&p[1]);
> +		flush_dcache_range((ulong)p & ~(CONFIG_SYS_CACHELINE_SIZE - 1),
> +			ALIGN((ulong)&p[1], CONFIG_SYS_CACHELINE_SIZE));

dragonboard410c_defconfig fails to build with this due to undefined
CONFIG_SYS_CACHELINE_SIZE. Do we need to #ifdef here or is the
dragonboard410c at fault for not defining it?

jetson-tk1_defconfig for instance builds fine with this patch.

Regards,
Andreas

>  	}
>  
>  #ifndef IS_RELA

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)

  parent reply	other threads:[~2016-04-10 22:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04  7:32 [U-Boot] [PATCH] efi_loader: Always flush in cache line size granularity Alexander Graf
2016-04-04  7:56 ` Marek Vasut
2016-04-10 22:24 ` Andreas Färber [this message]
2016-04-10 22:31   ` Alexander Graf
2016-04-10 22:36     ` Marek Vasut
2016-04-12  0:39       ` Tom Rini
2016-04-12  0:59         ` Marek Vasut
  -- strict thread matches above, loose matches on Subject: below --
2016-04-11 21:20 Alexander Graf
2016-04-13 12:53 ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=570AD2BA.609@suse.de \
    --to=afaerber@suse.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox