Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4399726ybv; Sun, 16 Feb 2020 21:33:04 -0800 (PST) X-Google-Smtp-Source: APXvYqyKmZz9uHJzHidCrDm5AR6zBPR4fV8go1YoVMlkUeAJH37Pnz/Sc6w9IaTdpoT2iiGBpKjm X-Received: by 2002:a9d:4e93:: with SMTP id v19mr8961318otk.200.1581917584026; Sun, 16 Feb 2020 21:33:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581917584; cv=none; d=google.com; s=arc-20160816; b=FnEpd765RxRRCOzRn6dmm8biK5eSUqgFnQ8Su84kyjLf5umXYGA2eTG4Dhq02RYIXF sT7zMBRgmFsMHEOO2ZSk6VJ9Wg/39b/FlN7DW/zDLf5FzNgoXhdp28tI4aFLLrfmmwiR guwQ/ySih9p6TlUrlko0PkzfJ+k8JotyWDpN/XNVTBEpNWkr5SSblfJwro5V05XK+jSb mJePBX9y8dqKH4kr0Mwb9veZASLcPdL5mNBXJqdFLyfhEq9Q8tUQmiwwKe79nGf0GMsF EvrB8PmoWHlf72O1vOfTQ9UkkLb8AXWUmQNB3+ZGmaawFMzhon5HSv1qk5BH0nnkD0p8 kKrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qK8OjVx+UrlFpp7xoUR1rRApkI96TZRdTAo+J2wgjp4=; b=egiHK0DUfxwGxzMTyn7Ik/bXpE1P1eVgss9s36723zS78A06WseyfLJFg+6Nw0VQOZ nmPutf1Ald4vL3xmvQidhYiMQp2bFx6copE8uJQsuIdHkybBEWXHE7wKD3N6meIqkNRr GlejkGjo+EJkjZqF0HPNys31iqF3fMlW+8PHOnHfJfOJAwg/OTM3f0kdzrgy7YF+pFWo bNpWYt4o9vgwF/urigPsSHrYKvYLyJpIQzZQxy4omYyUAxiHiux0y4Q0rkXf+6Xw5yae VJCC8/JujGH4MzV+S91IVoQxb4vXkrax1v/9C4pQahiHqV2ULidXoDpELCRl7gw9tYo0 zpfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=IL8t3Uqz; 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 s7si6679263otd.280.2020.02.16.21.32.51; Sun, 16 Feb 2020 21:33:04 -0800 (PST) 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; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=IL8t3Uqz; 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 S1726025AbgBQFbp (ORCPT + 99 others); Mon, 17 Feb 2020 00:31:45 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41512 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725873AbgBQFbp (ORCPT ); Mon, 17 Feb 2020 00:31:45 -0500 Received: by mail-wr1-f65.google.com with SMTP id c9so18066635wrw.8 for ; Sun, 16 Feb 2020 21:31:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qK8OjVx+UrlFpp7xoUR1rRApkI96TZRdTAo+J2wgjp4=; b=IL8t3UqzajJ8X/Va2bVJn/7/EnDmBxTC5T3DlaybGhuCCl//pvqxTZNF0kopfHdzfo cjNjQSLU6K3XvbxKh2ZcpySu6e953c3lgMTIHrjTORqzIgjVOkq0nR6aF8JzDAoAaRv9 o1PGO8RbOgWv3kE0UK6ZzZlMBqm+zCR8upj6HwuMbOu1M+EUztm7RPAG/YPe7gXQ9c/I wv/8giNlnCfHC//hrLvzxWBORlf8+ZFMyv/VWbvJp5p8nyNZg32OrBQfuO9FYuYv4Nnk EIR6VGo0hLxhF9fWi+ocm2EzMdmGi7hsJWlZGL5ziWzY7xrdu+tR8Ldxz9IMSBCgLAQe XyUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qK8OjVx+UrlFpp7xoUR1rRApkI96TZRdTAo+J2wgjp4=; b=LDeUXEaBx2M5kWPtWdWux2+e7YNjcrx7hYHlDSmfjV6qGpd0w3ZK8ThT6zs7hnHo69 fuvC/c5eds9DcuPn06USQ/N1wZK2szooBj+Aoe4NHSB9LvGUCEVC6f8dtsrFSgBCL90r LLAL2WHek31MDVOLEL8Nc3XksLvJbei/IEjLlq/StI1mGItLUn/PDKbR77J+F6P8ViUX OwGvk+PBAIGor0iEF7jAP1/eDnf3GakKMpNu+tGqbtCtWDcodPNEHoyZi+NLGqTU4lwA CLXe5NyUvwzNZex5nQ+RThA6UQJWbwOUWa8FFY9AVLJe19VynKc6csJUA9o0W/PsbVA6 Ru8A== X-Gm-Message-State: APjAAAUe5SbpK3u9rLORIXV+bjR9j6vh9jyCsA+DpTWOdHo/C19AetSs qils+v/K/mLOMMNJWM1L+lr+X0vEF84ssusNSNNqHQ== X-Received: by 2002:a05:6000:1289:: with SMTP id f9mr18846622wrx.381.1581917501593; Sun, 16 Feb 2020 21:31:41 -0800 (PST) MIME-Version: 1.0 References: <20200217052847.3174-1-alex@ghiti.fr> In-Reply-To: <20200217052847.3174-1-alex@ghiti.fr> From: Anup Patel Date: Mon, 17 Feb 2020 11:01:29 +0530 Message-ID: Subject: Re: [PATCH] riscv: Fix range looking for kernel image memblock To: Alexandre Ghiti Cc: Paul Walmsley , Palmer Dabbelt , Jan Kiszka , stable@vger.kernel.org, linux-riscv , "linux-kernel@vger.kernel.org List" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 17, 2020 at 10:59 AM Alexandre Ghiti wrote: > > When looking for the memblock where the kernel lives, we should check > that the memory range associated to the memblock entirely comprises the > kernel image and not only intersects with it. > > Signed-off-by: Alexandre Ghiti > --- > arch/riscv/mm/init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index 965a8cf4829c..fab855963c73 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -131,7 +131,7 @@ void __init setup_bootmem(void) > for_each_memblock(memory, reg) { > phys_addr_t end = reg->base + reg->size; > > - if (reg->base <= vmlinux_end && vmlinux_end <= end) { > + if (reg->base <= vmlinux_start && vmlinux_end <= end) { > mem_size = min(reg->size, (phys_addr_t)-PAGE_OFFSET); > > /* > -- > 2.20.1 > Looks good to me. Reviewed-by: Anup Patel Regards, Anup