[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/22] cpu/i386: populate CPUID 0x8000_001F when SEV
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 18/22] cpu/i386: populate CPUID 0x8000_001F when SEV is active |
Date: |
Tue, 13 Mar 2018 13:56:34 +0100 |
From: Brijesh Singh <address@hidden>
When SEV is enabled, CPUID 0x8000_001F should provide additional
information regarding the feature (such as which page table bit is used
to mark the pages as encrypted etc).
The details for memory encryption CPUID is available in AMD APM
(https://support.amd.com/TechDocs/24594.pdf) Section E.4.17
Cc: Paolo Bonzini <address@hidden>
Cc: Richard Henderson <address@hidden>
Cc: Eduardo Habkost <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Brijesh Singh <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/cpu.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 8ee0140..01607dd 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -26,6 +26,7 @@
#include "sysemu/hvf.h"
#include "sysemu/cpus.h"
#include "kvm_i386.h"
+#include "sev_i386.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
@@ -3612,6 +3613,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
*ecx = 0;
*edx = 0;
break;
+ case 0x8000001F:
+ *eax = sev_enabled() ? 0x2 : 0;
+ *ebx = sev_get_cbit_position();
+ *ebx |= sev_get_reduced_phys_bits() << 6;
+ *ecx = 0;
+ *edx = 0;
+ break;
default:
/* reserved values: zero */
*eax = 0;
@@ -4042,6 +4050,11 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error
**errp)
if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) {
x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A);
}
+
+ /* SEV requires CPUID[0x8000001F] */
+ if (sev_enabled()) {
+ x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000001F);
+ }
}
/* Set cpuid_*level* based on cpuid_min_*level, if not explicitly set */
--
1.8.3.1
- [Qemu-devel] [PULL 09/22] include: add psp-sev.h header file, (continued)
- [Qemu-devel] [PULL 09/22] include: add psp-sev.h header file, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 07/22] target/i386: add Secure Encrypted Virtualization (SEV) object, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 13/22] sev/i386: add command to encrypt guest memory region, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 11/22] sev/i386: register the guest memory range which may contain encrypted data, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 08/22] sev/i386: qmp: add query-sev command, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 12/22] sev/i386: add command to create launch memory encryption context, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 10/22] sev/i386: add command to initialize the memory encryption context, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 14/22] target/i386: encrypt bios rom, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 15/22] sev/i386: add support to LAUNCH_MEASURE command, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 16/22] sev/i386: finalize the SEV guest launch flow, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 18/22] cpu/i386: populate CPUID 0x8000_001F when SEV is active,
Paolo Bonzini <=
- [Qemu-devel] [PULL 19/22] sev/i386: hmp: add 'info sev' command, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 17/22] sev/i386: add migration blocker, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 20/22] sev/i386: qmp: add query-sev-launch-measure command, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 21/22] sev/i386: qmp: add query-sev-capabilities command, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 22/22] sev/i386: add sev_get_capabilities(), Paolo Bonzini, 2018/03/13
- Re: [Qemu-devel] [PULL 00/22] KVM patches for QEMU 2.12 soft freeze, Alex Williamson, 2018/03/13