<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/arch/arm/include/asm/xen/page.h, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2020-10-04T23:41:33Z</updated>
<entry>
<title>xen/arm: do not setup the runstate info page if kpti is enabled</title>
<updated>2020-10-04T23:41:33Z</updated>
<author>
<name>Stefano Stabellini</name>
<email>stefano.stabellini@xilinx.com</email>
</author>
<published>2020-09-24T23:49:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f88af7229f6f22ce7313c11a0bbb9c88317b7c5e'/>
<id>urn:sha1:f88af7229f6f22ce7313c11a0bbb9c88317b7c5e</id>
<content type='text'>
The VCPUOP_register_runstate_memory_area hypercall takes a virtual
address of a buffer as a parameter. The semantics of the hypercall are
such that the virtual address should always be valid.

When KPTI is enabled and we are running userspace code, the virtual
address is not valid, thus, Linux is violating the semantics of
VCPUOP_register_runstate_memory_area.

Do not call VCPUOP_register_runstate_memory_area when KPTI is enabled.

Signed-off-by: Stefano Stabellini &lt;stefano.stabellini@xilinx.com&gt;
CC: Bertrand Marquis &lt;Bertrand.Marquis@arm.com&gt;
CC: boris.ostrovsky@oracle.com
CC: jgross@suse.com
Link: https://lore.kernel.org/r/20200924234955.15455-1-sstabellini@kernel.org
Reviewed-by: Bertrand Marquis &lt;bertrand.marquis@arm.com&gt;
Signed-off-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
</content>
</entry>
<entry>
<title>arm/arm64: xen: Move shared architecture headers to include/xen/arm</title>
<updated>2016-12-02T19:49:55Z</updated>
<author>
<name>Marc Zyngier</name>
<email>marc.zyngier@arm.com</email>
</author>
<published>2016-12-02T14:19:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2fbadc3002c5f172d20aa2e7e48920c5f14ed11f'/>
<id>urn:sha1:2fbadc3002c5f172d20aa2e7e48920c5f14ed11f</id>
<content type='text'>
ARM and arm64 Xen ports share a number of headers, leading to
packaging issues when these headers needs to be exported, as it
breaks the reasonable requirement that an architecture port
has self-contained headers.

Fix the issue by moving the 5 header files to include/xen/arm,
and keep local placeholders to include the relevant files.

Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Reviewed-by: Stefano Stabellini &lt;sstabellini@kernel.org&gt;
</content>
</entry>
<entry>
<title>xen/swiotlb: Pass addresses rather than frame numbers to xen_arch_need_swiotlb</title>
<updated>2015-10-23T13:20:43Z</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@citrix.com</email>
</author>
<published>2015-09-09T14:17:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=291be10fd7511101d44cf98166d049bd31bc7600'/>
<id>urn:sha1:291be10fd7511101d44cf98166d049bd31bc7600</id>
<content type='text'>
With 64KB page granularity support, the frame number will be different.

It will be easier to modify the behavior in a single place rather than
in each caller.

Signed-off-by: Julien Grall &lt;julien.grall@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>arm/xen: Add support for 64KB page granularity</title>
<updated>2015-10-23T13:20:42Z</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@citrix.com</email>
</author>
<published>2015-05-05T15:36:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=250c9af3d831139317009eaebbe82e20d23a581f'/>
<id>urn:sha1:250c9af3d831139317009eaebbe82e20d23a581f</id>
<content type='text'>
The hypercall interface is always using 4KB page granularity. This is
requiring to use xen page definition macro when we deal with hypercall.

Note that pfn_to_gfn is working with a Xen pfn (i.e 4KB). We may want to
rename pfn_gfn to make this explicit.

We also allocate a 64KB page for the shared page even though only the
first 4KB is used. I don't think this is really important for now as it
helps to have the pointer 4KB aligned (XENMEM_add_to_physmap is taking a
Xen PFN).

Signed-off-by: Julien Grall &lt;julien.grall@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>arm/xen: Drop pte_mfn and mfn_pte</title>
<updated>2015-10-23T13:20:32Z</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@citrix.com</email>
</author>
<published>2015-07-21T16:57:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5031612b5eaf15cb6471c6e936a515090810c8f1'/>
<id>urn:sha1:5031612b5eaf15cb6471c6e936a515090810c8f1</id>
<content type='text'>
They are not used in common code expect in one place in balloon.c which is
only compiled when Linux is using PV MMU. It's not the case on ARM.

