From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E3E8C43331 for ; Mon, 30 Mar 2020 17:17:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6585920776 for ; Mon, 30 Mar 2020 17:17:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6585920776 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F323A6B0032; Mon, 30 Mar 2020 13:17:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F0A346B0037; Mon, 30 Mar 2020 13:17:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E20E86B006C; Mon, 30 Mar 2020 13:17:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0249.hostedemail.com [216.40.44.249]) by kanga.kvack.org (Postfix) with ESMTP id C98506B0032 for ; Mon, 30 Mar 2020 13:17:30 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6EBE4180AD81F for ; Mon, 30 Mar 2020 17:17:30 +0000 (UTC) X-FDA: 76652685060.20.skin38_5e98e9e312528 X-HE-Tag: skin38_5e98e9e312528 X-Filterd-Recvd-Size: 3108 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Mar 2020 17:17:29 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2AEE8101E; Mon, 30 Mar 2020 10:17:29 -0700 (PDT) Received: from [172.16.1.108] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 81EE43F68F; Mon, 30 Mar 2020 10:17:27 -0700 (PDT) Subject: Re: [PATCH 0/3] kexec/memory_hotplug: Prevent removal and accidental use To: Baoquan He Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Eric Biederman , Andrew Morton , Catalin Marinas , Will Deacon , Anshuman Khandual , Bhupesh Sharma References: <20200326180730.4754-1-james.morse@arm.com> <20200330135522.GE6352@MiWiFi-R3L-srv> From: James Morse Openpgp: preference=signencrypt Message-ID: <2bdfbb1c-49da-d476-4a38-f91937105ae3@arm.com> Date: Mon, 30 Mar 2020 18:17:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200330135522.GE6352@MiWiFi-R3L-srv> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Baoquan, On 3/30/20 2:55 PM, Baoquan He wrote: > On 03/26/20 at 06:07pm, James Morse wrote: >> arm64 recently queued support for memory hotremove, which led to some >> new corner cases for kexec. >> >> If the kexec segments are loaded for a removable region, that region may >> be removed before kexec actually occurs. This causes the first kernel to >> lockup when applying the relocations. (I've triggered this on x86 too). >> >> The first patch adds a memory notifier for kexec so that it can refuse >> to allow in-use regions to be taken offline. > > I talked about this with Dave Young. Currently, we tend to use > kexec_file_load more in the future since most of its implementation is > in kernel, we can get information about kernel more easilier. For the > kexec kernel loaded into hotpluggable area, we can fix it in > kexec_file_load side, we know the MOVABLE zone's start and end. As for > the old kexec_load, we would like to keep it for back compatibility. At > least in our distros, we have switched to kexec_file_load, will > gradually obsolete kexec_load. > So for this one, I suggest avoiding those > MOVZBLE memory region when searching place for kexec kernel. How does today's user-space know? > Not sure if arm64 will still have difficulty. arm64 added support for kexec_load first, then kexec_file_load. (evidently a mistake). kexec_file_load support was only added in the last year or so, I'd hazard most people using this, are using the regular load kind. (and probably don't know or care). Thanks, James