Graham wrote:
Hello, I am wondering whether anyone has looked into which AMD CPUs support these instructions. I would think that installing a 486 kernel on an AthlonXP, for example, would be quite sub-optimal. i.e. can you safely enable X86_P6_NOP for other CPUs, such as AMD K7/K8, VIA C3/C7, or Efficeon? If not, would it be more sensible to avoid using these instructions? It appears that at least some VIA C3 CPUs do not support these opcodes: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=463606#45
Attached is a C program which tests this.
#include <stdio.h> #include <signal.h> #include <setjmp.h> static sigjmp_buf out; void sigill(int signal) { siglongjmp(out, 1); } int main(void) { int died; signal(SIGILL, sigill); died = sigsetjmp(out, 1); if (!died) asm volatile("nopl 0(%eax)"); printf("Long NOPs supported: %s\n", died ? "no" : "yes"); return died; }