Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2881899pxa; Mon, 17 Aug 2020 23:53:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZAlFkfLBs039v/7RvkBBJY1n02Nm28w7DMVDTwcD4sY0MsAytmIBFrSxixDTMg4Smxtqj X-Received: by 2002:aa7:d1c6:: with SMTP id g6mr19004608edp.232.1597733609467; Mon, 17 Aug 2020 23:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597733609; cv=none; d=google.com; s=arc-20160816; b=nbSPkhcMxmKJ+2Mj+JoAI/DE164l1K/5WZta26b/WAoANcxy8fb0BNIbksYsJFMagd 3XyYn7ypBp3Y4eQU1cKA8sYvYdx0pGAyydJ8NMjCoOd8rII+9bZnfT2l9suYEgftsx7s rnLy50GHaJjINxPupnvW6WJywxQSSZYKKeMdzfzUmwR38mRzcRrpKPi2YYh1ZdzDCRne b0pLJwxKvJMYR+9QNnMCn3S6Wah58QjQLhd3zp1mFYPhZpeKTZZtV/qgRVP8ZXqgVSUZ wm1GMhnrAB4D8eYrRAeM3y9Up0VfoWc0tZmwlz6ij4YjUdLA2a1Ryn9r++/U/69wReP4 Mxbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=OurvVp5CHdfdhWH+xzkMR3qZFVbShp/8aHkuKZ0dlg8=; b=RTl89zYbUd2apzVWDtvB/q5ldI9qDKKq3ohnzpCi2ka/xcMqLt0ohBnuKfRZqBoRbV QCZq4aMOEk3J7UfqhjcA/OrnZX5/rxOHun0gnc8P1pid//WaHq1UKM9Xh5aE8nYlcmHq 3twb+oeDYhX5/oRDxlksNGndDon6leEOwERYcvfd5H/YRGG1tZqQF2ycNBggrwuj/vz4 ivTkjOWkqvZ9jzChp+wF7UH5v05BTvHuznmFV/6TgiGnyFp09uxHQqKZZgcALo7HEN6q FbEtAMuIN2Tym8SxFWHufxTeD4EtdO9YsBgC6dlKYPeyFx7Ra11EO/yIIJ2ew49+WEBw qpRg== 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 by18si12395130ejb.185.2020.08.17.23.53.06; Mon, 17 Aug 2020 23:53:29 -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 S1726731AbgHRGuL (ORCPT + 99 others); Tue, 18 Aug 2020 02:50:11 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:52104 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726228AbgHRGuJ (ORCPT ); Tue, 18 Aug 2020 02:50:09 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 33B4020B6310118DD2DE; Tue, 18 Aug 2020 14:50:06 +0800 (CST) Received: from [127.0.0.1] (10.108.235.113) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Tue, 18 Aug 2020 14:49:56 +0800 Subject: Re: [PATCH 1/2] kexec: Add quick kexec support for kernel To: Pavel Machek CC: , , , , , , , References: <20200814055239.47348-1-sangyan@huawei.com> <20200817134224.GA8381@bug> From: Sang Yan Message-ID: <97b12762-cee1-67fd-2c6f-b0bfe1cf14fc@huawei.com> Date: Tue, 18 Aug 2020 14:49:56 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200817134224.GA8381@bug> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.108.235.113] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/17/2020 9:42 PM, Pavel Machek wrote: > 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 > > . > Thanks a lot for your review. Sang Yan.