aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2013-03-29 10:36:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-29 11:53:12 -0400
commit647965a268fd876781dd9899185482682bf42f6a (patch)
treefbcfd05483c368c816ca44b880ba810e8950494c /drivers/hv
parent39d791649781f6bb6937a217764a928b660375e2 (diff)
Drivers: hv: balloon: Permit Linux to specify hot-add alignment requirements
Some Windows hosts permit the guest to specify memory hot-add alignment requirements (if any). Linux currently requires a 128MB alignment on memory segments that can be hot-added. Specify this alignment requirement to the host. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/hv_balloon.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index d5225261ee54..2250bf532bb0 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -117,7 +117,14 @@ union dm_caps {
117 struct { 117 struct {
118 __u64 balloon:1; 118 __u64 balloon:1;
119 __u64 hot_add:1; 119 __u64 hot_add:1;
120 __u64 reservedz:62; 120 /*
121 * To support guests that may have alignment
122 * limitations on hot-add, the guest can specify
123 * its alignment requirements; a value of n
124 * represents an alignment of 2^n in mega bytes.
125 */
126 __u64 hot_add_alignment:4;
127 __u64 reservedz:58;
121 } cap_bits; 128 } cap_bits;
122 __u64 caps; 129 __u64 caps;
123} __packed; 130} __packed;
@@ -774,7 +781,7 @@ static unsigned long process_hot_add(unsigned long pg_start,
774 * If the host has specified a hot-add range; deal with it first. 781 * If the host has specified a hot-add range; deal with it first.
775 */ 782 */
776 783
777 if ((rg_size != 0) && (!dm_device.host_specified_ha_region)) { 784 if (rg_size != 0) {
778 ha_region = kzalloc(sizeof(struct hv_hotadd_state), GFP_KERNEL); 785 ha_region = kzalloc(sizeof(struct hv_hotadd_state), GFP_KERNEL);
779 if (!ha_region) 786 if (!ha_region)
780 return 0; 787 return 0;
@@ -1367,6 +1374,12 @@ static int balloon_probe(struct hv_device *dev,
1367 cap_msg.caps.cap_bits.hot_add = 1; 1374 cap_msg.caps.cap_bits.hot_add = 1;
1368 1375
1369 /* 1376 /*
1377 * Specify our alignment requirements as it relates
1378 * memory hot-add. Specify 128MB alignment.
1379 */
1380 cap_msg.caps.cap_bits.hot_add_alignment = 7;
1381
1382 /*
1370 * Currently the host does not use these 1383 * Currently the host does not use these
1371 * values and we set them to what is done in the 1384 * values and we set them to what is done in the
1372 * Windows driver. 1385 * Windows driver.