arch/arm64/kvm/hyp/nvhe/events.c

Source file repositories/reference/linux-study-clean/arch/arm64/kvm/hyp/nvhe/events.c

File Facts

System
Linux kernel
Corpus path
arch/arm64/kvm/hyp/nvhe/events.c
Extension
.c
Size
536 bytes
Lines
26
Domain
Architecture Layer
Bucket
arch/arm64
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2025 Google LLC
 * Author: Vincent Donnefort <vdonnefort@google.com>
 */

#include <nvhe/mm.h>
#include <nvhe/trace.h>

#include <nvhe/define_events.h>

int __tracing_enable_event(unsigned short id, bool enable)
{
	struct hyp_event_id *event_id = &__hyp_event_ids_start[id];
	atomic_t *enabled;

	if (event_id >= __hyp_event_ids_end)
		return -EINVAL;

	enabled = hyp_fixmap_map(__hyp_pa(&event_id->enabled));
	atomic_set(enabled, enable);
	hyp_fixmap_unmap();

	return 0;
}

Annotation

Implementation Notes