+
+#ifdef CONFIG_X86_64
+ if ((xcr0 & XFEATURE_MASK_XTILE) &&
+ ((xcr0 & XFEATURE_MASK_XTILE) != XFEATURE_MASK_XTILE))
+ return 1;
+#else
+ /*
+ * Intel AMX instructions can be executed only in 64-bit mode but
+ * XSAVE can operate on XTILECFG and XTILEDATA in any mode.
+ * Since the FPU core follows SDM recommendation to set
+ * XCR[18:17] only in 64-bit environment, here also prevent any
+ * guest OS from setting the two bits when host is 32-bit.
+ *
+ * XFEATURE_MASK_XTILE cannot be used since it is 0 in this case.
+ */
+ xcr0 &= ~(XFEATURE_MASK_XTILE_DATA | XFEATURE_MASK_XTILE_CFG);
+#endif