Xen Test Framework
main.c
Go to the documentation of this file.
1
14#include <xtf.h>
15
16const char test_title[] = "Guest MSR information";
17
18void 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
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 */
void printk(const char *fmt,...)
Definition: console.c:134
void test_main(void)
To be implemented by each test, as its entry point.
Definition: main.c:110
const char test_title[]
The title of the test.
Definition: main.c:24
#define PRIx64
Definition: inttypes.h:23
static bool rdmsr_safe(uint32_t idx, uint64_t *val)
Wrapper around rdmsr which safely catches #GP[0].
Definition: msr.h:35
void xtf_success(const char *fmt,...)
Report test success.
Definition: report.c:38
#define NULL
Definition: stddef.h:12
__UINT64_TYPE__ uint64_t
Definition: stdint.h:17