]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: s390: interrupt: use READ_ONCE() before cmpxchg()
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Jan 2023 14:54:56 +0000 (15:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Feb 2023 06:52:42 +0000 (07:52 +0100)
commit12d5d86ffd6eaa0c744f631749fa44c582dc97c0
treee36c4c702054b44ffbd667df25956333b834c32b
parentfe639789cfcc4d59ddbb7b964d0269a288d0ef0b
KVM: s390: interrupt: use READ_ONCE() before cmpxchg()

[ Upstream commit 42400d99e9f0728c17240edb9645637ead40f6b9 ]

Use READ_ONCE() before cmpxchg() to prevent that the compiler generates
code that fetches the to be compared old value several times from memory.

Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Link: https://lore.kernel.org/r/20230109145456.2895385-1-hca@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/kvm/interrupt.c