Skip to content

Commit 1478b99

Browse files
Fenghua Yusuryasaimadhu
authored andcommitted
x86/cpufeatures: Mark ENQCMD as disabled when configured out
Currently, the ENQCMD feature depends on CONFIG_IOMMU_SUPPORT. Add X86_FEATURE_ENQCMD to the disabled features mask so that it gets disabled when the IOMMU config option above is not enabled. Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 52ad9bc commit 1478b99

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

arch/x86/include/asm/disabled-features.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
# define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31))
5757
#endif
5858

59+
#ifdef CONFIG_IOMMU_SUPPORT
60+
# define DISABLE_ENQCMD 0
61+
#else
62+
# define DISABLE_ENQCMD (1 << (X86_FEATURE_ENQCMD & 31))
63+
#endif
64+
5965
/*
6066
* Make sure to add features to the correct mask
6167
*/
@@ -75,7 +81,8 @@
7581
#define DISABLED_MASK13 0
7682
#define DISABLED_MASK14 0
7783
#define DISABLED_MASK15 0
78-
#define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP)
84+
#define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP| \
85+
DISABLE_ENQCMD)
7986
#define DISABLED_MASK17 0
8087
#define DISABLED_MASK18 0
8188
#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)

0 commit comments

Comments
 (0)