File tree Expand file tree Collapse file tree 1 file changed +4
-19
lines changed
tools/testing/selftests/kvm/x86_64 Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ static inline void __xsavec(struct xstate *xstate, uint64_t rfbm)
86
86
87
87
static void check_xtile_info (void )
88
88
{
89
+ GUEST_ASSERT ((xgetbv (0 ) & XFEATURE_MASK_XTILE ) == XFEATURE_MASK_XTILE );
90
+
89
91
GUEST_ASSERT (this_cpu_has_p (X86_PROPERTY_XSTATE_MAX_SIZE_XCR0 ));
90
92
GUEST_ASSERT (this_cpu_property (X86_PROPERTY_XSTATE_MAX_SIZE_XCR0 ) <= XSAVE_SIZE );
91
93
@@ -122,29 +124,12 @@ static void set_tilecfg(struct tile_config *cfg)
122
124
}
123
125
}
124
126
125
- static void init_regs (void )
126
- {
127
- uint64_t cr4 , xcr0 ;
128
-
129
- GUEST_ASSERT (this_cpu_has (X86_FEATURE_XSAVE ));
130
-
131
- /* turn on CR4.OSXSAVE */
132
- cr4 = get_cr4 ();
133
- cr4 |= X86_CR4_OSXSAVE ;
134
- set_cr4 (cr4 );
135
- GUEST_ASSERT (this_cpu_has (X86_FEATURE_OSXSAVE ));
136
-
137
- xcr0 = xgetbv (0 );
138
- xcr0 |= XFEATURE_MASK_XTILE ;
139
- xsetbv (0x0 , xcr0 );
140
- GUEST_ASSERT ((xgetbv (0 ) & XFEATURE_MASK_XTILE ) == XFEATURE_MASK_XTILE );
141
- }
142
-
143
127
static void __attribute__((__flatten__ )) guest_code (struct tile_config * amx_cfg ,
144
128
struct tile_data * tiledata ,
145
129
struct xstate * xstate )
146
130
{
147
- init_regs ();
131
+ GUEST_ASSERT (this_cpu_has (X86_FEATURE_XSAVE ) &&
132
+ this_cpu_has (X86_FEATURE_OSXSAVE ));
148
133
check_xtile_info ();
149
134
GUEST_SYNC (1 );
150
135
You can’t perform that action at this time.
0 commit comments