From nobody Tue Jun 9 00:59:52 2026 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 A4FF239A06B for ; Mon, 25 May 2026 06:28:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690506; cv=none; b=ujugpR/K6r3ueA0/g1K/BbAljWYv3qg6uM9yugvp2invzsH4s16Kk0Fz8UMXRozFpVj32TBUXxDOJ9QDACiZz4rKjn4p1zw21Cky9fu6sFw3b0U42eXm1PG8EEMcvWDC4UEgku1P8meQXS4ZVL6tlL3SDZo/zi68JGO76q4Oduo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690506; c=relaxed/simple; bh=47XrFlb1dzY3YvIYk9Rbrd7Ttz0GaDQ9JtQbuBkkxYs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Uup86D/p4u4yz4Z+kbNm7Bb5JYpIp7IsdZviTGfiSCY12ru4GeK1XTOlHdCgMikybDMU6EJV85zBYHj8zCfufb3/+WxRGv5U5lGh44P/U1+0TGjVNZ/M7r+RwmOPhKqSqaJy3cKx5yqFvarLpOz9eDZHJdNFv3lut9wo870q9xY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=NPvavMM7; arc=none smtp.client-ip=95.215.58.187 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) header.d=linux.dev header.i=@linux.dev header.b="NPvavMM7" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779690501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RQwJVQQJjFYaN+yiFzOfDgwbwCm5RC8KKUcRaw9Pru0=; b=NPvavMM7LwpyRPOk7aLy9mf3jwBIuy2kBfc/x0X7+veNaUruj/PKBV9g3H44cZGIqQOtqN z5a7J/msPcok+wpXXNboGsyf/g3pC+OABmW5zuB0p0D1VJ/ZG5lvhGIBmzeBHKH3aQRs10 96vEyP3OkIMyCnw1q7e8sKiXci2FbPc= From: George Guo To: chenhuacai@kernel.org, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org Cc: kernel@xen0n.name, graf@amazon.com, shuah@kernel.org, loongarch@lists.linux.dev, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, George Guo , Kexin Liu Subject: [PATCH 1/7] LoongArch: Add KHO basic support Date: Mon, 25 May 2026 14:28:04 +0800 Message-Id: <20260525062810.103367-2-dongtai.guo@linux.dev> In-Reply-To: <20260525062810.103367-1-dongtai.guo@linux.dev> References: <20260525062810.103367-1-dongtai.guo@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: George Guo Enable Kexec Handover on LoongArch64: - Kconfig: select ARCH_SUPPORTS_KEXEC_HANDOVER for 64BIT - machine_kexec_file: add cmdline_add_kho() to pass the KHO FDT and scratch buffer addresses to the next kernel via the "kho_handover=3D" command-line parameter - setup: parse "kho_handover=3D" early and call kho_populate() to hand memory regions to the KHO core Co-developed-by: Kexin Liu Signed-off-by: Kexin Liu Signed-off-by: George Guo --- arch/loongarch/Kconfig | 3 +++ arch/loongarch/kernel/machine_kexec_file.c | 22 ++++++++++++++++++ arch/loongarch/kernel/setup.c | 27 ++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 606597da46b8..d494418545f5 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -684,6 +684,9 @@ config ARCH_SUPPORTS_KEXEC config ARCH_SUPPORTS_KEXEC_FILE def_bool 64BIT =20 +config ARCH_SUPPORTS_KEXEC_HANDOVER + def_bool 64BIT + config ARCH_SELECTS_KEXEC_FILE def_bool 64BIT depends on KEXEC_FILE diff --git a/arch/loongarch/kernel/machine_kexec_file.c b/arch/loongarch/ke= rnel/machine_kexec_file.c index 5584b798ba46..ddf4d0e0e7fd 100644 --- a/arch/loongarch/kernel/machine_kexec_file.c +++ b/arch/loongarch/kernel/machine_kexec_file.c @@ -55,6 +55,24 @@ static void cmdline_add_initrd(struct kimage *image, uns= igned long *cmdline_tmpl *cmdline_tmplen +=3D initrd_strlen; } =20 +#ifdef CONFIG_KEXEC_HANDOVER +/* Add "kho_handover=3D@,@= " to cmdline. */ +static void cmdline_add_kho(struct kimage *image, unsigned long *cmdline_t= mplen, + char *modified_cmdline) +{ + int n; + + if (!image->kho.fdt || !image->kho.scratch) + return; + + n =3D sprintf(modified_cmdline + *cmdline_tmplen, + "kho_handover=3D0x%llx@0x%llx,0x%lx@0x%llx ", + (u64)PAGE_SIZE, image->kho.fdt, + image->kho.scratch->bufsz, (u64)image->kho.scratch->mem); + *cmdline_tmplen +=3D n; +} +#endif + #ifdef CONFIG_CRASH_DUMP =20 static int prepare_elf_headers(void **addr, unsigned long *sz) @@ -220,6 +238,10 @@ int load_other_segments(struct kimage *image, cmdline_add_initrd(image, &cmdline_tmplen, modified_cmdline, initrd_load= _addr); } =20 +#ifdef CONFIG_KEXEC_HANDOVER + cmdline_add_kho(image, &cmdline_tmplen, modified_cmdline); +#endif + if (cmdline_len + cmdline_tmplen > COMMAND_LINE_SIZE) { pr_err("Appending command line exceeds COMMAND_LINE_SIZE\n"); ret =3D -EINVAL; diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c index 839b23edee87..5934ba6f13e3 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c @@ -48,6 +48,7 @@ #include #include #include +#include =20 #define SMBIOS_BIOSSIZE_OFFSET 0x09 #define SMBIOS_BIOSEXTERN_OFFSET 0x13 @@ -227,6 +228,32 @@ static int __init early_parse_mem(char *p) } early_param("mem", early_parse_mem); =20 +#ifdef CONFIG_KEXEC_HANDOVER +static int __init early_parse_kho(char *p) +{ + phys_addr_t fdt_addr, scratch_addr; + u64 fdt_size, scratch_size; + + if (!p) + return -EINVAL; + + fdt_size =3D memparse(p, &p); + if (*p++ !=3D '@') + return -EINVAL; + fdt_addr =3D memparse(p, &p); + if (*p++ !=3D ',') + return -EINVAL; + scratch_size =3D memparse(p, &p); + if (*p++ !=3D '@') + return -EINVAL; + scratch_addr =3D memparse(p, &p); + + kho_populate(fdt_addr, fdt_size, scratch_addr, scratch_size); + return 0; +} +early_param("kho_handover", early_parse_kho); +#endif + static void __init arch_reserve_vmcore(void) { #ifdef CONFIG_PROC_VMCORE --=20 2.25.1 From nobody Tue Jun 9 00:59:52 2026 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (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 9BB1D39B943 for ; Mon, 25 May 2026 06:28:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690508; cv=none; b=YqD4e0tFiTPnMoJ/owEegSVkjaZizkxzTR0DERxYCqVbaTFmcdunB86nFb8ZCN0bl5B+ZJHJSTn7OekKYgBDO/Zqv2Pdgjakt8sn5w10FnjRCIAeotbnkzBng+qLuPPQ02cvZgY1HA1tydZ42h672q0sgLG0pjPj5FVfYymPqjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690508; c=relaxed/simple; bh=Qpr3XO2rxFFX6hw2+sXMysT4YY8wb+1oEA/BSd+p+r0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tschbRbNd0sCT8ySrI7NF9BTtM2u2+BunhiK/FL6k1DPq6VrN40s+Ocv5zpepuhc1AiIiSGdH42UKXetAfGML0xyA5WpF6GAkoHf+ECnkoEG5rlEOcKIcVWvIyWwMMLa9c66WuSA0dflq68M4UwFfpeunJCxUKJ0KOQTZFLgVAg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=TJY4PHJq; arc=none smtp.client-ip=95.215.58.173 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) header.d=linux.dev header.i=@linux.dev header.b="TJY4PHJq" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779690504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hy1vnl/axXCuEJYWaxw1gEfqOcge1HsYtjEucBp1X78=; b=TJY4PHJqDlB3R77odWscnhSPPbwm9H68wWAZvxNyZIAtIklolvIxjfMXKeb+NlAfpqT5dM iEXiI1ZDh46GVM25OWf66JkFgGsp7DlsCDcu2btbWbtLcDL2T03HdRgZPj6yOsrPGbZkUp sKLcM+2MPj8jAP+t2bhDr7srZO32iPs= From: George Guo To: chenhuacai@kernel.org, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org Cc: kernel@xen0n.name, graf@amazon.com, shuah@kernel.org, loongarch@lists.linux.dev, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, George Guo Subject: [PATCH 2/7] LoongArch: kho: strip stale kho_handover= from reused cmdline Date: Mon, 25 May 2026 14:28:05 +0800 Message-Id: <20260525062810.103367-3-dongtai.guo@linux.dev> In-Reply-To: <20260525062810.103367-1-dongtai.guo@linux.dev> References: <20260525062810.103367-1-dongtai.guo@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: George Guo When kexec is invoked with --reuse-cmdline after a liveupdate boot, the running kernel's command line already contains a kho_handover=3D parameter from the previous kexec load. load_other_segments() prepends a fresh kho_handover=3D for the new handover FDT but then appends the original cmdline verbatim, resulting in two kho_handover=3D entries: kho_handover=3D0x4000@,... kho_handover=3D0x4000@,... early_param() calls early_parse_kho() for each occurrence in order, so kho_populate() is invoked twice and the second call overwrites the first with the stale FDT address. The stale address no longer holds a valid KHO FDT, causing __kho_radix_walk_tree() to dereference a garbage pointer and panic early in mm_core_init(). Fix this by adding the new kho_handover=3D to the cmdline prefix first, then stripping any stale kho_handover=3D tokens from the appended original cmdline portion, so only the freshly generated entry survives. Signed-off-by: George Guo --- arch/loongarch/kernel/machine_kexec_file.c | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arch/loongarch/kernel/machine_kexec_file.c b/arch/loongarch/ke= rnel/machine_kexec_file.c index ddf4d0e0e7fd..ffaedd055e62 100644 --- a/arch/loongarch/kernel/machine_kexec_file.c +++ b/arch/loongarch/kernel/machine_kexec_file.c @@ -71,6 +71,37 @@ static void cmdline_add_kho(struct kimage *image, unsign= ed long *cmdline_tmplen, image->kho.scratch->bufsz, (u64)image->kho.scratch->mem); *cmdline_tmplen +=3D n; } + +/* + * Remove all "kho_handover=3D..." tokens from cmdline. Needed when + * --reuse-cmdline is used: the running kernel's cmdline already carries a + * stale kho_handover=3D from the previous kexec load; without removal the= new + * kernel sees two entries and kho_populate() ends up using the wrong (sta= le) + * FDT address. + */ +static void cmdline_remove_kho(char *cmdline) +{ + const char *key =3D "kho_handover=3D"; + size_t key_len =3D strlen(key); + char *p =3D cmdline; + + while ((p =3D strstr(p, key)) !=3D NULL) { + char *start =3D p; + char *end; + + /* Only match at a token boundary */ + if (start !=3D cmdline && *(start - 1) !=3D ' ') { + p +=3D key_len; + continue; + } + end =3D start + key_len; + while (*end && *end !=3D ' ') + end++; + while (*end =3D=3D ' ') + end++; + memmove(start, end, strlen(end) + 1); + } +} #endif =20 #ifdef CONFIG_CRASH_DUMP @@ -249,6 +280,10 @@ int load_other_segments(struct kimage *image, } =20 memcpy(modified_cmdline + cmdline_tmplen, cmdline, cmdline_len); +#ifdef CONFIG_KEXEC_HANDOVER + /* Strip stale kho_handover=3D that --reuse-cmdline may have carried over= */ + cmdline_remove_kho(modified_cmdline + cmdline_tmplen); +#endif cmdline =3D modified_cmdline; image->arch.cmdline_ptr =3D (unsigned long)cmdline; =20 --=20 2.25.1 From nobody Tue Jun 9 00:59:52 2026 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 9A2C339DBE0 for ; Mon, 25 May 2026 06:28:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690511; cv=none; b=qt1fBCjjumBoSoYagHNnufXIZOVP7ysmK+2T1xEOQyfO/yBRdGOI66w9/imfBvc4jrhMroVUglGcrZt3oMoNchHDbAzineDzvGGb+aQeMawDFXLe/C0gTwMnzz7gGaBxsJ/or4S+4zfA0TTJFAYQj6s1Ii57s1/5jqIgIJY+PQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690511; c=relaxed/simple; bh=9CjF84FJpCHrZRL2IHoyuIePe3hokPwDjhhmVprjElM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KR8Qswm8BFTMR3SaJL5FV6zh6Qyde3XEmUb0/2JBh29V3PJYwdEYc0THsS4ZnJTH1YCk59seb341RUH2fSaj8XF8l+jPBrE/p8HmTKACHQs/eBQnfoy5PkPVjSH3GKp8/VTwUO8VeL6+bw1dmbugz0UXePJp+ZlqRWhyKuSWgRc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=VuZqun4P; arc=none smtp.client-ip=95.215.58.180 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) header.d=linux.dev header.i=@linux.dev header.b="VuZqun4P" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779690507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=acZ9/LK5EVhAjK8ZnaMSqOtU1DWY9dKNeWMugFjaoLg=; b=VuZqun4Pplkhr1ruJCNhwVyCRlrJ8YN5XTuCHzFwjIcN4On6My5+wO2nuTa2YcDH+R4x6j OjQ+8k237y/C3DS7wVCLCALfIUOCRMwX/WzkA/gCfLrA6MW2xJnKiJbNKOWvZQoDysQxv0 8CF/cAFRfIql3lLNEgSTyZ3IVe4HdCo= From: George Guo To: chenhuacai@kernel.org, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org Cc: kernel@xen0n.name, graf@amazon.com, shuah@kernel.org, loongarch@lists.linux.dev, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, George Guo , Kexin Liu Subject: [PATCH 3/7] LoongArch: Add missing linux/mm.h include in asm/io.h Date: Mon, 25 May 2026 14:28:06 +0800 Message-Id: <20260525062810.103367-4-dongtai.guo@linux.dev> In-Reply-To: <20260525062810.103367-1-dongtai.guo@linux.dev> References: <20260525062810.103367-1-dongtai.guo@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: George Guo When CONFIG_KFENCE is enabled, the virt_to_phys() and phys_to_virt() macros in arch/loongarch/include/asm/io.h expand to use offset_in_page() and page_address(), both of which are declared in . Without this include, any translation unit that includes and expands these macros with CONFIG_KFENCE=3Dy will fail to build. This was observed when building kernel/liveupdate/luo_session.c with CONFIG_KFENCE=3Dy: asm/io.h: error: implicit declaration of function 'offset_in_page' asm/io.h: error: implicit declaration of function 'page_address' Add the missing include to fix these build errors. Fixes: 0ca84aeaee15 ("LoongArch: Make {virt, phys, page, pfn} translation w= ork with KFENCE") Co-developed-by: Kexin Liu Signed-off-by: Kexin Liu Signed-off-by: George Guo --- arch/loongarch/include/asm/io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/loongarch/include/asm/io.h b/arch/loongarch/include/asm/i= o.h index 0130185e0349..7ff4aa72a34a 100644 --- a/arch/loongarch/include/asm/io.h +++ b/arch/loongarch/include/asm/io.h @@ -13,6 +13,7 @@ #include #include #include +#include =20 extern void __init __iomem *early_ioremap(phys_addr_t phys_addr, unsigned = long size); extern void __init early_iounmap(void __iomem *addr, unsigned long size); --=20 2.25.1 From nobody Tue Jun 9 00:59:52 2026 Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) (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 776EF39B978 for ; Mon, 25 May 2026 06:28:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690514; cv=none; b=J4/rwPci7hVDgKYv4/+ug46CpIegJyEKnWELgpG+OBxZ6JFT92cu+4hwt0Vye5Oc3ap2s3cKzomlR+uSmseuxB7bc+k3rI5O5tIjhhszyOY32NEqjxIKtygWcrm9vB4Vb/65WQttTs6mJNh6tnJPt+JpRObEbj/0cHyF+bOrd6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690514; c=relaxed/simple; bh=l52I/z7XJH2APwRLqgnwRHl+vcigrCoeaI76EFL82KU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KGS4uMxqSW/VnOMrLV1aNljJ/Cb0xw7Z0kryzGVXVmdIp1ROCmtU7j5ABa9rWAyEX8gHuTjg4KAPXu8RlzZbyCkz4XLH08arTlj3GIu7BbMRccltPnyrMg1Vh+1Vb7jNHS3gcaJsW4ZUol3uweMuE5Fia2xZZlMgTok2QAeycNU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=vUYWyZ1C; arc=none smtp.client-ip=95.215.58.172 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) header.d=linux.dev header.i=@linux.dev header.b="vUYWyZ1C" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779690510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RpXKe3wAdCVMwU6Llg7SIPesFhMG6uKuOmrHw+vv3aU=; b=vUYWyZ1CdvfZMVBvkgDZVbpei57KgtJs9mNpdIt8reqlu40mKSoS6h5RB2R2LDIOZMvIA3 7wD1tTsQvzyaW5cW3fY+xdCoerMSlFATNZAzoiFX+PB+IxAQ6fG/swWTRU8fGQxzBcT63L bQbqgORkRf7hUz3cU/du0doFMLefN78= From: George Guo To: chenhuacai@kernel.org, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org Cc: kernel@xen0n.name, graf@amazon.com, shuah@kernel.org, loongarch@lists.linux.dev, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, George Guo Subject: [PATCH 4/7] LoongArch: kexec: avoid overwriting QEMU's machine FDT at 0x100000 Date: Mon, 25 May 2026 14:28:07 +0800 Message-Id: <20260525062810.103367-5-dongtai.guo@linux.dev> In-Reply-To: <20260525062810.103367-1-dongtai.guo@linux.dev> References: <20260525062810.103367-1-dongtai.guo@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: George Guo QEMU places its machine FDT at physical address 0x100000 when booting with '-kernel'. KEXEC_CONTROL_CODE was defined at the same address, so machine_kexec_prepare() overwrites the FDT with the relocation trampoline before jumping to the new kernel. The kexec'd kernel's fdt_setup() reads the FDT pointer from the EFI config table (FDTPTR =3D 0x100000) and finds trampoline code instead of a valid FDT, so earlycon auto-detection fails and the second kernel boots silently with no console output. Move KEXEC_CONTROL_CODE to 0x180000, which is still within the first 2MB reserved by memblock_init() and does not conflict with the QEMU FDT. Signed-off-by: George Guo --- arch/loongarch/kernel/machine_kexec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/loongarch/kernel/machine_kexec.c b/arch/loongarch/kernel/= machine_kexec.c index d7fafda1d541..44df7dbd3de5 100644 --- a/arch/loongarch/kernel/machine_kexec.c +++ b/arch/loongarch/kernel/machine_kexec.c @@ -21,8 +21,13 @@ #include #include =20 -/* 0x100000 ~ 0x200000 is safe */ -#define KEXEC_CONTROL_CODE TO_CACHE(0x100000UL) +/* + * Both addresses are within the first 2MB which is always reserved by + * memblock_init(). Avoid 0x100000 because QEMU places its machine FDT + * there when using '-kernel'; overwriting it silences earlycon in the + * kexec'd kernel. + */ +#define KEXEC_CONTROL_CODE TO_CACHE(0x180000UL) #define KEXEC_CMDLINE_ADDR TO_CACHE(0x108000UL) =20 static unsigned long reboot_code_buffer; --=20 2.25.1 From nobody Tue Jun 9 00:59:52 2026 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 4340B39B4A3 for ; Mon, 25 May 2026 06:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690517; cv=none; b=YO1KPlQH/f+KGqfeI2ssHmNc+8RFhZeDscE6IY8xHVaWmDV13Oo4t0ez+hcdHQJduHwuoNbMR0a1rURAdwSOsWGznJtRPXGx6If/CLzZcmBPAJJsMSQO2HZzaD/JWPehspTbV4IKyibY7HnjdpK6Hinmo63Iash/pxrWoSvHHeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690517; c=relaxed/simple; bh=URHja9OauFJvc+Z+iRHVg/ypV51K/bFOEki6ac6/FY4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jYq800hHNTe5B+czDLZZQLZOABic0h10LHPJ1igF1KLKXb0GSyoui9l8xBSifJkhts01fOU7lyIkZuxoQZauMJFV9Bk8r0HJhuiroMDIZPCqL0apnMbg252CHdhke7ut/yx+nIjhHP81Md2E99dLSnoW2HNmVVQC+mgZKgo5G74= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=wF4CAHMK; arc=none smtp.client-ip=95.215.58.171 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) header.d=linux.dev header.i=@linux.dev header.b="wF4CAHMK" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779690514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mcgnzkCekxGDxlLfZgjscpscBgEbQ0p2mN6z74HWjig=; b=wF4CAHMKnaTjqP7CgZmhq1gjjZcsaQDDnRTJ7BOOXGt2R4+eBKLdLu6nFi1Etz86WDKBUm 9eIv/D+TXkOgB43kU/9ITlfPggrXIbYYowsynT59if8vuDhnasmeCa25X6FhnqXoDxoTVg kRRqpHBBSpRR8UA7tn4RIUkQmoAWafA= From: George Guo To: chenhuacai@kernel.org, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org Cc: kernel@xen0n.name, graf@amazon.com, shuah@kernel.org, loongarch@lists.linux.dev, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, George Guo , Kexin Liu Subject: [PATCH 5/7] selftests/kho: add LoongArch vmtest support Date: Mon, 25 May 2026 14:28:08 +0800 Message-Id: <20260525062810.103367-6-dongtai.guo@linux.dev> In-Reply-To: <20260525062810.103367-1-dongtai.guo@linux.dev> References: <20260525062810.103367-1-dongtai.guo@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: George Guo Add loongarch.conf to configure QEMU's LoongArch virt machine with a la464 CPU, enable the 8250 serial console, and set the kernel image to vmlinux.efi. Extend vmtest.sh to recognize loongarch64 as a supported target and map it to the 'loongarch' kernel arch name. QEMU's LoongArch virt machine provides no ACPI tables and relies on FDT to describe hardware. Without 'earlycon' on the kernel command line, the FDT is not scanned for a console UART, no output reaches the console, and vmtest.sh's console log stays empty causing the test to always fail. Add 'earlycon' to KERNEL_CMDLINE in loongarch.conf to fix this. Co-developed-by: Kexin Liu Signed-off-by: Kexin Liu Signed-off-by: George Guo --- tools/testing/selftests/kho/loongarch.conf | 7 +++++++ tools/testing/selftests/kho/vmtest.sh | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/kho/loongarch.conf diff --git a/tools/testing/selftests/kho/loongarch.conf b/tools/testing/sel= ftests/kho/loongarch.conf new file mode 100644 index 000000000000..b0551e0c2d77 --- /dev/null +++ b/tools/testing/selftests/kho/loongarch.conf @@ -0,0 +1,7 @@ +QEMU_CMD=3D"qemu-system-loongarch64 -M virt -cpu la464" +QEMU_KCONFIG=3D" +CONFIG_SERIAL_8250=3Dy +CONFIG_SERIAL_8250_CONSOLE=3Dy +" +KERNEL_IMAGE=3D"vmlinux.efi" +KERNEL_CMDLINE=3D"console=3DttyS0 earlycon" diff --git a/tools/testing/selftests/kho/vmtest.sh b/tools/testing/selftest= s/kho/vmtest.sh index 49fdac8e8b15..a6ae9ac09595 100755 --- a/tools/testing/selftests/kho/vmtest.sh +++ b/tools/testing/selftests/kho/vmtest.sh @@ -21,7 +21,7 @@ Options: -d) path to the kernel build directory -j) number of jobs for compilation, similar to -j in make -t) run test for target_arch, requires CROSS_COMPILE set - supported targets: aarch64, x86_64 + supported targets: aarch64, x86_64, loongarch64 -h) display this help EOF } @@ -123,6 +123,7 @@ function target_to_arch() { case $target in aarch64) echo "arm64" ;; x86_64) echo "x86" ;; + loongarch64) echo "loongarch" ;; *) skip "architecture $target is not supported" esac } --=20 2.25.1 From nobody Tue Jun 9 00:59:52 2026 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 8C77239B952 for ; Mon, 25 May 2026 06:28:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690521; cv=none; b=fll/fC+9Z3Ize2wjqtCobDA7mZwGwjuu8k7GmX8ujeoxfpVnLfDkKZcO4kHvovX1WUAj8izi833sWZPVwjSquNbUs9ZrPkwavIGY3C6LH0hgQYvlaJLIaPW54tpiGvCdkAq3/ehEyecUrn/MAgb18fZVTJVIDgG0OvAthijnMv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690521; c=relaxed/simple; bh=e4FM8ZhzT2nd6jhoefAjV1OAseKOwjDrNbHN2Uhbm4c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bioOgA5Em9iH8Aq6lqFSUpv8fO23T7iwBMPYH83k2I78tMXQKiBT6TNr2vgumydkZ9+4L0BSv8Ydl9ytrjYQKwKUXuimM9z1T3y7GIATOtRcGq3AL5J1sujoL1/tefYDzGWjt1HTpAZrqkrm8BpBx+7xi+ZJCt3vBfZI6P5+F+s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Yucifz/s; arc=none smtp.client-ip=95.215.58.171 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) header.d=linux.dev header.i=@linux.dev header.b="Yucifz/s" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779690517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1DpUemWUGyJtUUApdw/ETRvltxpRFxe9n1wlPX0btGE=; b=Yucifz/sdS2vKuW192qxuRBEWgSXVsddVL+KNGf+XI6D7sznnV9iJsKaKPcj5drGUYn+YD JBL+Z4v3QQJ3d074krQwygVweZ8fObWIwiw8MI7MMywq3T+IFQ2Ebk0zut2bAiCsDUu7KV PVHuh2mBNxiXm+o0Usrwp+1/B1cI60E= From: George Guo To: chenhuacai@kernel.org, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org Cc: kernel@xen0n.name, graf@amazon.com, shuah@kernel.org, loongarch@lists.linux.dev, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, George Guo Subject: [PATCH 6/7] selftests/kho: LoongArch: disable PS/2 input devices for QEMU virt Date: Mon, 25 May 2026 14:28:09 +0800 Message-Id: <20260525062810.103367-7-dongtai.guo@linux.dev> In-Reply-To: <20260525062810.103367-1-dongtai.guo@linux.dev> References: <20260525062810.103367-1-dongtai.guo@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: George Guo QEMU's LoongArch virt machine has no i8042 PS/2 controller. When PNP detection finds nothing, i8042_init() falls back to probing the ports directly. On LoongArch the I/O ports are memory-mapped, and the i8042 port addresses are not backed by any device on the virt machine, so i8042_flush() takes a page fault and the kernel panics: i8042: PNP: No PS/2 controller found. i8042: Probing ports directly. CPU 0 Unable to handle kernel paging request at virtual address ffff80000= 0008064 ERA: i8042_flush+0x50/0x198 RA: i8042_init+0x2a8/0x35c Kernel panic - not syncing: Attempted to kill init! Disable SERIO_I8042 and its dependents (KEYBOARD_ATKBD, MOUSE_PS2) in the QEMU_KCONFIG fragment to prevent the driver from being built. Signed-off-by: George Guo --- tools/testing/selftests/kho/loongarch.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/kho/loongarch.conf b/tools/testing/sel= ftests/kho/loongarch.conf index b0551e0c2d77..0145cb49e5b2 100644 --- a/tools/testing/selftests/kho/loongarch.conf +++ b/tools/testing/selftests/kho/loongarch.conf @@ -2,6 +2,9 @@ QEMU_CMD=3D"qemu-system-loongarch64 -M virt -cpu la464" QEMU_KCONFIG=3D" CONFIG_SERIAL_8250=3Dy CONFIG_SERIAL_8250_CONSOLE=3Dy +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_MOUSE_PS2 is not set +# CONFIG_SERIO_I8042 is not set " KERNEL_IMAGE=3D"vmlinux.efi" KERNEL_CMDLINE=3D"console=3DttyS0 earlycon" --=20 2.25.1 From nobody Tue Jun 9 00:59:52 2026 Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 D355739DBC0 for ; Mon, 25 May 2026 06:28:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690524; cv=none; b=khV6tXNk5zq1rlgQlb3L5mvN1z5TlVwlKcVnq7+bTRrRShgSXKc4uLOQ4lwU2eDelWsgvFxMMhrBTUfFtawt/A8Ak9Fi3EntdJwQSIXcPCTd+vTqeztCt/7DrpzvT1ZnTt2ooy5crkcClueQvRMk9p8moJKRKD2dCy2e8dGRBJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779690524; c=relaxed/simple; bh=z+FdkDPJqQMFpQ9S+75bwiqjIcMs1tm3tReEC2FAIug=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iccxEck9bBfSOiGY/V7ls6SjFWK9PX4HNLzlCcJUAS4mIK8yr7u88uOSlw5zNJrASdbsERP0gv7zaKxZ9hHBSuiLjj7AHsZE/GpsdOk1Zzjq6rU5T+fgRjSZfZf4r5HLQzfjVN4gH9MoKFnUIIj/GiY3XdNUw0evjTc+FTbhTdo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=tapMzdVl; arc=none smtp.client-ip=95.215.58.177 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) header.d=linux.dev header.i=@linux.dev header.b="tapMzdVl" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779690520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tYxwosLkp+8p8G15z4kXkSPo4todC1a7rfK+baWf0Ng=; b=tapMzdVlPtDDpbGp9ExBzdrIWJd5Y2uo8fnGLvCqnWZtlCYloM8DKKodK5W+vk8n8kh2zT bfsvelwOgxjow3PTKnfGN1YfC+4DEJwagn4PVMZlpiRhbPSa+9NbkpAWv3FaTpceQHBKZy McUhOyUC4DTF/o7X/PEECcln0mOrJ/Y= From: George Guo To: chenhuacai@kernel.org, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org Cc: kernel@xen0n.name, graf@amazon.com, shuah@kernel.org, loongarch@lists.linux.dev, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, George Guo Subject: [PATCH 7/7] selftests/kho: handle QEMU not exiting after kexec on LoongArch Date: Mon, 25 May 2026 14:28:10 +0800 Message-Id: <20260525062810.103367-8-dongtai.guo@linux.dev> In-Reply-To: <20260525062810.103367-1-dongtai.guo@linux.dev> References: <20260525062810.103367-1-dongtai.guo@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: George Guo On LoongArch, QEMU provides only a minimal EFI stub with no runtime services and no ACPI tables, so machine_restart() falls through to its infinite idle loop and QEMU never exits after kexec. Poll the serial output for the test verdict and kill QEMU once it appears, rather than waiting for QEMU to exit naturally. Signed-off-by: George Guo --- tools/testing/selftests/kho/vmtest.sh | 35 +++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kho/vmtest.sh b/tools/testing/selftest= s/kho/vmtest.sh index a6ae9ac09595..3cb9674e4475 100755 --- a/tools/testing/selftests/kho/vmtest.sh +++ b/tools/testing/selftests/kho/vmtest.sh @@ -103,16 +103,37 @@ function run_qemu() { local qemu_cmd=3D$1 local cmdline=3D$2 local kernel=3D$3 + local arch=3D$4 local serial=3D"$tmp_dir/qemu.serial" =20 cmdline=3D"$cmdline kho=3Don panic=3D-1" =20 - $qemu_cmd -m 1G -smp 2 -no-reboot -nographic -nodefaults \ - -accel kvm -accel hvf -accel tcg \ - -serial file:"$serial" \ - -append "$cmdline" \ - -kernel "$kernel" \ - -initrd "$initrd" + local qemu_args=3D( + -m 1G -smp 2 -no-reboot -nographic -nodefaults + -accel kvm -accel hvf -accel tcg + -serial file:"$serial" + -append "$cmdline" + -kernel "$kernel" + -initrd "$initrd" + ) + + # On LoongArch, EFI runtime services are unavailable after kexec so + # machine_restart() hangs and QEMU never exits on its own. Run QEMU + # in the background, poll for the test result, then kill it. + if [[ "$arch" =3D=3D "loongarch" ]]; then + $qemu_cmd "${qemu_args[@]}" & + local qemu_pid=3D$! + local timeout=3D100 + while ((timeout-- > 0)); do + grep -q "KHO restore succeeded\|KHO restore failed" \ + "$serial" 2>/dev/null && break + sleep 1 + done + kill "$qemu_pid" 2>/dev/null + wait "$qemu_pid" 2>/dev/null || true + else + $qemu_cmd "${qemu_args[@]}" + fi =20 grep "KHO restore succeeded" "$serial" &> /dev/null || fail "KHO failed" } @@ -179,7 +200,7 @@ function main() { local kernel=3D"$build_dir/arch/$arch/boot/$KERNEL_IMAGE" mkinitrd "$kernel" =20 - run_qemu "$QEMU_CMD" "$KERNEL_CMDLINE" "$kernel" + run_qemu "$QEMU_CMD" "$KERNEL_CMDLINE" "$kernel" "$arch" =20 ktap_test_pass "KHO succeeded" } --=20 2.25.1