Also add a mm_ops member for structure stage2_attr_data, since we
will move I-cache maintenance for guest stage-2 to the permission
path and as a result will need mm_ops for some callbacks.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 10 ++
1 file changed, 6 insertions
Adjust the parameter "kvm_pfn_t pfn" of __clean_dcache_guest_page
and __invalidate_icache_guest_page to "void *va", which paves the
way for converting these two guest CMO functions into callbacks in
structure kvm_pgtable_mm_ops. No functional change.
Signed-off-by: Yanan W
migration, the heavy workload will be resumed on the
destination VM, however all the stage-2 page tables need to be rebuilt
at the moment. So this solution will ease the performance drop during
resuming stage.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 38
To prepare for performing CMOs for guest stage-2 in the fault handlers
in pgtable.c, here introduce two cache maintenance callbacks in struct
kvm_pgtable_mm_ops. We also adjust the comment alignment for the
existing part but make no real content change at all.
Signed-off-by: Yanan Wang
---
arch
35760-1-wangyana...@huawei.com/
v4->v5:
- rebased on the latest kvmarm/tree to adapt to the new stage-2 page-table code
- v4: https://lore.kernel.org/lkml/20210409033652.28316-1-wangyana...@huawei.com
---
Yanan Wang (4):
KVM: arm64: Introduce two cache maintenance callbacks
KVM: arm64: Intr
migration, the heavy workload will be resumed on the
destination VM, however all the stage-2 page tables need to be rebuilt
at the moment. So this solution will ease the performance drop during
resuming stage.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 37
uentin)
- rebased on latest kvmarm/tree
- v5:
https://lore.kernel.org/lkml/20210415115032.35760-1-wangyana...@huawei.com/
v4->v5:
- rebased on the latest kvmarm/tree to adapt to the new stage-2 page-table code
- v4: https://lore.kernel.org/lkml/20210409033652.28316-1-wangyana...@huawei.com
---
To prepare for performing guest CMOs in the fault handlers in pgtable.c,
introduce two cache maintenance callbacks in struct kvm_pgtable_mm_ops.
The new callbacks are specific for guest stage-2, so they will only be
initialized in 'struct kvm_pgtable_mm_ops kvm_s2_mm_ops'.
Signed-off-by: Yanan
Adjust the parameter "kvm_pfn_t pfn" of __clean_dcache_guest_page
and __invalidate_icache_guest_page to "void *va", which paves the
way for converting these two guest CMO functions into callbacks in
structure kvm_pgtable_mm_ops. No functional change.
Signed-off-by: Yanan W
Also add a mm_ops member for structure stage2_attr_data, since we
will move I-cache maintenance for guest stage-2 to the permission
path and as a result will need mm_ops for some callbacks.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 10 ++
1 file changed, 6 insertions
tewak some comment identation by using tabs instead
of spaces to be consistent with the other functions.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index
tewak some comment identation by using tabs instead
of spaces to be consistent with the other functions.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index
lines.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/vgic/vgic-debug.c | 6 +++---
arch/arm64/kvm/vgic/vgic-init.c | 1 -
arch/arm64/kvm/vgic/vgic-irqfd.c | 4 ++--
arch/arm64/kvm/vgic/vgic-its.c| 20 +---
arch/arm64/kvm/vgic/vgic-kvm-device.c | 2 +-
arch
the existing leaf entry instead of collapsing a block entry into a table.
By comparing fault_granule and vma_pagesize, cases that require allocations
from memcache and cases that don't can be distinguished completely.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 25 -
1
an executable permission to the existing guest stage-2 mapping.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm/kvm_mmu.h | 15 --
arch/arm64/kvm/hyp/pgtable.c | 35 +++-
arch/arm64/kvm/mmu.c | 9 +---
3 files changed, 35 insertions
Also add a mm_ops member for structure stage2_attr_data, since we
will move I-cache maintenance for guest stage-2 to the permission
path and as a result will need mm_ops for address transformation.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 10 ++
1 file changed, 6
EL2 code for pKVM mode.
In this patch, we only introduce symbol of invalidate_icache_range
with no real functionality in nvhe/cache.S, because there haven't
been situations found currently where I-cache maintenance is also
needed in non-VHE EL2 for pKVM mode.
Signed-off-by: Yanan Wang
---
arch
the KVM_PGTABLE_S2_GUEST flag to determine if we are
doing something about guest stage-2. This flag will be used in a
coming patch, in which we will move CMOs for guest to pgtable.c.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm/kvm_pgtable.h | 38 ++--
arch/arm64/kvm/mmu.c
and improve efficiency
of the page table code.
This patch only moves clean of D-cache to the map path, and drop the
original APIs in mmu.c/mmu.h for D-cache maintenance by using what we
already have in pgtable.c. Change about the I-side will come from a
later patch.
Signed-off-by: Yanan Wang
---
arch
t v2 based on v5.12-rc2
- v1:
https://lore.kernel.org/lkml/20210208112250.163568-1-wangyana...@huawei.com/
---
Yanan Wang (6):
KVM: arm64: Introduce KVM_PGTABLE_S2_GUEST stage-2 flag
KVM: arm64: Move D-cache flush to the fault handlers
KVM: arm64: Add mm_ops member for structure stage2_attr_data
KVM: ar
t_granule and vma_pagesize, cases that require allocations
from memcache and cases that don't can be distinguished completely.
Yanan Wang (2):
KVM: arm64: Move CMOs from user_mem_abort to the fault handlers
KVM: arm64: Distinguish cases of memcache allocations completely
arch
the existing leaf entry instead of collapsing a block entry into a table.
By comparing fault_granule and vma_pagesize, cases that require allocations
from memcache and cases that don't can be distinguished completely.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 25 -
1
to pgtable.c.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm/kvm_mmu.h | 31 ---
arch/arm64/kvm/hyp/pgtable.c | 68 +---
arch/arm64/kvm/mmu.c | 23 ++-
3 files changed, 57 insertions(+), 65 deletions(-)
diff --git a/arch/arm64/include
to pgtable.c.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm/kvm_mmu.h | 31 ---
arch/arm64/kvm/hyp/pgtable.c | 68 +---
arch/arm64/kvm/mmu.c | 23 ++-
3 files changed, 57 insertions(+), 65 deletions(-)
diff --git a/arch/arm64/include
-> after 115.94s +33.44%
KVM_REBUILD_BLOCKS: before 103.95s -> after 2.96s +97.15%
Patch #2:
A new method to distinguish cases of memcache allocations is introduced.
By comparing fault_granule and vma_pagesize, cases that require allocations
from memcache and cases that don't can be di
the existing leaf entry instead of collapsing a block entry into a table.
By comparing fault_granule and vma_pagesize, cases that require allocations
from memcache and cases that don't can be distinguished completely.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 25 -
1
the existing leaf entry instead of collapsing a block entry into a table.
By comparing fault_granule and vma_pagesize, cases that require allocations
from memcache and cases that don't can be distinguished completely.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 25 -
1
clean of D-cache and invalidation of I-cache to the
map path and move only invalidation of I-cache to the permission path.
Since the original APIs for CMOs in mmu.c are only called in function
user_mem_abort, we now also move them to pgtable.c.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm
translation faults.
After this patch the steps can be like:
1) invalidate the table entry in the PMD/PUD table
2) flush TLB by VMID
3) install the new block entry to the PMD/PUD table
4) unmap the old sub-level tables
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 44
ew method to distinguish cases of memcache allocations is introduced.
By comparing fault_granule and vma_pagesize, cases that require allocations
from memcache and cases that don't can be distinguished completely.
---
Yanan Wang (3):
KVM: arm64: Move CMOs from user_mem_abort to the fault hand
the existing leaf entry instead of collapsing a block entry into a table.
By comparing fault_granule and vma_pagesize, cases that require allocations
from memcache and cases that don't can be distinguished completely.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 25 -
1
Process of coalescing page mappings back to a block mapping is different
from normal map path, such as TLB invalidation and CMOs, so here add an
independent API for this case.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 18 ++
1 file changed, 18 insertions
of the unnecessary translation faults.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 78a560446f80..308c36b9cd21 100644
--- a/arch
appings(granule 1G))
Before patch: KVM_ADJUST_MAPPINGS: 2.9621s 2.9648s 2.9474s 2.9587s 2.9603s
After patch: KVM_ADJUST_MAPPINGS: 0.3541s 0.3694s 0.3656s 0.3693s 0.3687s
---
Yanan Wang (4):
KVM: arm64: Move the clean of dcache to the map handler
KVM: arm64: Add an independent API for coalescing t
the
efficiency of creating mappings.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm/kvm_mmu.h | 16 --
arch/arm64/kvm/hyp/pgtable.c | 38
arch/arm64/kvm/mmu.c | 14 +++-
3 files changed, 27 insertions(+), 41 deletions(-)
diff --git
with the second kind
of implementation, the above described spurious translations can be prevented.
Yanan Wang (5):
KVM: arm64: Detect the ARMv8.4 TTRem feature
KVM: arm64: Add an API to get level of TTRem supported by hardware
KVM: arm64: Support usage of TTRem in guest stage-2 translation
KVM
.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm/cpufeature.h | 13 +
1 file changed, 13 insertions(+)
diff --git a/arch/arm64/include/asm/cpufeature.h
b/arch/arm64/include/asm/cpufeature.h
index 9a555809b89c..f8ee7d30829b 100644
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch
conflict which is bothering, so we use nT both
at level-1 and level-2 case to avoid handling TLB conflict aborts.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 35 +++
1 file changed, 35 insertions(+)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch
As TTrem can be used when coalesce existing table mappings into a block
in guest stage-2 translation, so just support usage of it.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp
the performance
in guest stage-2 translation. So detact the TTRem feature here.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm/cpucaps.h | 3 ++-
arch/arm64/kernel/cpufeature.c | 10 ++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/cpucaps.h b/arch
With new handling of coalescing tables, we can install the block entry
before unmap of the old table mappings. So make the installation in
stage2_map_walk_table_pre(), and elide the installation from function
stage2_map_walk_table_post().
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp
be skipped.
Yanan Wang (2):
KVM: arm64: Distinguish cases of allocating memcache more precisely
KVM: arm64: Skip the cache flush when coalescing tables into a block
arch/arm64/kvm/mmu.c | 37 +
1 file changed, 21 insertions(+), 16 deletions(-)
--
2.19.1
if VMs are not configured with huge mappings.
The cases where allocations from memcache are required can be much more
precisely distinguished by comparing fault_granule and vma_pagesize.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 25 -
1 file changed, 12 insertions
-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index 8e8549ea1d70..37b427dcbc4f 100644
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -744,7 +744,7 @@ static int
Add a new patch (patch-3)
---
Yanan Wang (2):
KVM: arm64: Adjust partial code of hyp stage-1 map and guest stage-2
map
KVM: arm64: Filter out the case of only changing permissions from
stage-2 map path
arch/arm64/include/asm/kvm_pgtable.h | 4 ++
arch/arm64/kvm/hyp/pgtable.c
change access permissions that don't
require break-before-make. If there have already been the permissions
we want, don't bother to update. If still more permissions need to be
added, then update the PTE directly without break-before-make.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm
Procedures of hyp stage-1 map and guest stage-2 map are quite different,
but they are tied closely by function kvm_set_valid_leaf_pte().
So adjust the relative code for ease of code maintenance in the future.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 54
Procedures of hyp stage-1 map and guest stage-2 map are quite different,
but they are tied closely by function kvm_set_valid_leaf_pte().
So adjust the relative code for ease of code maintenance in the future.
Signed-off-by: Will Deacon
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c
permissions, and don't update the valid
leaf PTE here in this case. Instead, let the vCPU enter back the guest
and it will exit next time to go through the relax_perms path without
break-before-make if it still wants more permissions.
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm/kvm_pgtable.h
anging permissions case in map path
- Add a new patch (patch-3)
- v1:
https://lore.kernel.org/lkml/20201211080115.21460-1-wangyana...@huawei.com/
---
Yanan Wang (3):
KVM: arm64: Adjust partial code of hyp stage-1 map and guest stage-2
map
KVM: arm64: Filter out the case of only changing permission
been handled successfully.
When an -EAGAIN errno is returned from the map handler, we hope to the
vcpu to enter guest directly instead of exiting back to userspace, so
adjust the return value at the end of function.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 13 -
1 file
51 matches
Mail list logo