]> xenbits.xensource.com Git - people/royger/xen.git/commit
x86/hvm/ioreq: simplify code and use consistent naming
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 3 Aug 2017 14:35:26 +0000 (15:35 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 3 Apr 2018 16:00:17 +0000 (17:00 +0100)
commit6ddfaabceeec3c31bc97a7208c46f581de55f71d
treec42ad15fd2fab68adc684aff18b620f1287f28cc
parent97a5a3e3016133334dc3200dfb04b142fbce9f59
x86/hvm/ioreq: simplify code and use consistent naming

This patch re-works much of the ioreq server initialization and teardown
code:

- The hvm_map/unmap_ioreq_gfn() functions are expanded to call through
  to hvm_alloc/free_ioreq_gfn() rather than expecting them to be called
  separately by outer functions.
- Several functions now test the validity of the hvm_ioreq_page gfn value
  to determine whether they need to act. This means can be safely called
  for the bufioreq page even when it is not used.
- hvm_add/remove_ioreq_gfn() simply return in the case of the default
  IOREQ server so callers no longer need to test before calling.
- hvm_ioreq_server_setup_pages() is renamed to hvm_ioreq_server_map_pages()
  to mirror the existing hvm_ioreq_server_unmap_pages().

All of this significantly shortens the code.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/ioreq.c