x86/svm: Fix handling of EFLAGS.RF on task switch
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 3 Dec 2019 16:59:09 +0000 (16:59 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 5 Dec 2019 13:19:28 +0000 (13:19 +0000)
commita57e0b39800242a0fc3ef76c9cb642f10a1a5cbd
treefe1292282ca9b6ae9de51d6f400c4519d3f66fd6
parentefff60f8be79790a6b195d2b8008da7e6e7716b1
x86/svm: Fix handling of EFLAGS.RF on task switch

VT-x updates RF before vmexit, so eflags written into the outgoing TSS happens
to be correct.  SVM does not update RF before vmexit, and instead provides it
via a bit in exitinfo2.

In practice, needing RF set in the outgoing state occurs when a task gate is
used to handle faults.

Extend hvm_task_switch() with an extra_eflags parameter which gets fed into
the outgoing TSS, and fill it in suitably from the SVM vmexit information.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/hvm.h