Skip to content

Commit 6e8c78d

Browse files
committed
Merge tag 'for-linus-6.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross: "One fix for silencing a smatch warning, and a small cleanup patch" * tag 'for-linus-6.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/xen: simplify sysenter and syscall setup x86/xen: silence smatch warning in pmu_msr_chk_emulated()
2 parents 9761070 + 4bff677 commit 6e8c78d

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

arch/x86/xen/pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static bool xen_amd_pmu_emulate(unsigned int msr, u64 *val, bool is_read)
302302
static bool pmu_msr_chk_emulated(unsigned int msr, uint64_t *val, bool is_read,
303303
bool *emul)
304304
{
305-
int type, index;
305+
int type, index = 0;
306306

307307
if (is_amd_pmu_msr(msr))
308308
*emul = xen_amd_pmu_emulate(msr, val, is_read);

arch/x86/xen/setup.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -910,17 +910,9 @@ static int register_callback(unsigned type, const void *func)
910910

911911
void xen_enable_sysenter(void)
912912
{
913-
int ret;
914-
unsigned sysenter_feature;
915-
916-
sysenter_feature = X86_FEATURE_SYSENTER32;
917-
918-
if (!boot_cpu_has(sysenter_feature))
919-
return;
920-
921-
ret = register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compat);
922-
if(ret != 0)
923-
setup_clear_cpu_cap(sysenter_feature);
913+
if (cpu_feature_enabled(X86_FEATURE_SYSENTER32) &&
914+
register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compat))
915+
setup_clear_cpu_cap(X86_FEATURE_SYSENTER32);
924916
}
925917

926918
void xen_enable_syscall(void)
@@ -934,12 +926,9 @@ void xen_enable_syscall(void)
934926
mechanism for syscalls. */
935927
}
936928

937-
if (boot_cpu_has(X86_FEATURE_SYSCALL32)) {
938-
ret = register_callback(CALLBACKTYPE_syscall32,
939-
xen_entry_SYSCALL_compat);
940-
if (ret != 0)
941-
setup_clear_cpu_cap(X86_FEATURE_SYSCALL32);
942-
}
929+
if (cpu_feature_enabled(X86_FEATURE_SYSCALL32) &&
930+
register_callback(CALLBACKTYPE_syscall32, xen_entry_SYSCALL_compat))
931+
setup_clear_cpu_cap(X86_FEATURE_SYSCALL32);
943932
}
944933

945934
static void __init xen_pvmmu_arch_setup(void)

0 commit comments

Comments
 (0)