x86/pv: Code improvements to do_update_descriptor()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 6 Dec 2018 14:05:34 +0000 (14:05 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 10 Dec 2018 15:43:25 +0000 (15:43 +0000)
commitd2b58b6477d8331aa7cdd360934c617491664501
tree361ab2ecbf42f099bd83c373eeacb3ee1c10628c
parent95efc483ed1368b5c65c7b8486a18f5b7757d25a
x86/pv: Code improvements to do_update_descriptor()

 * Add "uint64_t raw" to seg_desc_t to remove the opencoded uint64_t casting
   in this function.  Change the parameter to be of type seg_desc_t.
 * Rename the 'pa' parameter to 'gaddr', because it lives in GFN space rather
   than physical address space.
 * Use gfn_t and mfn_t rather than unsigned longs.
 * Check the alignment and proposed new descriptor before taking a page
   reference.
 * Use the more flexible ACCESS_ONCE() accessor in preference to
   write_atomic()

No expected change in behaviour.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/pv/descriptor-tables.c
xen/include/asm-x86/desc.h
xen/include/asm-x86/hypercall.h