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>
This commit is contained in:
parent
39d7916497
commit
647965a268
|
@ -117,7 +117,14 @@ union dm_caps {
|
||||||
struct {
|
struct {
|
||||||
__u64 balloon:1;
|
__u64 balloon:1;
|
||||||
__u64 hot_add:1;
|
__u64 hot_add:1;
|
||||||
__u64 reservedz:62;
|
/*
|
||||||
|
* To support guests that may have alignment
|
||||||
|
* limitations on hot-add, the guest can specify
|
||||||
|
* its alignment requirements; a value of n
|
||||||
|
* represents an alignment of 2^n in mega bytes.
|
||||||
|
*/
|
||||||
|
__u64 hot_add_alignment:4;
|
||||||
|
__u64 reservedz:58;
|
||||||
} cap_bits;
|
} cap_bits;
|
||||||
__u64 caps;
|
__u64 caps;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
@ -774,7 +781,7 @@ static unsigned long process_hot_add(unsigned long pg_start,
|
||||||
* If the host has specified a hot-add range; deal with it first.
|
* If the host has specified a hot-add range; deal with it first.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((rg_size != 0) && (!dm_device.host_specified_ha_region)) {
|
if (rg_size != 0) {
|
||||||
ha_region = kzalloc(sizeof(struct hv_hotadd_state), GFP_KERNEL);
|
ha_region = kzalloc(sizeof(struct hv_hotadd_state), GFP_KERNEL);
|
||||||
if (!ha_region)
|
if (!ha_region)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1366,6 +1373,12 @@ static int balloon_probe(struct hv_device *dev,
|
||||||
cap_msg.caps.cap_bits.balloon = 1;
|
cap_msg.caps.cap_bits.balloon = 1;
|
||||||
cap_msg.caps.cap_bits.hot_add = 1;
|
cap_msg.caps.cap_bits.hot_add = 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Specify our alignment requirements as it relates
|
||||||
|
* memory hot-add. Specify 128MB alignment.
|
||||||
|
*/
|
||||||
|
cap_msg.caps.cap_bits.hot_add_alignment = 7;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Currently the host does not use these
|
* Currently the host does not use these
|
||||||
* values and we set them to what is done in the
|
* values and we set them to what is done in the
|
||||||
|
|
Loading…
Reference in a new issue