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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FF3DC433EF for ; Mon, 4 Jul 2022 07:52:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E8746B0073; Mon, 4 Jul 2022 03:52:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 998DD8E0002; Mon, 4 Jul 2022 03:52:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8600B8E0001; Mon, 4 Jul 2022 03:52:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 76E796B0073 for ; Mon, 4 Jul 2022 03:52:47 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C8E9752BD for ; Mon, 4 Jul 2022 07:19:09 +0000 (UTC) X-FDA: 79648566060.26.FB876C0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf23.hostedemail.com (Postfix) with ESMTP id A8AF0140169 for ; Mon, 4 Jul 2022 07:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656919148; 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: in-reply-to:in-reply-to:references:references; bh=XZvdib+oo3lvrA14EYB6RpofmfTNnpFnXxq1/Do0txY=; b=RVgyP0uv9dKOCvZY7PR0BzivTRLeLLuDK795CR18Av1wuYBL9ACvhPfAjt/5OcH3SfOM7a 8WYpVV16YSE0zWptLGqJuuUKcJMOJblp8Bf+tCceLWHQvuHYChiZeLT5Vp0Fic0TMUttzf KA6Pm361UWEmvvU4N65PkNQsN6XcE+I= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-83--XgrCsv1Pl-eKhp29ATjdw-1; Mon, 04 Jul 2022 03:19:06 -0400 X-MC-Unique: -XgrCsv1Pl-eKhp29ATjdw-1 Received: by mail-wm1-f69.google.com with SMTP id k5-20020a05600c0b4500b003941ca130f9so3709681wmr.0 for ; Mon, 04 Jul 2022 00:19:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XZvdib+oo3lvrA14EYB6RpofmfTNnpFnXxq1/Do0txY=; b=bt2BTODMSlKrJ9xUAGV9aDkechLFLAUR5ivRMyYgfudUd6kd7VbOgl6hauOx760KPi snIT7oNUe5nNkHlZts0YvI6Zw5mL2AGSY+3x0+1a9aGO5gPM0l8oLqhAN8ZKf6Kdeisg 6t9+5PZsxPmNbI/5o0kTqlB4UvfTVhWSZd1n0hh0vmGDFIF615qDc+hcINNj/u938wCK V9naE264WCGbuf+I5Vcc4Tq3sqnuF10ZndjPRySHtwjV1J83vxI3yyLd2tJ1G+HTbzAW tupVJX3B1FGWCAjcYD4K5MOK13ak0jsaTw/hE5WY3lpd180v7o6lx4PBFtD+7qXYXZym jOMw== X-Gm-Message-State: AJIora81Xw9uOM3OICyPiCXhYi+V4a8v5nSLAKDWwpdNzJM7QwEhnHGH crbz4L1yrBTr+9T+gfSbpdTm2TGNMb1CKurGLu1TPRHoNCj/T0sgOVC+avhIFnNh3+6kkNCLd3G b2YXeSufTvGA3Hvp65dSIYDTJwyc= X-Received: by 2002:a7b:cd08:0:b0:3a0:37f9:6e5d with SMTP id f8-20020a7bcd08000000b003a037f96e5dmr29297896wmj.167.1656919145763; Mon, 04 Jul 2022 00:19:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tkdZbo2UPOn3erwRwVBiaO/vhxvuXgkMCqyD6lyQOAT9BAwU6xS4YUbV77VaB9q2ElZmkyOxqjB6Wsp4Bc8ZM= X-Received: by 2002:a7b:cd08:0:b0:3a0:37f9:6e5d with SMTP id f8-20020a7bcd08000000b003a037f96e5dmr29297854wmj.167.1656919145478; Mon, 04 Jul 2022 00:19:05 -0700 (PDT) MIME-Version: 1.0 References: <20220614120231.48165-1-kirill.shutemov@linux.intel.com> <20220614120231.48165-12-kirill.shutemov@linux.intel.com> <6be29d38-5c93-7cc9-0de7-235d3f83773c@intel.com> <87a6a3aw50.fsf@email.froward.int.ebiederm.org> <20220624020005.txpxlsbjbebf6oq4@black.fi.intel.com> <20220628235105.z6ytdzxofrdkjti4@black.fi.intel.com> <88fe385c-fe40-d659-5081-7f3cdd9493e4@intel.com> <20220629005915.gieli3dbjzvjbk5i@black.fi.intel.com> In-Reply-To: <20220629005915.gieli3dbjzvjbk5i@black.fi.intel.com> From: Dave Young Date: Mon, 4 Jul 2022 15:18:54 +0800 Message-ID: Subject: Re: [PATCHv7 11/14] x86: Disable kexec if system has unaccepted memory To: "Kirill A. Shutemov" Cc: Dave Hansen , "Eric W. Biederman" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , Mike Rapoport , David Hildenbrand , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , kexec@lists.infradead.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RVgyP0uv; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf23.hostedemail.com: domain of ruyang@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=ruyang@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656919148; a=rsa-sha256; cv=none; b=Sz+z/uPkPshm9hkM1I2/aCmfkJiNulIQOlLhtFlik1YtoI03TDapm0DAm5pcvT3mUouUnI oKPWmAiG+X9F16V+qZpfU2RmZI78ECn3uCBuhgv4rlDaOBwHuKBg9SF+ePyZLh4uhmATEN zJSJd+Il8zGj7yeRIBxr4X1iAXlWdtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656919148; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XZvdib+oo3lvrA14EYB6RpofmfTNnpFnXxq1/Do0txY=; b=BwOmO5uRSEGJQgOOXuYIoSnJsW+gf4zOaRxXTT++EQQqOrQM/BR1y1MlaTHyHOJhoobrBK MO2CuZJRb8wLoc3stC4SkBbH3PAO72ckZvDGtqK/QCHHwSa7G0W6nfkvAloaaGOK6fOh2R bkmPdw4a7bgor5XiAjySZ7nefoSNORY= Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RVgyP0uv; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf23.hostedemail.com: domain of ruyang@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=ruyang@redhat.com X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: na8zjc6x64hmxx314tcpyges37fgaotx X-Rspamd-Queue-Id: A8AF0140169 X-HE-Tag: 1656919148-255213 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 Wed, 29 Jun 2022 at 08:59, Kirill A. Shutemov wrote: > > On Tue, Jun 28, 2022 at 05:10:56PM -0700, Dave Hansen wrote: > > On 6/28/22 16:51, Kirill A. Shutemov wrote: > > > On Fri, Jun 24, 2022 at 05:00:05AM +0300, Kirill A. Shutemov wrote: > > >>> If there is some deep and fundamental why this can not be supported > > >>> then it probably makes sense to put some code in the arch_kexec_load > > >>> hook that verifies that deep and fundamental reason is present. > > ... > > > + /* > > > + * TODO: Information on memory acceptance status has to be communicated > > > + * between kernel. > > > + */ > > > > So, the deep and fundamental reason is... drum roll... you haven't > > gotten around to implementing bitmap passing yet?!?!? I have the > > feeling that wasn't what Eric was looking for. > > The deep fundamental reason is that everything cannot be implemented and > upstreamed at once. If the only thing is to pass bitmap to kexec kernel, since you have reserved the bitmap memory I guess it is straightforward to set the kexec bootparams.unaccepted_memory as the old value. Not sure if there are problems when the decompress code accepts memory again though. for kernel kexec_file_load, refer to function setup_boot_parameters() in arch/x86/kernel/kexec-bzimage64.c for kexec_file_load, for kexec-tools kexec_load code refer to setup_linux_system_parameters() kexec/arch/i386/x86-linux-setup.c Thanks Dave