Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/arch/arm64/kvm/hyp/nvhe/events.c
170998 views
1
// SPDX-License-Identifier: GPL-2.0-only
2
/*
3
* Copyright (C) 2025 Google LLC
4
* Author: Vincent Donnefort <[email protected]>
5
*/
6
7
#include <nvhe/mm.h>
8
#include <nvhe/trace.h>
9
10
#include <nvhe/define_events.h>
11
12
int __tracing_enable_event(unsigned short id, bool enable)
13
{
14
struct hyp_event_id *event_id = &__hyp_event_ids_start[id];
15
atomic_t *enabled;
16
17
if (event_id >= __hyp_event_ids_end)
18
return -EINVAL;
19
20
enabled = hyp_fixmap_map(__hyp_pa(&event_id->enabled));
21
atomic_set(enabled, enable);
22
hyp_fixmap_unmap();
23
24
return 0;
25
}
26
27