1 /*
2  * Copyright 2019 The Hafnium Authors.
3  *
4  * Use of this source code is governed by a BSD-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/BSD-3-Clause.
7  */
8 
9 #include "hf/arch/vm/interrupts.h"
10 
11 #include "hf/dlog.h"
12 
13 #include "../sysregs.h"
14 #include "test/vmapi/arch/exception_handler.h"
15 
TEST_SERVICE(perfmon_secondary_basic)16 TEST_SERVICE(perfmon_secondary_basic)
17 {
18 	exception_setup(NULL, exception_handler_skip_instruction);
19 
20 	EXPECT_GT(hf_vm_get_id(), HF_PRIMARY_VM_ID);
21 	TRY_READ(PMCCFILTR_EL0);
22 	TRY_READ(PMCR_EL0);
23 	write_msr(PMINTENSET_EL1, 0xf);
24 
25 	EXPECT_EQ(exception_handler_get_num(), 3);
26 	ffa_yield();
27 }
28