All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Expose available KVM free memory slot count to help avoid aborts
@ 2011-01-21 23:48 Alex Williamson
  2011-01-21 23:48 ` [RFC PATCH 1/2] kvm: Allow querying free slots Alex Williamson
                   ` (3 more replies)
  0 siblings, 4 replies; 50+ messages in thread
From: Alex Williamson @ 2011-01-21 23:48 UTC (permalink / raw)
  To: kvm; +Cc: alex.williamson, ddutile, mst, avi, chrisw, jan.kiszka

When doing device assignment, we use cpu_register_physical_memory() to
directly map the qemu mmap of the device resource into the address
space of the guest.  The unadvertised feature of the register physical
memory code path on kvm, at least for this type of mapping, is that it
needs to allocate an index from a small, fixed array of memory slots.
Even better, if it can't get an index, the code aborts deep in the
kvm specific bits, preventing the caller from having a chance to
recover.

It's really easy to hit this by hot adding too many assigned devices
to a guest (pretty easy to hit with too many devices at instantiation
time too, but the abort is slightly more bearable there).

I'm assuming it's pretty difficult to make the memory slot array
dynamically sized.  If that's not the case, please let me know as
that would be a much better solution.

I'm not terribly happy with the solution in this series, it doesn't
provide any guarantees whether a cpu_register_physical_memory() will
succeed, only slightly better educated guesses.

Are there better ideas how we could solve this?  Thanks,

Alex

---

Alex Williamson (2):
      device-assignment: Count required kvm memory slots
      kvm: Allow querying free slots


 hw/device-assignment.c |   59 +++++++++++++++++++++++++++++++++++++++++++++++-
 hw/device-assignment.h |    3 ++
 kvm-all.c              |   16 +++++++++++++
 kvm.h                  |    2 ++
 4 files changed, 79 insertions(+), 1 deletions(-)

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2011-02-24 18:10 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-21 23:48 [RFC PATCH 0/2] Expose available KVM free memory slot count to help avoid aborts Alex Williamson
2011-01-21 23:48 ` [RFC PATCH 1/2] kvm: Allow querying free slots Alex Williamson
2011-01-21 23:48 ` [RFC PATCH 2/2] device-assignment: Count required kvm memory slots Alex Williamson
2011-01-22 22:11 ` [RFC PATCH 0/2] Expose available KVM free memory slot count to help avoid aborts Michael S. Tsirkin
2011-01-24  9:32 ` Marcelo Tosatti
2011-01-24 14:16   ` Jan Kiszka
2011-01-24 15:44     ` Alex Williamson
2011-01-25  5:37       ` Alex Williamson
2011-01-25  7:36         ` Jan Kiszka
2011-01-25 14:41           ` Alex Williamson
2011-01-25 14:45             ` Michael S. Tsirkin
2011-01-25 14:54               ` Avi Kivity
2011-01-25 14:53             ` Avi Kivity
2011-01-25 14:59               ` Michael S. Tsirkin
2011-01-25 17:33                 ` Avi Kivity
2011-01-25 17:58                   ` Michael S. Tsirkin
2011-01-26  9:17                     ` Avi Kivity
2011-01-26  9:20                       ` Michael S. Tsirkin
2011-01-26  9:23                         ` Avi Kivity
2011-01-26  9:39                           ` Michael S. Tsirkin
2011-01-26  9:54                             ` Avi Kivity
2011-01-26 12:08                               ` Michael S. Tsirkin
2011-01-27  9:21                                 ` Avi Kivity
2011-01-27  9:26                                   ` Michael S. Tsirkin
2011-01-27  9:28                                     ` Avi Kivity
2011-01-27  9:29                                       ` Michael S. Tsirkin
2011-01-27  9:51                                         ` Avi Kivity
2011-01-27  9:28                                     ` Michael S. Tsirkin
2011-01-25 16:35               ` Jan Kiszka
2011-01-25 19:13                 ` Alex Williamson
2011-01-26  8:14                   ` Jan Kiszka
2011-01-25 10:23         ` Avi Kivity
2011-01-25 14:57           ` Alex Williamson
2011-01-25 17:11             ` Avi Kivity
2011-01-25 17:43               ` Alex Williamson
2011-01-26  9:22                 ` Avi Kivity
2011-01-31 19:18         ` Marcelo Tosatti
2011-02-23 21:46           ` Alex Williamson
2011-02-24 12:34             ` Avi Kivity
2011-02-24 12:37               ` Avi Kivity
2011-02-24 18:10               ` Alex Williamson
2011-01-25 10:20   ` Avi Kivity
2011-01-25 14:46     ` Alex Williamson
2011-01-25 14:56       ` Avi Kivity
2011-01-25 14:55     ` Michael S. Tsirkin
2011-01-25 14:58       ` Avi Kivity
2011-01-25 15:23         ` Michael S. Tsirkin
2011-01-25 17:34           ` Avi Kivity
2011-01-25 18:00             ` Michael S. Tsirkin
2011-01-26  9:25               ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.