This matches hardware behaviour, and prevents erroneous failures when a guest
has SMEP/SMAP active and issues a FEP from userspace.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit:
0831e99446121636045cf6f616a1991d6ef22071
master date: 2016-09-08 16:39:46 +0100
if ( opt_hvm_fep )
{
+ uint32_t walk = (ctxt.seg_reg[x86_seg_ss].attr.fields.dpl == 3)
+ ? PFEC_user_mode : 0;
char sig[5]; /* ud2; .ascii "xen" */
if ( (hvm_fetch_from_guest_virt_nofault(
- sig, regs->eip, sizeof(sig), 0) == HVMCOPY_okay) &&
+ sig, regs->eip, sizeof(sig), walk) == HVMCOPY_okay) &&
(memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
{
regs->eip += sizeof(sig);
if ( opt_hvm_fep )
{
+ uint32_t walk = (ctxt.seg_reg[x86_seg_ss].attr.fields.dpl == 3)
+ ? PFEC_user_mode : 0;
char sig[5]; /* ud2; .ascii "xen" */
if ( (hvm_fetch_from_guest_virt_nofault(
- sig, regs->eip, sizeof(sig), 0) == HVMCOPY_okay) &&
+ sig, regs->eip, sizeof(sig), walk) == HVMCOPY_okay) &&
(memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
{
regs->eip += sizeof(sig);