From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3938929535500254574==" MIME-Version: 1.0 From: Catalin Marinas To: kbuild-all@lists.01.org Subject: Re: [linux-stable-rc:linux-4.14.y 8552/9999] arch/arm64/kernel/cpu_errata.c:91:23: error: '__bp_harden_hyp_vecs_start' undeclared; did you mean Date: Thu, 04 Mar 2021 18:21:36 +0000 Message-ID: <20210304182136.GE29547@arm.com> In-Reply-To: <20210304180955.GC29547@arm.com> List-Id: --===============3938929535500254574== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Thu, Mar 04, 2021 at 06:09:57PM +0000, Catalin Marinas wrote: > On Tue, Mar 02, 2021 at 06:57:05AM +0800, kernel test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-st= able-rc.git linux-4.14.y > > head: e1f7d50ae3a3ec342e87a9b1ce6787bfb8b3c08b > > commit: 3e91f3eacc91d9d6116ed56ea339f858958ba3ee [8552/9999] arm64: Alw= ays enable spectre-v2 vulnerability detection > > config: arm64-randconfig-c003-20210301 (attached as .config) > > compiler: aarch64-linux-gcc (GCC) 7.5.0 > > reproduce (this is a W=3D1 build): > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/s= bin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-= stable-rc.git/commit/?id=3D3e91f3eacc91d9d6116ed56ea339f858958ba3ee > > git remote add linux-stable-rc https://git.kernel.org/pub/scm/l= inux/kernel/git/stable/linux-stable-rc.git > > git fetch --no-tags linux-stable-rc linux-4.14.y > > git checkout 3e91f3eacc91d9d6116ed56ea339f858958ba3ee > > # save the attached .config to linux build tree > > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-7.5.0 make.cr= oss ARCH=3Darm64 = > > = > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > = > > All errors (new ones prefixed by >>): > > = > > In file included from arch/arm64/include/asm/thread_info.h:30:0, > > from include/linux/thread_info.h:38, > > from include/asm-generic/preempt.h:5, > > from ./arch/arm64/include/generated/asm/preempt.h:1, > > from include/linux/preempt.h:81, > > from include/linux/radix-tree.h:28, > > from include/linux/idr.h:15, > > from include/linux/kernfs.h:14, > > from include/linux/sysfs.h:16, > > from include/linux/kobject.h:21, > > from include/linux/device.h:17, > > from include/linux/node.h:18, > > from include/linux/cpu.h:17, > > from arch/arm64/include/asm/cpu.h:19, > > from arch/arm64/kernel/cpu_errata.c:22: > > arch/arm64/kernel/cpu_errata.c: In function '__copy_hyp_vect_bpi': > > >> arch/arm64/kernel/cpu_errata.c:91:23: error: '__bp_harden_hyp_vecs_s= tart' undeclared (first use in this function); did you mean 'hyp_vecs_start= '? > > void *dst =3D lm_alias(__bp_harden_hyp_vecs_start + slot * SZ_2K); > = > It looks like commit 8c1e3d2bb44c ("arm64: Always enable spectre-v2 > vulnerability detection") was backported from 5.2 to 4.14 but the > context for the __bp_harden_hyp_vecs_start declaration/definition is > missing. > = > In 4.17, commit 4340ba80bd3a ("arm64: KVM: Move BP hardening vectors > into .hyp.text section") moved the __bp_harden_hyp_vecs_start to a > different section and compiled bpi.S if CONFIG_KVM_INDIRECT_VECTORS. > In the same kernel, commit e8b22d0f4500 ("arm64: Move the content of > bpi.S to hyp-entry.S") added #ifdef CONFIG_KVM_INDIRECT_VECTORS around > the faulty code above. However, the 8c1e3d2bb44c backport did not take > any of these into account and left the code above bracketed only by > CONFIG_KVM. > = > I think it's better if we dropped this commit altogether from 4.14.y. > Jeremy, any reason why this should be in stable? It looks like it can't be easily reverted, more stuff on top depends on it. Maybe a quick fix would do (hopefully the problem is only in 4.14): diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 7d15f4cb6393..e565ec5e072f 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -82,7 +82,7 @@ cpu_enable_trap_ctr_access(const struct arm64_cpu_capabil= ities *__unused) = DEFINE_PER_CPU_READ_MOSTLY(struct bp_hardening_data, bp_hardening_data); = -#ifdef CONFIG_KVM +#if defined(CONFIG_KVM) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) extern char __smccc_workaround_1_smc_start[]; extern char __smccc_workaround_1_smc_end[]; -- = Catalin --===============3938929535500254574==--