linux/drivers/hv
Vitaly Kuznetsov cb7a5724c7 Drivers: hv: balloon: account for gaps in hot add regions
I'm observing the following hot add requests from the WS2012 host:

hot_add_req: start_pfn = 0x108200 count = 330752
hot_add_req: start_pfn = 0x158e00 count = 193536
hot_add_req: start_pfn = 0x188400 count = 239616

As the host doesn't specify hot add regions we're trying to create
128Mb-aligned region covering the first request, we create the 0x108000 -
0x160000 region and we add 0x108000 - 0x158e00 memory. The second request
passes the pfn_covered() check, we enlarge the region to 0x108000 -
0x190000 and add 0x158e00 - 0x188200 memory. The problem emerges with the
third request as it starts at 0x188400 so there is a 0x200 gap which is
not covered. As the end of our region is 0x190000 now it again passes the
pfn_covered() check were we just adjust the covered_end_pfn and make it
0x188400 instead of 0x188200 which means that we'll try to online
0x188200-0x188400 pages but these pages were never assigned to us and we
crash.

We can't react to such requests by creating new hot add regions as it may
happen that the whole suggested range falls into the previously identified
128Mb-aligned area so we'll end up adding nothing or create intersecting
regions and our current logic doesn't allow that. Instead, create a list of
such 'gaps' and check for them in the page online callback.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:41 +02:00
..
channel_mgmt.c Drivers: hv: vmbus: Enable explicit signaling policy for NIC channels 2016-08-31 13:05:41 +02:00
channel.c Drivers: hv: vmbus: Implement a mechanism to tag the channel for low latency 2016-08-31 13:05:41 +02:00
connection.c Drivers: hv: vmbus: Reduce the delay between retries in vmbus_post_msg() 2016-08-31 13:05:41 +02:00
hv_balloon.c Drivers: hv: balloon: account for gaps in hot add regions 2016-08-31 13:05:41 +02:00
hv_fcopy.c Drivers: hv: utils: fix a race on userspace daemons registration 2016-08-31 13:05:41 +02:00
hv_kvp.c Drivers: hv: utils: fix a race on userspace daemons registration 2016-08-31 13:05:41 +02:00
hv_snapshot.c Drivers: hv: utils: fix a race on userspace daemons registration 2016-08-31 13:05:41 +02:00
hv_util.c Drivers: hv: util: Pass the channel information during the init call 2016-03-01 16:57:20 -08:00
hv_utils_transport.c Drivers: hv: utils: fix a race on userspace daemons registration 2016-08-31 13:05:41 +02:00
hv_utils_transport.h Drivers: hv: utils: fix a race on userspace daemons registration 2016-08-31 13:05:41 +02:00
hv.c Drivers: hv: avoid vfree() on crash 2016-08-31 13:05:40 +02:00
hyperv_vmbus.h Drivers: hv: vmbus: Enable explicit signaling policy for NIC channels 2016-08-31 13:05:41 +02:00
Kconfig x86: Make Linux guest support optional 2013-03-04 13:14:25 -08:00
Makefile Drivers: hv: util: introduce hv_utils_transport abstraction 2015-05-24 12:17:41 -07:00
ring_buffer.c Drivers: hv: vmbus: Enable explicit signaling policy for NIC channels 2016-08-31 13:05:41 +02:00
vmbus_drv.c Drivers: hv: avoid vfree() on crash 2016-08-31 13:05:40 +02:00