<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/include/xen/grant_table.h, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-02-23T12:58:14Z</updated>
<entry>
<title>Xen/gntdev: correct error checking in gntdev_map_grant_pages()</title>
<updated>2021-02-23T12:58:14Z</updated>
<author>
<name>Jan Beulich</name>
</author>
<published>2021-02-15T07:52:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=71ed732b5725b3a2e36694644ce8ccdf7d9918e8'/>
<id>urn:sha1:71ed732b5725b3a2e36694644ce8ccdf7d9918e8</id>
<content type='text'>
commit ebee0eab08594b2bd5db716288a4f1ae5936e9bc upstream.

Failure of the kernel part of the mapping operation should also be
indicated as an error to the caller, or else it may assume the
respective kernel VA is okay to access.

Furthermore gnttab_map_refs() failing still requires recording
successfully mapped handles, so they can be unmapped subsequently. This
in turn requires there to be a way to tell full hypercall failure from
partial success - preset map_op status fields such that they won't
"happen" to look as if the operation succeeded.

Also again use GNTST_okay instead of implying its value (zero).

This is part of XSA-361.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xen/grant-table: Add an helper to iterate over a specific number of grants</title>
<updated>2015-10-23T13:20:46Z</updated>
<author>
<name>Julien Grall</name>
</author>
<published>2015-10-13T16:50:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f73314b28148f9ee9f89a0ae961c8fb36e3269fa'/>
<id>urn:sha1:f73314b28148f9ee9f89a0ae961c8fb36e3269fa</id>
<content type='text'>
With the 64KB page granularity support on ARM64, a Linux page may be
split accross multiple grant.

Currently we have the helper gnttab_foreach_grant_in_grant to break a
Linux page based on an offset and a len, but it doesn't fit when we only
have a number of grants in hand.

Introduce a new helper which take an array of Linux page and a number of
grant and will figure out the address of each grant.

Signed-off-by: Julien Grall &lt;julien.grall@citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen/grant: Add helper gnttab_page_grant_foreign_access_ref_one</title>
<updated>2015-10-23T13:20:34Z</updated>
<author>
<name>Julien Grall</name>
</author>
<published>2015-06-19T17:05:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3922f32c1e6db2e096ff095a5b8af0b940b97508'/>
<id>urn:sha1:3922f32c1e6db2e096ff095a5b8af0b940b97508</id>
<content type='text'>
Many PV drivers contain the idiom:

pfn = page_to_gfn(...) /* Or similar */
gnttab_grant_foreign_access_ref

Replace it by a new helper. Note that when Linux is using a different
page granularity than Xen, the helper only gives access to the first 4KB
grant.

This is useful where drivers are allocating a full Linux page for each
grant.

Also include xen/interface/grant_table.h rather than xen/grant_table.h in
asm/page.h for x86 to fix a compilation issue [1]. Only the former is
useful in order to get the structure definition.

[1] Interdependency between asm/page.h and xen/grant_table.h which result
to page_mfn not being defined when necessary.

Signed-off-by: Julien Grall &lt;julien.grall@citrix.com&gt;
Reviewed-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen/grant: Introduce helpers to split a page into grant</title>
<updated>2015-10-23T13:20:33Z</updated>
<author>
<name>Julien Grall</name>
</author>
<published>2015-06-19T16:49:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=008c320a96d218712043f8db0111d5472697785c'/>
<id>urn:sha1:008c320a96d218712043f8db0111d5472697785c</id>
<content type='text'>
Currently, a grant is always based on the Xen page granularity (i.e
4KB). When Linux is using a different page granularity, a single page
will be split between multiple grants.

The new helpers will be in charge of splitting the Linux page into grants
and call a function given by the caller on each grant.

Also provide an helper to count the number of grants within a given
contiguous region.

Note that the x86/include/asm/xen/page.h is now including
xen/interface/grant_table.h rather than xen/grant_table.h. It's
necessary because xen/grant_table.h depends on asm/xen/page.h and will
break the compilation. Furthermore, only definition in
interface/grant_table.h is required.

