Skip to content

Commit 6a5abee

Browse files
kirylhansendc
authored andcommitted
x86/mtrr: Rename mtrr_overwrite_state() to guest_force_mtrr_state()
Rename the helper to better reflect its function. Suggested-by: Dave Hansen <[email protected]> Signed-off-by: Kirill A. Shutemov <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Acked-by: Dave Hansen <[email protected]> Link: https://lore.kernel.org/all/20241202073139.448208-1-kirill.shutemov%40linux.intel.com
1 parent 40384c8 commit 6a5abee

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

arch/x86/hyperv/ivm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ void __init hv_vtom_init(void)
664664
x86_platform.guest.enc_status_change_finish = hv_vtom_set_host_visibility;
665665

666666
/* Set WB as the default cache mode. */
667-
mtrr_overwrite_state(NULL, 0, MTRR_TYPE_WRBACK);
667+
guest_force_mtrr_state(NULL, 0, MTRR_TYPE_WRBACK);
668668
}
669669

670670
#endif /* defined(CONFIG_AMD_MEM_ENCRYPT) || defined(CONFIG_INTEL_TDX_GUEST) */

arch/x86/include/asm/mtrr.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ struct mtrr_state_type {
5858
*/
5959
# ifdef CONFIG_MTRR
6060
void mtrr_bp_init(void);
61-
void mtrr_overwrite_state(struct mtrr_var_range *var, unsigned int num_var,
62-
mtrr_type def_type);
61+
void guest_force_mtrr_state(struct mtrr_var_range *var, unsigned int num_var,
62+
mtrr_type def_type);
6363
extern u8 mtrr_type_lookup(u64 addr, u64 end, u8 *uniform);
6464
extern void mtrr_save_fixed_ranges(void *);
6565
extern void mtrr_save_state(void);
@@ -75,9 +75,9 @@ void mtrr_disable(void);
7575
void mtrr_enable(void);
7676
void mtrr_generic_set_state(void);
7777
# else
78-
static inline void mtrr_overwrite_state(struct mtrr_var_range *var,
79-
unsigned int num_var,
80-
mtrr_type def_type)
78+
static inline void guest_force_mtrr_state(struct mtrr_var_range *var,
79+
unsigned int num_var,
80+
mtrr_type def_type)
8181
{
8282
}
8383

arch/x86/kernel/cpu/mtrr/generic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ void __init mtrr_copy_map(void)
423423
}
424424

425425
/**
426-
* mtrr_overwrite_state - set static MTRR state
426+
* guest_force_mtrr_state - set static MTRR state for a guest
427427
*
428428
* Used to set MTRR state via different means (e.g. with data obtained from
429429
* a hypervisor).
@@ -436,8 +436,8 @@ void __init mtrr_copy_map(void)
436436
* @num_var: length of the @var array
437437
* @def_type: default caching type
438438
*/
439-
void mtrr_overwrite_state(struct mtrr_var_range *var, unsigned int num_var,
440-
mtrr_type def_type)
439+
void guest_force_mtrr_state(struct mtrr_var_range *var, unsigned int num_var,
440+
mtrr_type def_type)
441441
{
442442
unsigned int i;
443443

arch/x86/kernel/cpu/mtrr/mtrr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ void mtrr_save_state(void)
625625
static int __init mtrr_init_finalize(void)
626626
{
627627
/*
628-
* Map might exist if mtrr_overwrite_state() has been called or if
628+
* Map might exist if guest_force_mtrr_state() has been called or if
629629
* mtrr_enabled() returns true.
630630
*/
631631
mtrr_copy_map();

arch/x86/kernel/kvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ static void __init kvm_init_platform(void)
983983
x86_platform.apic_post_init = kvm_apic_init;
984984

985985
/* Set WB as the default cache mode for SEV-SNP and TDX */
986-
mtrr_overwrite_state(NULL, 0, MTRR_TYPE_WRBACK);
986+
guest_force_mtrr_state(NULL, 0, MTRR_TYPE_WRBACK);
987987
}
988988

989989
#if defined(CONFIG_AMD_MEM_ENCRYPT)

arch/x86/xen/enlighten_pv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static void __init xen_set_mtrr_data(void)
171171

172172
/* Only overwrite MTRR state if any MTRR could be got from Xen. */
173173
if (reg)
174-
mtrr_overwrite_state(var, reg, MTRR_TYPE_UNCACHABLE);
174+
guest_force_mtrr_state(var, reg, MTRR_TYPE_UNCACHABLE);
175175
#endif
176176
}
177177

@@ -195,7 +195,7 @@ static void __init xen_pv_init_platform(void)
195195
if (xen_initial_domain())
196196
xen_set_mtrr_data();
197197
else
198-
mtrr_overwrite_state(NULL, 0, MTRR_TYPE_WRBACK);
198+
guest_force_mtrr_state(NULL, 0, MTRR_TYPE_WRBACK);
199199

200200
/* Adjust nr_cpu_ids before "enumeration" happens */
201201
xen_smp_count_cpus();

0 commit comments

Comments
 (0)