Re: [PATCH 10/10] introduce qemu_ram_map

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

 



On Tue, Apr 27, 2010 at 08:28:15AM -0600, Cam Macdonell wrote:
> On Mon, Apr 26, 2010 at 12:54 PM, Anthony Liguori <anthony@xxxxxxxxxxxxx> wrote:
> > On 04/26/2010 01:49 PM, Marcelo Tosatti wrote:
> >>
> >> On Mon, Apr 26, 2010 at 01:27:30PM -0500, Anthony Liguori wrote:
> >>
> >>>
> >>> On 04/26/2010 12:59 PM, Marcelo Tosatti wrote:
> >>>
> >>>>
> >>>> Which allows drivers to register an mmaped region into ram block
> >>>> mappings.
> >>>> To be used by device assignment driver.
> >>>>
> >>>
> >>> This doesn't make much sense to me.
> >>>
> >>> Do you use this like:
> >>>
> >>> qemu_ram_map(64k, ptr);
> >>> assert(qemu_ram_alloc(64k) == ptr);
> >>>
> >>
> >> No. hw/device-assignment.c in qemu-kvm mmaps
> >> /sys/bus/pci/devices/x:y:z/resourcen (the PCI devices memory regions) to
> >> the guest.
> >>
> >
> > I understand, but how do you use qemu_ram_map() to actually map that memory
> > to a given PCI device resource?  I assume you rely on it getting put on the
> > front of the list so that the next qemu_ram_alloc() will be at that
> > location.
> 
> In my shared memory patch, I passed the offset returned from
> qemu_ram_mmap to cpu_register_physical_memory from within the map
> function passed to pci_register_bar.  Could the same not be done?  Is
> there something incorrect with this approach?

No, its correct. Its similar to what hw/device-assignment.c in qemu-kvm 
will do.

--
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