Skip to content

Commit 7fafb59

Browse files
committed
tools headers UAPI: sync asm/kvm.h with kernel
JIRA: https://issues.redhat.com/browse/RHEL-29796 Upstream Status: RHEL only description =========== Upstream, when there is a change in a header file from the specific set of headers (listed in tools/perf/check-headers.sh), it is accompanied by a commit that brings the same change into its counterpart located in tools/include. Usually several changes are squashed together. We cannot easily follow this strategy, since we not always take all the commits squashed together. In order to tidy tools/include up, we need to sync the headers manually. Signed-off-by: Michael Petlan <mpetlan@redhat.com>
1 parent 2fcbd61 commit 7fafb59

File tree

1 file changed

+48
-0
lines changed
  • tools/arch/x86/include/uapi/asm

1 file changed

+48
-0
lines changed

tools/arch/x86/include/uapi/asm/kvm.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,11 @@ enum sev_cmd_id {
697697
/* Second time is the charm; improved versions of the above ioctls. */
698698
KVM_SEV_INIT2,
699699

700+
/* SNP-specific commands */
701+
KVM_SEV_SNP_LAUNCH_START = 100,
702+
KVM_SEV_SNP_LAUNCH_UPDATE,
703+
KVM_SEV_SNP_LAUNCH_FINISH,
704+
700705
KVM_SEV_NR_MAX,
701706
};
702707

@@ -824,6 +829,48 @@ struct kvm_sev_receive_update_data {
824829
__u32 pad2;
825830
};
826831

832+
struct kvm_sev_snp_launch_start {
833+
__u64 policy;
834+
__u8 gosvw[16];
835+
__u16 flags;
836+
__u8 pad0[6];
837+
__u64 pad1[4];
838+
};
839+
840+
/* Kept in sync with firmware values for simplicity. */
841+
#define KVM_SEV_SNP_PAGE_TYPE_NORMAL 0x1
842+
#define KVM_SEV_SNP_PAGE_TYPE_ZERO 0x3
843+
#define KVM_SEV_SNP_PAGE_TYPE_UNMEASURED 0x4
844+
#define KVM_SEV_SNP_PAGE_TYPE_SECRETS 0x5
845+
#define KVM_SEV_SNP_PAGE_TYPE_CPUID 0x6
846+
847+
struct kvm_sev_snp_launch_update {
848+
__u64 gfn_start;
849+
__u64 uaddr;
850+
__u64 len;
851+
__u8 type;
852+
__u8 pad0;
853+
__u16 flags;
854+
__u32 pad1;
855+
__u64 pad2[4];
856+
};
857+
858+
#define KVM_SEV_SNP_ID_BLOCK_SIZE 96
859+
#define KVM_SEV_SNP_ID_AUTH_SIZE 4096
860+
#define KVM_SEV_SNP_FINISH_DATA_SIZE 32
861+
862+
struct kvm_sev_snp_launch_finish {
863+
__u64 id_block_uaddr;
864+
__u64 id_auth_uaddr;
865+
__u8 id_block_en;
866+
__u8 auth_key_en;
867+
__u8 vcek_disabled;
868+
__u8 host_data[KVM_SEV_SNP_FINISH_DATA_SIZE];
869+
__u8 pad0[3];
870+
__u16 flags;
871+
__u64 pad1[4];
872+
};
873+
827874
#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
828875
#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
829876

@@ -874,5 +921,6 @@ struct kvm_hyperv_eventfd {
874921
#define KVM_X86_SW_PROTECTED_VM 1
875922
#define KVM_X86_SEV_VM 2
876923
#define KVM_X86_SEV_ES_VM 3
924+
#define KVM_X86_SNP_VM 4
877925

878926
#endif /* _ASM_X86_KVM_H */

0 commit comments

Comments
 (0)