Also use CLOCK_MONOTONIC flag to get time in kvm_page_table_test.c,
since that's what all the kvm/selftests do currently. And this will
be consistent with function timespec_elapsed() in test_util.c.
Signed-off-by: Yanan Wang
---
tools/testing/selftests/kvm/kvm_page_table_test.c | 8 --
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 ---
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
---
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
retest 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
KV
m 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
---
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
ve them 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/arm
aring fault_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 co
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 ---
that we want. And as all the known hugetlb page sizes
are listed, it's appropriate for all architectures.
Besides, the helper get_backing_src_pagesz() is added to get the
granularity of different backing src types(anonumous, thp, hugetlb).
Suggested-by: Ben Gardon
Signed-off-by: Yanan
to dirty logging stopped of a VM with block mappings,
so it can also reproduce this TLB conflict abort due to inadequate TLB
invalidation when coalescing tables.
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
Reviewed-by: Andrew Jones
---
tools/testing/selftests/kvm/.gitignore| 1
For generality and conciseness, make an API which can be used in all
kvm libs and selftests to get vm guest mode strings. And the index i
is checked in the API in case of possiable faults.
Suggested-by: Sean Christopherson
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
Reviewed-by: Andrew
d and
then get the default page size by reading /proc/meminfo.
This helper can be useful when a program wants to use the default hugetlb
pages of the system and doesn't know the default page size.
Signed-off-by: Yanan Wang
Reviewed-by: Andrew Jones
---
.../testing/selftests/kvm/include/t
architectures may have different THP page sizes configured,
this can get the accurate THP page sizes on any platform.
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
Reviewed-by: Andrew Jones
---
tools/testing/selftests/kvm/lib/kvm_util.c | 28 +++---
1 file changed, 9 insertions
.
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
Reviewed-by: Andrew Jones
---
.../testing/selftests/kvm/include/test_util.h | 2 ++
tools/testing/selftests/kvm/lib/test_util.c | 29 +++
2 files changed, 31 insertions(+)
diff --git a/tools/testing/selftests/kvm/include
Print the errno besides error-string in TEST_ASSERT in the format of
"errno=%d - %s" will explicitly indicate that the string is an error
information. Besides, the errno is easier to be used for debugging
than the error-string.
Suggested-by: Andrew Jones
Signed-off-by: Yanan Wang
R
corresponding hugetlb page size, using flag x.
Cc: Ben Gardon
Cc: Ingo Molnar
Cc: Adrian Hunter
Cc: Jiri Olsa
Cc: Arnaldo Carvalho de Melo
Cc: Arnd Bergmann
Cc: Michael Kerrisk
Cc: Thomas Gleixner
Suggested-by: Ben Gardon
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
include/uapi
,
but not tools/include/asm-generic/hugetlb_encode.h.
Cc: Ingo Molnar
Cc: Adrian Hunter
Cc: Jiri Olsa
Cc: Arnaldo Carvalho de Melo
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
tools/include/asm-generic/hugetlb_encode.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/include
In addition to function of CLOCK_MONOTONIC, flag CLOCK_MONOTONIC_RAW can
also shield possiable impact of NTP, which can provide more robustness.
Suggested-by: Vitaly Kuznetsov
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
Reviewed-by: Andrew Jones
---
tools/testing/selftests/kvm
patch to sync header files
- Add helpers to get granularity of different backing src types
- Some changes for suggestions about v1 series
- v1:
https://lore.kernel.org/lkml/20210208090841.333724-1-wangyana...@huawei.com/
---
Yanan Wang (10):
tools headers: sync headers of asm-generic/hugetlb_e
before 174.20s -> 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
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 ---
ve them 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/arm
d and
then get the default page size by reading /proc/meminfo.
This helper can be useful when a program wants to use the default hugetlb
pages of the system and doesn't know the default page size.
Signed-off-by: Yanan Wang
Reviewed-by: Andrew Jones
---
.../testing/selftests/kvm/include/t
architectures may have different THP page sizes configured,
this can get the accurate THP page sizes on any platform.
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
Reviewed-by: Andrew Jones
---
tools/testing/selftests/kvm/lib/kvm_util.c | 28 +++---
1 file changed, 9 insertions
to dirty logging stopped of a VM with block mappings,
so it can also reproduce this TLB conflict abort due to inadequate TLB
invalidation when coalescing tables.
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
tools/testing/selftests/kvm/.gitignore| 1 +
tools/testing/selftests/kvm/
that we want. And as all the known hugetlb page sizes
are listed, it's appropriate for all architectures.
Besides, the helper get_backing_src_pagesz() is added to get the
granularity of different backing src types(anonumous, thp, hugetlb).
Suggested-by: Ben Gardon
Signed-off-by: Yanan
.
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
.../testing/selftests/kvm/include/test_util.h | 2 ++
tools/testing/selftests/kvm/lib/test_util.c | 29 +++
2 files changed, 31 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/test_util.h
b/tools/testing
Print the errno besides error-string in TEST_ASSERT in the format of
"errno=%d - %s" will explicitly indicate that the string is an error
information. Besides, the errno is easier to be used for debugging
than the error-string.
Suggested-by: Andrew Jones
Signed-off-by: Yanan Wang
corresponding hugetlb page size, using flag x.
Cc: Ben Gardon
Cc: Ingo Molnar
Cc: Adrian Hunter
Cc: Jiri Olsa
Cc: Arnaldo Carvalho de Melo
Cc: Arnd Bergmann
Cc: Michael Kerrisk
Cc: Thomas Gleixner
Suggested-by: Ben Gardon
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
include/uapi/linux
In addition to function of CLOCK_MONOTONIC, flag CLOCK_MONOTONIC_RAW can
also shield possiable impact of NTP, which can provide more robustness.
Suggested-by: Vitaly Kuznetsov
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
Reviewed-by: Andrew Jones
---
tools/testing/selftests/kvm
For generality and conciseness, make an API which can be used in all
kvm libs and selftests to get vm guest mode strings. And the index i
is checked in the API in case of possiable faults.
Suggested-by: Sean Christopherson
Signed-off-by: Yanan Wang
Reviewed-by: Andrew Jones
Reviewed-by: Ben
,
but not tools/include/asm-generic/hugetlb_encode.h.
Cc: Ingo Molnar
Cc: Adrian Hunter
Cc: Jiri Olsa
Cc: Arnaldo Carvalho de Melo
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
tools/include/asm-generic/hugetlb_encode.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/include
/20210225055940.18748-1-wangyana...@huawei.com/
v1->v2:
- Add a patch to sync header files
- Add helpers to get granularity of different backing src types
- Some changes for suggestions about v1 series
- v1:
https://lore.kernel.org/lkml/20210208090841.333724-1-wangyana...@huawei.com/
---
Yan
ssary 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
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 ---
move both 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/i
ut patch 3:
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 distinguished completely.
---
Yanan Wang (3):
KVM: arm64: Move CMOs from user_mem_abo
that we want. And as all the known hugetlb page sizes
are listed, it's appropriate for all architectures.
Besides, the helper get_backing_src_pagesz() is added to get the
granularity of different backing src types(anonumous, thp, hugetlb).
Suggested-by: Ben Gardon
Signed-off-by: Yanan
For generality and conciseness, make an API which can be used in all
kvm libs and selftests to get vm guest mode strings. And the index i
is checked in the API in case of possiable faults.
Suggested-by: Sean Christopherson
Signed-off-by: Yanan Wang
Reviewed-by: Andrew Jones
Reviewed-by: Ben
In addition to function of CLOCK_MONOTONIC, flag CLOCK_MONOTONIC_RAW can
also shield possiable impact of NTP, which can provide more robustness.
Suggested-by: Vitaly Kuznetsov
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
tools/testing/selftests/kvm/demand_paging_test.c | 8
t;v3:
- Add tags of Suggested-by, Reviewed-by in the patches
- Add a generic micro to get hugetlb page sizes
- Some changes for suggestions about v2 series
v1->v2:
- Add a patch to sync header files
- Add helpers to get granularity of different backing src types
- Some changes for suggestions about
d and
then get the default page size by reading /proc/meminfo.
This helper can be useful when a program wants to use the default hugetlb
pages of the system and doesn't know the default page size.
Signed-off-by: Yanan Wang
---
.../testing/selftests/kvm/include/test_util.h | 1 +
too
corresponding hugetlb page size, using flag x.
Cc: Ben Gardon
Cc: Ingo Molnar
Cc: Adrian Hunter
Cc: Jiri Olsa
Cc: Arnaldo Carvalho de Melo
Cc: Arnd Bergmann
Cc: Michael Kerrisk
Cc: Thomas Gleixner
Suggested-by: Ben Gardon
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
include/uapi/linux
,
but not tools/include/asm-generic/hugetlb_encode.h.
Cc: Ingo Molnar
Cc: Adrian Hunter
Cc: Jiri Olsa
Cc: Arnaldo Carvalho de Melo
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
tools/include/asm-generic/hugetlb_encode.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/include
to dirty logging stopped of a VM with block mappings,
so it can also reproduce this TLB conflict abort due to inadequate TLB
invalidation when coalescing tables.
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
tools/testing/selftests/kvm/Makefile | 3 +
.../selft
architectures may have different THP page sizes configured,
this can get the accurate THP page sizes on any platform.
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
tools/testing/selftests/kvm/lib/kvm_util.c | 28 +++---
1 file changed, 9 insertions(+), 19 deletions(-)
diff
.
Signed-off-by: Yanan Wang
Reviewed-by: Ben Gardon
---
.../testing/selftests/kvm/include/test_util.h | 2 ++
tools/testing/selftests/kvm/lib/test_util.c | 36 +++
2 files changed, 38 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/test_util.h
b/tools/testing
For generality and conciseness, make an API which can be used in all
kvm libs and selftests to get vm guest mode strings. And the index i
is checked in the API in case of possiable faults.
Reviewed-by: Andrew Jones
Suggested-by: Sean Christopherson
Signed-off-by: Yanan Wang
---
.../testing
,
but not tools/include/asm-generic/hugetlb_encode.h.
Cc: Ingo Molnar
Cc: Adrian Hunter
Cc: Jiri Olsa
Cc: Arnaldo Carvalho de Melo
Signed-off-by: Yanan Wang
---
tools/include/asm-generic/hugetlb_encode.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/include/asm-generic
that we want. And as all the known hugetlb page sizes
are listed, it's appropriate for all architectures.
Besides, the helper get_backing_src_pagesz() is added to get the
granularity of different backing src types(anonumous, thp, hugetlb).
Suggested-by: Ben Gardon
Signed-off-by: Yanan
to dirty logging stopped of a VM with block mappings,
so it can also reproduce this TLB conflict abort due to inadequate TLB
invalidation when coalescing tables.
Signed-off-by: Yanan Wang
---
tools/testing/selftests/kvm/Makefile | 3 +
.../selftests/kvm/kvm_page_table_test.c
Add helpers to get granularity of different backing src types
- Some changes for suggestions about v1 series
---
Yanan Wang (7):
tools headers: sync headers of asm-generic/hugetlb_encode.h
tools headers: Add a macro to get HUGETLB page sizes for mmap
KVM: selftests: Use flag CLOCK_MONOTONIC_R
In addition to function of CLOCK_MONOTONIC, flag CLOCK_MONOTONIC_RAW can
also shield possiable impact of NTP, which can provide more robustness.
Suggested-by: Vitaly Kuznetsov
Signed-off-by: Yanan Wang
---
tools/testing/selftests/kvm/demand_paging_test.c | 8
tools/testing/selftests
architectures may have different THP page sizes configured,
this can get the accurate THP page sizes on any platform.
Signed-off-by: Yanan Wang
---
tools/testing/selftests/kvm/lib/kvm_util.c | 28 +++---
1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/tools/testing
.
Reviewed-by: Ben Gardon
Signed-off-by: Yanan Wang
---
.../testing/selftests/kvm/include/test_util.h | 2 ++
tools/testing/selftests/kvm/lib/test_util.c | 36 +++
2 files changed, 38 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/test_util.h
b/tools/testing
corresponding hugetlb page size, using flag x.
Cc: Ben Gardon
Cc: Ingo Molnar
Cc: Adrian Hunter
Cc: Jiri Olsa
Cc: Arnaldo Carvalho de Melo
Cc: Arnd Bergmann
Cc: Michael Kerrisk
Cc: Thomas Gleixner
Suggested-by: Ben Gardon
Signed-off-by: Yanan Wang
---
include/uapi/linux/mman.h | 2 ++
tools
to dirty logging stopped of a VM with block mappings,
so it can also reproduce this TLB conflict abort due to inadequate TLB
invalidation when coalescing tables.
Signed-off-by: Yanan Wang
---
tools/testing/selftests/kvm/Makefile | 3 +
.../selftests/kvm/kvm_page_table_test.c
architectures may have different THP page sizes configured,
this can get the accurate THP page sizes on any platform.
Signed-off-by: Yanan Wang
---
tools/testing/selftests/kvm/lib/kvm_util.c | 27 +++---
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/tools/testing
that we want. And as all the known hugetlb page sizes
are listed, it's appropriate for all architectures.
Besides, the helper get_backing_src_pagesz() is added to get the
granularity of different backing src types(anonumous, thp, hugetlb).
Signed-off-by: Yanan Wang
---
.../testing/selftest
In addition to function of CLOCK_MONOTONIC, flag CLOCK_MONOTONIC_RAW can
also shield possiable impact of NTP, which can provide more robustness.
Signed-off-by: Yanan Wang
---
tools/testing/selftests/kvm/demand_paging_test.c | 8
tools/testing/selftests/kvm/dirty_log_perf_test.c | 14
For generality and conciseness, make an API which can be used in all
kvm libs and selftests to get vm guest mode strings. And the index i
is checked in the API in case of possiable faults.
Signed-off-by: Yanan Wang
---
.../testing/selftests/kvm/include/kvm_util.h | 4 +--
tools/testing
,
but not tools/include/asm-generic/hugetlb_encode.h.
Signed-off-by: Yanan Wang
---
tools/include/asm-generic/hugetlb_encode.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/include/asm-generic/hugetlb_encode.h
b/tools/include/asm-generic/hugetlb_encode.h
index e4732d3c2998
.
Signed-off-by: Yanan Wang
---
.../testing/selftests/kvm/include/test_util.h | 2 ++
tools/testing/selftests/kvm/lib/test_util.c | 36 +++
2 files changed, 38 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/test_util.h
b/tools/testing/selftests/kvm/include
bled to dirty logging stopped of a VM with block mappings,
so it can also reproduce this TLB conflict abort due to inadequate TLB
invalidation when coalescing tables.
Links about the TLB conflict abort:
https://lore.kernel.org/lkml/20201201201034.116760-3-wangyana...@huawei.com/
Yanan Wang (7):
tools
e 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 --
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 ---
f 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
memory, block mappings(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 f
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
Before patch: KVM_ADJUST_MAPPINGS: 103.931s 103.936s 103.927s 103.942s 103.927s
After patch: KVM_ADJUST_MAPPINGS: 0.3541s 0.3694s 0.3656s 0.3693s 0.3687s
---
Yanan Wang (2):
KVM: selftests: Add a macro to get string of vm_mem_backing_src_type
KVM: selftests: Add a test for kvm page ta
Add a macro to get string of the backing source memory type, so that
application can add choices for source types in the help() function,
and users can specify which type to use for testing.
Signed-off-by: Yanan Wang
---
tools/testing/selftests/kvm/include/kvm_util.h | 3 +++
tools/testing
abled to dirty-logging
stopped of a VM with block mappings, so it can also reproduce this TLB conflict
abort due to inadequate TLB invalidation when coalescing tables.
Signed-off-by: Yanan Wang
---
tools/testing/selftests/kvm/Makefile | 3 +
.../selftests/kvm/kvm_page_table_test.c
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
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
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
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
.
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
-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
ons can 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
ng
time 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
sions case in map path
- 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/ar
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
pdate only 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
---
ar
nge access 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/as
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
meeting changing 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
t has 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
but not return to userspace if we were
trying to recreate the same mapping or only change access permissions
with BBM, which is not permitted in the mapping path.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/mmu.c | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git
of the diff as an independent patch (PATCH1/3),
and add Will's Signed-off-by.
- Use *return -EPERM* way when changing permissions only in the mapping path.
- Add a new patch (PATCH3/3).
Yanan Wang (3):
KVM: arm64: Decouple partial code of hyp stage 1 mapping and guest
stage 2 mapping
, change of permissions will be handled
through the relax_perms path next time if necessary.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 28 +++-
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm
Procedures of hyp stage 1 mapping and guest stage 2 mapping are different,
but they are tied closely by function kvm_set_valid_leaf_pte().
So separate them by rewriting kvm_set_valid_leaf_pte().
Signed-off-by: Will Deacon
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 54
nly.
Yanan Wang (1):
KVM: arm64: Add prejudgement for relaxing permissions only case in
stage2 translation fault hand
eak-before-make if we are trying to add more permissions only.
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 73 +---
1 file changed, 52 insertions(+), 21 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
in
mappings for the block. Without enough TLBI, multiple TLB entries
for the memory in the block will be cached.
Signed-off-by: Will Deacon
Signed-off-by: Yanan Wang
---
arch/arm64/kvm/hyp/pgtable.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b
can strictly
distinguish conditions is introduced in PATCH 3/3.
Changes from v1:
* In PATCH 1/3, introduce a more concise fix.
* In PATCH 2/3, using full S2 TLB invalidation when merging tables into
a block entry.
Yanan Wang (3):
KVM: arm64: Fix possible memory leak in kvm stage2
KVM: arm64
d-by: Keqian Zhu
Signed-off-by: Yanan Wang
---
arch/arm64/include/asm/esr.h | 1 +
arch/arm64/include/asm/kvm_emulate.h | 5 +
arch/arm64/kvm/mmu.c | 11 +--
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/esr.h b/arch
1 - 100 of 105 matches
Mail list logo