From: Jan Kiszka <[email protected]>

Signed-off-by: Jan Kiszka <[email protected]>
---
 driver/main.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/driver/main.c b/driver/main.c
index a9bd3384..41552b74 100644
--- a/driver/main.c
+++ b/driver/main.c
@@ -58,6 +58,12 @@
 #error 64-bit kernel required!
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+#define MSR_IA32_FEAT_CTL                      MSR_IA32_FEATURE_CONTROL
+#define FEAT_CTL_VMX_ENABLED_OUTSIDE_SMX \
+       FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX
+#endif
+
 #if JAILHOUSE_CELL_ID_NAMELEN != JAILHOUSE_CELL_NAME_MAXLEN
 # warning JAILHOUSE_CELL_ID_NAMELEN and JAILHOUSE_CELL_NAME_MAXLEN out of sync!
 #endif
@@ -406,9 +412,8 @@ static int jailhouse_cmd_enable(struct jailhouse_system 
__user *arg)
        if (boot_cpu_has(X86_FEATURE_VMX)) {
                u64 features;
 
-               rdmsrl(MSR_IA32_FEATURE_CONTROL, features);
-               if ((features &
-                    FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX) == 0) {
+               rdmsrl(MSR_IA32_FEAT_CTL, features);
+               if ((features & FEAT_CTL_VMX_ENABLED_OUTSIDE_SMX) == 0) {
                        pr_err("jailhouse: VT-x disabled by Firmware/BIOS\n");
                        err = -ENODEV;
                        goto error_put_module;
-- 
2.16.4


-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/1ab95302-de42-4d47-c853-acc6e05d0791%40siemens.com.

Reply via email to