x86/mem-sharing: ensure consistent lock order in get_two_gfns()
authorJan Beulich <jbeulich@suse.com>
Thu, 15 Jul 2021 07:34:28 +0000 (09:34 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 15 Jul 2021 07:34:28 +0000 (09:34 +0200)
commit3cfccd70992b3d2b739e3febfceb99fdf6283be0
tree78342b51951fa81732ccaf952367b6d84bb4cdda
parent1ed3661879ce85188b8ef295f4e388221292b3f9
x86/mem-sharing: ensure consistent lock order in get_two_gfns()

While the comment validly says "Sort by domain, if same domain by gfn",
the implementation also included equal domain IDs in the first part of
the check, thus rending the second part entirely dead and leaving
deadlock potential when there's only a single domain involved.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
master commit: 09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
master date: 2021-07-07 12:35:12 +0200
xen/include/asm-x86/p2m.h