/* * ucall_pool holds per-VM values (global data is duplicated by each VM), it * must not be accessed from host code.
*/ staticstruct ucall_header *ucall_pool;
staticstruct ucall *ucall_alloc(void)
{ struct ucall *uc; int i;
if (!ucall_pool) goto ucall_failed;
for (i = 0; i < KVM_MAX_VCPUS; ++i) { if (!test_and_set_bit(i, ucall_pool->in_use)) {
uc = &ucall_pool->ucalls[i];
memset(uc->args, 0, sizeof(uc->args)); return uc;
}
}
ucall_failed: /* * If the vCPU cannot grab a ucall structure, make a bare ucall with a * magic value to signal to get_ucall() that things went sideways. * GUEST_ASSERT() depends on ucall_alloc() and so cannot be used here.
*/
ucall_arch_do_ucall(GUEST_UCALL_FAILED); return NULL;
}
staticvoid ucall_free(struct ucall *uc)
{ /* Beware, here be pointer arithmetic. */
clear_bit(uc - ucall_pool->ucalls, ucall_pool->in_use);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.