Message ID | 1505510552-22114-1-git-send-email-pbonzini@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/x86/access.c b/x86/access.c index a0c19dc..11f561b 100644 --- a/x86/access.c +++ b/x86/access.c @@ -207,7 +207,7 @@ unsigned set_cr4_smep(int smep) if (smep) ptl2[2] &= ~PT_USER_MASK; r = write_cr4_checking(cr4); - if (!smep) + if (r || !smep) ptl2[2] |= PT_USER_MASK; return r; }
We need to restore PDPE.U=1, similar to what the tests do after printing the "Set SMEP in CR4 - expect #GP: FAIL" message. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- x86/access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)