Skip to content

Commit 2d8c18f

Browse files
committed
[X86] Don't add implicit REP prefix to VIA PadLock xstore
Commit 8fa3e8f added an implicit REP prefix to all VIA PadLock instructions, but GNU as doesn't add one to xstore, only all the others. This resulted in a kernel panic regression in FreeBSD upon updating to LLVM 11 (https://bugs.freebsd.org/259218) which includes the commit in question. This partially reverts that commit. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D112355
1 parent b432583 commit 2d8c18f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

llvm/lib/Target/X86/X86InstrSystem.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def XRSTORS64 : RI<0xC7, MRM3m, (outs), (ins opaquemem:$dst),
584584
//===----------------------------------------------------------------------===//
585585
// VIA PadLock crypto instructions
586586
let Defs = [RAX, RDI], Uses = [RDX, RDI], SchedRW = [WriteSystem] in
587-
def XSTORE : I<0xa7, MRM_C0, (outs), (ins), "xstore", []>, TB, REP;
587+
def XSTORE : I<0xa7, MRM_C0, (outs), (ins), "xstore", []>, TB;
588588

589589
def : InstAlias<"xstorerng", (XSTORE)>;
590590

llvm/test/MC/X86/padlock.s

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s
22

3+
/// Check xstore does not get an implicit REP prefix but all other PadLock
4+
/// instructions do.
5+
36
xstore
47
// CHECK: xstore
5-
// CHECK: encoding: [0xf3,0x0f,0xa7,0xc0]
8+
// CHECK: encoding: [0x0f,0xa7,0xc0]
69
xcryptecb
710
// CHECK: xcryptecb
811
// CHECK: encoding: [0xf3,0x0f,0xa7,0xc8]

0 commit comments

Comments
 (0)