From patchwork Fri Dec 22 19:35:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 182763 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1289075dyi; Fri, 22 Dec 2023 11:38:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpfAvJRY79h94jXiO4Qr2pK4RluQleAtlFbm6HYiAa+tHZnhD1fwm7JHnDNLMPraoMzmnv X-Received: by 2002:a50:d55c:0:b0:554:1100:99e9 with SMTP id f28-20020a50d55c000000b00554110099e9mr2000023edj.9.1703273908766; Fri, 22 Dec 2023 11:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703273908; cv=none; d=google.com; s=arc-20160816; b=In9HPBpeztfsnOeQPjR+TISozaDoOKTvL7hVob/UUQV5Aff084o8naBaq/QpVQfKmy AE0p+uvrsRWMr9lvr7l+14myq8ew9lngWz82lXEPjPvqApKiwPb9eMFavJsvW1iIybIR IAKthl0KwP70dtfMnLfHTOu+SrrBf5w/OPHy5VSv0PJqwLNnIEO3ahKKlRbXE40gQrkZ +q3OocEDJ6NfueXV9L/swqWIitoE5XMUGbSsd0/2NLcKBhLSOe7u3S1q9+SqFEaFnhGw Kr9G9mUn+cA4xethiRWk/Zsx2vjkuTtrNashIJqQKUUHzGTFwVg3LGpFjQLOAjXnxivs UegQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZLYCMQzZdYknax/wRIALOVvHrvD35sO3OPXkV3K/85M=; fh=xprWcyUKTLi4rhte7gFCvduD673j12awuFkCPnYDQVY=; b=x6D/JVVn9Buxp3eQk0nx9Qqp6MEE+uNj0RSOgz+7PIXHzebJkyBFeSBfN2RjCbsj6H Izg2ajzYqpS9+WzpDyTvxvAPqcWZAv0jmrVQspFv9k1Iq7C/2Iu8ziT/ckze30Buc1w2 Tu+1CrRX6JGJRhM0yhyZeCZm+AYWkvzmhtWa/7MCgvwxCxlOybcfmILNDm7E67qQt4ez EfIZj7YoAFLn/DRHOse8uLlsovCZUpIFj1IvcX8QrYti5wNu24RD7Tr0hGQYgrjRgX6P zNKOgwzhhvjxALykaOFCE2viC++uyiLVv3kdHdHykiFRzUl9qbrcpjfBY/NhFWCRgNE5 6MLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=Cx61cJb6; spf=pass (google.com: domain of linux-kernel+bounces-10021-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10021-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id co6-20020a0564020c0600b005543b5e806bsi1316630edb.527.2023.12.22.11.38.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 11:38:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10021-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=Cx61cJb6; spf=pass (google.com: domain of linux-kernel+bounces-10021-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10021-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 624471F235DD for ; Fri, 22 Dec 2023 19:38:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D8282E82B; Fri, 22 Dec 2023 19:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="Cx61cJb6" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-fw-52003.amazon.com (smtp-fw-52003.amazon.com [52.119.213.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3FE02E62D; Fri, 22 Dec 2023 19:37:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1703273851; x=1734809851; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZLYCMQzZdYknax/wRIALOVvHrvD35sO3OPXkV3K/85M=; b=Cx61cJb6X+azik7tFKGVmv+46fSg7qLmyc/DyGaQHGMegSLYqTnjd82/ pU9DuIlFrASEE11fGenc8ab38nEA05T6FTI03DrCGScwK7Eg9aKaUPJcH NKWMJ0xD1SQFrKgBbRf9vikPB8p93LX3Y348q4rUk1eq2EUXoMmSOflSA o=; X-IronPort-AV: E=Sophos;i="6.04,297,1695686400"; d="scan'208";a="627319050" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1a-m6i4x-b5bd57cf.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-52003.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2023 19:37:28 +0000 Received: from smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev (iad7-ws-svc-p70-lb3-vlan3.iad.amazon.com [10.32.235.38]) by email-inbound-relay-iad-1a-m6i4x-b5bd57cf.us-east-1.amazon.com (Postfix) with ESMTPS id C66E4499DC; Fri, 22 Dec 2023 19:37:21 +0000 (UTC) Received: from EX19MTAUWB001.ant.amazon.com [10.0.21.151:42367] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.15.218:2525] with esmtp (Farcaster) id 7d43c3c0-a068-40c5-899c-569b1b9ac52f; Fri, 22 Dec 2023 19:37:20 +0000 (UTC) X-Farcaster-Flow-ID: 7d43c3c0-a068-40c5-899c-569b1b9ac52f Received: from EX19D020UWC004.ant.amazon.com (10.13.138.149) by EX19MTAUWB001.ant.amazon.com (10.250.64.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 22 Dec 2023 19:37:20 +0000 Received: from dev-dsk-graf-1a-5ce218e4.eu-west-1.amazon.com (10.253.83.51) by EX19D020UWC004.ant.amazon.com (10.13.138.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 22 Dec 2023 19:37:16 +0000 From: Alexander Graf To: CC: , , , , , , , Eric Biederman , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , "Rob Herring" , Steven Rostedt , "Andrew Morton" , Mark Rutland , "Tom Lendacky" , Ashish Kalra , James Gowans , Stanislav Kinsburskii , , , , Anthony Yznaga , Usama Arif , David Woodhouse , Benjamin Herrenschmidt Subject: [PATCH v2 06/17] kexec: Add config option for KHO Date: Fri, 22 Dec 2023 19:35:56 +0000 Message-ID: <20231222193607.15474-7-graf@amazon.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231222193607.15474-1-graf@amazon.com> References: <20231222193607.15474-1-graf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D037UWB001.ant.amazon.com (10.13.138.123) To EX19D020UWC004.ant.amazon.com (10.13.138.149) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786012142441176587 X-GMAIL-MSGID: 1786012142441176587 We have all generic code in place now to support Kexec with KHO. This patch adds a config option that depends on architecture support to enable KHO support. Signed-off-by: Alexander Graf --- kernel/Kconfig.kexec | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec index 2fd510256604..909ab28f1341 100644 --- a/kernel/Kconfig.kexec +++ b/kernel/Kconfig.kexec @@ -91,6 +91,19 @@ config KEXEC_JUMP Jump between original kernel and kexeced kernel and invoke code in physical address mode via KEXEC +config KEXEC_KHO + bool "kexec handover" + depends on ARCH_SUPPORTS_KEXEC_KHO + depends on KEXEC + select MEMBLOCK_SCRATCH + select LIBFDT + select CMA + help + Allow kexec to hand over state across kernels by generating and + passing additional metadata to the target kernel. This is useful + to keep data or state alive across the kexec. For this to work, + both source and target kernels need to have this option enabled. + config CRASH_DUMP bool "kernel crash dumps" depends on ARCH_SUPPORTS_CRASH_DUMP