<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/xen/balloon.c, branch linux-4.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-09-08T17:03:49Z</updated>
<entry>
<title>xen: Use correctly the Xen memory terminologies</title>
<updated>2015-09-08T17:03:49Z</updated>
<author>
<name>Julien Grall</name>
</author>
<published>2015-08-07T16:34:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0df4f266b3af90442bbeb5e685a84a80745beba0'/>
<id>urn:sha1:0df4f266b3af90442bbeb5e685a84a80745beba0</id>
<content type='text'>
Based on include/xen/mm.h [1], Linux is mistakenly using MFN when GFN
is meant, I suspect this is because the first support for Xen was for
PV. This resulted in some misimplementation of helpers on ARM and
confused developers about the expected behavior.

For instance, with pfn_to_mfn, we expect to get an MFN based on the name.
Although, if we look at the implementation on x86, it's returning a GFN.

For clarity and avoid new confusion, replace any reference to mfn with
gfn in any helpers used by PV drivers. The x86 code will still keep some
reference of pfn_to_mfn which may be used by all kind of guests
No changes as been made in the hypercall field, even
though they may be invalid, in order to keep the same as the defintion
in xen repo.

Note that page_to_mfn has been renamed to xen_page_to_gfn to avoid a
name to close to the KVM function gfn_to_page.

Take also the opportunity to simplify simple construction such
as pfn_to_mfn(page_to_pfn(page)) into xen_page_to_gfn. More complex clean up
will come in follow-up patches.

[1] http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=e758ed14f390342513405dd766e874934573e6cb

Signed-off-by: Julien Grall &lt;julien.grall@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Acked-by: Wei Liu &lt;wei.liu2@citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen: switch extra memory accounting to use pfns</title>
<updated>2015-09-08T15:28:06Z</updated>
<author>
<name>Juergen Gross</name>
</author>
<published>2015-09-04T12:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=626d7508664c4bc8e67f496da4387ecd0c410b8c'/>
<id>urn:sha1:626d7508664c4bc8e67f496da4387ecd0c410b8c</id>
<content type='text'>
Instead of using physical addresses for accounting of extra memory
areas available for ballooning switch to pfns as this is much less
error prone regarding partial pages.

Reported-by: Roger Pau Monné &lt;roger.pau@citrix.com&gt;
Tested-by: Roger Pau Monné &lt;roger.pau@citrix.com&gt;
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen: release lock occasionally during ballooning</title>
<updated>2015-07-20T12:37:05Z</updated>
<author>
<name>Juergen Gross</name>
</author>
<published>2015-07-20T11:49:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=929423fa83e5b75e94101b280738b9a5a376a0e1'/>
<id>urn:sha1:929423fa83e5b75e94101b280738b9a5a376a0e1</id>
<content type='text'>
When dom0 is being ballooned balloon_process() will hold the balloon
mutex until it is finished. This will block e.g. creation of new
domains as the device backends for the new domain need some
autoballooned pages for the ring buffers.

Avoid this by releasing the balloon mutex from time to time during
ballooning. Adjust the comment above balloon_process() regarding
multiple instances of balloon_process().

