All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
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	[thread overview]
Message-ID: <20210304182136.GE29547@arm.com> (raw)
In-Reply-To: <20210304180955.GC29547@arm.com>

[-- Attachment #1: Type: text/plain, Size: 4246 bytes --]

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-stable-rc.git linux-4.14.y
> > head:   e1f7d50ae3a3ec342e87a9b1ce6787bfb8b3c08b
> > commit: 3e91f3eacc91d9d6116ed56ea339f858958ba3ee [8552/9999] arm64: Always 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=1 build):
> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/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=3e91f3eacc91d9d6116ed56ea339f858958ba3ee
> >         git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/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=$HOME/0day COMPILER=gcc-7.5.0 make.cross ARCH=arm64 
> > 
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> > 
> > 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_start' undeclared (first use in this function); did you mean 'hyp_vecs_start'?
> >      void *dst = 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_capabilities *__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

      reply	other threads:[~2021-03-04 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 22:57 [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 kernel test robot
2021-03-04 18:09 ` Catalin Marinas
2021-03-04 18:21   ` Catalin Marinas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210304182136.GE29547@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.