File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -163,9 +163,15 @@ static noinstr unsigned long __rdgsbase_inactive(void)
163
163
164
164
lockdep_assert_irqs_disabled ();
165
165
166
- native_swapgs ();
167
- gsbase = rdgsbase ();
168
- native_swapgs ();
166
+ if (!static_cpu_has (X86_FEATURE_XENPV )) {
167
+ native_swapgs ();
168
+ gsbase = rdgsbase ();
169
+ native_swapgs ();
170
+ } else {
171
+ instrumentation_begin ();
172
+ rdmsrl (MSR_KERNEL_GS_BASE , gsbase );
173
+ instrumentation_end ();
174
+ }
169
175
170
176
return gsbase ;
171
177
}
@@ -182,9 +188,15 @@ static noinstr void __wrgsbase_inactive(unsigned long gsbase)
182
188
{
183
189
lockdep_assert_irqs_disabled ();
184
190
185
- native_swapgs ();
186
- wrgsbase (gsbase );
187
- native_swapgs ();
191
+ if (!static_cpu_has (X86_FEATURE_XENPV )) {
192
+ native_swapgs ();
193
+ wrgsbase (gsbase );
194
+ native_swapgs ();
195
+ } else {
196
+ instrumentation_begin ();
197
+ wrmsrl (MSR_KERNEL_GS_BASE , gsbase );
198
+ instrumentation_end ();
199
+ }
188
200
}
189
201
190
202
/*
You can’t perform that action at this time.
0 commit comments