};
 
 /* Called with the sev_bitmap_lock held, or on shutdown  */
-static int sev_flush_asids(int min_asid, int max_asid)
+static int sev_flush_asids(unsigned int min_asid, unsigned int max_asid)
 {
-       int ret, asid, error = 0;
+       int ret, error = 0;
+       unsigned int asid;
 
        /* Check if there are any ASIDs to reclaim before performing a flush */
        asid = find_next_bit(sev_reclaim_asid_bitmap, nr_asids, min_asid);
 }
 
 /* Must be called with the sev_bitmap_lock held */
-static bool __sev_recycle_asids(int min_asid, int max_asid)
+static bool __sev_recycle_asids(unsigned int min_asid, unsigned int max_asid)
 {
        if (sev_flush_asids(min_asid, max_asid))
                return false;
 
 static int sev_asid_new(struct kvm_sev_info *sev)
 {
-       int asid, min_asid, max_asid, ret;
+       unsigned int asid, min_asid, max_asid;
        bool retry = true;
+       int ret;
 
        WARN_ON(sev->misc_cg);
        sev->misc_cg = get_current_misc_cg();
        return ret;
 }
 
-static int sev_get_asid(struct kvm *kvm)
+static unsigned int sev_get_asid(struct kvm *kvm)
 {
        struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
 
 
 static int sev_bind_asid(struct kvm *kvm, unsigned int handle, int *error)
 {
+       unsigned int asid = sev_get_asid(kvm);
        struct sev_data_activate activate;
-       int asid = sev_get_asid(kvm);
        int ret;
 
        /* activate ASID on the given handle */
  */
 static void sev_flush_encrypted_page(struct kvm_vcpu *vcpu, void *va)
 {
-       int asid = to_kvm_svm(vcpu->kvm)->sev_info.asid;
+       unsigned int asid = sev_get_asid(vcpu->kvm);
 
        /*
         * Note!  The address must be a kernel address, as regular page walk
 void pre_sev_run(struct vcpu_svm *svm, int cpu)
 {
        struct svm_cpu_data *sd = per_cpu_ptr(&svm_data, cpu);
-       int asid = sev_get_asid(svm->vcpu.kvm);
+       unsigned int asid = sev_get_asid(svm->vcpu.kvm);
 
        /* Assign the asid allocated with this SEV guest */
        svm->asid = asid;
 
  * Tracepoint for nested #vmexit because of interrupt pending
  */
 TRACE_EVENT(kvm_invlpga,
-           TP_PROTO(__u64 rip, int asid, u64 address),
+           TP_PROTO(__u64 rip, unsigned int asid, u64 address),
            TP_ARGS(rip, asid, address),
 
        TP_STRUCT__entry(
-               __field(        __u64,  rip     )
-               __field(        int,    asid    )
-               __field(        __u64,  address )
+               __field(        __u64,          rip     )
+               __field(        unsigned int,   asid    )
+               __field(        __u64,          address )
        ),
 
        TP_fast_assign(
                __entry->address        =       address;
        ),
 
-       TP_printk("rip: 0x%016llx asid: %d address: 0x%016llx",
+       TP_printk("rip: 0x%016llx asid: %u address: 0x%016llx",
                  __entry->rip, __entry->asid, __entry->address)
 );