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 928D7C3ABBC for ; Tue, 6 May 2025 02:31:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 590A56B000A; Mon, 5 May 2025 22:31:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 540426B0082; Mon, 5 May 2025 22:31:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 407716B0085; Mon, 5 May 2025 22:31:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1C8766B000A for ; Mon, 5 May 2025 22:31:54 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A7D90C12FD for ; Tue, 6 May 2025 02:31:53 +0000 (UTC) X-FDA: 83410907706.20.DD20F79 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf14.hostedemail.com (Postfix) with ESMTP id B5B26100009 for ; Tue, 6 May 2025 02:31:51 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZYXaUWZK; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf14.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1746498711; a=rsa-sha256; cv=none; b=QsCkwkB9tLrAKtJ9MvfqPrSpK0mqTrAEvQZM+4sl9RKD2aEHhgGYJXRg/FDA+J0PtjtGJX nTy9GjIC0z9wheLD0zbjHN9dFuZg/GycW6EUImHF5pbnuAHMtOOC89ADPyCGmmG8Jioc0z f9jUw9h7p4nKr0lgpNt5i+Ih+LL9TBo= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZYXaUWZK; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf14.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1746498711; 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=poh4flnsblOTuXQPZPNN2P3hxWXnOplQoLoK9Oy5wOo=; b=p0teRstSWKuQrsybUwRLaK2vMY9Avyw0Y3JTa6OcjG8Hjw2f9J/cZrP0B6Gz8X4/AkAaud iKVr/9Tnf3y73en14DFQ9IJ/FJueUTuVmbQPJj6kdsRxkMMwrvUoIkD3bqt0tUq5mkWzgA BcTHph2ceKwNLjEnEtRxGF0/OwfYTLg= Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-736b0c68092so4481381b3a.0 for ; Mon, 05 May 2025 19:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746498710; x=1747103510; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=poh4flnsblOTuXQPZPNN2P3hxWXnOplQoLoK9Oy5wOo=; b=ZYXaUWZKYQP55RZGbt0BHe8kivrUEGG+xhQQPkA8V7hYzKm9RJ3exIWbqiQimSv0xZ xK+2SarBXN1L5f2PkiyOSahLi95oOJahKAVIEtX+xE8kpDzoyAqsA/8n/CUhHMucTcmB leM+RG2JXll7oDNkv5WTiTDbkXuu86eDtuvOUzhxI1DBu0mup4Ife2n/8OmOi8SZIbBi Tg0G+mMJRBYxDvVgM7KpvJt2kANvIsPnplZp4s/7mBTk5fGoiWz2ENOBXf6O155Zl3sg i6sxuoqQxLAwSEMTiLaID8stHhFS15MbTDH7nJFCbHVst5X/faI6qNx45F+EZr5tvc7o nA+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746498710; x=1747103510; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=poh4flnsblOTuXQPZPNN2P3hxWXnOplQoLoK9Oy5wOo=; b=Rt28E1wFz2kdsJkvURZmYT02QcMgNjMMLFYOY9eMuqxKY440SHNtbJocCvuANIWi/R yq2+uVbukyuCLNEW/Q672/wJwgpu9R7AlfTvNZBVfJuRmw9sdmgwWQ68nLpI8X1zn5th FO+74vUnzccu+rMr+QRjutCeI8X50U+7OBUibA7mM6kIi7EleE+3JsbbZC3D5JYhBzqO QKwWi4WUshoeLgoTNcuRg5eDoGIt0wmOSbuk0Syy2qDQ5OM+ljUzOTthxi+PrJiincDK Ih61T2jAwpy2+Ie4N9mNr8/f20+VSSX8EkCzSOwMaNYsGOPKF65L0EqBGYxV4pMrg/s7 LHyA== X-Forwarded-Encrypted: i=1; AJvYcCVDCWiEzgl/8sqbz5ANJjXPo4OnM6sMWzzqPhraDbBJ/zRF46MGleSUw4p9NH3l6oxGAwO3Qn6Azw==@kvack.org X-Gm-Message-State: AOJu0YxZ9i66KpRNYaDj++XJE+tsDsyo4szVrgvw1add1PnVW4bbPgri h0Q07SvyuYQkK6XclrclTJ1zQQAl69C7cQZHL+tWEPA9ARHEVvsjkx/Q1A== X-Gm-Gg: ASbGncvd8Qx0w2baeZGcIhn5dEvLx6NCyHgou6JqABToW9qhQL6x52UIhnHBhpW1hzi UABpMQf6sCzoJ/W89uBQQvi872JiQv3leI27yDIQRS0uXWk7UPkwCK688oVcD6HqYM8pcs8FaEn Hrsl4By2rkqPvaWSYXXkF00vkw3kAVlDthl3Omj+cDI4pTYKSixz7uIYESh6IVdWRuWuNe5LDOp 7CYYHLZB9pi9e8jS/OZyrqkSIoF9S0euL7I1qOIcDTOGlI1s9+kFnYn05tWJCYe8+Pbi1ZxOVII JYdD0zVYp9LrflBnjjj/axXAivNGk7O0xJpYPMLA X-Google-Smtp-Source: AGHT+IFm2DxJzuwGUz6BKAo8aCcTy5T+PX1t2f2NG17JtptJTbCdw+A9Vy7/npC+48IEhStxuhVLiA== X-Received: by 2002:a05:6a00:4294:b0:736:6ecd:8e32 with SMTP id d2e1a72fcca58-74058b23ef3mr18912149b3a.21.1746498710367; Mon, 05 May 2025 19:31:50 -0700 (PDT) Received: from archie.me ([103.124.138.155]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74058dbbb15sm7939011b3a.58.2025.05.05.19.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 May 2025 19:31:49 -0700 (PDT) Received: by archie.me (Postfix, from userid 1000) id 3FFBD42439E4; Tue, 06 May 2025 09:31:45 +0700 (WIB) Date: Tue, 6 May 2025 09:31:45 +0700 From: Bagas Sanjaya To: Changyuan Lyu , linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, anthony.yznaga@oracle.com, arnd@arndb.de, ashish.kalra@amd.com, benh@kernel.crashing.org, bp@alien8.de, catalin.marinas@arm.com, corbet@lwn.net, dave.hansen@linux.intel.com, devicetree@vger.kernel.org, dwmw2@infradead.org, ebiederm@xmission.com, graf@amazon.com, hpa@zytor.com, jgowans@amazon.com, kexec@lists.infradead.org, krzk@kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, luto@kernel.org, mark.rutland@arm.com, mingo@redhat.com, pasha.tatashin@soleen.com, pbonzini@redhat.com, peterz@infradead.org, ptyadav@amazon.de, robh@kernel.org, rostedt@goodmis.org, rppt@kernel.org, saravanak@google.com, skinsburskii@linux.microsoft.com, tglx@linutronix.de, thomas.lendacky@amd.com, will@kernel.org, x86@kernel.org Subject: Re: [PATCH v7 17/18] Documentation: add documentation for KHO Message-ID: References: <20250501225425.635167-1-changyuanl@google.com> <20250501225425.635167-18-changyuanl@google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7/7+Tnuu7kTtOC0+" Content-Disposition: inline In-Reply-To: <20250501225425.635167-18-changyuanl@google.com> X-Rspamd-Queue-Id: B5B26100009 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: 7tzmzczongy8a8iurbcyd17zde3o994z X-HE-Tag: 1746498711-463445 X-HE-Meta: U2FsdGVkX19OxiYTcAjYwqKYYhwSwfO9T8odwDXFsOx0dpcqiJA+DvQ5lDjQ8h487Xw52vHP9p3+MzsrHOBcPhiaa/BovC5sdAwi11U4AKjybIW3C57n/Iwm75TrYDiRRWWQ0ZONV/6OEOjCfknrs6d5idWYmoJZKxsKS7jlSwQs5cosCPAo/nPHj6idzb62qUz62oQS7j/lTKO6uAKto88cEZvUv8XyCQo2dXwtG8O4QViL7xBF8EZ11NTEo5tT47jaJaF6Va7KV6clQpAoBwaa2yjOCoNUurJXWom2Hbxd+Lg+BnqtDa77HMw20gb0AXvBfdChee0SZhEa9+QVvtRWwwqaYUXw5WUr1MlNkb9kq01NCvdazo4jbr5DbiMDogA8NMRsnCa2M+hD0B5DMt9N4QP1t75N/MLMbhGvAMunMlY+IUNufmtlwkGqvP2Bacfc9lmGHDMq+3RmjgLBC439Fa31kWddGIfWP+pkL7wNgQNCgd3o9hdYDk82Hoyn/AIfvzbUJ60ADVQ4X/sMJZ4oSTF827pe3mC71pnnJjIB5JvLH9a4/lRGlRNJz9hR9yE8xK1BtvPlXG8tTobETiB67nPzWybstPgQXu7jiqrKsdNFUyjw8q5q/TPrv1Mv2kMETlhDCwuuEHLEYOp7dqeJ98jnCyLYKyOleh7BjRuGhfkH/4pWYdHNao49iwVU8TymNBMiCrJj03bpUKR214LEghN9Gdjv6kkcGINc9gFy4yO4W6CbxBgk8p6GI/s2YtNzvd3hhsA5N2SpOn3kwNegIOeKUMbgBjNTEKQ4MY0FpZgNH1bcAVE+HXeeSktcIZgpStbYnk/Rr7uhT5lvdaKzhKzR3BFXYoYAEsh8vzxw3cwYQ6wZ+IykUPB9Zpd6wuFL6PdNwM8y8lYRhhPkxUMWjTu7/BPcigcRyQF9AQYNF+SuosIPdChFcdLwvYf5oCzCoOrX0NR2B25bKoV mGPCey47 DjDfhTz6LdE4JOdTYK7vLxoQEG6Td6gsehG570IU2fWjJKVwhtxyme1wcKRQCo3mj9rHKoAZRlubr4zWxtA5T232x75Jdp246amuxD9Zfzo3FPrYw5ewhSorQojZh9WLOOryNuIbwQubmFXE4gv0vonAk/i08Kjs6/cVw5TdvAXWGCjhOZzx8l1a1O/mVzwPjzx19C/tzWJWrJ56d1SCLKOM6oyeBQvRte+/HhhL8gOTRYHyGuuRkcLRsrgBqVTubcsb5rgH/1x4+Fh0vJNNDwIBLAbgHI/NwHHB3BmfLJpJa12+INHehWqhlMfG+YDk1IX7QyY9234XmSjZeAmJR5UvZtZQAdWruuEIwBlseWwECUSmLjRxAE2ZThGrBvYAi2jrMFicDVwJI5a8aqcHEHUIt73qNFvEEpI35ZFEX8+Fxi4DaZSBQY1Ksomf05g+uJIJW+9H5Wbiauyo= 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: List-Subscribe: List-Unsubscribe: --7/7+Tnuu7kTtOC0+ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 01, 2025 at 03:54:24PM -0700, Changyuan Lyu wrote: > +This document expects that you are familiar with the base KHO > +:ref:`concepts `. If you have not read The reference label is generic and can collide with future patches. It should've been disambiguated as kho_concepts instead. > +them yet, please do so now. > + > +Prerequisites > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +KHO is available when the ``CONFIG_KEXEC_HANDOVER`` config option is set= to y > +at compile time. Every KHO producer may have its own config option that = you when the kernel is compiled with ``CONFIG_KEXEC_HANDOVER`` set to y. > +need to enable if you would like to preserve their respective state acro= ss > +kexec. > + > ... > +First, before you perform a KHO kexec, you need to move the system into > +the :ref:`KHO finalization phase ` :: kho_finalization_phase to disambiguate label. > +Next, load the target payload and kexec into it. It is important that you > +use the ``-s`` parameter to use the in-kernel kexec file loader, as user > +space kexec tooling currently has no support for KHO with the user space > +based file loader :: > + > + # kexec -l Image --initrd=3Dinitrd -s > + # kexec -e Use full paths to kernel and initramfs image. > +``/sys/kernel/debug/kho/out/scratch_len`` > + To support continuous KHO kexecs, we need to reserve > + physically contiguous memory regions that will always stay > + available for future kexec allocations. This file describes > + the length of these memory regions. Kexec user space tooling > + can use this to determine where it should place its payload > + images. "Length of KHO scratch region, which is a physically contiguous memory regi= ons that will always available for future kexec allocations. Kexec user space tools can use this file to determine where it should place its payload imag= es." > + > +``/sys/kernel/debug/kho/out/scratch_phys`` > + To support continuous KHO kexecs, we need to reserve > + physically contiguous memory regions that will always stay > + available for future kexec allocations. This file describes > + the physical location of these memory regions. Kexec user space > + tooling can use this to determine where it should place its > + payload images. "Physical location of KHO scratch region. Kexec user space tools can use th= is file in conjunction to scratch_phys to determine where it should place its payload images." > +.. SPDX-License-Identifier: GPL-2.0-or-later > +.. _concepts: The label can be ambiguous. It should've been _kho_concepts instead. > +.. _finalization_phase: The label should be _kho_finalization_phase. > +Generally, A KHO user serialize its state into its own FDT and instructs "Generally, a KHO user ..." > +KHO to preserve the underlying memory, such that after kexec, the new ke= rnel > +can recover its state from the preserved FDT. > + Thanks. --=20 An old man doll... just what I always wanted! - Clara --7/7+Tnuu7kTtOC0+ Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSSYQ6Cy7oyFNCHrUH2uYlJVVFOowUCaBl0iQAKCRD2uYlJVVFO oy/8AP48Fa7VB0kwt+kqGg4VMR/+tEgBDGxzTX5HXZWYD5fZLQEAm6XrPJBViu5A Mpce1oumgUOmlwq+sRSgixha15i4eAo= =lxMZ -----END PGP SIGNATURE----- --7/7+Tnuu7kTtOC0+--