ANDROID: KVM: arm64: PROTECTED_NVHE_FTRACE to PKVM_FTRACE

The mouthful PROTECTED_NVHE and now inaccurate prefix (the pKVM
hypervisor actually runs with hVHE) is on its way out in favor of PKVM.

Bug: 357781595
Change-Id: I3f695065677c1bba0db2e66b2f9bf9f7b777a896
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
This commit is contained in:
Vincent Donnefort
2025-02-21 11:01:08 +00:00
parent 386af809e4
commit 58ca789e21
11 changed files with 13 additions and 13 deletions

View File

@@ -11,7 +11,7 @@
* Hypervisor events definitions.
*/
#ifdef CONFIG_PROTECTED_NVHE_FTRACE
#ifdef CONFIG_PKVM_FTRACE
HYP_EVENT(func,
HE_PROTO(unsigned long ip, unsigned long parent),
HE_STRUCT(

View File

@@ -140,7 +140,7 @@ KVM_NVHE_ALIAS(__hyp_rodata_end);
KVM_NVHE_ALIAS(__hyp_event_ids_start);
KVM_NVHE_ALIAS(__hyp_event_ids_end);
KVM_NVHE_ALIAS(__hyp_printk_fmts_start);
#ifdef CONFIG_PROTECTED_NVHE_FTRACE
#ifdef CONFIG_PKVM_FTRACE
KVM_NVHE_ALIAS(__hyp_patchable_function_entries_start);
KVM_NVHE_ALIAS(__hyp_patchable_function_entries_end);
#endif

View File

@@ -122,7 +122,7 @@ config PTDUMP_STAGE2_DEBUGFS
If in doubt, say N.
config PROTECTED_NVHE_FTRACE
config PKVM_FTRACE
bool "Protected KVM hypervisor function tracing"
depends on KVM
depends on TRACING

View File

@@ -263,7 +263,7 @@ SYM_CODE_START(__bp_harden_hyp_vecs)
.org 1b
SYM_CODE_END(__bp_harden_hyp_vecs)
#if defined(__KVM_NVHE_HYPERVISOR__) && defined(CONFIG_PROTECTED_NVHE_FTRACE)
#if defined(__KVM_NVHE_HYPERVISOR__) && defined(CONFIG_PKVM_FTRACE)
SYM_FUNC_START(__hyp_ftrace_tramp)
stp x0, x1, [sp, #-16]!
stp x2, x3, [sp, #-16]!

View File

@@ -82,7 +82,7 @@ do { \
#define trace_hyp_printk(fmt, ...) \
__trace_hyp_printk_N(fmt, __VA_ARGS__)
#ifdef CONFIG_PROTECTED_NVHE_FTRACE
#ifdef CONFIG_PKVM_FTRACE
void hyp_ftrace_setup_core(void);
unsigned long *hyp_ftrace_find_host_func(unsigned long host_func,
unsigned long *funcs,
@@ -106,7 +106,7 @@ static inline void hyp_ftrace_enable(unsigned long *funcs, unsigned long *funcs_
bool enable, void *tramp) { }
static inline int __pkvm_sync_ftrace(unsigned long host_func_pg) { return -EOPNOTSUPP; }
static inline int __pkvm_disable_ftrace(void) { return -EOPNOTSUPP; }
#endif /* CONFIG_PROTECTED_NVHE_FTRACE */
#endif /* CONFIG_PKVM_FTRACE */
#else /* CONFIG_TRACING */
static inline int
register_hyp_mod_events(void *event_ids, size_t nr_events, void *funcs, void *funcs_end,

View File

@@ -14,7 +14,7 @@ hyp-obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \
../../../kernel/smccc-call.o
hyp-obj-$(CONFIG_LIST_HARDENED) += list_debug.o
hyp-obj-$(CONFIG_TRACING) += clock.o events.o trace.o
hyp-obj-$(CONFIG_PROTECTED_NVHE_FTRACE) += ftrace.o
hyp-obj-$(CONFIG_PKVM_FTRACE) += ftrace.o
hyp-obj-$(CONFIG_MODULES) += modules.o
hyp-obj-y += $(lib-objs)

View File

@@ -14,7 +14,7 @@ ccflags-y += -fno-stack-protector \
-DDISABLE_BRANCH_PROFILING \
$(DISABLE_STACKLEAK_PLUGIN)
ifeq ($(CONFIG_PROTECTED_NVHE_FTRACE), y)
ifeq ($(CONFIG_PKVM_FTRACE), y)
ccflags-y += -fpatchable-function-entry=3
endif

View File

@@ -29,7 +29,7 @@ static struct {
} funcs;
} hyp_mod_events[MAX_MOD_EVENTS];
#ifdef CONFIG_PROTECTED_NVHE_FTRACE
#ifdef CONFIG_PKVM_FTRACE
int __pkvm_sync_ftrace(unsigned long host_funcs_pg)
{
unsigned long *funcs_pg = (unsigned long *)kern_hyp_va(host_funcs_pg);

View File

@@ -41,7 +41,7 @@ SECTIONS {
*(__patchable_function_entries __patchable_function_entries.*)
}
#ifdef CONFIG_PROTECTED_NVHE_FTRACE
#ifdef CONFIG_PKVM_FTRACE
.hyp.text.ftrace_tramp : {
. = . +20;
}

View File

@@ -101,7 +101,7 @@ static const char *hyp_printk_fmt_from_id(u8 fmt_id)
return fmt ? fmt->fmt : "Unknown Format";
}
#ifdef CONFIG_PROTECTED_NVHE_FTRACE
#ifdef CONFIG_PKVM_FTRACE
extern unsigned long __hyp_patchable_function_entries_start[];
extern unsigned long __hyp_patchable_function_entries_end[];
extern unsigned long kvm_nvhe_sym(__hyp_text_start_kern);
@@ -835,7 +835,7 @@ void hyp_trace_init_event_tracefs(struct dentry *parent)
{
int nr_events = nr_entries(__hyp_events_start, __hyp_events_end);
#ifdef CONFIG_PROTECTED_NVHE_FTRACE
#ifdef CONFIG_PKVM_FTRACE
tracefs_create_file("set_ftrace_filter", 0600, parent, (void *)true,
&hyp_ftrace_filter_fops);
tracefs_create_file("set_ftrace_notrace", 0200, parent, (void *)false,

View File

@@ -1485,7 +1485,7 @@ EXPORT_SYMBOL(__pkvm_register_el2_call);
void pkvm_el2_mod_frob_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings)
{
#ifdef CONFIG_PROTECTED_NVHE_FTRACE
#ifdef CONFIG_PKVM_FTRACE
int i;
for (i = 0; i < ehdr->e_shnum; i++) {