<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/arm64/kvm/hyp/pgtable.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/arm64/kvm/hyp/pgtable.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/arm64/kvm/hyp/pgtable.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-01-14T14:12:23Z</updated>
<entry>
<title>KVM: arm64: pkvm: Use the mm_ops indirection for cache maintenance</title>
<updated>2022-01-14T14:12:23Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2022-01-14T08:57:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=094d00f8ca58c5d29b25e23b4daaed1ff1f13b41'/>
<id>urn:sha1:094d00f8ca58c5d29b25e23b4daaed1ff1f13b41</id>
<content type='text'>
CMOs issued from EL2 cannot directly use the kernel helpers,
as EL2 doesn't have a mapping of the guest pages. Oops.

Instead, use the mm_ops indirection to use helpers that will
perform a mapping at EL2 and allow the CMO to be effective.

Fixes: 25aa28691bb9 ("KVM: arm64: Move guest CMOs to the fault handlers")
Reviewed-by: Quentin Perret &lt;qperret@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20220114125038.1336965-1-maz@kernel.org
</content>
</entry>
<entry>
<title>Merge branch kvm-arm64/misc-5.17 into kvmarm-master/next</title>
<updated>2022-01-04T17:16:15Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2022-01-04T17:16:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1c53a1ae36120997a82f936d044c71075852e521'/>
<id>urn:sha1:1c53a1ae36120997a82f936d044c71075852e521</id>
<content type='text'>
* kvm-arm64/misc-5.17:
  : .
  : Misc fixes and improvements:
  : - Add minimal support for ARMv8.7's PMU extension
  : - Constify kvm_io_gic_ops
  : - Drop kvm_is_transparent_hugepage() prototype
  : - Drop unused workaround_flags field
  : - Rework kvm_pgtable initialisation
  : - Documentation fixes
  : - Replace open-coded SCTLR_EL1.EE useage with its defined macro
  : - Sysreg list selftest update to handle PAuth
  : - Include cleanups
  : .
  KVM: arm64: vgic: Replace kernel.h with the necessary inclusions
  KVM: arm64: Fix comment typo in kvm_vcpu_finalize_sve()
  KVM: arm64: selftests: get-reg-list: Add pauth configuration
  KVM: arm64: Fix comment on barrier in kvm_psci_vcpu_on()
  KVM: arm64: Fix comment for kvm_reset_vcpu()
  KVM: arm64: Use defined value for SCTLR_ELx_EE
  KVM: arm64: Rework kvm_pgtable initialisation
  KVM: arm64: Drop unused workaround_flags vcpu field

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
</content>
</entry>
<entry>
<title>KVM: arm64: Rework kvm_pgtable initialisation</title>
<updated>2021-12-16T17:01:05Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2021-11-29T20:00:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9d8604b28575ccab3afd8d6f56cab9a6c0d281ef'/>
<id>urn:sha1:9d8604b28575ccab3afd8d6f56cab9a6c0d281ef</id>
<content type='text'>
Ganapatrao reported that the kvm_pgtable-&gt;mmu pointer is more or
less hardcoded to the main S2 mmu structure, while the nested
code needs it to point to other instances (as we have one instance
per nested context).

Rework the initialisation of the kvm_pgtable structure so that
this assumtion doesn't hold true anymore. This requires some
minor changes to the order in which things are initialised
(the mmu-&gt;arch pointer being the critical one).

Reported-by: Ganapatrao Kulkarni &lt;gankulkarni@os.amperecomputing.com&gt;
Reviewed-by: Ganapatrao Kulkarni &lt;gankulkarni@os.amperecomputing.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20211129200150.351436-5-maz@kernel.org
</content>
</entry>
<entry>
<title>KVM: arm64: Implement kvm_pgtable_hyp_unmap() at EL2</title>
<updated>2021-12-16T12:58:56Z</updated>
<author>
<name>Will Deacon</name>
<email>will@kernel.org</email>
</author>
<published>2021-12-15T16:12:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=82bb02445de57bb3072052705f6f5dea9465592e'/>
<id>urn:sha1:82bb02445de57bb3072052705f6f5dea9465592e</id>
<content type='text'>
Implement kvm_pgtable_hyp_unmap() which can be used to remove hypervisor
stage-1 mappings at EL2.

Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20211215161232.1480836-6-qperret@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Refcount hyp stage-1 pgtable pages</title>
<updated>2021-12-16T12:58:55Z</updated>
<author>
<name>Quentin Perret</name>
<email>qperret@google.com</email>
</author>
<published>2021-12-15T16:12:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2ea2ff91e82293909d4879b0b4c6c94b02d52b7e'/>
<id>urn:sha1:2ea2ff91e82293909d4879b0b4c6c94b02d52b7e</id>
<content type='text'>
To prepare the ground for allowing hyp stage-1 mappings to be removed at
run-time, update the KVM page-table code to maintain a correct refcount
using the -&gt;{get,put}_page() function callbacks.

Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20211215161232.1480836-3-qperret@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Enable retrieving protections attributes of PTEs</title>
<updated>2021-08-11T10:39:51Z</updated>
<author>
<name>Quentin Perret</name>
<email>qperret@google.com</email>
</author>
<published>2021-08-09T15:24:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9024b3d0069ab4b8ef70cf55f0ee09e61f3a0747'/>
<id>urn:sha1:9024b3d0069ab4b8ef70cf55f0ee09e61f3a0747</id>
<content type='text'>
Introduce helper functions in the KVM stage-2 and stage-1 page-table
manipulation library allowing to retrieve the enum kvm_pgtable_prot of a
PTE. This will be useful to implement custom walkers outside of
pgtable.c.

Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Reviewed-by: Fuad Tabba &lt;tabba@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210809152448.1810400-17-qperret@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Allow populating software bits</title>
<updated>2021-08-11T10:39:50Z</updated>
<author>
<name>Quentin Perret</name>
<email>qperret@google.com</email>
</author>
<published>2021-08-09T15:24:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=4505e9b624cefafa4b75d8a28e72f32076c33375'/>
<id>urn:sha1:4505e9b624cefafa4b75d8a28e72f32076c33375</id>
<content type='text'>
Introduce infrastructure allowing to manipulate software bits in stage-1
and stage-2 page-tables using additional entries in the kvm_pgtable_prot
enum.

