@@ -198,17 +198,6 @@ static void sev_asid_free(struct kvm_sev_info *sev)
sev->misc_cg = NULL;
}
-static void sev_decommission(unsigned int handle)
-{
- struct sev_data_decommission decommission;
-
- if (!handle)
- return;
-
- decommission.handle = handle;
- sev_guest_decommission(&decommission, NULL);
-}
-
static void sev_unbind_asid(struct kvm *kvm, unsigned int handle)
{
struct sev_data_deactivate deactivate;
@@ -223,7 +212,7 @@ static void sev_unbind_asid(struct kvm *kvm, unsigned int handle)
sev_guest_deactivate(&deactivate, NULL);
up_read(&sev_deactivate_lock);
- sev_decommission(handle);
+ sev_guest_decommission(handle, NULL);
}
static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp)
@@ -349,7 +338,7 @@ static int sev_launch_start(struct kvm *kvm, struct kvm_sev_cmd *argp)
/* Bind ASID to this guest */
ret = sev_bind_asid(kvm, start.handle, error);
if (ret) {
- sev_decommission(start.handle);
+ sev_guest_decommission(start.handle, NULL);
goto e_free_session;
}
@@ -1398,7 +1387,7 @@ static int sev_receive_start(struct kvm *kvm, struct kvm_sev_cmd *argp)
/* Bind ASID to this guest */
ret = sev_bind_asid(kvm, start.handle, error);
if (ret) {
- sev_decommission(start.handle);
+ sev_guest_decommission(start.handle, NULL);
goto e_free_session;
}
@@ -903,9 +903,15 @@ int sev_guest_activate(struct sev_data_activate *data, int *error)
}
EXPORT_SYMBOL_GPL(sev_guest_activate);
-int sev_guest_decommission(struct sev_data_decommission *data, int *error)
+int sev_guest_decommission(unsigned int handle, int *error)
{
- return sev_do_cmd(SEV_CMD_DECOMMISSION, data, error);
+ struct sev_data_decommission decommission;
+
+ if (!handle)
+ return -EINVAL;
+
+ decommission.handle = handle;
+ return sev_do_cmd(SEV_CMD_DECOMMISSION, &decommission, error);
}
EXPORT_SYMBOL_GPL(sev_guest_decommission);
@@ -612,17 +612,18 @@ int sev_guest_df_flush(int *error);
/**
* sev_guest_decommission - perform SEV DECOMMISSION command
*
- * @decommission: sev_data_decommission structure to be processed
+ * @handle: sev_data_decommission structure to be processed
* @sev_ret: sev command return code
*
* Returns:
* 0 if the sev successfully processed the command
+ * -%EINVAL if handle is NULL
* -%ENODEV if the sev device is not available
* -%ENOTSUPP if the sev does not support SEV
* -%ETIMEDOUT if the sev command timed out
* -%EIO if the sev returned a non-zero return code
*/
-int sev_guest_decommission(struct sev_data_decommission *data, int *error);
+int sev_guest_decommission(unsigned int handle, int *error);
void *psp_copy_user_blob(u64 uaddr, u32 len);
@@ -637,7 +638,7 @@ static inline int
sev_guest_deactivate(struct sev_data_deactivate *data, int *error) { return -ENODEV; }
static inline int
-sev_guest_decommission(struct sev_data_decommission *data, int *error) { return -ENODEV; }
+sev_guest_decommission(unsigned int handle, int *error) { return -ENODEV; }
static inline int
sev_guest_activate(struct sev_data_activate *data, int *error) { return -ENODEV; }