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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 DE798C43331 for ; Tue, 31 Mar 2020 03:46:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A14E92072D for ; Tue, 31 Mar 2020 03:46:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LxEC7dNW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A14E92072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 480EE8E0001; Mon, 30 Mar 2020 23:46:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 431506B0037; Mon, 30 Mar 2020 23:46:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FA248E0001; Mon, 30 Mar 2020 23:46:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id 1578B6B0032 for ; Mon, 30 Mar 2020 23:46:26 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C27B4180AD817 for ; Tue, 31 Mar 2020 03:46:25 +0000 (UTC) X-FDA: 76654269930.16.women91_3817e34967a27 X-HE-Tag: women91_3817e34967a27 X-Filterd-Recvd-Size: 4987 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 31 Mar 2020 03:46:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585626385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4Emxfgw9v24rANWjnidLawXCzRz7ULAT99YrgVx/WFE=; b=LxEC7dNWXY5yLH1Dp3H0LFd3Qgd66P3KwOk0HVIrl1Ok3U03W6n+La4kqZZFY0aEZSyZbG KcEDoOXeypem46MiJ/s6N42JQbuIPPFV4TCUHCB+7BTNJDFyixqofg3TwpPuBe4v3pKxiV 7rGtBQdsWsOkSHXN4sjLWyciyvalQOk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-vluCViNdNKGy2R7GGm48lQ-1; Mon, 30 Mar 2020 23:46:23 -0400 X-MC-Unique: vluCViNdNKGy2R7GGm48lQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25C758017CC; Tue, 31 Mar 2020 03:46:21 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-247.pek2.redhat.com [10.72.12.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC38C953D6; Tue, 31 Mar 2020 03:46:16 +0000 (UTC) Date: Tue, 31 Mar 2020 11:46:12 +0800 From: Dave Young To: James Morse Cc: Baoquan He , Anshuman Khandual , Catalin Marinas , Bhupesh Sharma , kexec@lists.infradead.org, linux-mm@kvack.org, Eric Biederman , Andrew Morton , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 0/3] kexec/memory_hotplug: Prevent removal and accidental use Message-ID: <20200331034612.GB83248@dhcp-128-65.nay.redhat.com> References: <20200326180730.4754-1-james.morse@arm.com> <20200330135522.GE6352@MiWiFi-R3L-srv> <2bdfbb1c-49da-d476-4a38-f91937105ae3@arm.com> MIME-Version: 1.0 In-Reply-To: <2bdfbb1c-49da-d476-4a38-f91937105ae3@arm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 James, On 03/30/20 at 06:17pm, James Morse wrote: > Hi Baoquan, >=20 > 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 m= ay > >> 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. > >=20 > > 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. >=20 > > So for this one, I suggest avoiding those > > MOVZBLE memory region when searching place for kexec kernel. >=20 > How does today's user-space know? >=20 >=20 > > Not sure if arm64 will still have difficulty. >=20 > arm64 added support for kexec_load first, then kexec_file_load. (evidentl= y 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 k= now or > care). I agreed that file load is still not widely used, but in the long run we should not maintain both of them all the future time. Especially when some kernel-userspace interfaces need to be introduced, file load will have the natural advantage. We may keep the kexec_load for other misc usecases, but we can use file load for the major modern linux-to-linux loading. I'm not saying we can do it immediately, just thought we should reduce the duplicate effort and try to avoid hacking if possible. Anyway about this particular issue, I wonder if we can just reload with a udev rule as replied in another mail. Thanks Dave