[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20191106015814.GA99@boqun-laptop.fareast.corp.microsoft.com>
Date: Wed, 6 Nov 2019 09:58:14 +0800
From: Boqun Feng <boqun.feng@...il.com>
To: Michael Kelley <mikelley@...rosoft.com>
Cc: "will@...nel.org" <will@...nel.org>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"mark.rutland@....com" <mark.rutland@....com>,
"maz@...nel.org" <maz@...nel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"olaf@...fle.de" <olaf@...fle.de>,
"apw@...onical.com" <apw@...onical.com>,
vkuznets <vkuznets@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"marcelo.cerri@...onical.com" <marcelo.cerri@...onical.com>,
KY Srinivasan <kys@...rosoft.com>,
Sunil Muthuswamy <sunilmut@...rosoft.com>
Subject: Re: [PATCH v5 2/8] arm64: hyperv: Add hypercall and register access
functions
On Wed, Nov 06, 2019 at 12:40:04AM +0000, Michael Kelley wrote:
> From: Boqun Feng <boqun.feng@...il.com> Sent: Sunday, November 3, 2019 8:37 PM
> >
> > > diff --git a/arch/arm64/Kbuild b/arch/arm64/Kbuild
> > > index d646582..2469421 100644
> > > --- a/arch/arm64/Kbuild
> > > +++ b/arch/arm64/Kbuild
> > > @@ -3,4 +3,5 @@ obj-y += kernel/ mm/
> > > obj-$(CONFIG_NET) += net/
> > > obj-$(CONFIG_KVM) += kvm/
> > > obj-$(CONFIG_XEN) += xen/
> > > +obj-$(CONFIG_HYPERV) += hyperv/
> >
> > I did a kernel built with CONFIG_HYPERV=m today, and found out this line
> > should be (similar to x86):
> >
> > +obj-$(subst m,y,$(CONFIG_HYPERV)) += hyperv/
> >
> > , otherwise, when CONFIG_HYPERV=m, files in arch/arm64/hyperv/ will be
> > compiled as obj-m, and symbols defined in those files cannot be
> > used by kernel builtin, e.g. hyperv_timer (since CONFIG_HYPERV_TIMER=y
> > in this case).
>
> Agreed. I'll fix that in the next version.
>
> >
> > A compile/link error I hit today is:
> >
> > | /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:98: undefined reference
> > to `hv_set_vpreg'
> > | aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:98:
> > undefined reference to `hv_set_vpreg'
>
> I'm not seeing this error. I'm building natively on an ARM64 system, though
> the environment and tools are perhaps a couple of years old. Are you still
> able to reproduce the above error? And is it only complaining about
> 'hv_set_vpreg', or also about similar functions like 'hv_get_vpreg' that
> are very parallel?
>
I just reproduced this, your patchset is applied on v5.4-rc6 and I used
the config in the attachment, I reproduced this with command:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j16 vmlinux
The version of my gcc is:
aarch64-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909
And here is the complete list of the warning:
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_ce_set_next_event':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:61: undefined reference to `hv_set_vpreg'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_ce_set_oneshot':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:98: undefined reference to `hv_set_vpreg'
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:98: undefined reference to `hv_set_vpreg'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_stimer_alloc':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:157: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ms_hyperv' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:157:(.text+0x134): dangerous relocation: unsupported relocation
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:157: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:160: undefined reference to `hv_setup_stimer0_irq'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_stimer_free':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:178: undefined reference to `hv_remove_stimer0_irq'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_stimer_global_cleanup':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:195: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ms_hyperv' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:195:(.text+0x204): dangerous relocation: unsupported relocation
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:195: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `read_hv_clock_msr':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:255: undefined reference to `hv_get_vpreg'
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:255: undefined reference to `hv_get_vpreg'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_stimer_init':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:114: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ms_hyperv' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:114:(.text+0x2d8): dangerous relocation: unsupported relocation
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:114: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_ce_shutdown':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:67: undefined reference to `hv_set_vpreg'
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:68: undefined reference to `hv_set_vpreg'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_stimer_cleanup':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:141: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ms_hyperv' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:141:(.text+0x3e0): dangerous relocation: unsupported relocation
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:141: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `read_hv_clock_tsc':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:229: undefined reference to `hv_get_vpreg'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_init_tsc_clocksource':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:277: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ms_hyperv' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:277:(.init.text+0x4): dangerous relocation: unsupported relocation
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:277: undefined reference to `ms_hyperv'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_init_clocksource':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:324: undefined reference to `hv_setup_sched_clock'
aarch64-linux-gnu-ld: drivers/clocksource/hyperv_timer.o: in function `hv_init_tsc_clocksource':
/home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:290: undefined reference to `hv_get_vpreg'
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:293: undefined reference to `hv_set_vpreg'
aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:299: undefined reference to `hv_setup_sched_clock'
make: *** [Makefile:1074: vmlinux] Error 1
Regards,
Boqun
> >
> > [...]
> >
> > Besides, another problem I hit when compiled with CONFIG_HYPERV=m is:
> >
> > | ERROR: "screen_info" [drivers/hv/hv_vmbus.ko] undefined!
> >
> > , which can be fixed by the following change.
> >
> > Regards,
> > Boqun
> >
> > ---------------->8
> > diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
> > index d0cf596db82c..8ff557ae5cc6 100644
> > --- a/arch/arm64/kernel/efi.c
> > +++ b/arch/arm64/kernel/efi.c
> >
> > @@ -55,6 +55,7 @@ static __init pteval_t create_mapping_protection(efi_memory_desc_t
> > *md)
> >
> > /* we will fill this structure from the stub, so don't put it in .bss */
> > struct screen_info screen_info __section(.data);
> > +EXPORT_SYMBOL(screen_info);
> >
> > int __init efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md)
> > {
>
> Agreed. I can reproduce the same problem, and will fix it as you suggest.
>
> Michael
View attachment "arm64-config" of type "text/plain" (203580 bytes)
Powered by blists - more mailing lists