-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support complex backend/frontend hierarchies #7
base: main
Are you sure you want to change the base?
Conversation
`service_vm_va` is a bit redundant here -- `vaddr` should be enough. Signed-off-by: Hannu Lyytinen <[email protected]>
Signed-off-by: Hannu Lyytinen <[email protected]>
Signed-off-by: Hannu Lyytinen <[email protected]>
Despite eliminating all locks on ring buffers, userspace helper (such as QEMU) can access the buffers without context switches to kernel. Signed-off-by: Hannu Lyytinen <[email protected]>
Signed-off-by: Hannu Lyytinen <[email protected]>
Userspace helper (such as QEMU) is now able to ring the doorbell without context switch to kernel. Signed-off-by: Hannu Lyytinen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Queue head/tail reading and writing require barriers as well as ioreq state variable reads and writes because these are inspected and modified by all three (sel4 vmm, linux kernel and linux user space) and we must ensure all three share the same view
#define RPC_MR0_STATE_SHIFT (RPC_MR0_OP_WIDTH + RPC_MR0_OP_SHIFT) | ||
|
||
#define RPC_MR0_STATE_COMPLETE 0 | ||
#define RPC_MR0_STATE_RESERVED 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reserved here means unused...?
static inline | ||
sel4_rpc_t *rpcmsg_commit(sel4_rpc_t *rpc, rpcmsg_t *msg) | ||
{ | ||
msg->mr0 = BIT_FIELD_SET(msg->mr0, RPC_MR0_STATE, RPC_MR0_STATE_PENDING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write release / write barrier
rpcmsg_t *rpcmsg_queue_advance_tail(rpcmsg_queue_t *q) | ||
{ | ||
rpc_assert((!rpcmsg_queue_full(q))); | ||
q->tail = QUEUE_NEXT(q->tail); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have write release / write barrier
rpcmsg_t *rpcmsg_queue_advance_head(rpcmsg_queue_t *q) | ||
{ | ||
rpc_assert(!rpcmsg_queue_empty(q)); | ||
q->head = QUEUE_NEXT(q->head); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have write release / write barrier
rpc_assert(!"tx queue full"); | ||
} | ||
|
||
switch (BIT_FIELD_GET(msg->mr0, RPC_MR0_STATE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Load acquire / read barrier
return NULL; | ||
} | ||
|
||
next = QUEUE_NEXT(msg - q->data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Load acquire
((uint32_t *) dataport->mem[0].service_vm_va)[0] = 1; | ||
uint32_t *emit_register = private; | ||
|
||
*emit_register = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think write barrier here to ensure ordering of writes
smp_store_release(&ioreq->state, | ||
SEL4_IOREQ_STATE_PROCESSING); | ||
set_bit(slot, vm->ioreq_map); | ||
req->mr0 = BIT_FIELD_SET(req->mr0, RPC_MR0_STATE, RPC_MR0_STATE_PROCESSING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Store release to ensure others share the view
rpc = driver_ack_mmio_finish(rpc, slot, 0); | ||
BUG_ON(!rpc); | ||
|
||
req->mr0 = BIT_FIELD_SET(req->mr0, RPC_MR0_STATE, RPC_MR0_STATE_COMPLETE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Store release to ensure order of writes
No description provided.