x86/shadow: polish shadow_write_entries()
authorJan Beulich <jbeulich@suse.com>
Mon, 12 Apr 2021 10:30:13 +0000 (12:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 12 Apr 2021 10:30:13 +0000 (12:30 +0200)
commita3621d6b4a919c49fc04234776569c435bae0ce7
tree9a66569290260e8afde965864798ba7f1aeec915
parentc864eb01965ab212ce9663d5d83b482e9d149825
x86/shadow: polish shadow_write_entries()

First of all, avoid the initial dummy write: Try to write the actual
new value instead, and start the loop from 1 if this was successful.
Further, drop safe_write_entry() and use write_atomic() instead. This
eliminates the need for the BUILD_BUG_ON() there at the same time.

Then
- use const and unsigned,
- drop a redundant NULL check,
- don't open-code PAGE_OFFSET() and IS_ALIGNED(),
- adjust comment style.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/shadow/multi.c