aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/bootparam_utils.h
diff options
context:
space:
mode:
authorUros Bizjak <[email protected]>2023-02-27 17:09:17 +0100
committerBorislav Petkov (AMD) <[email protected]>2023-04-07 14:34:24 +0200
commitf96fb2df3eb31ede1b34b0521560967310267750 (patch)
tree95db336bc06881513bf8c02e9ad50530c5d77c10 /arch/x86/include/asm/bootparam_utils.h
parent5b422b9bb7318b5ab8d0c124d623db4d3f6b2771 (diff)
x86/apic: Fix atomic update of offset in reserve_eilvt_offset()
The detection of atomic update failure in reserve_eilvt_offset() is not correct. The value returned by atomic_cmpxchg() should be compared to the old value from the location to be updated. If these two are the same, then atomic update succeeded and "eilvt_offsets[offset]" location is updated to "new" in an atomic way. Otherwise, the atomic update failed and it should be retried with the value from "eilvt_offsets[offset]" - exactly what atomic_try_cmpxchg() does in a correct and more optimal way. Fixes: a68c439b1966c ("apic, x86: Check if EILVT APIC registers are available (AMD only)") Signed-off-by: Uros Bizjak <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'arch/x86/include/asm/bootparam_utils.h')
0 files changed, 0 insertions, 0 deletions