Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5004084ybf; Wed, 4 Mar 2020 15:18:09 -0800 (PST) X-Google-Smtp-Source: ADFU+vvSH4/PJmpdj4mBG5NOS5jJeRpPukC6wJimdogpY8K5HU8TVCdswvK7oqn9djbOqfUA/Jd1 X-Received: by 2002:a54:4585:: with SMTP id z5mr2196136oib.149.1583363888897; Wed, 04 Mar 2020 15:18:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583363888; cv=none; d=google.com; s=arc-20160816; b=iFYHpHfQ9KRir/upuSvyob5TlLeT4bl5XtaFAewL0xyeNBTMIsHl6FZ2mfMYCGZ7to pgaU0iQdExsxkWSlCwN9Ch2PTObHH2aCV3QeLDKBw7u4kcrCTIg+ujl67ri7BkcNxNC1 Xp6vcYQ4ShP75NS3e92oslEn/Fq0C+1JqZgK4fws+/lISh/2Ul6XdCUBLqQqdu5QbmB5 Yitnx1ODay3LqW8rw5wW5W2tgppxVfeZw/BVn6fLvJfUemCK5JEgKUddIlIHJKl3po7V AhwhVu8CIxbQAcLf+QqSgF9lxBK2ruAaxrQlBT6T0whnstTELixYENJjUvF62kmEK3NQ 4LBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=fLuBSubRkGwc0et1lSwg/yOrJz68JCULXi64QxtD9L4=; b=xjQ46TTzmQpwow/m/O43hdnEyDJAxjVIKARbc0/olW4WwOkSkPY1JJbcYuVUyCLrFc /MdMfZ2Ylnz44+0duS5188ZjWdjuuk2G4nTC0C06uTJmscfT+ZzprMIizsWk83NjZbwb 6vqbRzdGKJE0IwGB1Le2cat+Ws43/Z+muYPegniufCevBbDVfW3IeiRTkly0Z2ADWV5g pnqM4XSRiekm35hAYsMH2TK5lud9a7grPSVWCX0I/dPzSujkpFGfm40bBcRa5Ba8Wng3 sNl0dxvCefsiqLVTiWNVemQisGFS51gF5bLqZfbDmOlhR4XM8uwW6sZ8fm+OpjFtRANV l4NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=Zfx3aZDH; 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 s13si2030346otr.94.2020.03.04.15.17.57; Wed, 04 Mar 2020 15:18:08 -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=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=Zfx3aZDH; 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 S2388520AbgCDXQd (ORCPT + 99 others); Wed, 4 Mar 2020 18:16:33 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:36321 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388425AbgCDXQc (ORCPT ); Wed, 4 Mar 2020 18:16:32 -0500 Received: by mail-pj1-f66.google.com with SMTP id d7so1634426pjw.1 for ; Wed, 04 Mar 2020 15:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=fLuBSubRkGwc0et1lSwg/yOrJz68JCULXi64QxtD9L4=; b=Zfx3aZDHOKJv/xTct7dFMPFiJ5RG5nooZwf3B1Md2rdmwylu/vxshgKBxR/JXzh0tD ILxZPjvmXfQO/SuH/N0qK07KCfDtfALyxDCCZFxc2B5oaT8B5uCN1n5MIE8fM8Pw8OYT fyBlEUvLtcv7XvQQPzrsehVW9nxkUUlJnBnnBg4nPiFsqZpRmv0BIeAtS5xWy3bAUkK7 EKOTDIA9tusMsoUyU23lmsiRUAutFyFaC9sPkiymBzoqkhA8m2XNEP5ACMQ87Dr1K9L7 UhONoltdyIcJ0bCTJjQ6f3GbWTkvgcWNwd2jDPQLNNTAck6BZB9ffrWTJncrYXc7y5EN rk3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=fLuBSubRkGwc0et1lSwg/yOrJz68JCULXi64QxtD9L4=; b=jLFH7vA1Gcr8APN6mtPSdqqkZmNWXAWDMENN9633jt2KP1jBhTKeXO05/PrPUy1uUZ J8GEKlv/dJLsLckQlU3JivAbltBg6EbIzBELDVp4/5q+2s4j6TaL3zNPkG5Fvs2r2I1Y aQsTI/SpXnf17rOFgF27LHqdYMSiZp0agbild21xJIOnL2sBQi14n8GeaJYFa36BR3Q4 h2km6i+NUaucsoMqRd3+D8I1OBFZnd5BecsI5b93gAs6oj+AM5FQfPFhTxYSnF5+EuWa /6kPaVUoyzl7UCBGXaS5/bd2cHtiGslL6OaXfaO7dU/7yHI7OFgb6GJlUnMNyGcCJPYt tWEQ== X-Gm-Message-State: ANhLgQ0aWn2aAS4PY9x7gcFhXdb6CwbHnTGE1LD0jaZD5OapmHYuIaQa qjLnyRDJzSbMyObTsUMcWC9+Wg== X-Received: by 2002:a17:90a:1f45:: with SMTP id y5mr5271710pjy.170.1583363791341; Wed, 04 Mar 2020 15:16:31 -0800 (PST) Received: from localhost ([2620:0:1000:2514:23a5:d584:6a92:3e3c]) by smtp.gmail.com with ESMTPSA id c5sm29203530pfi.10.2020.03.04.15.16.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 15:16:30 -0800 (PST) Date: Wed, 04 Mar 2020 15:16:30 -0800 (PST) X-Google-Original-Date: Wed, 04 Mar 2020 15:10:33 PST (-0800) Subject: Re: [PATCH] riscv: Fix range looking for kernel image memblock In-Reply-To: <20200217052847.3174-1-alex@ghiti.fr> CC: Paul Walmsley , anup@brainfault.org, jan.kiszka@web.de, stable@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, alex@ghiti.fr From: Palmer Dabbelt To: alex@ghiti.fr Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 16 Feb 2020 21:28:47 PST (-0800), alex@ghiti.fr 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); > > /* Reviewed-by: Palmer Dabbelt Thanks. I'm going to target this for the next RC.