PCI: partially revert 2e01c8cf4b076b05013c87723e3fc710b50a0a7a
Bus address conversion was not correct. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
		
							parent
							
								
									2e01c8cf4b
								
							
						
					
					
						commit
						c71b5b4a9c
					
				
							
								
								
									
										8
									
								
								hw/pci.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								hw/pci.c
									
									
									
									
									
								
							@ -899,7 +899,7 @@ static void pci_update_mappings(PCIDevice *d)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    PCIIORegion *r;
 | 
					    PCIIORegion *r;
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
    pcibus_t new_addr, filtered_size, bus_addr;
 | 
					    pcibus_t new_addr, filtered_size;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for(i = 0; i < PCI_NUM_REGIONS; i++) {
 | 
					    for(i = 0; i < PCI_NUM_REGIONS; i++) {
 | 
				
			||||||
        r = &d->io_regions[i];
 | 
					        r = &d->io_regions[i];
 | 
				
			||||||
@ -921,7 +921,6 @@ static void pci_update_mappings(PCIDevice *d)
 | 
				
			|||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* now do the real mapping */
 | 
					        /* now do the real mapping */
 | 
				
			||||||
        bus_addr = r->addr;
 | 
					 | 
				
			||||||
        if (r->addr != PCI_BAR_UNMAPPED) {
 | 
					        if (r->addr != PCI_BAR_UNMAPPED) {
 | 
				
			||||||
            if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
 | 
					            if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
 | 
				
			||||||
                int class;
 | 
					                int class;
 | 
				
			||||||
@ -934,8 +933,7 @@ static void pci_update_mappings(PCIDevice *d)
 | 
				
			|||||||
                    isa_unassign_ioport(r->addr, r->filtered_size);
 | 
					                    isa_unassign_ioport(r->addr, r->filtered_size);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                bus_addr = pci_to_cpu_addr(d->bus, r->addr);
 | 
					                cpu_register_physical_memory(pci_to_cpu_addr(d->bus, r->addr),
 | 
				
			||||||
                cpu_register_physical_memory(bus_addr,
 | 
					 | 
				
			||||||
                                             r->filtered_size,
 | 
					                                             r->filtered_size,
 | 
				
			||||||
                                             IO_MEM_UNASSIGNED);
 | 
					                                             IO_MEM_UNASSIGNED);
 | 
				
			||||||
                qemu_unregister_coalesced_mmio(r->addr, r->filtered_size);
 | 
					                qemu_unregister_coalesced_mmio(r->addr, r->filtered_size);
 | 
				
			||||||
@ -951,7 +949,7 @@ static void pci_update_mappings(PCIDevice *d)
 | 
				
			|||||||
             * Teach them such cases, such that filtered_size < size and
 | 
					             * Teach them such cases, such that filtered_size < size and
 | 
				
			||||||
             * addr & (size - 1) != 0.
 | 
					             * addr & (size - 1) != 0.
 | 
				
			||||||
             */
 | 
					             */
 | 
				
			||||||
            r->map_func(d, i, bus_addr, r->filtered_size, r->type);
 | 
					            r->map_func(d, i, r->addr, r->filtered_size, r->type);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user