On 22/03/2023 16:01, Jason Gunthorpe wrote: >> It seems that EFA uses shared MMIO pages with hardware security assurance. > > I'm not sure how EFA works, it writes this: > > EFA_SET(&db, EFA_IO_REGS_CQ_DB_CONSUMER_INDEX, cq->cc); > EFA_SET(&db, EFA_IO_REGS_CQ_DB_CMD_SN, cq->cmd_sn & 0x3); > EFA_SET(&db, EFA_IO_REGS_CQ_DB_ARM, arm); > > But interestingly there is no CQN value, so I have no idea how it > associates the doorbell register with the CQ to load the data into. > > If it is using a DB register offset to learn the CQN then obviously it > cannot share the same doorbell page (or associated CQNs) across verbs > FD contexts, that would be a security bug. EFA folks? The doorbell's BAR address is dictated by the device, and the CQN is derived from the address. Each doorbell resides in a separate page, there is no sharing of doorbells pages between different UARs.