diff options
Diffstat (limited to 'drivers/misc/vmw_balloon.c')
-rw-r--r-- | drivers/misc/vmw_balloon.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index 2a1e804a71aa..4d2ea8e80140 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | MODULE_AUTHOR("VMware, Inc."); | 46 | MODULE_AUTHOR("VMware, Inc."); |
47 | MODULE_DESCRIPTION("VMware Memory Control (Balloon) Driver"); | 47 | MODULE_DESCRIPTION("VMware Memory Control (Balloon) Driver"); |
48 | MODULE_VERSION("1.2.1.1-k"); | 48 | MODULE_VERSION("1.2.1.2-k"); |
49 | MODULE_ALIAS("dmi:*:svnVMware*:*"); | 49 | MODULE_ALIAS("dmi:*:svnVMware*:*"); |
50 | MODULE_ALIAS("vmware_vmmemctl"); | 50 | MODULE_ALIAS("vmware_vmmemctl"); |
51 | MODULE_LICENSE("GPL"); | 51 | MODULE_LICENSE("GPL"); |
@@ -315,7 +315,8 @@ static bool vmballoon_send_get_target(struct vmballoon *b, u32 *new_target) | |||
315 | * fear that guest will need it. Host may reject some pages, we need to | 315 | * fear that guest will need it. Host may reject some pages, we need to |
316 | * check the return value and maybe submit a different page. | 316 | * check the return value and maybe submit a different page. |
317 | */ | 317 | */ |
318 | static bool vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn) | 318 | static bool vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn, |
319 | unsigned int *hv_status) | ||
319 | { | 320 | { |
320 | unsigned long status, dummy; | 321 | unsigned long status, dummy; |
321 | u32 pfn32; | 322 | u32 pfn32; |
@@ -326,7 +327,7 @@ static bool vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn) | |||
326 | 327 | ||
327 | STATS_INC(b->stats.lock); | 328 | STATS_INC(b->stats.lock); |
328 | 329 | ||
329 | status = VMWARE_BALLOON_CMD(LOCK, pfn, dummy); | 330 | *hv_status = status = VMWARE_BALLOON_CMD(LOCK, pfn, dummy); |
330 | if (vmballoon_check_status(b, status)) | 331 | if (vmballoon_check_status(b, status)) |
331 | return true; | 332 | return true; |
332 | 333 | ||
@@ -410,6 +411,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep) | |||
410 | { | 411 | { |
411 | struct page *page; | 412 | struct page *page; |
412 | gfp_t flags; | 413 | gfp_t flags; |
414 | unsigned int hv_status; | ||
413 | bool locked = false; | 415 | bool locked = false; |
414 | 416 | ||
415 | do { | 417 | do { |
@@ -429,11 +431,12 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep) | |||
429 | } | 431 | } |
430 | 432 | ||
431 | /* inform monitor */ | 433 | /* inform monitor */ |
432 | locked = vmballoon_send_lock_page(b, page_to_pfn(page)); | 434 | locked = vmballoon_send_lock_page(b, page_to_pfn(page), &hv_status); |
433 | if (!locked) { | 435 | if (!locked) { |
434 | STATS_INC(b->stats.refused_alloc); | 436 | STATS_INC(b->stats.refused_alloc); |
435 | 437 | ||
436 | if (b->reset_required) { | 438 | if (hv_status == VMW_BALLOON_ERROR_RESET || |
439 | hv_status == VMW_BALLOON_ERROR_PPN_NOTNEEDED) { | ||
437 | __free_page(page); | 440 | __free_page(page); |
438 | return -EIO; | 441 | return -EIO; |
439 | } | 442 | } |