[PATCH] powerpc: Fix compile issue with force DAWR

Michael Ellerman mpe at ellerman.id.au
Fri May 10 00:46:26 AEST 2019


Christophe Leroy <christophe.leroy at c-s.fr> writes:
> Le 08/05/2019 à 03:30, Michael Neuling a écrit :
>> If you compile with KVM but without CONFIG_HAVE_HW_BREAKPOINT you fail
>> at linking with:
>>    arch/powerpc/kvm/book3s_hv_rmhandlers.o:(.text+0x708): undefined reference to `dawr_force_enable'
>> 
>> This was caused by this recent patch:
>>     commit c1fe190c06723322f2dfac31d3b982c581e434ef
>>     Author: Michael Neuling <mikey at neuling.org>
>>     powerpc: Add force enable of DAWR on P9 option
>
> I think you should use the standard commit format, checkpatch will tell you.
>
>> 
>> This builds dawr_force_enable in always via a new file.
>
> Do we really need a new file just for that ?

I told him to make a new file, rather than drop it in some other file
that's already full of unrealted junk :)

I did mean for him to put all the dawr_force_enable code in the file
though, not just the variable.

> As far as I understand, it is always compiled in, so can't we use 
> another file like traps.o or setup-common.o or somewhere else ?
>
> Or just put an ifdef in arch/powerpc/kvm/book3s_hv_rmhandlers.S ?
> Because your fix will put dawr_force_enable on every build even the ones 
> who don't need it at all.

We don't want to use an ifdef in the KVM code, because that would break
the case where you want to enable the DAWR for use by guests but the
host kernel doesn't have PERF support.

It shouldn't be in obj-y, it should at least be 64-bit only.

But it should be pretty trivial to create a config symbol for it, with
something like:

config DAWR_FORCE_ENABLE
	def_bool y
        depends on PERF || KVM

cheers


More information about the Linuxppc-dev mailing list