Skip to content

Commit c1de0f2

Browse files
pgondabonzini
authored andcommitted
KVM x86: Move kvm cpuid support out of svm
Memory encryption support does not have module parameter dependencies and can be moved into the general x86 cpuid __do_cpuid_ent function. This changes maintains current behavior of passing through all of CPUID.8000001F. Suggested-by: Jim Mattson <[email protected]> Signed-off-by: Peter Gonda <[email protected]> Reviewed-by: Jim Mattson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 9671024 commit c1de0f2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

arch/x86/kvm/cpuid.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,11 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
778778
case 0x8000001a:
779779
case 0x8000001e:
780780
break;
781+
/* Support memory encryption cpuid if host supports it */
782+
case 0x8000001F:
783+
if (!boot_cpu_has(X86_FEATURE_SEV))
784+
entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
785+
break;
781786
/*Add support for Centaur's CPUID instruction*/
782787
case 0xC0000000:
783788
/*Just support up to 0xC0000004 now*/

arch/x86/kvm/svm.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5958,13 +5958,6 @@ static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
59585958
if (npt_enabled)
59595959
entry->edx |= F(NPT);
59605960

5961-
break;
5962-
case 0x8000001F:
5963-
/* Support memory encryption cpuid if host supports it */
5964-
if (boot_cpu_has(X86_FEATURE_SEV))
5965-
cpuid(0x8000001f, &entry->eax, &entry->ebx,
5966-
&entry->ecx, &entry->edx);
5967-
59685961
}
59695962
}
59705963

0 commit comments

Comments
 (0)