public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [Linaro-acpi] Touching the initrd before paging_init
Date: Tue, 15 Dec 2015 15:42:40 +0000	[thread overview]
Message-ID: <20151215154240.GB7228@leverpostej> (raw)
In-Reply-To: <567031F2.8060102@redhat.com>

On Tue, Dec 15, 2015 at 10:29:54AM -0500, Jon Masters wrote:
> On 12/15/2015 06:43 AM, M?ns Rullg?rd wrote:
> > Jon Masters <jcm@redhat.com> writes:
> 
> >> But the reading of that cpio content into the new table locations is
> >> done using the kernel memcpy routine to early_ioremap'd memory (Device
> >> memory), which is architecturally sensitive to missaligned accesses.
> > 
> > As others have pointed out, your error is twofold: first using
> > early_ioremap() when early_memremap() would do, then using regular
> > memcpy() and not memcpy_fromio() on that.  Seems like your precious ACPI
> > code is to blame here.
> 
> So I get that this could be changed. But I still want to understand
> whether memcpy is behaving correctly. Will it guaranteed /never/ occur
> that a copy will involve Device memory?

It is guaranteed in the same sense that other problems resulting from
misuses of kernel APIs are guaranteed never to occur -- so long as the
contract between the API and the programmer is respected.

It is physically possible that a programmer may violate that contract.
It is a programming error if that happens.

> All other such occurrences in the kernel will be caught and fixed so
> this will never be an issue?

No-one has the prescience to be able to tell you whether a particular
bug will or will not be introduced in future. If the programmer pays
attention to their tools (e.g. sparse warnings about address space
mismatches), this class of error is fairly easy to avoid.

If you have found another occurrence of this issue, please report it.

Mark.

  reply	other threads:[~2015-12-15 15:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13  8:47 Touching the initrd before paging_init Jon Masters
2015-12-07  6:05 ` Mark Rutland
2015-12-13 16:54   ` [Linaro-acpi] " G Gregory
2015-12-13 16:59 ` Leif Lindholm
2015-12-13 21:36   ` Jon Masters
2015-12-13 22:02     ` Jon Masters
2015-12-13 22:15       ` G Gregory
2015-12-13 22:19         ` Jon Masters
2015-12-15 11:19           ` G Gregory
2015-12-15 15:36             ` Jon Masters
2015-12-15 16:13               ` G Gregory
2015-12-15 16:28                 ` G Gregory
2015-12-15 16:31                   ` Jon Masters
2015-12-15 17:08                     ` G Gregory
2015-12-15 19:22                       ` G Gregory
2015-12-13 22:15       ` Jon Masters
2015-12-15  4:51         ` Jon Masters
2015-12-15 10:14           ` Leif Lindholm
2015-12-15 10:22           ` Mark Rutland
2015-12-15 11:43           ` Måns Rullgård
2015-12-15 15:29             ` Jon Masters
2015-12-15 15:42               ` Mark Rutland [this message]
2015-12-15 16:31               ` Måns Rullgård

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=20151215154240.GB7228@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox