Debian Codegraph @

src/cpu/intel/car/non-evict/exit_car.S

raw
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <cpu/intel/post_codes.h>
4 #include <cpu/x86/mtrr.h>
5 #include <cpu/x86/cache.h>
6 #include <cpu/x86/post_code.h>
7
8 #define NoEvictMod_MSR 0x2e0
9
10 .code32
11 .global chipset_teardown_car
12
13 chipset_teardown_car:
14 pop %esp
15
16 post_code(POSTCODE_POSTCAR_DISABLE_CACHE)
17
18 /* Disable cache. */
19 movl %cr0, %eax
20 orl $CR0_CacheDisable, %eax
21 movl %eax, %cr0
22
23 post_code(POSTCODE_POSTCAR_DISABLE_DEF_MTRR)
24
25 /* Disable MTRR. */
26 movl $MTRR_DEF_TYPE_MSR, %ecx
27 rdmsr
28 andl $(~MTRR_DEF_TYPE_EN), %eax
29 wrmsr
30
31 /* Disable the no eviction run state */
32 movl $NoEvictMod_MSR, %ecx
33 rdmsr
34 andl $~2, %eax
35 wrmsr
36 andl $~1, %eax
37 wrmsr
38
39 post_code(POSTCODE_POSTCAR_TEARDOWN_DONE)
40
41 /* Return to caller. */
42 jmp *%esp