<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/xen/grant-table.c, branch linux-3.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-09-23T13:36:18Z</updated>
<entry>
<title>xen/grant-table: refactor error cleanup in grow_gnttab_list()</title>
<updated>2014-09-23T13:36:18Z</updated>
<author>
<name>Chen Gang</name>
</author>
<published>2014-08-26T15:38:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=46e3626adb86be2ff1321d26107cb75df07a7f4e'/>
<id>urn:sha1:46e3626adb86be2ff1321d26107cb75df07a7f4e</id>
<content type='text'>
The cleanup loop in grow_gnttab_list() is safe from the underflow of
the unsigned 'i' since nr_glist_frames is &gt;= 1, but refactor it
anyway.

Signed-off-by: Chen Gang &lt;gang.chen.5i5j@gmail.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@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>
<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>
</author>
<published>2014-07-11T15:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>xen/grant-table: fix suspend for non-PV guests</title>
<updated>2014-06-18T09:58:01Z</updated>
<author>
<name>David Vrabel</name>
</author>
<published>2014-06-16T10:12:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13cd36a37a06ae0318d23b7e60adf0dac3547238'/>
<id>urn:sha1:13cd36a37a06ae0318d23b7e60adf0dac3547238</id>
<content type='text'>
Commit aa8532c32216ae07c3813b9aeb774517878a7573 (xen: refactor suspend
pre/post hooks) broke resuming PVHVM (auto-translated physmap) guests.

The gnttab_suspend() would clear the mapping for the grant table
frames, but the -&gt;unmap_frames() call is only applicable to PV guests.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reported-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Tested-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
</content>
</entry>
<entry>
<title>xen/grant-table: Refactor gnttab_[un]map_refs to avoid m2p_override</title>
<updated>2014-03-18T14:40:19Z</updated>
<author>
<name>Zoltan Kiss</name>
</author>
<published>2014-02-27T15:55:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1429d46df4c538d28460d0b493997006a62a1093'/>
<id>urn:sha1:1429d46df4c538d28460d0b493997006a62a1093</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 bulk of the original function (everything after the mapping hypercall)
  is moved to arch-dependent set/clear_foreign_p2m_mapping
- the "if (xen_feature(XENFEAT_auto_translated_physmap))" branch goes to ARM
- therefore the ARM function could be much smaller, the m2p_override stubs
  could be also removed
- on x86 the set_phys_to_machine calls were moved up to this new funcion
  from m2p_override functions
- and m2p_override functions are only called when there is a kmap_ops param

It also removes a stray space from arch/x86/include/asm/xen/page.h.

Signed-off-by: Zoltan Kiss &lt;zoltan.kiss@citrix.com&gt;
Suggested-by: Anthony Liguori &lt;aliguori@amazon.com&gt;
Suggested-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Suggested-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
</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>
</author>
<published>2014-02-03T11:43:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
</author>
<published>2014-01-23T21:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
</author>
<published>2014-01-30T12:56:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
<entry>
<title>xen/grant-table: Force to use v1 of grants.</title>
<updated>2014-01-06T15:44:39Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
</author>
<published>2014-01-06T15:44:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=11c7ff17c9b6dbf3a4e4f36be30ad531a6cf0ec9'/>
<id>urn:sha1:11c7ff17c9b6dbf3a4e4f36be30ad531a6cf0ec9</id>
<content type='text'>
We have the framework to use v2, but there are no backends that
actually use it. The end result is that on PV we use v2 grants
and on PVHVM v1. The v1 has a capacity of 512 grants per page while
the v2 has 256 grants per page. This means we lose about 50%
capacity - and if we want more than 16 VIFs (each VIF takes
512 grants), then we are hitting the max per guest of 32.

Oracle-bug: 16039922
CC: annie.li@oracle.com
CC: msw@amazon.com
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Reviewed-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
<entry>
<title>xen/pvh: Piggyback on PVHVM for grant driver (v4)</title>
<updated>2014-01-06T15:44:21Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
</author>
<published>2014-01-03T15:20:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6926f6d6109714aab7b26df7099b12555e36676f'/>
<id>urn:sha1:6926f6d6109714aab7b26df7099b12555e36676f</id>
<content type='text'>
In PVH the shared grant frame is the PFN and not MFN,
hence its mapped via the same code path as HVM.

The allocation of the grant frame is done differently - we
do not use the early platform-pci driver and have an
ioremap area - instead we use balloon memory and stitch
all of the non-contingous pages in a virtualized area.

That means when we call the hypervisor to replace the GMFN
with a XENMAPSPACE_grant_table type, we need to lookup the
old PFN for every iteration instead of assuming a flat
contingous PFN allocation.

Lastly, we only use v1 for grants. This is because PVHVM
is not able to use v2 due to no XENMEM_add_to_physmap
calls on the error status page (see commit
69e8f430e243d657c2053f097efebc2e2cd559f0
 xen/granttable: Disable grant v2 for HVM domains.)

Until that is implemented this workaround has to
be in place.

Also per suggestions by Stefano utilize the PVHVM paths
as they share common functionality.

v2 of this patch moves most of the PVH code out in the
arch/x86/xen/grant-table driver and touches only minimally
the generic driver.

v3, v4: fixes us some of the code due to earlier patches.

Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Acked-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
</content>
</entry>
</feed>