This is heavily inspired by Marc's implementation of a similar feature
in the NV patch series, but adapted to allow stage-1 changes as well:

  https://lore.kernel.org/kvmarm/20210510165920.1913477-56-maz@kernel.org/

Suggested-by: Marc Zyngier &lt;maz@kernel.org&gt;
Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Reviewed-by: Fuad Tabba &lt;tabba@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210809152448.1810400-12-qperret@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Enable forcing page-level stage-2 mappings</title>
<updated>2021-08-11T10:39:50Z</updated>
<author>
<name>Quentin Perret</name>
<email>qperret@google.com</email>
</author>
<published>2021-08-09T15:24:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5651311941105ca077d3ab74dd4a92e646ecf7fb'/>
<id>urn:sha1:5651311941105ca077d3ab74dd4a92e646ecf7fb</id>
<content type='text'>
Much of the stage-2 manipulation logic relies on being able to destroy
block mappings if e.g. installing a smaller mapping in the range. The
rationale for this behaviour is that stage-2 mappings can always be
re-created lazily. However, this gets more complicated when the stage-2
page-table is used to store metadata about the underlying pages. In such
cases, destroying a block mapping may lead to losing part of the state,
and confuse the user of those metadata (such as the hypervisor in nVHE
protected mode).

To avoid this, introduce a callback function in the pgtable struct which
is called during all map operations to determine whether the mappings
can use blocks, or should be forced to page granularity. This is used by
the hypervisor when creating the host stage-2 to force page-level
mappings when using non-default protection attributes.

Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Reviewed-by: Fuad Tabba &lt;tabba@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210809152448.1810400-11-qperret@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Tolerate re-creating hyp mappings to set software bits</title>
<updated>2021-08-11T10:39:50Z</updated>
<author>
<name>Quentin Perret</name>
<email>qperret@google.com</email>
</author>
<published>2021-08-09T15:24:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b53846c5f279cb5329b82f19a7d313f02cb9d21c'/>
<id>urn:sha1:b53846c5f279cb5329b82f19a7d313f02cb9d21c</id>
<content type='text'>
The current hypervisor stage-1 mapping code doesn't allow changing an
existing valid mapping. Relax this condition by allowing changes that
only target software bits, as that will soon be needed to annotate shared
pages.

Reviewed-by: Fuad Tabba &lt;tabba@google.com&gt;
Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210809152448.1810400-10-qperret@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Don't overwrite software bits with owner id</title>
<updated>2021-08-11T10:39:50Z</updated>
<author>
<name>Quentin Perret</name>
<email>qperret@google.com</email>
</author>
<published>2021-08-09T15:24:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8a0282c68121e53ab17413283cfed408a47e1a2a'/>
<id>urn:sha1:8a0282c68121e53ab17413283cfed408a47e1a2a</id>
<content type='text'>
We will soon start annotating page-tables with new flags to track shared
pages and such, and we will do so in valid mappings using software bits
in the PTEs, as provided by the architecture. However, it is possible
that we will need to use those flags to annotate invalid mappings as
well in the future, similar to what we do to track page ownership in the
host stage-2.

In order to facilitate the annotation of invalid mappings with such
flags, it would be preferable to re-use the same bits as for valid
mappings (bits [58-55]), but these are currently used for ownership
encoding. Since we have plenty of bits left to use in invalid
mappings, move the ownership bits further down the PTE to avoid the
conflict.

Reviewed-by: Fuad Tabba &lt;tabba@google.com&gt;
Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210809152448.1810400-9-qperret@google.com
</content>
</entry>
</feed>
