summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/kvm_pkvm.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-01-08 16:09:53 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2024-01-08 16:09:53 +0300
commit5f53d88f10eb07de0a9bf50e6ad21982e48fd3e3 (patch)
treecf6b71c034f87b2ff8adac94b7a3b2dd87832ab9 /arch/arm64/include/asm/kvm_pkvm.h
parent783288010035e4c250a0b6491a4642cdb8d30548 (diff)
parent040113fa32f27096f531c377001936e0d7964597 (diff)
downloadlinux-5f53d88f10eb07de0a9bf50e6ad21982e48fd3e3.tar.xz
Merge tag 'kvmarm-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 updates for Linux 6.8 - LPA2 support, adding 52bit IPA/PA capability for 4kB and 16kB base granule sizes. Branch shared with the arm64 tree. - Large Fine-Grained Trap rework, bringing some sanity to the feature, although there is more to come. This comes with a prefix branch shared with the arm64 tree. - Some additional Nested Virtualization groundwork, mostly introducing the NV2 VNCR support and retargetting the NV support to that version of the architecture. - A small set of vgic fixes and associated cleanups.
Diffstat (limited to 'arch/arm64/include/asm/kvm_pkvm.h')
-rw-r--r--arch/arm64/include/asm/kvm_pkvm.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/kvm_pkvm.h b/arch/arm64/include/asm/kvm_pkvm.h
index e46250a02017..ad9cfb5c1ff4 100644
--- a/arch/arm64/include/asm/kvm_pkvm.h
+++ b/arch/arm64/include/asm/kvm_pkvm.h
@@ -56,10 +56,11 @@ static inline unsigned long hyp_vm_table_pages(void)
static inline unsigned long __hyp_pgtable_max_pages(unsigned long nr_pages)
{
- unsigned long total = 0, i;
+ unsigned long total = 0;
+ int i;
/* Provision the worst case scenario */
- for (i = 0; i < KVM_PGTABLE_MAX_LEVELS; i++) {
+ for (i = KVM_PGTABLE_FIRST_LEVEL; i <= KVM_PGTABLE_LAST_LEVEL; i++) {
nr_pages = DIV_ROUND_UP(nr_pages, PTRS_PER_PTE);
total += nr_pages;
}