Xen Test Framework
tests
msr
main.c
Go to the documentation of this file.
1
14
#include <xtf.h>
15
16
const
char
test_title
[] =
"Guest MSR information"
;
17
18
void
test_main
(
void
)
19
{
20
unsigned
int
idx = 0;
21
uint64_t
val;
22
23
do
{
24
if
( !
rdmsr_safe
(idx, &val) )
25
printk
(
" %08x -> %016"
PRIx64
"\n"
, idx, val);
26
27
idx++;
28
29
switch
( idx )
30
{
31
case
0x2000:
32
idx = 0x40000000;
33
break
;
34
35
case
0x40000100:
36
idx = 0xC0000000;
37
break
;
38
}
39
40
}
while
( idx <= 0xC0001fff );
41
42
xtf_success
(
NULL
);
43
}
44
45
/*
46
* Local variables:
47
* mode: C
48
* c-file-style: "BSD"
49
* c-basic-offset: 4
50
* tab-width: 4
51
* indent-tabs-mode: nil
52
* End:
53
*/
printk
void printk(const char *fmt,...)
Definition:
console.c:134
test_main
void test_main(void)
To be implemented by each test, as its entry point.
Definition:
main.c:110
test_title
const char test_title[]
The title of the test.
Definition:
main.c:24
PRIx64
#define PRIx64
Definition:
inttypes.h:23
rdmsr_safe
static bool rdmsr_safe(uint32_t idx, uint64_t *val)
Wrapper around rdmsr which safely catches #GP[0].
Definition:
msr.h:35
xtf_success
void xtf_success(const char *fmt,...)
Report test success.
Definition:
report.c:38
NULL
#define NULL
Definition:
stddef.h:12
uint64_t
__UINT64_TYPE__ uint64_t
Definition:
stdint.h:17
Generated by
1.9.4