mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Fall back to wbinvd when region for CLFLUSH is >= 2MB.
Submitted by: Kevin Day <toasty dragondata com> Reviewed by: jhb MFC after: 2 weeks
This commit is contained in:
parent
33962e6d47
commit
2a595a404f
2 changed files with 8 additions and 4 deletions
|
|
@ -1105,7 +1105,8 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva)
|
|||
|
||||
if (cpu_feature & CPUID_SS)
|
||||
; /* If "Self Snoop" is supported, do nothing. */
|
||||
else if (cpu_feature & CPUID_CLFSH) {
|
||||
else if ((cpu_feature & CPUID_CLFSH) != 0 &&
|
||||
eva - sva < 2 * 1024 * 1024) {
|
||||
|
||||
/*
|
||||
* Otherwise, do per-cache line flush. Use the mfence
|
||||
|
|
@ -1122,7 +1123,8 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva)
|
|||
|
||||
/*
|
||||
* No targeted cache flush methods are supported by CPU,
|
||||
* globally invalidate cache as a last resort.
|
||||
* or the supplied range is bigger then 2MB.
|
||||
* Globally invalidate cache.
|
||||
*/
|
||||
pmap_invalidate_cache();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -996,7 +996,8 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva)
|
|||
|
||||
if (cpu_feature & CPUID_SS)
|
||||
; /* If "Self Snoop" is supported, do nothing. */
|
||||
else if (cpu_feature & CPUID_CLFSH) {
|
||||
else if ((cpu_feature & CPUID_CLFSH) != 0 &&
|
||||
eva - sva < 2 * 1024 * 1024) {
|
||||
|
||||
/*
|
||||
* Otherwise, do per-cache line flush. Use the mfence
|
||||
|
|
@ -1013,7 +1014,8 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva)
|
|||
|
||||
/*
|
||||
* No targeted cache flush methods are supported by CPU,
|
||||
* globally invalidate cache as a last resort.
|
||||
* or the supplied range is bigger then 2MB.
|
||||
* Globally invalidate cache.
|
||||
*/
|
||||
pmap_invalidate_cache();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue