Skip to content

Commit 11224e1

Browse files
committed
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()
2 parents 90e6872 + 8fc669e commit 11224e1

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10179,7 +10179,6 @@ F: Documentation/parport*.txt
1017910179

1018010180
PARAVIRT_OPS INTERFACE
1018110181
M: Juergen Gross <[email protected]>
10182-
M: Chris Wright <[email protected]>
1018310182
M: Alok Kataria <[email protected]>
1018410183
M: Rusty Russell <[email protected]>
1018510184

arch/arm/xen/p2m.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <linux/bootmem.h>
22
#include <linux/gfp.h>
33
#include <linux/export.h>
4-
#include <linux/rwlock.h>
4+
#include <linux/spinlock.h>
55
#include <linux/slab.h>
66
#include <linux/types.h>
77
#include <linux/dma-mapping.h>

drivers/xen/gntdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
10241024
mutex_unlock(&priv->lock);
10251025

10261026
if (use_ptemod) {
1027+
map->pages_vm_start = vma->vm_start;
10271028
err = apply_to_page_range(vma->vm_mm, vma->vm_start,
10281029
vma->vm_end - vma->vm_start,
10291030
find_grant_ptes, map);
@@ -1061,7 +1062,6 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
10611062
set_grant_ptes_as_special, NULL);
10621063
}
10631064
#endif
1064-
map->pages_vm_start = vma->vm_start;
10651065
}
10661066

10671067
return 0;

drivers/xen/xen-balloon.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static int register_balloon(struct device *dev);
5757
static void watch_target(struct xenbus_watch *watch,
5858
const char *path, const char *token)
5959
{
60-
unsigned long long new_target;
60+
unsigned long long new_target, static_max;
6161
int err;
6262
static bool watch_fired;
6363
static long target_diff;
@@ -72,13 +72,20 @@ static void watch_target(struct xenbus_watch *watch,
7272
* pages. PAGE_SHIFT converts bytes to pages, hence PAGE_SHIFT - 10.
7373
*/
7474
new_target >>= PAGE_SHIFT - 10;
75-
if (watch_fired) {
76-
balloon_set_new_target(new_target - target_diff);
77-
return;
75+
76+
if (!watch_fired) {
77+
watch_fired = true;
78+
err = xenbus_scanf(XBT_NIL, "memory", "static-max", "%llu",
79+
&static_max);
80+
if (err != 1)
81+
static_max = new_target;
82+
else
83+
static_max >>= PAGE_SHIFT - 10;
84+
target_diff = xen_pv_domain() ? 0
85+
: static_max - balloon_stats.target_pages;
7886
}
7987

80-
watch_fired = true;
81-
target_diff = new_target - balloon_stats.target_pages;
88+
balloon_set_new_target(new_target - target_diff);
8289
}
8390
static struct xenbus_watch target_watch = {
8491
.node = "memory/target",

0 commit comments

Comments
 (0)