diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-02-23 10:27:32 +0100 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-02-23 10:27:32 +0100 |
commit | 27121864ab366992583d894961ecdc6e2ffe0ca1 (patch) | |
tree | 87ef1dcf82ce2d0d29b686d5ae81003ab3eb3b4a /tools/testing/selftests/kvm/lib/kvm_util.c | |
parent | 84549c816dc317f012798e706e58669b3b013604 (diff) | |
parent | f047382519ca41702ebaee5a862e87390f687137 (diff) |
Merge tag 'spi-nor/for-6.3' into mtd/next
SPI NOR changes:
* small fixes on core and spansion driver.
Diffstat (limited to 'tools/testing/selftests/kvm/lib/kvm_util.c')
-rw-r--r-- | tools/testing/selftests/kvm/lib/kvm_util.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index c88c3ace16d2..56d5ea949cbb 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -186,6 +186,15 @@ const struct vm_guest_mode_params vm_guest_mode_params[] = { _Static_assert(sizeof(vm_guest_mode_params)/sizeof(struct vm_guest_mode_params) == NUM_VM_MODES, "Missing new mode params?"); +/* + * Initializes vm->vpages_valid to match the canonical VA space of the + * architecture. + * + * The default implementation is valid for architectures which split the + * range addressed by a single page table into a low and high region + * based on the MSB of the VA. On architectures with this behavior + * the VA region spans [0, 2^(va_bits - 1)), [-(2^(va_bits - 1), -1]. + */ __weak void vm_vaddr_populate_bitmap(struct kvm_vm *vm) { sparsebit_set_num(vm->vpages_valid, @@ -1416,10 +1425,10 @@ void virt_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr, while (npages--) { virt_pg_map(vm, vaddr, paddr); + sparsebit_set(vm->vpages_mapped, vaddr >> vm->page_shift); + vaddr += page_size; paddr += page_size; - - sparsebit_set(vm->vpages_mapped, vaddr >> vm->page_shift); } } |