Signed-off-by: Julien Grall &lt;julien.grall@citrix.com&gt;
Reviewed-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen/grant: introduce func gnttab_unmap_refs_sync()</title>
<updated>2015-04-27T10:41:12Z</updated>
<author>
<name>Bob Liu</name>
</author>
<published>2015-04-03T06:42:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b44166cd46e28dd608d5baa5873047a40f32919c'/>
<id>urn:sha1:b44166cd46e28dd608d5baa5873047a40f32919c</id>
<content type='text'>
There are several place using gnttab async unmap and wait for
completion, so move the common code to a function
gnttab_unmap_refs_sync().

Signed-off-by: Bob Liu &lt;bob.liu@oracle.com&gt;
Acked-by: Roger Pau Monné &lt;roger.pau@citrix.com&gt;
Acked-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen/grant-table: add a mechanism to safely unmap pages that are in use</title>
<updated>2015-01-28T14:03:14Z</updated>
<author>
<name>Jennifer Herbert</name>
</author>
<published>2014-12-09T18:28:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f9f1c67572f5e5e6dc84216d48d1480f3c4fcf6'/>
<id>urn:sha1:3f9f1c67572f5e5e6dc84216d48d1480f3c4fcf6</id>
<content type='text'>
Introduce gnttab_unmap_refs_async() that can be used to safely unmap
pages that may be in use (ref count &gt; 1).  If the pages are in use the
unmap is deferred and retried later.  This polling is not very clever
but it should be good enough if the cases where the delay is necessary
are rare.

The initial delay is 5 ms and is increased linearly on each subsequent
retry (to reduce load if the page is in use for a long time).

This is needed to allow block backends using grant mapping to safely
use network storage (block or filesystem based such as iSCSI or NFS).

The network storage driver may complete a block request whilst there
is a queued network packet retry (because the ack from the remote end
races with deciding to queue the retry).  The pages for the retried
packet would be grant unmapped and the network driver (or hardware)
would access the unmapped page.

Signed-off-by: Jennifer Herbert &lt;jennifer.herbert@citrix.com&gt;
Acked-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen: mark grant mapped pages as foreign</title>
<updated>2015-01-28T14:03:12Z</updated>
<author>
<name>Jennifer Herbert</name>
</author>
<published>2014-12-24T14:17:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8da7633f168b5428e2cfb7342408b2c44088f5df'/>
<id>urn:sha1:8da7633f168b5428e2cfb7342408b2c44088f5df</id>
<content type='text'>
Use the "foreign" page flag to mark pages that have a grant map.  Use
page-&gt;private to store information of the grant (the granting domain
and the grant reference).

Signed-off-by: Jennifer Herbert &lt;jennifer.herbert@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen/grant-table: add helpers for allocating pages</title>
<updated>2015-01-28T14:03:12Z</updated>
<author>
<name>David Vrabel</name>
</author>
<published>2015-01-08T18:06:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ff4b156f166b3931894d2a8b5cdba6cdf4da0618'/>
<id>urn:sha1:ff4b156f166b3931894d2a8b5cdba6cdf4da0618</id>
<content type='text'>
Add gnttab_alloc_pages() and gnttab_free_pages() to allocate/free pages
suitable to for granted maps.

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/grant-table: pre-populate kernel unmap ops for xen_gnttab_unmap_refs()</title>
<updated>2015-01-28T14:03:10Z</updated>
<author>
<name>David Vrabel</name>
</author>
<published>2015-01-05T14:13:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=853d0289340026b30f93fd0e768340221d4e605c'/>
<id>urn:sha1:853d0289340026b30f93fd0e768340221d4e605c</id>
<content type='text'>
When unmapping grants, instead of converting the kernel map ops to
unmap ops on the fly, pre-populate the set of unmap ops.

This allows the grant unmap for the kernel mappings to be trivially
batched in the future.

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/grant-table: remove support for V2 tables</title>
<updated>2014-07-14T19:28:30Z</updated>
<author>
<name>David Vrabel</name>
</author>
<published>2014-07-02T10:25:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=438b33c7145ca8a5131a30c36d8f59bce119a19a'/>
<id>urn:sha1:438b33c7145ca8a5131a30c36d8f59bce119a19a</id>
<content type='text'>
Since 11c7ff17c9b6dbf3a4e4f36be30ad531a6cf0ec9 (xen/grant-table: Force
to use v1 of grants.) the code for V2 grant tables is not used.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
</content>
</entry>
</feed>
