From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.224 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793295050; b=JSRjUSLyE4pfGBbCg4/5jai/XHJp1DRw1wJbdDjvhq4Dr+GsWoWBZ5AVnO/spdBJHDc1 PKOiN3z/5Spo9pLyv1zTIEXtcH0akX13flbeH910qYGW4neb9JwvYcEOA04MzM6Es0u7X MzwhpK1ufjZ6USi0sKrC1W8PCpMI7FCng5icWWIzleHjRvPaTEG2zuWxfHerkI8IIf+4r kTkd8kmIFMHWC3c8uhNsanekNcAUbK9bBy7myhUYU2DttN7sCwdJNb4r50bc1rcQiS5qR OMUqKqknNoVrDCEafX5AvdLmhcZTx1DUHhhI7fjXmYn71nTuP0oR6Jj3sfnYL7jMm2Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793295050; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=rBVVW3tHabgwrKT2QwycDYkPKCsMYjmGYVvwfvGvrhE=; b=4qB5VRFpXugXKIdFxpPGpRcaPVveOX5A45toz/dadB3Xp6dm4ZBk3s2zzYdDf57YB2bs jmcLup2VdezsCmRa57Y1xB8EbJZ/8BfeTRmGR/nWRjAWSmlPKk4cWyddo6jv0fx1CZygI WATsWLZ5rND0jKx6G8/aDRAoGsmM3dViZeRFFx8DBJ/duFMua9i7iTu5aWFEYN3sHIvfw 5YYP1SCWm4YPiBuDwMZyXHnvYqYx36mjpm+L58jghoXvWW2KWXL+jkMlvq6n3dB5pnehN 5qGXSBco6ckQP2gqJhgp0tWjlNP6GqcOfU7LYM6MMzYmWyh/lPog+uIUx/ucdtgTwkA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=HC6izpFB; arc=none smtp.remote-ip=95.215.58.224 Received: from mta1.migadu.com (out-224.mta1.migadu.com [95.215.58.224]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10E8F606A32C for ; Thu, 29 Oct 2026 17:30:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 10E8F606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=HC6izpFB X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=7EdBEd5XL5wRdZvYlylGxvVrrhD/K6K3u333eKYP51c=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793295047; v=1; x=1793899847; b=HC6izpFBgx9Os0a9ApbmT2Glk501euie4yvJGNNb7zQBjlxydSGvilwWczTel/QZIX6ywO4n MTUMT5QvMBh0ouFgHp4Nv4X3nrI2oItKbxYRkNG+LllR7xNIV3QSufQWwP14HJ5/bGcN9HFVUX0 L2/ocLWMVGp1/+3XWj/tMaXk= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 155dc8602c7bb9c2; Thu, 29 Oct 2026 17:30:46 +0000 X-Mizu-Trace-ID: 155dc8602c7bb9c2 X-Migadu-Flow: FLOW_OUT From: George Guo To: rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org, chenhuacai@kernel.org, ardb@kernel.org, shuah@kernel.org Cc: ilias.apalodimas@linaro.org, akpm@linux-foundation.org, baoquan.he@linux.dev, ruirui.yang@linux.dev, guodongtai@kylinos.cn, kernel@xen0n.name, graf@amazon.com, liukexin@kylinos.cn, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH v6 4/8] kho: Add kho_disable() Date: Fri, 30 Oct 2026 02:29:51 +0900 Message-ID: <20261029172956.20791-5-dongtai.guo@linux.dev> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261029172956.20791-1-dongtai.guo@linux.dev> References: <20261029172956.20791-1-dongtai.guo@linux.dev> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: George Guo On LoongArch, KHO state is passed to the next kernel only through an EFI configuration table. Only the EFI stub installs this table, during a cold boot. A kernel entered through kexec does not run the EFI stub, so it cannot create the table if the previous kernel did not provide one. Without the table, it cannot pass KHO state to the next kernel on a subsequent kexec. Add kho_disable() so architecture code can turn KHO off when the EFI configuration table is missing. Signed-off-by: George Guo --- include/linux/kexec_handover.h | 3 +++ kernel/liveupdate/kexec_handover.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/include/linux/kexec_handover.h b/include/linux/kexec_handover.h index ef2b188c8ed0..6f80e1b0ccd4 100644 --- a/include/linux/kexec_handover.h +++ b/include/linux/kexec_handover.h @@ -15,6 +15,7 @@ struct page; #ifdef CONFIG_KEXEC_HANDOVER bool kho_is_enabled(void); +void kho_disable(void); bool is_kho_boot(void); int kho_preserve_folio(struct folio *folio); @@ -54,6 +55,8 @@ static inline bool kho_is_enabled(void) return false; } +static inline void kho_disable(void) { } + static inline bool is_kho_boot(void) { return false; diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c index 74c4633f5afc..3280533eaebe 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -82,6 +82,15 @@ static int __init kho_parse_enable(char *p) } early_param("kho", kho_parse_enable); +/* + * For architecture code that finds, after the early parameters are parsed, + * that it cannot pass the KHO state to the next kernel. + */ +void __init kho_disable(void) +{ + kho_enable = false; +} + struct kho_out { void *fdt; struct mutex lock; /* protects KHO FDT */ -- 2.53.0