Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2312810pxa; Mon, 17 Aug 2020 06:44:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9usa2QJqzMFJLJp43ZI4kl8N/li2/GQMlZ9znSXzD3Lgg9c006m/EnvtQjhbqH9aqRGy4 X-Received: by 2002:aa7:d607:: with SMTP id c7mr14836156edr.184.1597671875448; Mon, 17 Aug 2020 06:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597671875; cv=none; d=google.com; s=arc-20160816; b=RtvAENbxeSIsbJ7NpUo2qNIw9DtPrPdanj014O9MvytC/fOTzNO39oXTGrUTzePmMX aDdSIhhMP3pF5B6Mg28+a/b8e4ZgnSE49tm8FqTW16rgGHYy/JsNKK+eVuJBgIcCZ6Hy h92Sxs3HapSIyv0Io9VvrvGAkC55VT8cd+xulg+VlxhhdVSPpwtzMiJI4AnJFMXvYqh1 erGRNhVefcoEX8lXU/CqeAIckUQxpS7LMnVOmqMOnikUoEL+QsAGpPdyk/GPmkN+zTQs RmPsLfOqTAT/29rDRp3BEzPgtttLPJFWcpfX0ZGsk+/X0IZn1kSZLD61vzfGBvskaSlv FDLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=7fdfPlGGz2pGnodPunxewJ9XKI7rQtGHbiMa/av/RME=; b=HRd0U6Uds2g34bk4o0N/Co03s8OnEZCDYfh0Rz3RMrU9FcSDSg0ZLEkjqGbGk71BEk 93OVr6FEqA0dvqV+ebTV0vt5P6qOVwZF3hJx9DVjp+s6DqEsFlEGzzKcgbGXsIjqlDwC t2zy803n5PO5AH7uP4S7XTvoK1NY81aYbRHtnDrAwDIDWTHJAUVsZHZ172H5twj8wy9N kqeDSD1RLnp9IA9tOWqxEfEGN1Uq9s83or4g5IoWXKI3zQS9v0GY2R4F5Gztyy96bm8m l7ECwqoaGFRAeO/gKTieV/AHafaISsVrNzRrx3UFSBoVxCO34/GgIXu0RGbtK+4y1J4t LEag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si11474571ejs.414.2020.08.17.06.44.12; Mon, 17 Aug 2020 06:44:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728790AbgHQNmc convert rfc822-to-8bit (ORCPT + 99 others); Mon, 17 Aug 2020 09:42:32 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:49358 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728779AbgHQNm1 (ORCPT ); Mon, 17 Aug 2020 09:42:27 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 11E611C0BB7; Mon, 17 Aug 2020 15:42:25 +0200 (CEST) Date: Mon, 17 Aug 2020 15:42:24 +0200 From: Pavel Machek To: Sang Yan Cc: kexec@lists.infradead.org, ebiederm@xmission.com, linux-kernel@vger.kernel.org, xiexiuqi@huawei.com, guohanjun@huawei.com, zhuling8@huawei.com, luanjianhai@huawei.com, luchunhua@huawei.com Subject: Re: [PATCH 1/2] kexec: Add quick kexec support for kernel Message-ID: <20200817134224.GA8381@bug> References: <20200814055239.47348-1-sangyan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20200814055239.47348-1-sangyan@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > +config QUICK_KEXEC > + bool "Support for quick kexec" > + depends on KEXEC_CORE > + help > + Say y here to enable this feature. ? > + It use reserved memory to accelerate kexec, just like crash uses > + kexec, load new kernel and initrd to reserved memory, and > + boot new kernel on that memory. It will save the time of > + relocating kernel. loads a new.... boots new... > IORES_DESC_DEVICE_PRIVATE_MEMORY = 6, > IORES_DESC_RESERVED = 7, > IORES_DESC_SOFT_RESERVED = 8, > +#ifdef CONFIG_QUICK_KEXEC > + IORES_DESC_QUICK_KEXEC = 9, > +#endif > }; Remove ifdef. > /* > diff --git a/include/linux/kexec.h b/include/linux/kexec.h > index 9e93bef52968..976bf9631070 100644 > --- a/include/linux/kexec.h > +++ b/include/linux/kexec.h > @@ -269,9 +269,12 @@ struct kimage { > unsigned long control_page; > > /* Flags to indicate special processing */ > - unsigned int type : 1; > + unsigned int type : 2; > #define KEXEC_TYPE_DEFAULT 0 > #define KEXEC_TYPE_CRASH 1 > +#ifdef CONFIG_QUICK_KEXEC > +#define KEXEC_TYPE_QUICK 2 > +#endif > unsigned int preserve_context : 1; Here, too. > +++ b/include/uapi/linux/kexec.h > @@ -12,6 +12,9 @@ > /* kexec flags for different usage scenarios */ > #define KEXEC_ON_CRASH 0x00000001 > #define KEXEC_PRESERVE_CONTEXT 0x00000002 > +#ifdef CONFIG_QUICK_KEXEC > +#define KEXEC_QUICK 0x00000004 > +#endif > #define KEXEC_ARCH_MASK 0xffff0000 And here. Pavel