x86: Split cache_flush() out of cache_writeback()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 9 Jun 2022 12:22:38 +0000 (14:22 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Jun 2022 12:22:38 +0000 (14:22 +0200)
commit9a67ffee3371506e1cbfdfff5b90658d4828f6a2
treeab79ac9c125c40355b3ecdae818e06fa7451334e
parentae09597da34aee6bc5b76475c5eea6994457e854
x86: Split cache_flush() out of cache_writeback()

Subsequent changes will want a fully flushing version.

Use the new helper rather than opencoding it in flush_area_local().  This
resolves an outstanding issue where the conditional sfence is on the wrong
side of the clflushopt loop.  clflushopt is ordered with respect to older
stores, not to younger stores.

Rename gnttab_cache_flush()'s helper to avoid colliding in name.
grant_table.c can see the prototype from cache.h so the build fails
otherwise.

This is part of XSA-402.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/flushtlb.c
xen/arch/x86/include/asm/cache.h
xen/common/grant_table.c