cmd_desc = &(q->desc[desc_idx]);
- if (guest_pa_to_host_va(core, cmd_desc->addr_gpa, (addr_t *)&cmd) == -1) {
+ if (v3_gpa_to_hva(core, cmd_desc->addr_gpa, (addr_t *)&cmd) == -1) {
PrintError("Could not translate SYMMOD header address\n");
return -1;
}
-
+
desc_idx = cmd_desc->next;
if (cmd->cmd == CMD_LOAD) {
name_desc = &(q->desc[desc_idx]);
- if (guest_pa_to_host_va(core, name_desc->addr_gpa, (addr_t *)&name) == -1) {
+ if (v3_gpa_to_hva(core, name_desc->addr_gpa, (addr_t *)&name) == -1) {
PrintError("Could not translate SYMMOD header address\n");
return -1;
}
buf_desc = &(q->desc[desc_idx]);
- if (guest_pa_to_host_va(core, buf_desc->addr_gpa, (addr_t *)&(buf)) == -1) {
+ if (v3_gpa_to_hva(core, buf_desc->addr_gpa, (addr_t *)&(buf)) == -1) {
PrintError("Could not translate buffer address\n");
return -1;
}
status_desc = &(q->desc[desc_idx]);
- if (guest_pa_to_host_va(core, status_desc->addr_gpa, (addr_t *)&status_ptr) == -1) {
+ if (v3_gpa_to_hva(core, status_desc->addr_gpa, (addr_t *)&status_ptr) == -1) {
PrintError("SYMMOD Error could not translate status address\n");
return -1;
}
hdr_desc = &(q->desc[desc_idx]);
- if (guest_pa_to_host_va(core, hdr_desc->addr_gpa, (addr_t *)&hdr) == -1) {
+ if (v3_gpa_to_hva(core, hdr_desc->addr_gpa, (addr_t *)&hdr) == -1) {
PrintError("Could not translate SYMMOD header address\n");
return -1;
}
// round up to next page boundary.
sym_state->cur_queue->ring_used_addr = (sym_state->cur_queue->ring_used_addr + 0xfff) & ~0xfff;
- if (guest_pa_to_host_va(core, sym_state->cur_queue->ring_desc_addr, (addr_t *)&(sym_state->cur_queue->desc)) == -1) {
+ if (v3_gpa_to_hva(core, sym_state->cur_queue->ring_desc_addr, (addr_t *)&(sym_state->cur_queue->desc)) == -1) {
PrintError("Could not translate ring descriptor address\n");
return -1;
}
- if (guest_pa_to_host_va(core, sym_state->cur_queue->ring_avail_addr, (addr_t *)&(sym_state->cur_queue->avail)) == -1) {
+ if (v3_gpa_to_hva(core, sym_state->cur_queue->ring_avail_addr, (addr_t *)&(sym_state->cur_queue->avail)) == -1) {
PrintError("Could not translate ring available address\n");
return -1;
}
- if (guest_pa_to_host_va(core, sym_state->cur_queue->ring_used_addr, (addr_t *)&(sym_state->cur_queue->used)) == -1) {
+ if (v3_gpa_to_hva(core, sym_state->cur_queue->ring_used_addr, (addr_t *)&(sym_state->cur_queue->used)) == -1) {
PrintError("Could not translate ring used address\n");
return -1;
}
notifier_desc = &(q->desc[notifier_idx]);
- PrintDebug("SYMMOD: Notifier Descriptor (ptr=%p) gpa=%p, len=%d, flags=%x, next=%d\n", notifier_desc,
- (void *)(notifier_desc->addr_gpa), notifier_desc->length, notifier_desc->flags, notifier_desc->next);
+ PrintDebug("SYMMOD: Notifier Descriptor (ptr=%p) gpa=%p, len=%d, flags=%x, next=%d\n",
+ notifier_desc, (void *)(addr_t)(notifier_desc->addr_gpa),
+ notifier_desc->length, notifier_desc->flags,
+ notifier_desc->next);
- if (guest_pa_to_host_va(&(vm->cores[0]), notifier_desc->addr_gpa, (addr_t *)&(notifier)) == -1) {
+ if (v3_gpa_to_hva(&(vm->cores[0]), notifier_desc->addr_gpa, (addr_t *)&(notifier)) == -1) {
PrintError("Could not translate receive buffer address\n");
return -1;
}
struct virtio_sym_state * virtio_state = NULL;
struct v3_symmod_state * symmod_state = &(vm->sym_vm_state.symmod_state);
struct pci_device * pci_dev = NULL;
- char * name = v3_cfg_val(cfg, "name");
+ char * dev_id = v3_cfg_val(cfg, "ID");
PrintDebug("SYMMOD: Initializing VIRTIO Symbiotic Module device\n");
- struct vm_device * dev = v3_allocate_device(name, &dev_ops, virtio_state);
+ struct vm_device * dev = v3_allocate_device(dev_id, &dev_ops, virtio_state);
if (v3_attach_device(vm, dev) == -1) {
- PrintError("Could not attach device %s\n", name);
+ PrintError("Could not attach device %s\n", dev_id);
return -1;
}