Skip to content

Commit ae24102

Browse files
jrtc27tstellar
authored andcommitted
[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 (cherry picked from commit 2d8c18f)
1 parent c95753f commit ae24102

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
@@ -583,7 +583,7 @@ def XRSTORS64 : RI<0xC7, MRM3m, (outs), (ins opaquemem:$dst),
583583
//===----------------------------------------------------------------------===//
584584
// VIA PadLock crypto instructions
585585
let Defs = [RAX, RDI], Uses = [RDX, RDI], SchedRW = [WriteSystem] in
586-
def XSTORE : I<0xa7, MRM_C0, (outs), (ins), "xstore", []>, TB, REP;
586+
def XSTORE : I<0xa7, MRM_C0, (outs), (ins), "xstore", []>, TB;
587587

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

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)