* *resgr0 is to be used instead of qid to further process this entry.
  */
 static inline struct ap_queue_status ap_dqap(ap_qid_t qid,
-                                            unsigned long long *psmid,
+                                            unsigned long *psmid,
                                             void *msg, size_t length,
                                             size_t *reslength,
                                             unsigned long *resgr0)
                if (resgr0)
                        *resgr0 = reg0;
        } else {
-               *psmid = (((unsigned long long)rp1.even) << 32) + rp1.odd;
+               *psmid = (rp1.even << 32) + rp1.odd;
                if (resgr0)
                        *resgr0 = 0;
        }
 
 
 struct ap_message {
        struct list_head list;          /* Request queueing. */
-       unsigned long long psmid;       /* Message id. */
+       unsigned long psmid;            /* Message id. */
        void *msg;                      /* Pointer to message buffer. */
        unsigned int len;               /* actual msg len in msg buffer */
        unsigned int bufsize;           /* allocated msg buffer size */
  * for the first time. Otherwise the ap message queue will get
  * confused.
  */
-int ap_send(ap_qid_t, unsigned long long, void *, size_t);
-int ap_recv(ap_qid_t, unsigned long long *, void *, size_t);
+int ap_send(ap_qid_t qid, unsigned long psmid, void *msg, size_t length);
+int ap_recv(ap_qid_t qid, unsigned long *psmid, void *msg, size_t length);
 
 enum ap_sm_wait ap_sm_event(struct ap_queue *aq, enum ap_sm_event event);
 enum ap_sm_wait ap_sm_event_loop(struct ap_queue *aq, enum ap_sm_event event);
 
  * because a segment boundary was reached. The NQAP is repeated.
  */
 static inline struct ap_queue_status
-__ap_send(ap_qid_t qid, unsigned long long psmid, void *msg, size_t length,
+__ap_send(ap_qid_t qid, unsigned long psmid, void *msg, size_t length,
          int special)
 {
        if (special)
        return ap_nqap(qid, psmid, msg, length);
 }
 
-int ap_send(ap_qid_t qid, unsigned long long psmid, void *msg, size_t length)
+int ap_send(ap_qid_t qid, unsigned long psmid, void *msg, size_t length)
 {
        struct ap_queue_status status;
 
 }
 EXPORT_SYMBOL(ap_send);
 
-int ap_recv(ap_qid_t qid, unsigned long long *psmid, void *msg, size_t length)
+int ap_recv(ap_qid_t qid, unsigned long *psmid, void *msg, size_t length)
 {
        struct ap_queue_status status;
 
                        break;
                }
                if (!found) {
-                       AP_DBF_WARN("%s unassociated reply psmid=0x%016llx on 0x%02x.%04x\n",
+                       AP_DBF_WARN("%s unassociated reply psmid=0x%016lx on 0x%02x.%04x\n",
                                    __func__, aq->reply->psmid,
                                    AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid));
                }
 
 static int zcrypt_cex2c_rng_supported(struct ap_queue *aq)
 {
        struct ap_message ap_msg;
-       unsigned long long psmid;
+       unsigned long psmid;
        unsigned int domain;
        struct {
                struct type86_hdr hdr;
        msg = ap_msg.msg;
        msg->cprbx.domain = AP_QID_QUEUE(aq->qid);
 
-       rc = ap_send(aq->qid, 0x0102030405060708ULL, ap_msg.msg, ap_msg.len);
+       rc = ap_send(aq->qid, 0x0102030405060708UL, ap_msg.msg, ap_msg.len);
        if (rc)
                goto out_free;
 
        for (i = 0; i < 2 * HZ; i++) {
                msleep(1000 / HZ);
                rc = ap_recv(aq->qid, &psmid, ap_msg.msg, 4096);
-               if (rc == 0 && psmid == 0x0102030405060708ULL)
+               if (rc == 0 && psmid == 0x0102030405060708UL)
                        break;
        }
 
 
        if (!ap_msg->msg)
                return -ENOMEM;
        ap_msg->receive = zcrypt_cex2a_receive;
-       ap_msg->psmid = (((unsigned long long)current->pid) << 32) +
+       ap_msg->psmid = (((unsigned long)current->pid) << 32) +
                atomic_inc_return(&zcrypt_step);
        ap_msg->private = &work;
        rc = ICAMEX_msg_to_type50MEX_msg(zq, ap_msg, mex);
        if (!ap_msg->msg)
                return -ENOMEM;
        ap_msg->receive = zcrypt_cex2a_receive;
-       ap_msg->psmid = (((unsigned long long)current->pid) << 32) +
+       ap_msg->psmid = (((unsigned long)current->pid) << 32) +
                atomic_inc_return(&zcrypt_step);
        ap_msg->private = &work;
        rc = ICACRT_msg_to_type50CRT_msg(zq, ap_msg, crt);
 
                return -ENOMEM;
        ap_msg->bufsize = PAGE_SIZE;
        ap_msg->receive = zcrypt_msgtype6_receive;
-       ap_msg->psmid = (((unsigned long long)current->pid) << 32) +
+       ap_msg->psmid = (((unsigned long)current->pid) << 32) +
                atomic_inc_return(&zcrypt_step);
        ap_msg->private = &resp_type;
        rc = icamex_msg_to_type6mex_msgx(zq, ap_msg, mex);
                return -ENOMEM;
        ap_msg->bufsize = PAGE_SIZE;
        ap_msg->receive = zcrypt_msgtype6_receive;
-       ap_msg->psmid = (((unsigned long long)current->pid) << 32) +
+       ap_msg->psmid = (((unsigned long)current->pid) << 32) +
                atomic_inc_return(&zcrypt_step);
        ap_msg->private = &resp_type;
        rc = icacrt_msg_to_type6crt_msgx(zq, ap_msg, crt);
        if (!ap_msg->msg)
                return -ENOMEM;
        ap_msg->receive = zcrypt_msgtype6_receive;
-       ap_msg->psmid = (((unsigned long long)current->pid) << 32) +
+       ap_msg->psmid = (((unsigned long)current->pid) << 32) +
                                atomic_inc_return(&zcrypt_step);
        ap_msg->private = kmemdup(&resp_type, sizeof(resp_type), GFP_KERNEL);
        if (!ap_msg->private)
        if (!ap_msg->msg)
                return -ENOMEM;
        ap_msg->receive = zcrypt_msgtype6_receive_ep11;
-       ap_msg->psmid = (((unsigned long long)current->pid) << 32) +
+       ap_msg->psmid = (((unsigned long)current->pid) << 32) +
                                atomic_inc_return(&zcrypt_step);
        ap_msg->private = kmemdup(&resp_type, sizeof(resp_type), GFP_KERNEL);
        if (!ap_msg->private)
        if (!ap_msg->msg)
                return -ENOMEM;
        ap_msg->receive = zcrypt_msgtype6_receive;
-       ap_msg->psmid = (((unsigned long long)current->pid) << 32) +
+       ap_msg->psmid = (((unsigned long)current->pid) << 32) +
                                atomic_inc_return(&zcrypt_step);
        ap_msg->private = kmemdup(&resp_type, sizeof(resp_type), GFP_KERNEL);
        if (!ap_msg->private)