On Sun, 25 Sep 2016, Sami wrote:
> Hello! I encountered a problem (kernel trap) when I was installing 
> OpenBSD 6.0 to an old computer that has AMD AM486DX2 as a CPU. OpenBSD 
> 5.9 works fine. When I compiled the kernel with GENERIC config but only 
> the pctr driver commented out from the config file, I managed to get the 
> 486 machine working using that newly compiled kernel. I think that the 
> problem is probably in pctr.c in line #86, where it seems to call CPUID 
> without checking first that the CPU supports it.

Whoops, yep.  This diff should fix it on your box.


--- i386/pctr.c 14 Apr 2016 07:00:24 -0000      1.28
+++ i386/pctr.c 25 Sep 2016 23:11:11 -0000
@@ -81,7 +81,7 @@ pctrattach(int num)
                return;
 
        pctr_isamd = (strcmp(cpu_vendor, "AuthenticAMD") == 0);
-       if (!pctr_isamd) {
+       if (!pctr_isamd && cpuid_level >= 0xa) {
                pctr_isintel = (strcmp(cpu_vendor, "GenuineIntel") == 0);
                CPUID(0xa, pctr_intel_cap, dummy, dummy, dummy);
        }

Reply via email to