Rather than worrying how to handle the 64KB case, drop them.

Signed-off-by: Julien Grall &lt;julien.grall@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: Use correctly the Xen memory terminologies</title>
<updated>2015-09-08T17:03:49Z</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@citrix.com</email>
</author>
<published>2015-08-07T16:34:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>arm/xen: implement correctly pfn_to_mfn</title>
<updated>2015-09-08T16:10:52Z</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@citrix.com</email>
</author>
<published>2015-08-07T16:34:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5192b35de47e47a0f736fe30da199f32030680e7'/>
<id>urn:sha1:5192b35de47e47a0f736fe30da199f32030680e7</id>
<content type='text'>
After the commit introducing convertion between DMA and guest addresses,
all the callers of pfn_to_mfn are expecting to get a GFN (Guest Frame
Number). On ARM, all the guests are auto-translated so the GFN is equal
to the Linux PFN (Pseudo-physical Frame Number).

The current implementation may return an MFN if the caller is passing a
PFN associated to a mapped foreign grant. In pratice, I haven't seen
the problem on running guest but we should fix it for the sake of
correctness.

Correct the implementation by always returning the pfn passed in parameter.

A follow-up patch will take care to rename pfn_to_mfn to a suitable
name.

Signed-off-by: Julien Grall &lt;julien.grall@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: Make clear that swiotlb and biomerge are dealing with DMA address</title>
<updated>2015-09-08T16:10:52Z</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@citrix.com</email>
</author>
<published>2015-08-07T16:34:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=32e09870eedfb501a6cb5729d8c23f44f8a7cbdd'/>
<id>urn:sha1:32e09870eedfb501a6cb5729d8c23f44f8a7cbdd</id>
<content type='text'>
The swiotlb is required when programming a DMA address on ARM when a
device is not protected by an IOMMU.

In this case, the DMA address should always be equal to the machine address.
For DOM0 memory, Xen ensure it by have an identity mapping between the
guest address and host address. However, when mapping a foreign grant
reference, the 1:1 model doesn't work.

For ARM guest, most of the callers of pfn_to_mfn expects to get a GFN
(Guest Frame Number), i.e a PFN (Page Frame Number) from the Linux point
of view given that all ARM guest are auto-translated.

Even though the name pfn_to_mfn is misleading, we need to ensure that
those caller get a GFN and not by mistake a MFN. In pratical, I haven't
seen error related to this but we should fix it for the sake of
correctness.

In order to fix the implementation of pfn_to_mfn on ARM in a follow-up
patch, we have to introduce new helpers to return the DMA from a PFN and
the invert.

On x86, the new helpers will be an alias of pfn_to_mfn and mfn_to_pfn.

The helpers will be used in swiotlb and xen_biovec_phys_mergeable.

This is necessary in the latter because we have to ensure that the
biovec code will not try to merge a biovec using foreign page and
another using Linux memory.

Lastly, the helper mfn_to_local_pfn has been renamed to bfn_to_local_pfn
given that the only usage was in swiotlb.

Signed-off-by: Julien Grall &lt;julien.grall@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>arm/xen: Remove helpers which are PV specific</title>
<updated>2015-08-20T11:25:27Z</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@citrix.com</email>
</author>
<published>2015-08-07T16:34:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=724afaea2020f3bd98891b535f3ce5d3935bcf63'/>
<id>urn:sha1:724afaea2020f3bd98891b535f3ce5d3935bcf63</id>
<content type='text'>
ARM guests are always HVM. The current implementation is assuming a 1:1
mapping which is only true for DOM0 and may not be at all in the future.

Furthermore, all the helpers but arbitrary_virt_to_machine are used in
x86 specific code (or only compiled for).

The helper arbitrary_virt_to_machine is only used in PV specific code.
Therefore we should never call the function.

Add a BUG() in this helper and drop all the others.

Signed-off-by: Julien Grall &lt;julien.grall@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>arm/xen: Drop duplicate define mfn_to_virt</title>
<updated>2015-06-17T15:35:17Z</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@linaro.org</email>
</author>
<published>2015-06-17T14:28:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=90d73c4f43630ca45398cee7f32f0fe51271b2ce'/>
<id>urn:sha1:90d73c4f43630ca45398cee7f32f0fe51271b2ce</id>
<content type='text'>
Signed-off-by: Julien Grall &lt;julien.grall@citrix.com&gt;
Cc: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
</entry>
</feed>
