LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Steven Price <steven.price@arm.com>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-kernel@vger.kernel.org, Mike Rapoport <rppt@linux.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Will Deacon <will.deacon@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: Bad virt_to_phys since commit 54c7a8916a887f35
Date: Thu, 16 May 2019 15:27:57 +0100	[thread overview]
Message-ID: <20190516142756.GE43059@lakrids.cambridge.arm.com> (raw)
In-Reply-To: <d265e5fe-c061-17a0-427d-0e6f31be17f3@arm.com>

On Thu, May 16, 2019 at 03:20:59PM +0100, Steven Price wrote:
> On 16/05/2019 15:16, Mark Rutland wrote:
> > On Thu, May 16, 2019 at 03:05:31PM +0100, Steven Price wrote:
> >> I suspect the following is sufficient to fix the problem:
> >>
> >> ----8<-----
> >> diff --git a/init/initramfs.c b/init/initramfs.c
> >> index 435a428c2af1..178130fd61c2 100644
> >> --- a/init/initramfs.c
> >> +++ b/init/initramfs.c
> >> @@ -669,7 +669,7 @@ static int __init populate_rootfs(void)
> >>  	 * If the initrd region is overlapped with crashkernel reserved region,
> >>  	 * free only memory that is not part of crashkernel region.
> >>  	 */
> >> -	if (!do_retain_initrd && !kexec_free_initrd())
> >> +	if (!do_retain_initrd && initrd_start && !kexec_free_initrd())
> >>  		free_initrd_mem(initrd_start, initrd_end);
> >>  	initrd_start = 0;
> >>  	initrd_end = 0;
> > 
> > That works for me. If you spin this as a real patch:
> > 
> > Tested-by: Mark Rutland <mark.rutland@arm.com>
> > 
> > As I mentioned, initrd_start has not been initialized at all, so I
> > suspect we should also update its declaration in init/do_mounts_initrd.c
> > such that it is guaranteed to be initialized to zero. We get away with
> > that today, but that won't necessarily hold with LTO and so on...
> 
> Well it's a global variable, so the C standard says it should be
> initialised to 0...

For some reason I was under the impression that wasn't guaranteed, but I
see that it is. Sorry for the noise.

> I'll spin a real patch and add your Tested-by

Great; thanks!

Mark.

  reply	other threads:[~2019-05-16 14:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 13:38 Mark Rutland
2019-05-16 13:41 ` Mark Rutland
2019-05-16 14:05   ` Steven Price
2019-05-16 14:16     ` Mark Rutland
2019-05-16 14:20       ` Steven Price
2019-05-16 14:27         ` Mark Rutland [this message]
2019-05-23  9:31         ` Will Deacon
2019-05-23  9:54           ` Mike Rapoport
2019-05-23  9:58             ` Steven Price
2019-05-23 10:01               ` Will Deacon
2019-05-16 14:13   ` Mike Rapoport
2019-05-16 14:21     ` Mark Rutland
2019-05-16 14:23       ` Christoph Hellwig

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=20190516142756.GE43059@lakrids.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rppt@linux.ibm.com \
    --cc=steven.price@arm.com \
    --cc=will.deacon@arm.com \
    --subject='Re: Bad virt_to_phys since commit 54c7a8916a887f35' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).