Darren J Moffat wrote: > Bart Smaalders wrote: >>> What we would like to be able to do is something like what we have >>> in userland with $HWCAP, for example: >>> /kernel/crypto/aes/aes_hwcap1 >>> /kernel/crypto/aes/aes_hwcap2 [VIA_C7] >>> /kernel/crypto/rsa/rsa_hwcap1 >>> /kernel/crypto/rsa/rsa_hwcap2 [SSE MMX CMOV SEP FPU] >>> >>> Would this be possible to have implemented with krtld ? Or is there >>> a better/existing way to provide $HWCAP like functionality for >>> kernel modules ? >>> >>> >> >> So far we've not done this aside from $PLATFORM... we should. >> Solaris doesn't use this for x86; so far we've just written >> the code to use different internal routines depending on >> what the processor features are... >> >> The Sparc kernels use $PLATFORM and differing cpu modules, >> but that mechanism isn't flexible enough as you note. It's >> particularly problematic with multiple vendors shipping >> different CPUs that each implement some of the available features. > > So this sounds like you support the concept of this. > > Do you happen to know the best person/alias to discuss the krtld > implementation needed since Rod has said it isn't the same group of > people as ld.so.1 ? >
Maybe (and I hesitate here, because it is likely to be very controversial), it is time to create different values of $PLATFORM for different classes of x86 cpu. Having a catchall for all x86 cpus seems like a limiting factor here. There is no OBP to set up the initial value, but perhaps grub/bootstrap could be modified to pass it in (the value to be determined at install time -- with a fallback default of i86pc). Then we could have uname -i different for VIA platforms, AMD Opteron platforms, perhaps certain NUMA machines, and maybe even different classes of laptop. (For example, one could imagine that it might be easier to provide "platform-specific" modules to deal with platforms that have a reasonable ACPI versus certain others that might need different hacks. Or to deal with things like custom buttons/gadgets that some PC boxes seem to ship with these days.) Of course, the challenge here is that _something_ must determine the initial value. For platforms that are detectable via cpuinfo it is easier. For other cases, I'm not sure -- look at ACPI/BIOS information perhaps? -- Garrett D'Amore, Principal Software Engineer Tadpole Computer / Computing Technologies Division, General Dynamics C4 Systems http://www.tadpolecomputer.com/ Phone: 951 325-2134 Fax: 951 325-2191