All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pingfan Liu <kernelfans@gmail.com>
To: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Linux ARM <linux-arm-kernel@lists.infradead.org>,
	 Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>,
	 Kristina Martsenko <kristina.martsenko@arm.com>,
	James Morse <james.morse@arm.com>,
	Steven Price <steven.price@arm.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	 Anshuman Khandual <anshuman.khandual@arm.com>,
	Atish Patra <atish.patra@wdc.com>,
	 Mike Rapoport <rppt@kernel.org>,
	Logan Gunthorpe <logang@deltatee.com>,
	Mark Brown <broonie@kernel.org>,
	 "Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [RFC 0/8] use __create_pgd_mapping() to implement idmap and unify codes
Date: Thu, 15 Apr 2021 10:14:09 +0800	[thread overview]
Message-ID: <CAFgQCTvq3VAm7yztoR9jw=EYUdS1K-cuTKcUn_DNdGsnxMyrHA@mail.gmail.com> (raw)
In-Reply-To: <CA+CK2bCLwRWiNf-pUbD_qSRPt=taQxSvrEMOP-8D7FgNhXQKug@mail.gmail.com>

Hi Pavel,

First of all, sorry to stir up this topic too late.

On Wed, Apr 14, 2021 at 10:06 PM Pavel Tatashin
<pasha.tatashin@soleen.com> wrote:
>
[...]
> Hi Pingfan,
>
> The MMU enabled kexec code has been in development for a while, and
> has gone through several iterations:
>

Yes, I have gone through the whole iterations after reviewing v12.

> 1. simply reserve memory (similar to crash kernel) so no relocation is
> needed. The approach was only ~50 LOC, but since this was an ARM64
> specific problem I was asked to fix it in ARM64, not in generic code.
> 2. The second approach was to use idmap (as you are proposing now),
> but James Morse explained to me that there are arm systems that have
> very high starting physical addresses that they cannot cover all
> physical memory via idamp. So, I cannot assume that I can idmap any
> page in PA.

I think here, the exact blocking factor is the routines in hand can
not set up idmap. But the current routines have the capability if
enhanced. And  it turns out easy to achieve the goal by redefining
CONFIG_PGTABLE_LEVEL.

> 3. The third approach was to unify some of page table management code
> with hibernations (trans_pgd), and use contiguous VA maps, so the
> relocation function can be as simply as possible. However, both, Eric
> Biederman and James Morse asked me to change it to a linear map
> instead: to be inline with other arches, and also for easier
> debugging.
> 4. The fourth approach is the current one, I am using a linear map,
> and a lot of patches for this project have already landed into the
> mainline. The last set of changes does not add any new LOC: "18 files
> changed, 315 insertions(+), 330 deletions(-)", as all the preliminary
> work has landed upstream.
>
> What is the benefit of going back to approach 2, when the current
> approach has already been agreed with James and Eric, and does not add
> new complexity, as the net LOC change is negative?
>

It takes me some time to understand the stub handling. But James is
expert on this field and sure about it.  In contrast, idmap is similar
to linear map, meanwhile free of kvm stub handling. As a result, the
code scarcely needs change against MMU-disabled code.

Anyway, the primary target of my series is to share the common code
with [5/8] and [8/8].

Thanks,
Pingfan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2021-04-15  2:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10  9:56 [RFC 0/8] use __create_pgd_mapping() to implement idmap and unify codes Pingfan Liu
2021-04-10  9:56 ` [RFC 1/8] arm64/mm: split out __create_pgd_mapping() routines Pingfan Liu
2021-04-14 13:19   ` Pingfan Liu
2021-04-10  9:56 ` [RFC 2/8] arm64/mm: change __create_pgd_mapping() prototype to accept nr_entries and introduce create_idmap() Pingfan Liu
2021-04-10  9:56 ` [RFC 3/8] arm64/mm: change __create_pgd_mapping() prototype to accept extra info for allocator Pingfan Liu
2021-04-10  9:56 ` [RFC 4/8] arm64/mm: enable __create_pgd_mapping() to run across different pgtable Pingfan Liu
2021-04-10  9:56 ` [RFC 5/8] arm64/mm: make trans_pgd_idmap_page() use create_idmap() Pingfan Liu
2021-04-10  9:56 ` [RFC 6/8] arm64/mm: introduce pgtable allocator for head Pingfan Liu
2021-04-10  9:56 ` [RFC 7/8] arm64/pgtable-prot.h: reorganize to cope with asm Pingfan Liu
2021-04-10  9:56 ` [RFC 8/8] arm64/head: convert idmap_pg_dir and init_pg_dir to __create_pgd_mapping() Pingfan Liu
2021-04-19 14:10   ` Pingfan Liu
2021-04-14 14:05 ` [RFC 0/8] use __create_pgd_mapping() to implement idmap and unify codes Pavel Tatashin
2021-04-15  2:14   ` Pingfan Liu [this message]

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='CAFgQCTvq3VAm7yztoR9jw=EYUdS1K-cuTKcUn_DNdGsnxMyrHA@mail.gmail.com' \
    --to=kernelfans@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=anshuman.khandual@arm.com \
    --cc=atish.patra@wdc.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=ebiederm@xmission.com \
    --cc=james.morse@arm.com \
    --cc=kristina.martsenko@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=logang@deltatee.com \
    --cc=maz@kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=rppt@kernel.org \
    --cc=steven.price@arm.com \
    --cc=will@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.