Commit d762a4ab authored by Nadav Amit's avatar Nadav Amit Committed by Kleber Sacilotto de Souza

vmw_balloon: fix inflation with batching

BugLink: https://bugs.launchpad.net/bugs/1790620

commit 90d72ce0 upstream.

Embarrassingly, the recent fix introduced worse problem than it solved,
causing the balloon not to inflate. The VM informed the hypervisor that
the pages for lock/unlock are sitting in the wrong address, as it used
the page that is used the uninitialized page variable.

Fixes: b23220fe ("vmw_balloon: fixing double free when batching mode is off")
Cc: stable@vger.kernel.org
Reviewed-by: default avatarXavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: default avatarNadav Amit <namit@vmware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 2d867aa0
...@@ -467,7 +467,7 @@ static int vmballoon_send_batched_lock(struct vmballoon *b, ...@@ -467,7 +467,7 @@ static int vmballoon_send_batched_lock(struct vmballoon *b,
unsigned int num_pages, bool is_2m_pages, unsigned int *target) unsigned int num_pages, bool is_2m_pages, unsigned int *target)
{ {
unsigned long status; unsigned long status;
unsigned long pfn = page_to_pfn(b->page); unsigned long pfn = PHYS_PFN(virt_to_phys(b->batch_page));
STATS_INC(b->stats.lock[is_2m_pages]); STATS_INC(b->stats.lock[is_2m_pages]);
...@@ -515,7 +515,7 @@ static bool vmballoon_send_batched_unlock(struct vmballoon *b, ...@@ -515,7 +515,7 @@ static bool vmballoon_send_batched_unlock(struct vmballoon *b,
unsigned int num_pages, bool is_2m_pages, unsigned int *target) unsigned int num_pages, bool is_2m_pages, unsigned int *target)
{ {
unsigned long status; unsigned long status;
unsigned long pfn = page_to_pfn(b->page); unsigned long pfn = PHYS_PFN(virt_to_phys(b->batch_page));
STATS_INC(b->stats.unlock[is_2m_pages]); STATS_INC(b->stats.unlock[is_2m_pages]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment