@@ -109,13 +109,13 @@ static bool __sev_recycle_asids(int min_asid, int max_asid)
return true;
}
-static int sev_asid_new(bool es_active)
+static int sev_asid_new(bool es_active, struct kvm_sev_info *sev)
{
int pos, min_asid, max_asid, ret;
bool retry = true;
enum misc_res_type type;
- type = sev->es_active ? MISC_CG_RES_SEV_ES : MISC_CG_RES_SEV;
+ type = es_active ? MISC_CG_RES_SEV_ES : MISC_CG_RES_SEV;
WARN_ON(sev->misc_cg);
sev->misc_cg = get_current_misc_cg();
ret = misc_cg_try_charge(type, sev->misc_cg, 1);
@@ -221,7 +221,7 @@ static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp)
if (unlikely(sev->active))
return ret;
- asid = sev_asid_new(es_active);
+ asid = sev_asid_new(es_active, sev);
if (asid < 0)
return ret;
sev->asid = asid;