Re: PCI device passthrough / memory mapping issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/19/2010 12:46 AM, Fede wrote:
I'm currently working to enable vga passthrough in kvm.

assigned_dev_iomem_map: e_phys=10000000 r_virt=0x7fa64af0e000 type=0
len=02000000 region_num=3
kvm_register_phys_mem:580 memory: gpa: 10000000, size: 2000000, uaddr:
7fa64af0e000, slot: 7,flags: 0
create_userspace_phys_mem: File exists
assigned_dev_iomem_map: Error: create new mapping failed


This worked a month ago. But after some git updates there's a problem.

When the real device regions are mapped from real virtual memory to
guest physical addresses in kvm, it overlaps region 3 with the guest
physical memory assigned to kernel space (0x10000000 to 0x10200000)

I've been trying to look for the answer to this question: Why is gpa
0x10000000 chosen and not any other free memory space?

The BIOS generally assigns addresses, then the OS updates them if it wants to. Is the crash before or after the OS has started loading?

If before, suggest you add some printfs to seabios to explain its decisions.

It seems that this addresses are being chosen here (for example, for region 3):
assigned_dev_pci_read_config: (4.0): address=001c val=0x00000000 len=4
assigned_dev_pci_write_config: (4.0): address=001c val=0xffffffff len=4
assigned_dev_pci_read_config: (4.0): address=001c val=0xfe000000 len=4

The above sequence is how the bios determines the BAR size. (0x2000000 in this case).

assigned_dev_pci_write_config: (4.0): address=001c val=0x00000000 len=4

Now it clears the mess from the previous step.

assigned_dev_pci_read_config: (4.0): address=001c val=0x00000000 len=4
assigned_dev_pci_write_config: (4.0): address=001c val=0x10000000 len=4

Here it assigns a new address. It's clearly wrong. A log in seabios will explain this.

What does this mean? Why PCI BARs are being written and read?

Why the
values that are written differs from the ones that are read after?

BARs are not RAM cells. the least significant address bits are hardwired to zero, that's how the BIOS detects the BAR size (and required alignment).

The last write is the gpa that is used.

Is this a bug? I can't find the source of this gpa addresses. I need
to change them.

Looks like a bug in seabios.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux