@@ -1389,16 +1389,15 @@ int snp_issue_svsm_attest_req(u64 call_id, struct svsm_call *call,
1389
1389
}
1390
1390
EXPORT_SYMBOL_GPL (snp_issue_svsm_attest_req );
1391
1391
1392
- static int snp_issue_guest_request (struct snp_guest_req * req , struct snp_req_data * input ,
1393
- struct snp_guest_request_ioctl * rio )
1392
+ static int snp_issue_guest_request (struct snp_guest_req * req , struct snp_req_data * input )
1394
1393
{
1395
1394
struct ghcb_state state ;
1396
1395
struct es_em_ctxt ctxt ;
1397
1396
unsigned long flags ;
1398
1397
struct ghcb * ghcb ;
1399
1398
int ret ;
1400
1399
1401
- rio -> exitinfo2 = SEV_RET_NO_FW_CALL ;
1400
+ req -> exitinfo2 = SEV_RET_NO_FW_CALL ;
1402
1401
1403
1402
/*
1404
1403
* __sev_get_ghcb() needs to run with IRQs disabled because it is using
@@ -1423,8 +1422,8 @@ static int snp_issue_guest_request(struct snp_guest_req *req, struct snp_req_dat
1423
1422
if (ret )
1424
1423
goto e_put ;
1425
1424
1426
- rio -> exitinfo2 = ghcb -> save .sw_exit_info_2 ;
1427
- switch (rio -> exitinfo2 ) {
1425
+ req -> exitinfo2 = ghcb -> save .sw_exit_info_2 ;
1426
+ switch (req -> exitinfo2 ) {
1428
1427
case 0 :
1429
1428
break ;
1430
1429
@@ -1919,8 +1918,7 @@ static int enc_payload(struct snp_msg_desc *mdesc, u64 seqno, struct snp_guest_r
1919
1918
return 0 ;
1920
1919
}
1921
1920
1922
- static int __handle_guest_request (struct snp_msg_desc * mdesc , struct snp_guest_req * req ,
1923
- struct snp_guest_request_ioctl * rio )
1921
+ static int __handle_guest_request (struct snp_msg_desc * mdesc , struct snp_guest_req * req )
1924
1922
{
1925
1923
unsigned long req_start = jiffies ;
1926
1924
unsigned int override_npages = 0 ;
@@ -1934,7 +1932,7 @@ static int __handle_guest_request(struct snp_msg_desc *mdesc, struct snp_guest_r
1934
1932
* sequence number must be incremented or the VMPCK must be deleted to
1935
1933
* prevent reuse of the IV.
1936
1934
*/
1937
- rc = snp_issue_guest_request (req , & req -> input , rio );
1935
+ rc = snp_issue_guest_request (req , & req -> input );
1938
1936
switch (rc ) {
1939
1937
case - ENOSPC :
1940
1938
/*
@@ -1987,7 +1985,7 @@ static int __handle_guest_request(struct snp_msg_desc *mdesc, struct snp_guest_r
1987
1985
snp_inc_msg_seqno (mdesc );
1988
1986
1989
1987
if (override_err ) {
1990
- rio -> exitinfo2 = override_err ;
1988
+ req -> exitinfo2 = override_err ;
1991
1989
1992
1990
/*
1993
1991
* If an extended guest request was issued and the supplied certificate
@@ -2005,8 +2003,7 @@ static int __handle_guest_request(struct snp_msg_desc *mdesc, struct snp_guest_r
2005
2003
return rc ;
2006
2004
}
2007
2005
2008
- int snp_send_guest_request (struct snp_msg_desc * mdesc , struct snp_guest_req * req ,
2009
- struct snp_guest_request_ioctl * rio )
2006
+ int snp_send_guest_request (struct snp_msg_desc * mdesc , struct snp_guest_req * req )
2010
2007
{
2011
2008
u64 seqno ;
2012
2009
int rc ;
@@ -2043,14 +2040,14 @@ int snp_send_guest_request(struct snp_msg_desc *mdesc, struct snp_guest_req *req
2043
2040
req -> input .resp_gpa = __pa (mdesc -> response );
2044
2041
req -> input .data_gpa = req -> certs_data ? __pa (req -> certs_data ) : 0 ;
2045
2042
2046
- rc = __handle_guest_request (mdesc , req , rio );
2043
+ rc = __handle_guest_request (mdesc , req );
2047
2044
if (rc ) {
2048
2045
if (rc == - EIO &&
2049
- rio -> exitinfo2 == SNP_GUEST_VMM_ERR (SNP_GUEST_VMM_ERR_INVALID_LEN ))
2046
+ req -> exitinfo2 == SNP_GUEST_VMM_ERR (SNP_GUEST_VMM_ERR_INVALID_LEN ))
2050
2047
return rc ;
2051
2048
2052
2049
pr_alert ("Detected error from ASP request. rc: %d, exitinfo2: 0x%llx\n" ,
2053
- rc , rio -> exitinfo2 );
2050
+ rc , req -> exitinfo2 );
2054
2051
2055
2052
snp_disable_vmpck (mdesc );
2056
2053
return rc ;
@@ -2069,7 +2066,6 @@ EXPORT_SYMBOL_GPL(snp_send_guest_request);
2069
2066
2070
2067
static int __init snp_get_tsc_info (void )
2071
2068
{
2072
- struct snp_guest_request_ioctl * rio ;
2073
2069
struct snp_tsc_info_resp * tsc_resp ;
2074
2070
struct snp_tsc_info_req * tsc_req ;
2075
2071
struct snp_msg_desc * mdesc ;
@@ -2093,13 +2089,9 @@ static int __init snp_get_tsc_info(void)
2093
2089
if (!req )
2094
2090
goto e_free_tsc_resp ;
2095
2091
2096
- rio = kzalloc (sizeof (* rio ), GFP_KERNEL );
2097
- if (!rio )
2098
- goto e_free_req ;
2099
-
2100
2092
mdesc = snp_msg_alloc ();
2101
2093
if (IS_ERR_OR_NULL (mdesc ))
2102
- goto e_free_rio ;
2094
+ goto e_free_req ;
2103
2095
2104
2096
rc = snp_msg_init (mdesc , snp_vmpl );
2105
2097
if (rc )
@@ -2114,7 +2106,7 @@ static int __init snp_get_tsc_info(void)
2114
2106
req -> resp_sz = sizeof (* tsc_resp ) + AUTHTAG_LEN ;
2115
2107
req -> exit_code = SVM_VMGEXIT_GUEST_REQUEST ;
2116
2108
2117
- rc = snp_send_guest_request (mdesc , req , rio );
2109
+ rc = snp_send_guest_request (mdesc , req );
2118
2110
if (rc )
2119
2111
goto e_request ;
2120
2112
@@ -2135,8 +2127,6 @@ static int __init snp_get_tsc_info(void)
2135
2127
memzero_explicit (tsc_resp , sizeof (* tsc_resp ) + AUTHTAG_LEN );
2136
2128
e_free_mdesc :
2137
2129
snp_msg_free (mdesc );
2138
- e_free_rio :
2139
- kfree (rio );
2140
2130
e_free_req :
2141
2131
kfree (req );
2142
2132
e_free_tsc_resp :
0 commit comments