x86/HVM: fix hvmemul_rep_outs_set_context()
authorJan Beulich <jbeulich@suse.com>
Fri, 15 Dec 2017 10:11:36 +0000 (11:11 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 Dec 2017 10:11:36 +0000 (11:11 +0100)
commit378d31ab3e007d7a059b3e26d4062d7ac318eef4
tree45717c9c75e6e4af1818fbf9949d289274060979
parent8439e8b6c13f0c11ee30dba8d209e8800537c1d5
x86/HVM: fix hvmemul_rep_outs_set_context()

There were two issues with this function: Its use of
hvmemul_do_pio_buffer() was wrong (the function deals only with
individual port accesses, not repeated ones, i.e. passing it
"*reps * bytes_per_rep" does not have the intended effect). And it
could have processed a larger set of operations in one go than was
probably intended (limited just by the size that xmalloc() can hand
back).

By converting to proper use of hvmemul_do_pio_buffer(), no intermediate
buffer is needed at all. As a result a preemption check is being added.

Also drop unused parameters from the function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
xen/arch/x86/hvm/emulate.c