History

Merge tag 'kvm-s390-next-5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD

KVM: s390: Features and Enhancements for 5.7 part1 1. Allow to disable gisa 2. protected virtual machines Protected VMs (PVM) are KVM VMs, where KVM can't access the VM's state like guest memory and guest registers anymore. Instead the PVMs are mostly managed by a new entity called Ultravisor (UV), which provides an API, so KVM and the PV can request management actions. PVMs are encrypted at rest and protected from hypervisor access while running. They switch from a normal operation into protected mode, so we can still use the standard boot process to load a encrypted blob and then move it into protected mode. Rebooting is only possible by passing through the unprotected/normal mode and switching to protected again. One mm related patch will go via Andrews mm tree ( mm/gup/writeback: add callbacks for inaccessible pages)

Paolo Bonzini committed 6 years ago

Commit 1c482452 parents 6d05a96 cc674ef362 files · +6431 −2586Browse files

Showing the changes to include/uapi/linux (1 of 362 files). Show all

Unified · Split

include/uapi/linux/kvm.h+41−2
@@ -474,12 +474,17 @@ struct kvm_s390_mem_op { · 473 unmodified lines
474474 __u32 size; /* amount of bytes */
475475 __u32 op; /* type of operation */
476476 __u64 buf; /* buffer in userspace */
477− __u8 ar; /* the access register number */
478− __u8 reserved[31]; /* should be set to 0 */
477+ union {
478+ __u8 ar; /* the access register number */
479+ __u32 sida_offset; /* offset into the sida */
480+ __u8 reserved[32]; /* should be set to 0 */
481+ };
479482 };
480483 /* types for kvm_s390_mem_op->op */
481484 #define KVM_S390_MEMOP_LOGICAL_READ 0
482485 #define KVM_S390_MEMOP_LOGICAL_WRITE 1
486+#define KVM_S390_MEMOP_SIDA_READ 2
487+#define KVM_S390_MEMOP_SIDA_WRITE 3
483488 /* flags for kvm_s390_mem_op->flags */
484489 #define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
485490 #define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
@@ -1010,6 +1015,7 @@ struct kvm_ppc_resize_hpt { · 524 unmodified lines
10101015 #define KVM_CAP_ARM_NISV_TO_USER 177
10111016 #define KVM_CAP_ARM_INJECT_EXT_DABT 178
10121017 #define KVM_CAP_S390_VCPU_RESETS 179
1018+#define KVM_CAP_S390_PROTECTED 180
10131019
10141020 #ifdef KVM_CAP_IRQ_ROUTING
10151021
@@ -1478,6 +1484,39 @@ struct kvm_enc_region { · 462 unmodified lines
14781484 #define KVM_S390_NORMAL_RESET _IO(KVMIO, 0xc3)
14791485 #define KVM_S390_CLEAR_RESET _IO(KVMIO, 0xc4)
14801486
1487+struct kvm_s390_pv_sec_parm {
1488+ __u64 origin;
1489+ __u64 length;
1490+};
1491+
1492+struct kvm_s390_pv_unp {
1493+ __u64 addr;
1494+ __u64 size;
1495+ __u64 tweak;
1496+};
1497+
1498+enum pv_cmd_id {
1499+ KVM_PV_ENABLE,
1500+ KVM_PV_DISABLE,
1501+ KVM_PV_SET_SEC_PARMS,
1502+ KVM_PV_UNPACK,
1503+ KVM_PV_VERIFY,
1504+ KVM_PV_PREP_RESET,
1505+ KVM_PV_UNSHARE_ALL,
1506+};
1507+
1508+struct kvm_pv_cmd {
1509+ __u32 cmd; /* Command to be executed */
1510+ __u16 rc; /* Ultravisor return code */
1511+ __u16 rrc; /* Ultravisor return reason code */
1512+ __u64 data; /* Data or address */
1513+ __u32 flags; /* flags for future extensions. Must be 0 for now */
1514+ __u32 reserved[3];
1515+};
1516+
1517+/* Available with KVM_CAP_S390_PROTECTED */
1518+#define KVM_S390_PV_COMMAND _IOWR(KVMIO, 0xc5, struct kvm_pv_cmd)
1519+
14811520 /* Secure Encrypted Virtualization command */
14821521 enum sev_cmd_id {
14831522 /* Guest initialization commands */