From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 722552222AA for ; Thu, 9 Jul 2026 12:49:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783601348; cv=none; b=hQST7Rqet7Guxh1SgsQvve/9/7wleUv862kEK5EHP0W1aR4A+ZnkLA4VuKIhU/pEhiuO3EzmtPoDMM/rZLlOF9q5C+bbxr3qh9NeDKdFD044wkALeIfLg8uRI6tXESxwCOoeV4nqjO+Yj0XK0/tyj4fEM0WasbvXPdkQvFumzjM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783601348; c=relaxed/simple; bh=8OUUT8qKzTxyLqKTXaf6utKezb1ei0lgRETyjCKwMRo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y/wjP6IcKQIwbHxDE5ZXc9Lt75WqB6yCDpcuCJJIZa802obXzucIoVT3xLybHqYOkd5uY3gqZXu5ikAAqlg+WBnRNaZpfLxLPEpmp9PXO1rgCUYNuKDf2LTn9RsYmOH3wc7boIXUNmo5TisIV1pPuHmfmo80yospm8EgXWmhTaE= 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=Iycg/KIV; arc=none smtp.client-ip=91.218.175.185 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="Iycg/KIV" 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=1783601334; 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=egEQegkzVd6qWuiMRf57t7zF7MyRk5jNUn1HniJAO8k=; b=Iycg/KIVqDMfLX8Xy+tVV/5u6vC42kFOn0WbRUUEikqUEe+PnvXScKlmERZNC+QZDq/4l9 mJztvFMEpgk1ET9hT3h2VfL9kJwZhtygo99555KQ6Vyk05NJLziCH3xjbLtzs6Tk4c2jQx 0CqbzLokzg0DSOA7mnIWVA4lJ1+bCx4= From: George Guo To: Huacai Chen Cc: maobibo@loongson.cn, loongarch@lists.linux.dev, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, George Guo Subject: Re: [PATCH v4 0/2] LoongArch: kexec: avoid clobbering the QEMU FDT Date: Thu, 9 Jul 2026 20:48:30 +0800 Message-ID: <20260709124830.15417-1-dongtai.guo@linux.dev> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Hi Huacai, Thanks for the correction, and I am sorry for the way I handled this. > Who told you the trampoline is dead code? All non-boot CPUs are > running in the trampoline, you can use maxcpus=1 to go to the new > kernel, and do something, and then hotplug the non-boot CPUs at any > time. You are right, and I was wrong to call the trampoline dead once the new kernel starts. The non-boot CPUs spin in kexec_smp_wait inside the trampoline buffer and only leave it when the new kernel brings them online, so with maxcpus=1 they stay there until a later CPU hotplug. The buffer has to stay valid the whole time. That breaks my patch 1. control_code_page is allocated by the kexec core and is not reserved in the new kernel, so the new kernel can reuse that page while the non-boot CPUs are still spinning in it, and small memory makes that more likely. The fixed KEXEC_CONTROL_CODE at 0x100000 avoided this because the first 2MB is memblock_reserve()d in both kernels; its only problem was that it overlaps QEMU's machine FDT at 0x100000. So my Q2 answer in the cover letter was also wrong, and "as arm64/riscv do" does not apply here. So the trampoline still needs to live in the cross-kexec reserved first 2MB, just not on top of the FDT. The FDT declares fdt_totalsize 1MB and covers [0x100000, 0x200000), so the room left is below 0x100000. Do you have a different fix in mind? I would like to agree on the direction with you before I send anything. > BTW, you have never replied to my comments, all you have done is > submit new versions again and again. That is fair, and it was my mistake. I should have replied to your review in the thread and discussed it before sending a new version, instead of putting my answers in a cover letter. I will reply to comments first from now on. I will hold the series until we settle the trampoline approach. Thanks, George