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 "vmapi/hf/call.h"
10 
11 #include "../msr.h"
12 #include "test/hftest.h"
13 
14 /**
15  * Test that encoding a system register using the implementation defined syntax
16  * maps to the same register defined by name.
17  */
TEST(arch_features,read_write_msr_impdef)18 TEST(arch_features, read_write_msr_impdef)
19 {
20 	uintreg_t value = 0xa;
21 	write_msr(S3_3_C9_C13_0, value);
22 	EXPECT_EQ(read_msr(S3_3_C9_C13_0), value);
23 	EXPECT_EQ(read_msr(PMCCNTR_EL0), value);
24 }
25