Instead of open coding it, just use cond_resched().

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen/balloon: before adding hotplugged memory, set frames to invalid</title>
<updated>2015-03-23T15:15:53Z</updated>
<author>
<name>Juergen Gross</name>
</author>
<published>2015-03-20T12:55:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c56b3a12ce52f361468cbdd2f79b2f3b8da0ea6'/>
<id>urn:sha1:3c56b3a12ce52f361468cbdd2f79b2f3b8da0ea6</id>
<content type='text'>
Commit 25b884a83d487fd62c3de7ac1ab5549979188482 ("x86/xen: set
regions above the end of RAM as 1:1") introduced a regression.

To be able to add memory pages which were added via memory hotplug to
a pv domain, the pages must be "invalid" instead of "identity" in the
p2m list before they can be added.

Suggested-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.16+
Reviewed-by: Daniel Kiper &lt;daniel.kiper@oracle.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen: remove scratch frames for ballooned pages and m2p override</title>
<updated>2015-01-28T14:03:10Z</updated>
<author>
<name>David Vrabel</name>
</author>
<published>2015-01-05T17:06:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0bb599fd30108883b00c7d4a226eeb49111e6932'/>
<id>urn:sha1:0bb599fd30108883b00c7d4a226eeb49111e6932</id>
<content type='text'>
The scratch frame mappings for ballooned pages and the m2p override
are broken.  Remove them in preparation for replacing them with
simpler mechanisms that works.

The scratch pages did not ensure that the page was not in use.  In
particular, the foreign page could still be in use by hardware.  If
the guest reused the frame the hardware could read or write that
frame.

The m2p override did not handle the same frame being granted by two
different grant references.  Trying an M2P override lookup in this
case is impossible.

With the m2p override removed, the grant map/unmap for the kernel
mappings (for x86 PV) can be easily batched in
set_foreign_p2m_mapping() and clear_foreign_p2m_mapping().

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
</content>
</entry>
<entry>
<title>xen/balloon: Don't continue ballooning when BP_ECANCELED is encountered</title>
<updated>2014-10-23T15:24:01Z</updated>
<author>
<name>Boris Ostrovsky</name>
</author>
<published>2014-10-07T21:00:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd8b79511349efd1f0decea920f61b93acb34a75'/>
<id>urn:sha1:fd8b79511349efd1f0decea920f61b93acb34a75</id>
<content type='text'>
Commit 3dcf63677d4e ("xen/balloon: cancel ballooning if adding new
memory failed") makes reserve_additional_memory() return BP_ECANCELED
when an error is encountered. This error, however, is ignored by the
caller (balloon_process()) since it is overwritten by subsequent call
to update_schedule(). This results in continuous attempts to add more
memory, all of which are likely to fail again.

We should stop trying to schedule next iteration of ballooning when
the current one has failed.

Signed-off-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Reviewed-by: Daniel Kiper &lt;daniel.kiper@oracle.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen/balloon: cancel ballooning if adding new memory failed</title>
<updated>2014-09-02T14:37:19Z</updated>
<author>
<name>David Vrabel</name>
</author>
<published>2014-09-01T17:52:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3dcf63677d4eb7fdfc13290c8558c301d2588fe8'/>
<id>urn:sha1:3dcf63677d4eb7fdfc13290c8558c301d2588fe8</id>
<content type='text'>
If the balloon driver is adding additional memory regions to the
balloon and add_memory() fails it will likely continuously fail so
cancel the balloon operation.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Daniel Kiper &lt;daniel.kiper@oracle.com&gt;
</content>
</entry>
<entry>
<title>xen/balloon: set ballooned out pages as invalid in p2m</title>
<updated>2014-07-04T14:17:43Z</updated>
<author>
<name>David Vrabel</name>
</author>
<published>2014-06-27T09:42:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fb9a0c443691ceaab3daba966bbbd9f5ff3aa26f'/>
<id>urn:sha1:fb9a0c443691ceaab3daba966bbbd9f5ff3aa26f</id>
<content type='text'>
Since cd9151e26d31048b2b5e00fd02e110e07d2200c9 (xen/balloon: set a
mapping for ballooned out pages), a ballooned out page had its entry
in the p2m set to the MFN of one of the scratch pages.  This means
that the p2m will contain many entries pointing to the same MFN.

During a domain save, these many-to-one entries are not identified as
such and the scratch page is saved multiple times. On restore the
ballooned pages are populated with new frames and the domain may use
up its allocation before all pages can be restored.

Since the original fix only needed to keep a mapping for the ballooned
page it is safe to set ballooned out pages as INVALID_P2M_ENTRY in the
p2m (as they were before). Thus preventing them from being saved and
re-populated on restore.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reported-by: Marek Marczykowski &lt;marmarek@invisiblethingslab.com&gt;
Tested-by: Marek Marczykowski &lt;marmarek@invisiblethingslab.com&gt;
Acked-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm</title>
<updated>2014-04-07T21:55:46Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2014-04-07T21:55:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=467a9e1633043810259a7f5368fbcc1e84746137'/>
<id>urn:sha1:467a9e1633043810259a7f5368fbcc1e84746137</id>
<content type='text'>
Pull CPU hotplug notifiers registration fixes from Rafael Wysocki:
 "The purpose of this single series of commits from Srivatsa S Bhat
  (with a small piece from Gautham R Shenoy) touching multiple
  subsystems that use CPU hotplug notifiers is to provide a way to
  register them that will not lead to deadlocks with CPU online/offline
  operations as described in the changelog of commit 93ae4f978ca7f ("CPU
  hotplug: Provide lockless versions of callback registration
  functions").

  The first three commits in the series introduce the API and document
  it and the rest simply goes through the users of CPU hotplug notifiers
  and converts them to using the new method"

* tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (52 commits)
  net/iucv/iucv.c: Fix CPU hotplug callback registration
  net/core/flow.c: Fix CPU hotplug callback registration
  mm, zswap: Fix CPU hotplug callback registration
  mm, vmstat: Fix CPU hotplug callback registration
  profile: Fix CPU hotplug callback registration
  trace, ring-buffer: Fix CPU hotplug callback registration
  xen, balloon: Fix CPU hotplug callback registration
  hwmon, via-cputemp: Fix CPU hotplug callback registration
  hwmon, coretemp: Fix CPU hotplug callback registration
  thermal, x86-pkg-temp: Fix CPU hotplug callback registration
  octeon, watchdog: Fix CPU hotplug callback registration
  oprofile, nmi-timer: Fix CPU hotplug callback registration
  intel-idle: Fix CPU hotplug callback registration
  clocksource, dummy-timer: Fix CPU hotplug callback registration
  drivers/base/topology.c: Fix CPU hotplug callback registration
  acpi-cpufreq: Fix CPU hotplug callback registration
  zsmalloc: Fix CPU hotplug callback registration
  scsi, fcoe: Fix CPU hotplug callback registration
  scsi, bnx2fc: Fix CPU hotplug callback registration
  scsi, bnx2i: Fix CPU hotplug callback registration
  ...
</content>
</entry>
<entry>
<title>xen/balloon: flush persistent kmaps in correct position</title>
<updated>2014-03-25T10:38:30Z</updated>
<author>
<name>Wei Liu</name>
</author>
<published>2014-03-15T16:11:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09ed3d5ba06137913960f9c9385f71fc384193ab'/>
<id>urn:sha1:09ed3d5ba06137913960f9c9385f71fc384193ab</id>
<content type='text'>
Xen balloon driver will update ballooned out pages' P2M entries to point
to scratch page for PV guests. In 24f69373e2 ("xen/balloon: don't alloc
page while non-preemptible", kmap_flush_unused was moved after updating
P2M table. In that case for 32 bit PV guest we might end up with

  P2M    X -----&gt; S  (S is mfn of balloon scratch page)
  M2P    Y -----&gt; X  (Y is mfn in persistent kmap entry)

kmap_flush_unused() iterates through all the PTEs in the kmap address
space, using pte_to_page() to obtain the page. If the p2m and the m2p
are inconsistent the incorrect page is returned.  This will clear
page-&gt;address on the wrong page which may cause subsequent oopses if
that page is currently kmap'ed.

Move the flush back between get_page and __set_phys_to_machine to fix
this.

Signed-off-by: Wei Liu &lt;wei.liu2@citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Cc: stable@vger.kernel.org # 3.12+
</content>
</entry>
</feed>
