x86/nvmx: split updating RVI from SVI in nvmx_update_apicv
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 27 Mar 2020 12:45:58 +0000 (13:45 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 27 Mar 2020 13:14:54 +0000 (13:14 +0000)
commit25df013e7ab27c95044655fbc188ea9810e471be
treec7548fb5536758520b4338817cbe359267d879ef
parentac71d99c6aebfbeb321b32ba84125ac6f2699a41
x86/nvmx: split updating RVI from SVI in nvmx_update_apicv

Updating SVI is required when an interrupt has been injected using the
Ack on exit VMEXIT feature, so that the in service interrupt in the
GUEST_INTR_STATUS matches the vector that is signaled in
VM_EXIT_INTR_INFO.

Updating RVI however is not tied to the Ack on exit feature, as it
signals the next vector to be injected, and hence should always be
updated to the next pending vector, regardless of whether Ack on exit
is enabled.

When not using the Ack on exit feature preserve the previous vector in
SVI, so that it's not lost when RVI is updated to contain the pending
vector to inject.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vvmx.c