|
|
@@ -113,11 +113,27 @@ static inline u32 __read_pkru(void)
|
|
|
: "c" (ecx));
|
|
|
return pkru;
|
|
|
}
|
|
|
+
|
|
|
+static inline void __write_pkru(u32 pkru)
|
|
|
+{
|
|
|
+ u32 ecx = 0, edx = 0;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * "wrpkru" instruction. Loads contents in EAX to PKRU,
|
|
|
+ * requires that ecx = edx = 0.
|
|
|
+ */
|
|
|
+ asm volatile(".byte 0x0f,0x01,0xef\n\t"
|
|
|
+ : : "a" (pkru), "c"(ecx), "d"(edx));
|
|
|
+}
|
|
|
#else
|
|
|
static inline u32 __read_pkru(void)
|
|
|
{
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
+static inline void __write_pkru(u32 pkru)
|
|
|
+{
|
|
|
+}
|
|
|
#endif
|
|
|
|
|
|
static inline void native_wbinvd(void)
|