X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fpci_front.c;h=08d03fe4dd9cb58a6ca59f40744762296b9bfce8;hb=9452a96dc7cfcadaa81a32a36acc1a95bc1844db;hp=1ec726804d930fbca1c97cd78c822642e82b3d87;hpb=0bb7a0bae401c985aa4cbeab32c57d29f7652e75;p=palacios.git diff --git a/palacios/src/devices/pci_front.c b/palacios/src/devices/pci_front.c index 1ec7268..08d03fe 100644 --- a/palacios/src/devices/pci_front.c +++ b/palacios/src/devices/pci_front.c @@ -682,17 +682,21 @@ static int pci_bar_write(int bar_num, uint32_t * src, void * private_data) { static int pci_front_cmd_update(struct pci_device *pci_dev, pci_cmd_t cmd, uint64_t arg, void * priv_data) { +#ifdef V3_CONFIG_DEBUG_PCI_FRONT struct vm_device * dev = (struct vm_device *)priv_data; struct pci_front_internal * state = (struct pci_front_internal *)dev->private_data; uint16_t command = (uint16_t)arg; +#endif - PrintDebug(VM_NONE, VCORE_NONE, "pci_front (%s): command update\n", state->name); + PrintDebug(VM_NONE, VCORE_NONE, "pci_front (%s): command update 0x%x\n", state->name,command); - if (v3_host_dev_write_config(state->host_dev, 0x4, &command, 2) != 2) { - PrintError(dev->vm, VCORE_NONE, "pci_front (%s): cmd update: unable to write all bytes\n", state->name); - return -1; - } + // Note that the config_update corresponding to this callback + // has occurred before this request, and so has already been delivered + // to the host_dev interface. + // + // We do not need to handle the special semantics of cmd_update here + // hence nothing... return 0; } @@ -705,7 +709,7 @@ static void remap_rom(struct v3_vm_info *vm, struct pci_front_internal *state, v // unmap struct v3_mem_region *old_reg = v3_get_mem_region(vm,V3_MEM_CORE_ANY,(addr_t)state->rom_gpa); if (old_reg) { - V3_Print(vm,VCORE_NONE,"pci_front: removing old memory region\n"); + PrintDebug(vm,VCORE_NONE,"pci_front: removing old memory region\n"); v3_delete_mem_region(vm,old_reg); } state->rom_gpa = 0; @@ -724,7 +728,7 @@ static void remap_rom(struct v3_vm_info *vm, struct pci_front_internal *state, v state->rom_gpa = new_gpa; } - V3_Print(vm,VCORE_NONE,"pci_front: remapped rom to %p (enable=%u)\n",state->rom_gpa,enable) ; + PrintDebug(vm,VCORE_NONE,"pci_front: remapped rom to %p (enable=%u)\n",state->rom_gpa,enable) ; } #define ROM_ADDR_MASK 0xfffff800 @@ -736,7 +740,7 @@ static int pci_front_rom_update(struct pci_device * pci_dev, uint32_t * src, voi struct vm_device * dev = (struct vm_device *)priv_data; struct pci_front_internal * state = (struct pci_front_internal *)dev->private_data; - V3_Print(dev->vm,VCORE_NONE,"pci_front: rom update with value 0x%x\n",*src); + PrintDebug(dev->vm,VCORE_NONE,"pci_front: rom update with value 0x%x\n",*src); // the assumption is that the config_write happened before this if (((*src) & ROM_ADDR_MASK) == ROM_ADDR_MASK) { @@ -769,15 +773,6 @@ static int pci_front_config_read(struct pci_device *pci_dev, uint_t reg_num, voi PrintDebug(VM_NONE, VCORE_NONE, "byte %d: %x\n", i, state->config_space[reg_num+i]); } - /* - PrintDebug(VM_NONE, VCORE_NONE, "pci_front config space read callback (%d bytes starting at reg num %x) returning:\n", length, reg_num); - for (i = 0; i < length/4; i++) { - PrintDebug(VM_NONE, VCORE_NONE, "%x\n", *(uint32_t*)(&(state->config_space[reg_num]) + i*4)); - } - */ - - - return 0; } @@ -959,8 +954,8 @@ static int pci_front_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) char *rom_id; struct v3_cfg_file *rom_file; v3_cfg_tree_t *rom; - void *rom_hpa; - uint64_t rom_size; + void *rom_hpa=0; + uint64_t rom_size=0; @@ -981,7 +976,7 @@ static int pci_front_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) } if (!(rom=v3_cfg_subtree(cfg,"rom"))) { - V3_Print(vm, VCORE_NONE, "pci_front (%s): no expansion block\n",dev_id); + PrintDebug(vm, VCORE_NONE, "pci_front (%s): no expansion block\n",dev_id); rom_file = 0; rom_hpa=0; } else { @@ -1004,7 +999,7 @@ static int pci_front_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) memcpy(V3_VAddr(rom_hpa),rom_file->data,rom_size); } - V3_Print(vm,VCORE_NONE,"pci_front (%s): rom %s tag %s size 0x%llx hpa %p\n", + PrintDebug(vm,VCORE_NONE,"pci_front (%s): rom %s tag %s size 0x%llx hpa %p\n", dev_id,rom_id,rom_file->tag,rom_file->size,rom_hpa); }