]> xenbits.xensource.com Git - xen.git/commit
x86/mem-sharing: ensure consistent lock order in get_two_gfns()
authorJan Beulich <jbeulich@suse.com>
Wed, 7 Jul 2021 10:35:12 +0000 (12:35 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 7 Jul 2021 10:35:12 +0000 (12:35 +0200)
commit09af2d01a2fe6a0af08598bdfe12c9707f4d82ba
treeb84eeef9d81af5afcda368d8cfea9a9d16659b17
parent980d6acf1517f0602e6dcf05ea922cf14c95e9c0
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>
xen/include/asm-x86/p2m.h