Re: [RFC PATCH 02/27] KVM: arm64: Link position-independent string routines into .hyp.text
From: Quentin Perret
Date: Mon Nov 23 2020 - 09:07:52 EST
On Monday 23 Nov 2020 at 12:34:25 (+0000), David Brazdil wrote:
> On Tue, Nov 17, 2020 at 06:15:42PM +0000, 'Quentin Perret' via kernel-team wrote:
> > diff --git a/arch/arm64/kernel/image-vars.h b/arch/arm64/kernel/image-vars.h
> > index 8539f34d7538..dd8ccc9efb6a 100644
> > --- a/arch/arm64/kernel/image-vars.h
> > +++ b/arch/arm64/kernel/image-vars.h
> > @@ -105,6 +105,17 @@ KVM_NVHE_ALIAS(__stop___kvm_ex_table);
> > /* Array containing bases of nVHE per-CPU memory regions. */
> > KVM_NVHE_ALIAS(kvm_arm_hyp_percpu_base);
> >
> > +/* Position-independent library routines */
> > +__kvm_nvhe_clear_page = __kvm_nvhe___pi_clear_page;
> > +__kvm_nvhe_copy_page = __kvm_nvhe___pi_copy_page;
> > +__kvm_nvhe_memcpy = __kvm_nvhe___pi_memcpy;
> > +__kvm_nvhe_memset = __kvm_nvhe___pi_memset;
> > +
> > +#ifdef CONFIG_KASAN
> > +__kvm_nvhe___memcpy = __kvm_nvhe___pi_memcpy;
> > +__kvm_nvhe___memset = __kvm_nvhe___pi_memset;
> > +#endif
> > +
> > #endif /* CONFIG_KVM */
>
> Nit: Would be good to use the kvm_nvhe_sym() helper for the namespacing.
> And feel free to define something like KVM_NVHE_ALIAS for PI in hyp-image.h.
Ack, that'd be much nicer, I'll fix it up for v2.
Thanks,
Quentin