All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Roy Franz <roy.franz@linaro.org>
Cc: keir@xen.org,
	Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>,
	tim@xen.org, xen-devel@lists.xen.org,
	stefano.stabellini@citrix.com, jbeulich@suse.com,
	fu.wei@linaro.org
Subject: Re: [PATCH V2 for-4.5] xen/arm64: Use __flush_dcache_area instead of __flush_dcache_all
Date: Mon, 20 Oct 2014 11:59:03 +0100	[thread overview]
Message-ID: <1413802743.11781.8.camel@citrix.com> (raw)
In-Reply-To: <1413431279-17559-1-git-send-email-roy.franz@linaro.org>

On Wed, 2014-10-15 at 20:47 -0700, Roy Franz wrote:
> +        /* flush dcache covering the FDT updated by EFI boot code */
> +        mov   x1, 0x200000        /* max size of FDT allowed */
> +        bl    __flush_dcache_area

Since we are now flushing by VA doesn't this run the risk of overrunning
the end of the 1:1 map and faulting? I think we haven't yet switched to
our own 2M mapping. Also this will flush for 2M even from a non-2M
aligned starting point, which might cross the boundary of even a 2M
mapping. (I think there is probably a related shortcoming in the regular
head.S, if the DTB is very near the end of a 2M region).

The FDT has a totalsize word (4 bytes from the start). I guess it would
be simple enough to check the magic number at offset 0 and then read the
length from offset 4 (don't forget to endian swap), especially since I
originally thought we would be looking at a full parsing loop (phew!).
We'd probably also want to clamp the value to 2M or some other sanity
check value.

Alternatively we might be able to defer the flush until head.S has made
the mapping in the BOOT_MISC slot, but I'm not 100% sure about that.

Ian.

  reply	other threads:[~2014-10-20 10:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16  3:47 [PATCH V2 for-4.5] xen/arm64: Use __flush_dcache_area instead of __flush_dcache_all Roy Franz
2014-10-20 10:59 ` Ian Campbell [this message]
2014-10-20 19:20   ` Roy Franz
2014-10-21  8:09     ` Ian Campbell

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=1413802743.11781.8.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=fu.wei@linaro.org \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=roy.franz@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.