.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2005 Intel Corporation |
---|
3 | 4 | * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> |
---|
.. | .. |
---|
51 | 52 | if (c->x86_vendor == X86_VENDOR_INTEL && |
---|
52 | 53 | (c->x86 > 0xf || (c->x86 == 6 && c->x86_model >= 0x0f))) |
---|
53 | 54 | flags->bm_control = 0; |
---|
| 55 | + /* |
---|
| 56 | + * For all recent Centaur CPUs, the ucode will make sure that each |
---|
| 57 | + * core can keep cache coherence with each other while entering C3 |
---|
| 58 | + * type state. So, set bm_check to 1 to indicate that the kernel |
---|
| 59 | + * doesn't need to execute a cache flush operation (WBINVD) when |
---|
| 60 | + * entering C3 type state. |
---|
| 61 | + */ |
---|
| 62 | + if (c->x86_vendor == X86_VENDOR_CENTAUR) { |
---|
| 63 | + if (c->x86 > 6 || (c->x86 == 6 && c->x86_model == 0x0f && |
---|
| 64 | + c->x86_stepping >= 0x0e)) |
---|
| 65 | + flags->bm_check = 1; |
---|
| 66 | + } |
---|
| 67 | + |
---|
| 68 | + if (c->x86_vendor == X86_VENDOR_ZHAOXIN) { |
---|
| 69 | + /* |
---|
| 70 | + * All Zhaoxin CPUs that support C3 share cache. |
---|
| 71 | + * And caches should not be flushed by software while |
---|
| 72 | + * entering C3 type state. |
---|
| 73 | + */ |
---|
| 74 | + flags->bm_check = 1; |
---|
| 75 | + /* |
---|
| 76 | + * On all recent Zhaoxin platforms, ARB_DISABLE is a nop. |
---|
| 77 | + * So, set bm_control to zero to indicate that ARB_DISABLE |
---|
| 78 | + * is not required while entering C3 type state. |
---|
| 79 | + */ |
---|
| 80 | + flags->bm_control = 0; |
---|
| 81 | + } |
---|
| 82 | + if (c->x86_vendor == X86_VENDOR_AMD && c->x86 >= 0x17) { |
---|
| 83 | + /* |
---|
| 84 | + * For all AMD Zen or newer CPUs that support C3, caches |
---|
| 85 | + * should not be flushed by software while entering C3 |
---|
| 86 | + * type state. Set bm->check to 1 so that kernel doesn't |
---|
| 87 | + * need to execute cache flush operation. |
---|
| 88 | + */ |
---|
| 89 | + flags->bm_check = 1; |
---|
| 90 | + /* |
---|
| 91 | + * In current AMD C state implementation ARB_DIS is no longer |
---|
| 92 | + * used. So set bm_control to zero to indicate ARB_DIS is not |
---|
| 93 | + * required while entering C3 type state. |
---|
| 94 | + */ |
---|
| 95 | + flags->bm_control = 0; |
---|
| 96 | + } |
---|
54 | 97 | } |
---|
55 | 98 | EXPORT_SYMBOL(acpi_processor_power_init_bm_check); |
---|
56 | 99 | |
---|