From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbguseast3.qq.com (smtpbguseast3.qq.com [54.243.244.52]) (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 8E7D938F94C; Wed, 13 May 2026 11:59:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.243.244.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778673596; cv=none; b=rt5+e8IrWPAv2WS+G1iBhaV12pGAogHmokBhzdaQyqWBiZ3IlKlrWunOOP81b/+NlrBtW6eX8bc58Ied0NiECjIC7JVCUpaCwL1PZyZ8yJcTBOmPUHfGVViAgN2rS3EYx8eL31IoWezKX5KZL+KXsv/YzNikdn6YC5Wop3R/uHc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778673596; c=relaxed/simple; bh=763pFe1J8vID9eAOLiyYmWwQJg6mRSiyJJD/9SABoV8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=k8WE7N1GGHTqEOGd3VpCae3PIr1qDYIjg2yYHuXIwz5gw0rBh0odcp8JL8cv0Gjw6iSbmFVeilZVTryWoqQKFEZv705zXV3gtyTHYPLbdPiApf8bVr/sa++uHhhXRAKuE5eymWsbhRn+ATP2IWnCkhkOh2ZeaNjN9thEdRSa7yg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=KYBhXU6S; arc=none smtp.client-ip=54.243.244.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="KYBhXU6S" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1778673572; bh=xEH2z8WCWcgrophkMiTtUC2J3DxjG4vcq5q2behA75Q=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=KYBhXU6SYQ/HPkrbyis/SBstMxVHmeTRIdCwJcD3ufr+8U9ysu07zm9ZZEheoTN76 NQjOSnNF2/m3OZSF9/lVacVPdNAOfaebysynHDAfiI0ddsJb6C5jcawGYIZ73jW9eC PkR78N+oMYTLbRSQENFTuIX6ZFuPbmhwei+sd5ow= X-QQ-mid: zesmtpip4t1778673570t776de1df X-QQ-Originating-IP: viOzyJ1fnQCzw4A7aaGWbCFEU/bkgfmroHrcN7wPcDI= Received: from localhost.localdomain ( [localhost]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 13 May 2026 19:59:28 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 842056211250941492 From: Wentao Guan To: gregkh@linuxfoundation.org Cc: chenhuacai@kernel.org, chenhuacai@loongson.cn, dave.hansen@linux.intel.com, kvm@vger.kernel.org, lixianglai@loongson.cn, loongarch@lists.linux.dev, maobibo@loongson.cn, ojeda@kernel.org, patches@lists.linux.dev, seanjc@google.com, stable@vger.kernel.org, zhaotianrui@loongson.cn Subject: Re: Re: [PATCH 6.18 091/270] LoongArch: KVM: Compile switch.S directly into the kernel Date: Wed, 13 May 2026 19:58:10 +0800 Message-Id: <20260513115810.338478-1-guanwentao@uniontech.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <2026051319-lazily-machine-5ab3@gregkh> References: <2026051319-lazily-machine-5ab3@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: zesmtpip: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nQ9nkxX59iu/Jn6tV9oq38L WFBt6htv4I3Hzo5jypDB5U8+wIJ/0tmkM2VR+9VjFY4kCiTFFqq0yplyq6dk/YgJdBS/L4P w== X-QQ-XMRINFO: M/715EihBoGS47X28/vv4NpnfpeBLnr4Qg== X-QQ-RECHKSPAM: 0 Hello, > On Wed, May 13, 2026 at 11:06:20AM +0800, Huacai Chen wrote: > > On Wed, May 13, 2026 at 5:53 AM Sean Christopherson wrote: > > > > > > On Tue, May 12, 2026, Miguel Ojeda wrote: > > > > On Tue, 12 May 2026 19:38:12 +0200 Greg Kroah-Hartman wrote: > > > > > > > > > > 6.18-stable review patch. If anyone has any objections, please let me know. > > > > > > > > > > ------------------ > > > > > > > > > > From: Xianglai Li > > > > > > > > > > commit 5203012fa6045aac4b69d4e7c212e16dcf38ef10 upstream. > > > > > > > > > > If we directly compile the switch.S file into the kernel, the address of > > > > > the kvm_exc_entry function will definitely be within the DMW memory area. > > > > > Therefore, we will no longer need to perform a copy relocation of the > > > > > kvm_exc_entry. > > > > > > > > > > So this patch compiles switch.S directly into the kernel, and then remove > > > > > the copy relocation execution logic for the kvm_exc_entry function. > > > > > > > > > > Cc: stable@vger.kernel.org > > > > > Signed-off-by: Xianglai Li > > > > > Signed-off-by: Huacai Chen > > > > > Signed-off-by: Greg Kroah-Hartman > > > > > > > > For loongarch64, I am seeing a bunch of errors like: > > > > > > > > arch/loongarch/kvm/switch.S:201:1: error: unrecognized instruction mnemonic > > > > EXPORT_SYMBOL_FOR_KVM(kvm_exc_entry) > > > > ^ > > > > > > > > `EXPORT_SYMBOL_FOR_KVM` does not exist in 6.18. Does this need a subset > > > > of commit 6276c67f2bc4 ("x86: Restrict KVM-induced symbol exports to KVM > > > > modules where obvious/possible")? > > > > > > Either that or just convert EXPORT_SYMBOL_FOR_KVM() => EXPORT_SYMBOL_GPL(). If > > > that's somewhat scriptable for ongoing LTS backports, that's probably the best > > > option. EXPORT_SYMBOL_FOR_KVM() will only work for 6.18, and the list of backports > > > needed to get EXPORT_SYMBOL_FOR_MODULES() working on older LTS kernels looks to > > > be non-trivial > > > > > > If we do end up backporting EXPORT_SYMBOL_FOR_KVM() and others, we might as well > > > also grab a subset of 01122b89361e ("perf: Use EXPORT_SYMBOL_FOR_KVM() for the > > > mediated APIs") to ensure a kvm_types.h stub is present on all archs. That way > > > EXPORT_SYMBOL_FOR_KVM() usage in arch-neutral code will also work. > > I have already noticed Greg about this before. > > You did? Where? Small problem, I guess where he means is 'stable-commits@vger.kernel.org', is a not public maillist? I want to find it in 'lore.kernel.org' but not found... BRs Wentao Guan