@@ -158,6 +158,19 @@ struct kvm_sregs {
__u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
};
+struct kvm_sregs2 {
+ /* out (KVM_GET_SREGS2) / in (KVM_SET_SREGS2) */
+ struct kvm_segment cs, ds, es, fs, gs, ss;
+ struct kvm_segment tr, ldt;
+ struct kvm_dtable gdt, idt;
+ __u64 cr0, cr2, cr3, cr4, cr8;
+ __u64 efer;
+ __u64 apic_base;
+ __u64 flags; /* must be zero*/
+ __u64 pdptrs[4];
+ __u64 padding;
+};
+
/* for KVM_GET_FPU and KVM_SET_FPU */
struct kvm_fpu {
__u8 fpr[8][16];
@@ -1056,6 +1056,7 @@ struct kvm_ppc_resize_hpt {
#define KVM_CAP_ENFORCE_PV_FEATURE_CPUID 190
#define KVM_CAP_SYS_HYPERV_CPUID 191
#define KVM_CAP_DIRTY_LOG_RING 192
+#define KVM_CAP_SREGS2 196
#ifdef KVM_CAP_IRQ_ROUTING
@@ -1563,6 +1564,10 @@ struct kvm_pv_cmd {
/* Available with KVM_CAP_DIRTY_LOG_RING */
#define KVM_RESET_DIRTY_RINGS _IO(KVMIO, 0xc7)
+
+#define KVM_GET_SREGS2 _IOR(KVMIO, 0xca, struct kvm_sregs2)
+#define KVM_SET_SREGS2 _IOW(KVMIO, 0xcb, struct kvm_sregs2)
+
/* Secure Encrypted Virtualization command */
enum sev_cmd_id {
/* Guest initialization commands */
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> --- linux-headers/asm-x86/kvm.h | 13 +++++++++++++ linux-headers/linux/kvm.h | 5 +++++ 2 files changed, 18 insertions(+)