<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/xen/grant_table.h, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2015-04-27T10:41:12Z</updated>
<entry>
<title>xen/grant: introduce func gnttab_unmap_refs_sync()</title>
<updated>2015-04-27T10:41:12Z</updated>
<author>
<name>Bob Liu</name>
<email>bob.liu@oracle.com</email>
</author>
<published>2015-04-03T06:42:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>
<email>jennifer.herbert@citrix.com</email>
</author>
<published>2014-12-09T18:28:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>
<email>jennifer.herbert@citrix.com</email>
</author>
<published>2014-12-24T14:17:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>
<email>david.vrabel@citrix.com</email>
</author>
<published>2015-01-08T18:06:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>
<email>david.vrabel@citrix.com</email>
</author>
<published>2015-01-05T14:13:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>
<email>david.vrabel@citrix.com</email>
</author>
<published>2014-07-02T10:25:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>
<entry>
<title>x86/xen: safely map and unmap grant frames when in atomic context</title>
<updated>2014-07-14T19:28:02Z</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2014-07-11T15:42:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=162e371712768248a38646eefa71af38b6e0f8ce'/>
<id>urn:sha1:162e371712768248a38646eefa71af38b6e0f8ce</id>
<content type='text'>
arch_gnttab_map_frames() and arch_gnttab_unmap_frames() are called in
atomic context but were calling alloc_vm_area() which might sleep.

Also, if a driver attempts to allocate a grant ref from an interrupt
and the table needs expanding, then the CPU may already by in lazy MMU
mode and apply_to_page_range() will BUG when it tries to re-enable
lazy MMU mode.

These two functions are only used in PV guests.

Introduce arch_gnttab_init() to allocates the virtual address space in
advance.

Avoid the use of apply_to_page_range() by using saving and using the
array of PTE addresses from the alloc_vm_area() call.

N.B. 'alloc_vm_area' pre-allocates the pagetable so there is no need
to worry about having to do a PGD/PUD/PMD walk (like apply_to_page_range
does) and we can instead do set_pte.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
----
[v2: Add comment about alloc_vm_area]
[v3: Fix compile error found by 0-day bot]
</content>
</entry>
<entry>
<title>Revert "xen/grant-table: Avoid m2p_override during mapping"</title>
<updated>2014-02-03T11:44:49Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
<email>konrad.wilk@oracle.com</email>
</author>
<published>2014-02-03T11:43:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e85fc9805591a17ca8af50023ee8e2b61d9a123b'/>
<id>urn:sha1:e85fc9805591a17ca8af50023ee8e2b61d9a123b</id>
<content type='text'>
This reverts commit 08ece5bb2312b4510b161a6ef6682f37f4eac8a1.

As it breaks ARM builds and needs more attention
on the ARM side.

Acked-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
</content>
</entry>
<entry>
<title>xen/grant-table: Avoid m2p_override during mapping</title>
<updated>2014-01-31T14:48:32Z</updated>
<author>
<name>Zoltan Kiss</name>
<email>zoltan.kiss@citrix.com</email>
</author>
<published>2014-01-23T21:23:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=08ece5bb2312b4510b161a6ef6682f37f4eac8a1'/>
<id>urn:sha1:08ece5bb2312b4510b161a6ef6682f37f4eac8a1</id>
<content type='text'>
The grant mapping API does m2p_override unnecessarily: only gntdev needs it,
for blkback and future netback patches it just cause a lock contention, as
those pages never go to userspace. Therefore this series does the following:
- the original functions were renamed to __gnttab_[un]map_refs, with a new
  parameter m2p_override
- based on m2p_override either they follow the original behaviour, or just set
  the private flag and call set_phys_to_machine
- gnttab_[un]map_refs are now a wrapper to call __gnttab_[un]map_refs with
  m2p_override false
- a new function gnttab_[un]map_refs_userspace provides the old behaviour

It also removes a stray space from page.h and change ret to 0 if
XENFEAT_auto_translated_physmap, as that is the only possible return value
there.

v2:
- move the storing of the old mfn in page-&gt;index to gnttab_map_refs
- move the function header update to a separate patch

v3:
- a new approach to retain old behaviour where it needed
- squash the patches into one

v4:
- move out the common bits from m2p* functions, and pass pfn/mfn as parameter
- clear page-&gt;private before doing anything with the page, so m2p_find_override
  won't race with this

v5:
- change return value handling in __gnttab_[un]map_refs
- remove a stray space in page.h
- add detail why ret = 0 now at some places

v6:
- don't pass pfn to m2p* functions, just get it locally

Signed-off-by: Zoltan Kiss &lt;zoltan.kiss@citrix.com&gt;
Suggested-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Acked-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Acked-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
</content>
</entry>
<entry>
<title>xen/gnttab: Use phys_addr_t to describe the grant frame base address</title>
<updated>2014-01-30T12:56:34Z</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@linaro.org</email>
</author>
<published>2014-01-30T12:56:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=47c542050d306e50f09512eb6339dbf2fc02fddd'/>
<id>urn:sha1:47c542050d306e50f09512eb6339dbf2fc02fddd</id>
<content type='text'>
On ARM, address size can be 32 bits or 64 bits (if CONFIG_ARCH_PHYS_ADDR_T_64BIT
is enabled).
We can't assume that the grant frame base address will always fits in an
unsigned long. Use phys_addr_t instead of unsigned long as argument for
gnttab_setup_auto_xlat_frames.

Signed-off-by: Julien Grall &lt;julien.grall@linaro.org&gt;
Signed-off-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Acked-by: Ian Campbell &lt;ian.campbell@citrix.com&gt;
Reviewed-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
</feed>
