summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/uv.h
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2019-10-23 14:56:39 +0300
committerChristian Borntraeger <borntraeger@de.ibm.com>2020-02-27 21:44:40 +0300
commit29d37e5b82f3e96dd648167657d5a0e0111ce877 (patch)
treedea4d0fedbb0471918625eb77e57bf4eb41c9921 /arch/s390/include/asm/uv.h
parentecdc5d842bb3c166c3d549e52ba91a3955b257f2 (diff)
downloadlinux-29d37e5b82f3e96dd648167657d5a0e0111ce877.tar.xz
s390/protvirt: add ultravisor initialization
Before being able to host protected virtual machines, donate some of the memory to the ultravisor. Besides that the ultravisor might impose addressing limitations for memory used to back protected VM storage. Treat that limit as protected virtualization host's virtual memory limit. Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> [borntraeger@de.ibm.com: patch merging, splitting, fixing] Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/uv.h')
-rw-r--r--arch/s390/include/asm/uv.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/s390/include/asm/uv.h b/arch/s390/include/asm/uv.h
index c6a330740e5d..1af6ce8023cc 100644
--- a/arch/s390/include/asm/uv.h
+++ b/arch/s390/include/asm/uv.h
@@ -23,12 +23,14 @@
#define UVC_RC_NO_RESUME 0x0007
#define UVC_CMD_QUI 0x0001
+#define UVC_CMD_INIT_UV 0x000f
#define UVC_CMD_SET_SHARED_ACCESS 0x1000
#define UVC_CMD_REMOVE_SHARED_ACCESS 0x1001
/* Bits in installed uv calls */
enum uv_cmds_inst {
BIT_UVC_CMD_QUI = 0,
+ BIT_UVC_CMD_INIT_UV = 1,
BIT_UVC_CMD_SET_SHARED_ACCESS = 8,
BIT_UVC_CMD_REMOVE_SHARED_ACCESS = 9,
};
@@ -59,6 +61,14 @@ struct uv_cb_qui {
u8 reserveda0[200 - 160];
} __packed __aligned(8);
+struct uv_cb_init {
+ struct uv_cb_header header;
+ u64 reserved08[2];
+ u64 stor_origin;
+ u64 stor_len;
+ u64 reserved28[4];
+} __packed __aligned(8);
+
struct uv_cb_share {
struct uv_cb_header header;
u64 reserved08[3];
@@ -160,8 +170,13 @@ static inline int is_prot_virt_host(void)
{
return prot_virt_host;
}
+
+void setup_uv(void);
+void adjust_to_uv_max(unsigned long *vmax);
#else
#define is_prot_virt_host() 0
+static inline void setup_uv(void) {}
+static inline void adjust_to_uv_max(unsigned long *vmax) {}
#endif
#if defined(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) || IS_ENABLED(CONFIG_KVM)