Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1408007pxf; Fri, 9 Apr 2021 07:43:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8PQcXThI08W3IiQQe6otg2uAa5JZaCT3WrJC577r+At8PlvQ0AobDXaTeti3G/rqM2qBz X-Received: by 2002:a17:906:1983:: with SMTP id g3mr16253943ejd.370.1617979435334; Fri, 09 Apr 2021 07:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617979435; cv=none; d=google.com; s=arc-20160816; b=jLoY/YMsGwOoQlKCilZqbtvYijLDA8LIpOgUrCtJ8Sd+Y2+O/Cf/ihMgr93mQn7VqM CIXLtvaQGr3qeFIhVpIX0pr3EQ15sacAWQFCZ8M4TNronhPHkhbGfthDMWhY5nIpFRyA rz4oQf8ao1QhJLfjuzGWbHyMNSxUjKf0tadXlXDW+LnrzakhUQ0h5DJLIxGm58TeKC/g zMJApST2GdzwqbKmJjID5SpK38cOOz2vjcNtYZbuWASfaRIs8lOcc5ZTdgVDLeHhCOvO soLuDwC0lIgUuHeSMYDgY5PwXRYytmwcwuPbYgFDdwyzsoVHq1nKrBPGHqY/M0rMP+Rq FuiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mgWegSwhOpcGml0uML3IWUn1X3Z+AH0MFZdCHi/93PY=; b=qMZP3N5wGRRYM+X1JdZX66wiBnI4ZQnY2Np5N4N6olpdQeXh7U4qqUVSnkHffad+nj bKkYkPuCEAbT4oHyt0QPl3lOJvgLE6yeIuBphigjrdLJ3vp6r2Ddbbl3nSMQgzDJv3Pj MX1OtcDPIu0As8hwLdu+KadBbHyf8HTF3B8PBmN3yr0IlEca7Hjk1MIkqnFMh37+0R9+ 057iy9GSA3XOPAYcZYCdB53yWsVvS2KDL5S876KO82fg5qNd/ltBMvZZJHKKunFtMwxZ NT8vSa9/VL1PJXLarESmNxqEZmxYGMckZk0SX/+hOl9MRUMjpS9EFZZsPXXEYKEgod8I la0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@konsulko.com header.s=google header.b=o7eFJ30q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn18si2146417ejc.590.2021.04.09.07.43.32; Fri, 09 Apr 2021 07:43:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@konsulko.com header.s=google header.b=o7eFJ30q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233534AbhDIOmm (ORCPT + 99 others); Fri, 9 Apr 2021 10:42:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232884AbhDIOmj (ORCPT ); Fri, 9 Apr 2021 10:42:39 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41CDFC061760 for ; Fri, 9 Apr 2021 07:42:25 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id u20so6726101lja.13 for ; Fri, 09 Apr 2021 07:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mgWegSwhOpcGml0uML3IWUn1X3Z+AH0MFZdCHi/93PY=; b=o7eFJ30qOzBa3dgRnh/WcCN0kX49sPw9maR/6OuBKUPp5AJKAFmoQDa74vCSyYhlXn hXJeJrBR3C5NdSpTtex/aViY9q5M/fbQ4/Z9GR18hYJendIm2ZSEhhp48Syfl2xDKuD7 d6uhhhrmy+ADPRbj2wNKbzG2BqQoEEVnbG5DY= 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=mgWegSwhOpcGml0uML3IWUn1X3Z+AH0MFZdCHi/93PY=; b=WJGNqDEQVm/p+Blmvds9jqnEW7v9WhF+P4MMS+FlNBUMr8H2gbwOJ9GGpT5nmO49oW M3MzsM2AHOA3mThwaTV7RZ3TZToOFqm8rd/DS5m6lzU7siEFnAmltbElot5M+VbOEjdN 3hl69v5wb29FhFQkWDd0lbbPyBtSqwp2EHyYtcgFJYXrdEf/tNgayzYrEkHTM7muXn1u 6m07I/U7FlZcqRTaqfIyWXr2+4lwZu9m2r2DT2GnTJOtrlUCS67NAg7jS7byJRdamYCX IpmRPJLqZs+HXl+ue6jyHsDpoRLxTpqI+NVyFasadPq/tV0dVD0XsKFn9fIHoigRu0lY 0XRw== X-Gm-Message-State: AOAM530noK/Melndzbn+B6BFUUffJsh8Nm5L0kWuOFipipYXA/Xoh0// QcWRylpFOaC1SaE2dOGiZa7JBa56qQ7sEfPtCuMskA== X-Received: by 2002:a2e:9dd8:: with SMTP id x24mr9267330ljj.173.1617979343021; Fri, 09 Apr 2021 07:42:23 -0700 (PDT) MIME-Version: 1.0 References: <20210409065115.11054-1-alex@ghiti.fr> <3500f3cb-b660-5bbc-ae8d-0c9770e4a573@ghiti.fr> In-Reply-To: From: Vitaly Wool Date: Fri, 9 Apr 2021 16:42:12 +0200 Message-ID: Subject: Re: [PATCH v7] RISC-V: enable XIP To: Mike Rapoport Cc: David Hildenbrand , Alex Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv , LKML , linux-arch@vger.kernel.org, Linux-MM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 9, 2021 at 3:59 PM Mike Rapoport wrote: > > On Fri, Apr 09, 2021 at 02:46:17PM +0200, David Hildenbrand wrote: > > > > > Also, will that memory properly be exposed in the resource tree as > > > > > System RAM (e.g., /proc/iomem) ? Otherwise some things (/proc/kcore) > > > > > won't work as expected - the kernel won't be included in a dump. > > > Do we really need a XIP kernel to included in kdump? > > > And does not it sound weird to expose flash as System RAM in /proc/iomem? ;-) > > > > See my other mail, maybe we actually want something different. > > > > > > > > > I have just checked and it does not appear in /proc/iomem. > > > > > > > > Ok your conclusion would be to have struct page, I'm going to implement this > > > > version then using memblock as you described. > > > > > > I'm not sure this is required. With XIP kernel text never gets into RAM, so > > > it does not seem to require struct page. > > > > > > XIP by definition has some limitations relatively to "normal" operation, > > > so lack of kdump could be one of them. > > > > I agree. > > > > > > > > I might be wrong, but IMHO, artificially creating a memory map for part of > > > flash would cause more problems in the long run. > > > > Can you elaborate? > > Nothing particular, just a gut feeling. Usually, when you force something > it comes out the wrong way later. It's possible still that MTD_XIP is implemented allowing to write to the flash used for XIP. While flash is being written, memory map doesn't make sense at all. I can't come up with a real life example when it can actually lead to problems but it is indeed weird when System RAM suddenly becomes unreadable. I really don't think exposing it in /proc/iomem is a good idea. > > > BTW, how does XIP account the kernel text on other architectures that > > > implement it? > > > > Interesting point, I thought XIP would be something new on RISC-V (well, at > > least to me :) ). If that concept exists already, we better mimic what > > existing implementations do. > > I had quick glance at ARM, it seems that kernel text does not have memory > map and does not show up in System RAM. Exactly, and I believe ARM64 won't do that too when it gets its own XIP support (which is underway). Best regards, Vitaly