History log of /openbsd-current/sys/arch/amd64/amd64/mtrr.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.5 03-Apr-2024 guenther

Add ci_cpuid_level and ci_vendor holding the per-CPU basic cpuid
level and a numeric mapping of the cpu vendor, both from CPUID(0).
Convert the general use of strcmp(cpu_vendor) to simple numeric
tests of ci_vendor. Track the minimum of all ci_cpuid_level in the
cpuid_level global and continue to use that for what we vmm exposes.

AMD testing help matthieu@ krw@
ok miod@ deraadt@ cheloha@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.4 19-Dec-2013 deraadt

Mtrr stops being a pseudo-device. We need to probe the cpu type and
initialize the structures when we see the first cpu. We also need to
initialize each cpu's properly (for PAT) before we setup mtrr on that
cpu. On i386 (late hatch) we were getting this desperately wrong on
the primary cpu.

After suspend/resume, we also need to do the same work. re-initialize
PAT before mtrr. On some laptops apparently PAT was not turned on by the
BIOS, so we ended up with incorrect setup for the primary cpu. Oops.

This makes mplayer on the x201 (and similar) machines work without weird
pauses after a suspend/resume. Many other things are likely fixed.
ok kettenis


# 1.3 24-Aug-2013 mlarkin

Cleanup amd64 and i386 MTRR code -

1. Makes amd64 and i386 MTRR code nearly identical
2. Removes support for per-process MTRRs (which were never implemented)
3. Treat "unknown" MTRR types as uncacheable instead of trying to preserve
bogus settings made by the BIOS
4. Various KNF cleanups

Should be no functional change.

ok jsg@, deraadt@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.2 01-Jun-2009 phessler

Fix the order of checking if a machine has MTRR. We need to check
against the vendor string, then cpu family, then if the cpu claims to
have it.

requested by toby@

Also match against Via's cpu string to enable MTRR on matthieu@'s VIA Nano

compile tested on i386 by wcmaier@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.1 11-Jun-2008 phessler

Synchronize the MTRR API with i386, and enable

"just commit it" deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.4 19-Dec-2013 deraadt

Mtrr stops being a pseudo-device. We need to probe the cpu type and
initialize the structures when we see the first cpu. We also need to
initialize each cpu's properly (for PAT) before we setup mtrr on that
cpu. On i386 (late hatch) we were getting this desperately wrong on
the primary cpu.

After suspend/resume, we also need to do the same work. re-initialize
PAT before mtrr. On some laptops apparently PAT was not turned on by the
BIOS, so we ended up with incorrect setup for the primary cpu. Oops.

This makes mplayer on the x201 (and similar) machines work without weird
pauses after a suspend/resume. Many other things are likely fixed.
ok kettenis


# 1.3 24-Aug-2013 mlarkin

Cleanup amd64 and i386 MTRR code -

1. Makes amd64 and i386 MTRR code nearly identical
2. Removes support for per-process MTRRs (which were never implemented)
3. Treat "unknown" MTRR types as uncacheable instead of trying to preserve
bogus settings made by the BIOS
4. Various KNF cleanups

Should be no functional change.

ok jsg@, deraadt@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.2 01-Jun-2009 phessler

Fix the order of checking if a machine has MTRR. We need to check
against the vendor string, then cpu family, then if the cpu claims to
have it.

requested by toby@

Also match against Via's cpu string to enable MTRR on matthieu@'s VIA Nano

compile tested on i386 by wcmaier@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.1 11-Jun-2008 phessler

Synchronize the MTRR API with i386, and enable

"just commit it" deraadt@