Skip to content

Commit

Permalink
Merge tag 'for-linus-4.14c-rc7-tag' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:

 - a fix for the Xen gntdev device repairing an issue in case of partial
   failure of mapping multiple pages of another domain

 - a fix of a regression in the Xen balloon driver introduced in 4.13

 - a build fix for Xen on ARM which will trigger e.g. for Linux RT

 - a maintainers update for pvops (not really Xen, but carrying through
   this tree just for convenience)

* tag 'for-linus-4.14c-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  maintainers: drop Chris Wright from pvops
  arm/xen: don't inclide rwlock.h directly.
  xen: fix booting ballooned down hvm guest
  xen/gntdev: avoid out of bounds access in case of partial gntdev_mmap()
  • Loading branch information
Linus Torvalds committed Oct 28, 2017
2 parents 90e6872 + 8fc669e commit 11224e1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10179,7 +10179,6 @@ F: Documentation/parport*.txt

PARAVIRT_OPS INTERFACE
M: Juergen Gross <jgross@suse.com>
M: Chris Wright <chrisw@sous-sol.org>
M: Alok Kataria <akataria@vmware.com>
M: Rusty Russell <rusty@rustcorp.com.au>
L: virtualization@lists.linux-foundation.org
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/xen/p2m.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <linux/bootmem.h>
#include <linux/gfp.h>
#include <linux/export.h>
#include <linux/rwlock.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/dma-mapping.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/xen/gntdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
mutex_unlock(&priv->lock);

if (use_ptemod) {
map->pages_vm_start = vma->vm_start;
err = apply_to_page_range(vma->vm_mm, vma->vm_start,
vma->vm_end - vma->vm_start,
find_grant_ptes, map);
Expand Down Expand Up @@ -1061,7 +1062,6 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
set_grant_ptes_as_special, NULL);
}
#endif
map->pages_vm_start = vma->vm_start;
}

return 0;
Expand Down
19 changes: 13 additions & 6 deletions drivers/xen/xen-balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static int register_balloon(struct device *dev);
static void watch_target(struct xenbus_watch *watch,
const char *path, const char *token)
{
unsigned long long new_target;
unsigned long long new_target, static_max;
int err;
static bool watch_fired;
static long target_diff;
Expand All @@ -72,13 +72,20 @@ static void watch_target(struct xenbus_watch *watch,
* pages. PAGE_SHIFT converts bytes to pages, hence PAGE_SHIFT - 10.
*/
new_target >>= PAGE_SHIFT - 10;
if (watch_fired) {
balloon_set_new_target(new_target - target_diff);
return;

if (!watch_fired) {
watch_fired = true;
err = xenbus_scanf(XBT_NIL, "memory", "static-max", "%llu",
&static_max);
if (err != 1)
static_max = new_target;
else
static_max >>= PAGE_SHIFT - 10;
target_diff = xen_pv_domain() ? 0
: static_max - balloon_stats.target_pages;
}

watch_fired = true;
target_diff = new_target - balloon_stats.target_pages;
balloon_set_new_target(new_target - target_diff);
}
static struct xenbus_watch target_watch = {
.node = "memory/target",
Expand Down

0 comments on commit 11224e1

Please sign in to comment.