linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Justin He <Justin.He@arm.com>
Cc: Mark Rutland <Mark.Rutland@arm.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Gavin Shan <gshan@redhat.com>,
	Suzuki Poulose <Suzuki.Poulose@arm.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Anshuman Khandual <Anshuman.Khandual@arm.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	linux-kernel@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Cristian Marussi <Cristian.Marussi@arm.com>,
	Mike Rapoport <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Price <Steven.Price@arm.com>,
	Will Deacon <will@kernel.org>,
	Dave P Martin <Dave.Martin@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH 0/2] Avoid booting stall caused by idmap_kpti_install_ng_mappings
Date: Wed, 20 Jan 2021 10:58:22 +0000	[thread overview]
Message-ID: <e8a45079ae30232eaa889f026439da9e@kernel.org> (raw)
In-Reply-To: <AM6PR08MB43763910418580E3A470BF27F7A20@AM6PR08MB4376.eurprd08.prod.outlook.com>

Hi Justin,

On 2021-01-20 04:51, Justin He wrote:
> Hi,
> Kindly ping 😊
> 
>> -----Original Message-----
>> From: Jia He <justin.he@arm.com>
>> Sent: Wednesday, January 13, 2021 9:41 AM
>> To: Catalin Marinas <Catalin.Marinas@arm.com>; Will Deacon
>> <will@kernel.org>; linux-arm-kernel@lists.infradead.org; linux-
>> kernel@vger.kernel.org
>> Cc: Anshuman Khandual <Anshuman.Khandual@arm.com>; Suzuki Poulose
>> <Suzuki.Poulose@arm.com>; Justin He <Justin.He@arm.com>; Mark Rutland
>> <Mark.Rutland@arm.com>; Gustavo A. R. Silva <gustavoars@kernel.org>;
>> Richard Henderson <richard.henderson@linaro.org>; Dave P Martin
>> <Dave.Martin@arm.com>; Steven Price <Steven.Price@arm.com>; Andrew 
>> Morton
>> <akpm@linux-foundation.org>; Mike Rapoport <rppt@kernel.org>; Ard
>> Biesheuvel <ardb@kernel.org>; Gavin Shan <gshan@redhat.com>; Kefeng 
>> Wang
>> <wangkefeng.wang@huawei.com>; Mark Brown <broonie@kernel.org>; Marc 
>> Zyngier
>> <maz@kernel.org>; Cristian Marussi <Cristian.Marussi@arm.com>
>> Subject: [RFC PATCH 0/2] Avoid booting stall caused by
>> 
>> There is a 10s stall in idmap_kpti_install_ng_mappings when kernel 
>> boots
>> on a Ampere EMAG server.
>> 
>> Commit f992b4dfd58b ("arm64: kpti: Add ->enable callback to remap
>> swapper using nG mappings") updates the nG bit runtime if kpti is
>> required.
>> 
>> But things get worse if rodata=full in map_mem(). NO_BLOCK_MAPPINGS |
>> NO_CONT_MAPPINGS is required when creating pagetable mapping. Hence 
>> all
>> ptes are fully mapped in this case. On a Ampere EMAG server with 256G
>> memory(pagesize=4k), it causes the 10s stall.
>> 
>> After moving init_cpu_features() ahead of early_fixmap_init(), we can 
>> use
>> cpu_have_const_cap earlier than before. Hence we can avoid this stall
>> by updating arm64_use_ng_mappings.
>> 
>> After this patch series, it reduces the kernel boot time from 14.7s to
>> 4.1s:
>> Before:
>> [   14.757569] Freeing initrd memory: 60752K
>> After:
>> [    4.138819] Freeing initrd memory: 60752K
>> 
>> Set it as RFC because I want to resolve any other points which I have
>> misconerned.

But you don't really explain *why* having the CPU Feature discovery
early helps at all. Is that so that you can bypass the idmap mapping?
I'd expect something that explain the problem instead of paraphrasing
the patches.

Another thing is whether you have tested this on some ThunderX HW
(the first version, not TX2), as this is the whole reason for this
code...

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

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

       reply	other threads:[~2021-01-20 10:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AM6PR08MB43763910418580E3A470BF27F7A20@AM6PR08MB4376.eurprd08.prod.outlook.com>
2021-01-20 10:58 ` Marc Zyngier [this message]
2021-01-20 15:55   ` [RFC PATCH 0/2] Avoid booting stall caused by idmap_kpti_install_ng_mappings Justin He
2021-01-25  6:36     ` Justin He

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=e8a45079ae30232eaa889f026439da9e@kernel.org \
    --to=maz@kernel.org \
    --cc=Anshuman.Khandual@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Cristian.Marussi@arm.com \
    --cc=Dave.Martin@arm.com \
    --cc=Justin.He@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=Steven.Price@arm.com \
    --cc=Suzuki.Poulose@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=broonie@kernel.org \
    --cc=gshan@redhat.com \
    --cc=gustavoars@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.henderson@linaro.org \
    --cc=rppt@kernel.org \
    --cc=wangkefeng.wang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).