[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.4] x86emul: tighten CLFLUSH emulation



commit b27f551db361b8ec04b25d15197617626ac0de83
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Feb 3 12:30:12 2015 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Feb 3 12:30:12 2015 +0100

    x86emul: tighten CLFLUSH emulation
    
    While for us it's not as bad as it was for Linux, their commit
    13e457e0ee ("KVM: x86: Emulator does not decode clflush well", by
    Nadav Amit <namit@xxxxxxxxxxxxxxxxx>) nevertheless points out two
    shortcomings in our code: opcode 0F AE /7 is clflush only when it uses
    a memory mode (otherwise it's SFENCE) and when there's no REP prefix
    (an operand size prefix is fine, as that's CLFLUSHOPT).
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 9d03db6b81d1880bf3aa4fc83a60346bf02be251
    master date: 2015-01-12 15:41:12 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c 
b/xen/arch/x86/x86_emulate/x86_emulate.c
index 25571c6..cb172e9 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4311,7 +4311,9 @@ x86_emulate(
     case 0xae: /* Grp15 */
         switch ( modrm_reg & 7 )
         {
-        case 7: /* clflush */
+        case 7: /* clflush{,opt} */
+            fail_if(modrm_mod == 3);
+            fail_if(rep_prefix());
             fail_if(ops->wbinvd == NULL);
             if ( (rc = ops->wbinvd(ctxt)) != 0 )
                 goto done;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.