Commit 11224e1f authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-4.14c-rc7-tag' of git://git.kernel.org/pub/scm/linux/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()
parents 90e68720 8fc669ea
...@@ -10179,7 +10179,6 @@ F: Documentation/parport*.txt ...@@ -10179,7 +10179,6 @@ F: Documentation/parport*.txt
PARAVIRT_OPS INTERFACE PARAVIRT_OPS INTERFACE
M: Juergen Gross <jgross@suse.com> M: Juergen Gross <jgross@suse.com>
M: Chris Wright <chrisw@sous-sol.org>
M: Alok Kataria <akataria@vmware.com> M: Alok Kataria <akataria@vmware.com>
M: Rusty Russell <rusty@rustcorp.com.au> M: Rusty Russell <rusty@rustcorp.com.au>
L: virtualization@lists.linux-foundation.org L: virtualization@lists.linux-foundation.org
......
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/rwlock.h> #include <linux/spinlock.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
......
...@@ -1024,6 +1024,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) ...@@ -1024,6 +1024,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
if (use_ptemod) { if (use_ptemod) {
map->pages_vm_start = vma->vm_start;
err = apply_to_page_range(vma->vm_mm, vma->vm_start, err = apply_to_page_range(vma->vm_mm, vma->vm_start,
vma->vm_end - vma->vm_start, vma->vm_end - vma->vm_start,
find_grant_ptes, map); find_grant_ptes, map);
...@@ -1061,7 +1062,6 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) ...@@ -1061,7 +1062,6 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
set_grant_ptes_as_special, NULL); set_grant_ptes_as_special, NULL);
} }
#endif #endif
map->pages_vm_start = vma->vm_start;
} }
return 0; return 0;
......
...@@ -57,7 +57,7 @@ static int register_balloon(struct device *dev); ...@@ -57,7 +57,7 @@ static int register_balloon(struct device *dev);
static void watch_target(struct xenbus_watch *watch, static void watch_target(struct xenbus_watch *watch,
const char *path, const char *token) const char *path, const char *token)
{ {
unsigned long long new_target; unsigned long long new_target, static_max;
int err; int err;
static bool watch_fired; static bool watch_fired;
static long target_diff; static long target_diff;
...@@ -72,13 +72,20 @@ static void watch_target(struct xenbus_watch *watch, ...@@ -72,13 +72,20 @@ static void watch_target(struct xenbus_watch *watch,
* pages. PAGE_SHIFT converts bytes to pages, hence PAGE_SHIFT - 10. * pages. PAGE_SHIFT converts bytes to pages, hence PAGE_SHIFT - 10.
*/ */
new_target >>= PAGE_SHIFT - 10; new_target >>= PAGE_SHIFT - 10;
if (watch_fired) {
balloon_set_new_target(new_target - target_diff); if (!watch_fired) {
return; 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; balloon_set_new_target(new_target - target_diff);
target_diff = new_target - balloon_stats.target_pages;
} }
static struct xenbus_watch target_watch = { static struct xenbus_watch target_watch = {
.node = "memory/target", .node = "memory/target",
......
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