Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp693350yba; Thu, 16 May 2019 07:30:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyM5GPfFr3baEBqjvvdb5SAaLRfi5r6+RW2453uV0O4V3Y0TqDu4NxIKZbcaBUzIPthzNYI X-Received: by 2002:aa7:9ab0:: with SMTP id x16mr47182793pfi.201.1558017034739; Thu, 16 May 2019 07:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558017034; cv=none; d=google.com; s=arc-20160816; b=dcAmrddQ1B9ioZJ33wjjm6yASct2Az5vIPOFywdFijtNHAZkojd1xUyv1hs5FjBkEw +6z5mApgKTmHfOuGrZSexojOV0BeI4w2SNMo0RzgxljnFI27SdS9CpQhUzOm0UOzOBYm Wrawv2QR1t9cxFK4Rh7HtHiLciPO3WRT+5hF8o6o5/dS07wBzqfKmMOqXihIyhcp+gJY HjcpbQLaEvY5I2LNt0LIT4IpuqaSH5n0GRMYD+5xHg3k4v+RLgFrc43QoPB2CuGVq829 IKlj79ktPYNV6bCvO6iHVn8wPkq9yspF7x+fWCLVePCtxrgxDhFuMTk/9hBWGOvKnqNr FBVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FfXTrQR1naldRBpYQteQyw426WiMM6oQ504XCUI8t2I=; b=FHXjuwwaJ1WdBhaJMWdBPQ9icIvfjwQvfEjs3o3D6+YGHYJPxsGSkxbJgtm7tOVLnW IybcQ4bapYFoW2o/1YcgeQjZrNzP7OUERp3q3NyQEEhOxnWvq0BjSThqX2zLHtbDEls3 UqANmNDbn9OAUWJGSDGeN3iuT8Pc6blw4cKm7xx4+Ru8bhaBHfi9hPII1ZDDJBQJHiB5 nhzxEzvhfg9cZcnTZM+6J/158RPZcidWX3pVOuuINkOUcGV99iENNGGjQj3N/ctJBgtj x+y8fhKtrSyIKFx1qcM/Yx0zJUzpoRb9mV2yf3ORVcF+gP4HrvOQexFZFOt02fggGVnV PwKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f92si5211594plf.100.2019.05.16.07.30.19; Thu, 16 May 2019 07:30:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727464AbfEPO2B (ORCPT + 99 others); Thu, 16 May 2019 10:28:01 -0400 Received: from foss.arm.com ([217.140.101.70]:47602 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726696AbfEPO2B (ORCPT ); Thu, 16 May 2019 10:28:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 08ED91715; Thu, 16 May 2019 07:28:01 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A5EAA3F71E; Thu, 16 May 2019 07:27:59 -0700 (PDT) Date: Thu, 16 May 2019 15:27:57 +0100 From: Mark Rutland To: Steven Price Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, Mike Rapoport , Andrew Morton , Will Deacon , Catalin Marinas Subject: Re: Bad virt_to_phys since commit 54c7a8916a887f35 Message-ID: <20190516142756.GE43059@lakrids.cambridge.arm.com> References: <20190516133820.GA43059@lakrids.cambridge.arm.com> <20190516134105.GB43059@lakrids.cambridge.arm.com> <20190516141640.GC43059@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > > 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.