Commit 4bff677b authored by Juergen Gross's avatar Juergen Gross

x86/xen: simplify sysenter and syscall setup

xen_enable_sysenter() and xen_enable_syscall() can be simplified a lot.

While at it, switch to use cpu_feature_enabled() instead of
boot_cpu_has().
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 354d8a4b
...@@ -910,17 +910,9 @@ static int register_callback(unsigned type, const void *func) ...@@ -910,17 +910,9 @@ static int register_callback(unsigned type, const void *func)
void xen_enable_sysenter(void) void xen_enable_sysenter(void)
{ {
int ret; if (cpu_feature_enabled(X86_FEATURE_SYSENTER32) &&
unsigned sysenter_feature; register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compat))
setup_clear_cpu_cap(X86_FEATURE_SYSENTER32);
sysenter_feature = X86_FEATURE_SYSENTER32;
if (!boot_cpu_has(sysenter_feature))
return;
ret = register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compat);
if(ret != 0)
setup_clear_cpu_cap(sysenter_feature);
} }
void xen_enable_syscall(void) void xen_enable_syscall(void)
...@@ -934,12 +926,9 @@ void xen_enable_syscall(void) ...@@ -934,12 +926,9 @@ void xen_enable_syscall(void)
mechanism for syscalls. */ mechanism for syscalls. */
} }
if (boot_cpu_has(X86_FEATURE_SYSCALL32)) { if (cpu_feature_enabled(X86_FEATURE_SYSCALL32) &&
ret = register_callback(CALLBACKTYPE_syscall32, register_callback(CALLBACKTYPE_syscall32, xen_entry_SYSCALL_compat))
xen_entry_SYSCALL_compat); setup_clear_cpu_cap(X86_FEATURE_SYSCALL32);
if (ret != 0)
setup_clear_cpu_cap(X86_FEATURE_SYSCALL32);
}
} }
static void __init xen_pvmmu_arch_setup(void) static void __init xen_pvmmu_arch_setup(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment