Subject: Re: net-next panic in ovs call to arch_fast_hash2 since e5a2c899

From: Jay Vosburgh <[email-masked]>
Date: Thu, 13 Nov 2014 21:04:04 -0800

[ adding Hannes to Cc, which I should've done initially ]

David Miller <[email-masked]> wrote:

>From: Jay Vosburgh <[email-masked]>
>Date: Thu, 13 Nov 2014 18:15:32 -0800
>
>> 	The "have feature" function, __intel_crc4_2_hash2, does not
>> clobber %r8, and so the call does not panic on a system with
>> X86_FEATURE_XMM4_2, although I'm not sure if that's a deliberate
>> compiler action or just happenstance because __intel_crc4_2_hash2 uses
>> fewer registers than __jhash2.
>
>Perhaps alternative calls can only be used with assembler routines
>that use specific calling conventions, and they therefore generally
>don't work with C functions?

	I don't know the answer to that, but a quick search suggests
that arch_fast_hash and arch_fast_hash2 (both added by commit e5a2c899)
may be the only cases of alternative calls that aren't supplying either
single instructions or assembly language functions.

	From looking at how the alternative calls are implemented (code
patching at boot or module load time from a table stored in a special
section of the object file), I'm skeptical that the compiler could know
what's the right thing to do.

	Hannes, can you shed any light on this?

	-J

---
	-Jay Vosburgh, [email-masked]