Disabling paging if PCID is enabled causes the machine to reboot
since tboot was not exited properly. This disables PCID just before
disabling paging in the shutdown handler in case it was not disabled by
the OS first.

Signed-off-by: Jason Zaman <ja...@perfinion.com>

diff -ur tboot-1.8.2.orig/tboot/common/shutdown.S tboot-1.8.2/tboot/common/shutdown.S
--- tboot-1.8.2.orig/tboot/common/shutdown.S	2014-07-28 12:24:22.000000000 +0400
+++ tboot-1.8.2/tboot/common/shutdown.S	2015-05-07 03:05:47.300985413 +0400
@@ -34,6 +34,11 @@
  */
 
 compat_mode_entry:
+	/* Disable PCID */
+        movl %cr4, %eax
+        andl $~CR4_PCIDE, %eax
+        movl %eax, %cr4
+
 	/* Disable paging and therefore leave 64 bit mode. */
         movl %cr0, %eax
         andl $~CR0_PG, %eax
diff -ur tboot-1.8.2.orig/tboot/include/processor.h tboot-1.8.2/tboot/include/processor.h
--- tboot-1.8.2.orig/tboot/include/processor.h	2014-07-28 12:24:22.000000000 +0400
+++ tboot-1.8.2/tboot/include/processor.h	2015-05-07 03:04:58.721244858 +0400
@@ -92,6 +92,7 @@
 #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */
 #define CR4_VMXE 0x00002000/* enable VMX */
 #define CR4_SMXE 0x00004000/* enable SMX */
+#define CR4_PCIDE 0x00020000/* enable PCID */
 
 #ifndef __ASSEMBLY__
 
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
tboot-devel mailing list
tboot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tboot-devel

Reply via email to