]> www.infradead.org Git - users/hch/misc.git/commit
virt: sev-guest: Reduce the scope of SNP command mutex
authorNikunj A Dadhania <nikunj@amd.com>
Wed, 9 Oct 2024 09:28:36 +0000 (14:58 +0530)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 16 Oct 2024 16:35:28 +0000 (18:35 +0200)
commitae596615d93dedbdfffbe383f821bea5c5289576
tree536d18fe9ac3ab46132c47e08adda18a9c363c5a
parent999d73686ba1c0700aba4ac0fe86e26f759468a9
virt: sev-guest: Reduce the scope of SNP command mutex

The SNP command mutex is used to serialize access to the shared buffer,
command handling, and message sequence number.

All shared buffer, command handling, and message sequence updates are done
within snp_send_guest_request(), so moving the mutex to this function is
appropriate and maintains the critical section.

Since the mutex is now taken at a later point in time, remove the lockdep
checks that occur before taking the mutex.

Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20241009092850.197575-6-nikunj@amd.com
drivers/virt/coco/sev-guest/sev-guest.c