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.4 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,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 09813C2BB55 for ; Sun, 12 Apr 2020 05:35:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9422820692 for ; Sun, 12 Apr 2020 05:35:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cKjUvc6Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9422820692 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 0B7EC8E00BF; Sun, 12 Apr 2020 01:35:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 040B88E0007; Sun, 12 Apr 2020 01:35:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E4ADE8E00BF; Sun, 12 Apr 2020 01:35:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0059.hostedemail.com [216.40.44.59]) by kanga.kvack.org (Postfix) with ESMTP id C89298E0007 for ; Sun, 12 Apr 2020 01:35:25 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7AF8A40C0 for ; Sun, 12 Apr 2020 05:35:25 +0000 (UTC) X-FDA: 76698090210.17.birth72_698257f156328 X-HE-Tag: birth72_698257f156328 X-Filterd-Recvd-Size: 7440 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Sun, 12 Apr 2020 05:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586669724; 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=VNHbBWHFmvu7Xd6pdBfYIvVGl+F5MeR3LAi8SFTjJV4=; b=cKjUvc6Qs98MKGZfcQ6fNtwI1wqlgNh7ywi3kOGrD2LZv6wm+tQYSGYmUyF88ZhfphLthY QT22nYLoiCWWzHiCpMMcIl+r7MJaC3VM0zQEp32wkfZ3oPDPMiwK8Zg1pjSzVH4AyNNfYX ncydtlQKuMuJBlbn7MqPj7DzPAIm1rw= 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-110-PoPXfklnMiGWmnP1PBuDoQ-1; Sun, 12 Apr 2020 01:35:16 -0400 X-MC-Unique: PoPXfklnMiGWmnP1PBuDoQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B805800D5B; Sun, 12 Apr 2020 05:35:14 +0000 (UTC) Received: from localhost (ovpn-12-60.pek2.redhat.com [10.72.12.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94E0860BE2; Sun, 12 Apr 2020 05:35:10 +0000 (UTC) Date: Sun, 12 Apr 2020 13:35:07 +0800 From: Baoquan He To: Russell King - ARM Linux admin Cc: Andrew Morton , David Hildenbrand , Catalin Marinas , Bhupesh Sharma , Anshuman Khandual , kexec@lists.infradead.org, linux-mm@kvack.org, James Morse , Eric Biederman , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/3] kexec: Prevent removal of memory in use by a loaded kexec image Message-ID: <20200412053507.GA4247@MiWiFi-R3L-srv> References: <9cb4ea0d-34c3-de42-4b3f-ee25a59c4835@redhat.com> <72672e2c-a57a-8df9-0cff-8035cbce7740@redhat.com> <34274b02-60ba-eb78-eacd-6dc1146ed3cd@arm.com> <80e4d1d7-f493-3f66-f700-86f18002d692@redhat.com> <20200410121013.03b609fd572504c03a666f4a@linux-foundation.org> <20200411034414.GH2129@MiWiFi-R3L-srv> <20200411093009.GH25745@shell.armlinux.org.uk> MIME-Version: 1.0 In-Reply-To: <20200411093009.GH25745@shell.armlinux.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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: On 04/11/20 at 10:30am, Russell King - ARM Linux admin wrote: > On Sat, Apr 11, 2020 at 11:44:14AM +0800, Baoquan He wrote: > > Because We tend to use kexec_file_load more and improve/enhance it in t= he > > future, and gradually obsolete the old kexec_load interface which this > > patchset is trying to fix on.=20 >=20 > That's not going to happen; 32-bit ARM kexec uses the kexec_load > interface rather than the kexec_file_load version, and I see no one > with any interest in changing that - and there's users of the former. >=20 > I don't see how it's possible to convert 32-bit ARM kexec to the > kexec_file_load interface - this assumes that all you have are the > kernel, initrd, and commandline, but on 32-bit ARM kexec, we have > kernel, initrd and the dtb blob which the user can specify. Well, I understand what you said about 32-bit ARM support with only kexec_old support thing. That's why I said we tend to obsolete it 'GRADUALLY'. It's the existing users who are using kexec_load, and the ARCHes which only has kexec_load, make us have to transfer to kexec_file_load gradually. Comparing with kexec_load, kexec_file_load has only one disadvantage, that is some ARCHes only have kexec_load. Otherwise, kexec_file_load benefits kexec/kdump developping/maintaining very much. The loading job of kexec_file_load is mostly done in kernel, we can get whatever we want about kernel information very conveniently to do anything needed. For the kexec_load interface, the loading job is mostly done in userspace, we have to export kernel information to procfs, sysfs, etc, then parse them in kexec_tools, finally passed it to kernel part of kexec loading. The gradual obsoleting means we may only add feature/improvement/enhancement to kexec_file_load. And if a bug fix is needed for both kexec_load and kexec_file_load, and the fix is very complicated, we may only fix it in kexec_file_load too. Kexec_file_load interface is suggested to add if does't have, just port user space part to kernel as x86/s390/arm64 have done. Surely, it doesn't mean we don't fix the critical/blocker bug with kexec_load loading. We still try to do, just are not so eager. In the existing product environment, the kexec_load is used, just keep using it. Do we bother to change it to kexec_file_load, e.g in our RHEL7 distros? Certainly not. But in our new product, we will change to use kexec_file_load interface. I guess this is similar with arm64. The advantage and benefit have been told in the 2nd paragraph. As for 32-bit ARM, is it like the old product, we have many in-use systems deployed in customers' laboratory? Wondering if ARM continues designing new 32-bit ARM cpu, and some companies continue producing tons of 32-bit AR= M cpus. If yes, I think we need continue taking care of kexec_load if 32-bit ARM can't convert to kexec_file_load. If not, it may be not a barrier when we consider converting kexec_load to kexec_file_load in other ARCHes. We just need keep using it, try to fix those critical/blocker bug in kexec_load interface if encountered. Finally, comning back to this patchset itself, the issue James spotted is not so ciritical, I would say. When I do kexec jumping, I will do loading firstly, then trigge jumping. I can think of the case that people may load kexec-ed kernel, then do something else, later she/he triggers the kexec jumping. These are not necessary steps. As Dave and I replied to James in the cover-letter thread, adding a systemd service of kexec loading, monitor hotplug uevent, reload it if any hot remove happened. This is quite easy to do, I don't see any problem with it, and why we don't do like this.=20 My personal opinion, please tell if I miss anything. >=20 > So, if we wanted to obsolete the kexec_load interface, _first_ there > needs to be a way to provide users with the existing functionality > they have already in place on 32-bit ARM - otherwise we're looking > at a userspace regression. Especially as kexec_file_load takes > precedence on some distro patched versions of the kexec tool, > irrespective of which interface the user requests of the tool. >=20 > --=20 > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbp= s up >=20