[PATCH] D112355: [X86] Don't add implicit REP prefix to VIA PadLock xstore

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 22 17:22:55 PDT 2021


jrtc27 created this revision.
jrtc27 added a reviewer: craig.topper.
Herald added subscribers: pengfei, hiraditya, krytarowski, arichardson, emaste.
jrtc27 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Commit 8fa3e8fa1492 <https://reviews.llvm.org/rG8fa3e8fa149203279dba9f4ace99575471cb46ac> 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112355

Files:
  llvm/lib/Target/X86/X86InstrSystem.td
  llvm/test/MC/X86/padlock.s


Index: llvm/test/MC/X86/padlock.s
===================================================================
--- llvm/test/MC/X86/padlock.s
+++ llvm/test/MC/X86/padlock.s
@@ -1,8 +1,11 @@
 // RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s
 
+/// Check xstore does not get an implicit REP prefix but all other PadLock
+/// instructions do.
+
 	xstore
 // CHECK: xstore
-// CHECK: encoding: [0xf3,0x0f,0xa7,0xc0]
+// CHECK: encoding: [0x0f,0xa7,0xc0]
 	xcryptecb
 // CHECK: xcryptecb
 // CHECK: encoding: [0xf3,0x0f,0xa7,0xc8]
Index: llvm/lib/Target/X86/X86InstrSystem.td
===================================================================
--- llvm/lib/Target/X86/X86InstrSystem.td
+++ llvm/lib/Target/X86/X86InstrSystem.td
@@ -584,7 +584,7 @@
 //===----------------------------------------------------------------------===//
 // VIA PadLock crypto instructions
 let Defs = [RAX, RDI], Uses = [RDX, RDI], SchedRW = [WriteSystem] in
-  def XSTORE : I<0xa7, MRM_C0, (outs), (ins), "xstore", []>, TB, REP;
+  def XSTORE : I<0xa7, MRM_C0, (outs), (ins), "xstore", []>, TB;
 
 def : InstAlias<"xstorerng", (XSTORE)>;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112355.381686.patch
Type: text/x-patch
Size: 1134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211023/cd7c8eb9/attachment.bin>


More information about the llvm-commits mailing list