From: Nadav Amit <namit@vmware.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Xavier Deguillard <xdeguillard@vmware.com>,
<linux-kernel@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Nadav Amit <namit@vmware.com>, <stable@vger.kernel.org>
Subject: [PATCH v2 1/7] vmw_balloon: fix inflation of 64-bit GFNs
Date: Wed, 13 Jun 2018 06:54:06 -0700 [thread overview]
Message-ID: <20180613135412.81660-2-namit@vmware.com> (raw)
In-Reply-To: <20180613135412.81660-1-namit@vmware.com>
When balloon batching is not supported by the hypervisor, the guest
frame number (GFN) must fit in 32-bit. However, due to a bug, this check
was mistakenly ignored. In practice, when total RAM is greater than
16TB, the balloon does not work currently, making this bug unlikely to
happen.
Fixes: ef0f8f112984 ("VMware balloon: partially inline vmballoon_reserve_page.")
Cc: stable@vger.kernel.org
Reviewed-by: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Nadav Amit <namit@vmware.com>
---
drivers/misc/vmw_balloon.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
index efd733472a35..28e77ab1e136 100644
--- a/drivers/misc/vmw_balloon.c
+++ b/drivers/misc/vmw_balloon.c
@@ -450,7 +450,7 @@ static int vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn,
pfn32 = (u32)pfn;
if (pfn32 != pfn)
- return -1;
+ return -EINVAL;
STATS_INC(b->stats.lock[false]);
@@ -460,7 +460,7 @@ static int vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn,
pr_debug("%s - ppn %lx, hv returns %ld\n", __func__, pfn, status);
STATS_INC(b->stats.lock_fail[false]);
- return 1;
+ return -EIO;
}
static int vmballoon_send_batched_lock(struct vmballoon *b,
@@ -597,11 +597,12 @@ static int vmballoon_lock_page(struct vmballoon *b, unsigned int num_pages,
locked = vmballoon_send_lock_page(b, page_to_pfn(page), &hv_status,
target);
- if (locked > 0) {
+ if (locked) {
STATS_INC(b->stats.refused_alloc[false]);
- if (hv_status == VMW_BALLOON_ERROR_RESET ||
- hv_status == VMW_BALLOON_ERROR_PPN_NOTNEEDED) {
+ if (locked == -EIO &&
+ (hv_status == VMW_BALLOON_ERROR_RESET ||
+ hv_status == VMW_BALLOON_ERROR_PPN_NOTNEEDED)) {
vmballoon_free_page(page, false);
return -EIO;
}
@@ -617,7 +618,7 @@ static int vmballoon_lock_page(struct vmballoon *b, unsigned int num_pages,
} else {
vmballoon_free_page(page, false);
}
- return -EIO;
+ return locked;
}
/* track allocated page */
--
2.17.0
next prev parent reply other threads:[~2018-06-13 21:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 13:54 [PATCH v2 0/7] vmw_balloon: addressing bugs and issues Nadav Amit
2018-06-13 13:54 ` Nadav Amit [this message]
2018-06-14 5:23 ` [PATCH v2 1/7] vmw_balloon: fix inflation of 64-bit GFNs Greg Kroah-Hartman
2018-06-14 5:41 ` Nadav Amit
2018-06-14 5:50 ` Greg Kroah-Hartman
2018-06-14 5:56 ` Nadav Amit
2018-06-13 13:54 ` [PATCH v2 2/7] vmw_balloon: do not use 2MB without batching Nadav Amit
2018-06-13 13:54 ` [PATCH v2 3/7] vmw_balloon: VMCI_DOORBELL_SET does not check status Nadav Amit
2018-06-13 13:54 ` [PATCH v2 4/7] vmw_balloon: fix VMCI use when balloon built into kernel Nadav Amit
2018-06-13 13:54 ` [PATCH v2 5/7] vmw_balloon: remove inflation rate limiting Nadav Amit
2018-06-13 13:54 ` [PATCH v2 6/7] vmw_balloon: update copyright message Nadav Amit
2018-06-14 5:24 ` Greg Kroah-Hartman
2018-06-14 5:33 ` Nadav Amit
2018-06-14 5:48 ` Greg Kroah-Hartman
2018-06-15 20:35 ` valdis.kletnieks
2018-06-15 20:38 ` Nadav Amit
2018-06-16 8:03 ` Greg Kroah-Hartman
2018-06-13 13:54 ` [PATCH v2 7/7] vmw_balloon: update maintainers list Nadav Amit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180613135412.81660-2-namit@vmware.com \
--to=namit@vmware.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=xdeguillard@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.