On 8/18/20 11:27 PM, Will Deacon wrote:
kvm_mmu_free_memory_caches() is only called by kvm_arch_vcpu_destroy(),
so inline the implementation and get rid of the extra function.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/include/asm/kvm_mmu.h | 2 --
arch/a
Hi Will,
On 8/18/20 11:27 PM, Will Deacon wrote:
kvm_phys_addr_ioremap() unconditionally empties out the memcache pages
for the current vCPU on return. This causes subsequent topups to allocate
fresh pages and is at odds with the behaviour when mapping memory in
user_mem_abort().
Remove the cal
On 2020-08-17 09:41, Keqian Zhu wrote:
Hi all,
This patch series picks up the LPT pvtime feature originally developed
by Steven Price: https://patchwork.kernel.org/cover/10726499/
Backgroud:
There is demand for cross-platform migration, which means we have to
solve different CPU features and a
On Tue, Aug 04, 2020 at 01:44:15PM +0100, Alex Bennée wrote:
> For a pure VirtIO guest bringing in all the PCI quirk handling adds a
> significant amount of bloat to kernel we don't need. Solve this by
> adding a CONFIG symbol for the ThunderX PCI devices and allowing it to
> be turned off. Saving
In preparation for removing the 'pgd' field of 'struct kvm_s2_mmu',
update the few remaining users to check the 'pgt' field instead.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/kvm/mmu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a
From: Quentin Perret
Add a stage-2 wrprotect() operation to the generic page-table code.
Cc: Marc Zyngier
Signed-off-by: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/include/asm/kvm_pgtable.h | 15 +++
arch/arm64/kvm/hyp/pgtable.c | 6 ++
2 files changed,
Now that KVM is using the generic page-table code to manage the guest
stage-2 page-tables, we can remove a bunch of unused macros, #defines
and static inline functions from the old implementation.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/include/asm/kvm_mmu
From: Quentin Perret
Convert stage2_flush_memslot() to call the kvm_pgtable_stage2_flush()
function of the generic page-table code instead of walking the page-table
directly.
Cc: Marc Zyngier
Signed-off-by: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/kvm/mmu.c | 13 +
Convert unmap_stage2_range() to use kvm_pgtable_stage2_unmap() instead
of walking the page-table directly.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/kvm/mmu.c | 57 +---
1 file changed, 32 insertions(+), 25 deletions(-
From: Quentin Perret
Convert stage2_wp_range() to call the kvm_pgtable_stage2_wrprotect()
function of the generic page-table code instead of walking the page-table
directly.
Cc: Marc Zyngier
Signed-off-by: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/kvm/mmu.c | 25 --
Introduce alloc() and free() functions to the generic page-table code
for guest stage-2 page-tables and plumb these into the existing KVM
page-table allocator. Subsequent patches will convert other operations
within the KVM allocator over to the generic code.
Cc: Marc Zyngier
Cc: Quentin Perret
Convert user_mem_abort() to call kvm_pgtable_stage2_relax_perms() when
handling a stage-2 permission fault and kvm_pgtable_stage2_map() when
handling a stage-2 translation fault, rather than walking the page-table
manually.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arc
Add stage-2 mkyoung(), mkold() and is_young() operations to the generic
page-table code.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/include/asm/kvm_pgtable.h | 38
arch/arm64/kvm/hyp/pgtable.c | 86
2 files ch
From: Quentin Perret
Add support for cache flushing a range of the stage-2 address space to
the generic page-table code.
Cc: Marc Zyngier
Signed-off-by: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/include/asm/kvm_pgtable.h | 12
arch/arm64/kvm/hyp/pgtable.c
kvm_mmu_free_memory_caches() is only called by kvm_arch_vcpu_destroy(),
so inline the implementation and get rid of the extra function.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/include/asm/kvm_mmu.h | 2 --
arch/arm64/kvm/arm.c | 2 +-
arch/arm6
Add support for relaxing the permissions of a stage-2 mapping (i.e.
adding additional permissions) to the generic page-table code.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/include/asm/kvm_pgtable.h | 17 +
arch/arm64/kvm/hyp/pgtable.c
Now that we have a shiny new page-table allocator, replace the hyp
page-table code with calls into the new API. This also allows us to
remove the extended idmap code, as we can now simply ensure that the
VA size is large enough to map everything we need.
Cc: Marc Zyngier
Cc: Quentin Perret
Signe
Convert kvm_set_spte_hva() to use kvm_pgtable_stage2_map() instead
of stage2_set_pte().
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/kvm/mmu.c | 23 ++-
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/arch/arm64/kvm/mmu.c b/a
The generic page-table walker is pretty useless as it stands, because it
doesn't understand enough to allocate anything. Teach it about stage-1
page-tables, and hook up an API for allocating these for the hypervisor
at EL2.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arc
Now that the guest stage-2 page-tables are managed independently from
the host stage-1 page-tables, we can avoid constraining the IPA size
based on the host and instead limit it only based on the PARange field
of the ID_AA64MMFR0 register.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will
Convert the page-aging functions and access fault handler to use the
generic page-table code instead of walking the page-table directly.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/kvm/mmu.c | 74 ++--
1 file changed, 16
The stage-2 page-tables are entirely encapsulated by the 'pgt' field of
'struct kvm_s2_mmu', so remove the unused 'pgd' field.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/include/asm/kvm_host.h | 1 -
arch/arm64/kvm/mmu.c | 2 --
2 files changed,
Hi everyone,
This is version two of the patches rewriting KVM's page-table code on arm64
that I previously posted here:
https://lore.kernel.org/r/20200730153406.25136-1-w...@kernel.org
Changes since v1 include:
* Removed opaque cookie in favour of exposing 'struct kvm_pgtable'
* Moved cod
The KVM page-table code is intricately tied into the kernel page-table
code and re-uses the pte/pmd/pud/p4d/pgd macros directly in an attempt
to reduce code duplication. Unfortunately, the reality is that there is
an awful lot of code required to make this work, and at the end of the
day you're lim
kvm_phys_addr_ioremap() unconditionally empties out the memcache pages
for the current vCPU on return. This causes subsequent topups to allocate
fresh pages and is at odds with the behaviour when mapping memory in
user_mem_abort().
Remove the call to kvm_mmu_free_memory_cache() from
kvm_phys_addr_
Add stage-2 map() and unmap() operations to the generic page-table code.
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/include/asm/kvm_pgtable.h | 39
arch/arm64/kvm/hyp/pgtable.c | 262 +++
2 files changed, 301 insertions(+
Convert kvm_phys_addr_ioremap() to use kvm_pgtable_stage2_map() instead
of stage2_set_pte().
Cc: Marc Zyngier
Cc: Quentin Perret
Signed-off-by: Will Deacon
---
arch/arm64/kvm/hyp/pgtable.c | 14 +-
arch/arm64/kvm/mmu.c | 24 ++--
2 files changed, 11 inse
On Tue, 11 Aug 2020 11:27:23 +0100, Will Deacon wrote:
> While stress-testing my arm64 stage-2 page-table rewrite [1], I ran into
> a sleeping while atomic BUG() during OOM that I can reproduce with
> mainline.
>
> The problem is that the arm64 page-table code periodically calls
> cond_resched_loc
On 2020-08-18 11:16, Will Deacon wrote:
On Tue, Aug 18, 2020 at 08:31:08AM +0200, Paolo Bonzini wrote:
On 11/08/20 12:27, Will Deacon wrote:
> Will Deacon (2):
> KVM: Pass MMU notifier range flags to kvm_unmap_hva_range()
> KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not s
On Tue, Aug 18, 2020 at 08:31:08AM +0200, Paolo Bonzini wrote:
> On 11/08/20 12:27, Will Deacon wrote:
> > Will Deacon (2):
> > KVM: Pass MMU notifier range flags to kvm_unmap_hva_range()
> > KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set
> >
> > arch/arm64/include/asm
30 matches
Mail list logo