Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: trouble with netbsd-8 on RPI3?



Martin Husemann <martin%duskware.de@localhost> writes:

> I have not found a table listing which processor types support "wait
> for event", but our default for armv7 seems not to be among them (while
> the default for aarch64 is):
>
>> tools/bin/armv7eb--netbsdelf-eabihf-as test.s
> test.s: Assembler messages:
> test.s:3: Error: selected processor does not support `wfe' in ARM mode
>> tools/bin/aarch64--netbsd-as test.s
>>
>
> So I would expect this to crash on a/some real armv7 machine(s) too - maybe
> the old kernel just eroneously allowed it?

Do you mean:

  the old kernel somehow set flags to allow wfe on armv7, which is a bug
  because the armv7 spec doesn't require it.  newer netbsd-8 fixes this
  by not enabling it, so it faults, even on hardware which does have
  that instruction

  also, our libpthread uses wfe on arm7, which is a bug because armv7
  doesn't have wfe


Are you aware of a change to stop allowing wfe?


As I read the docs (and I am not skilled at arm docs), wfe must execute
on armv7, but it can be nop if not implemented:

  http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.100076_0200_00_en/pge1425917119639.html

> Can you verify it is present in the official builds of the armv7 libpthread
> as well, and find out more details where it is in your build?

src/lib/libpthread/arch/arm/pthread_md.h has:

  #if defined(__thumb__) && defined(_ARM_ARCH_6)
  #define pthread__smt_pause()    __asm __volatile(".inst.n 0xbf20") /* wfe */
  #define pthread__smt_wake()     __asm __volatile(".inst.n 0xbf40") /* sev */
  #elif !defined(__thumb__)
  #define pthread__smt_pause()    __asm __volatile(".inst 0xe320f002") /* wfe */
  #define pthread__smt_wake()     __asm __volatile(".inst 0xe320f004") /* sev */
  #else
  #define pthread__smt_pause()
  #define pthread__smt_wake()
  #endif


I will check the official pthread.


Home | Main Index | Thread Index | Old Index