diff mbox series

KVM: selftests: Address extra memslot parameters in vm_vaddr_alloc

Message ID 20210702201042.4036162-1-ricarkol@google.com (mailing list archive)
State New, archived
Headers show
Series KVM: selftests: Address extra memslot parameters in vm_vaddr_alloc | expand

Commit Message

Ricardo Koller July 2, 2021, 8:10 p.m. UTC
Commit a75a895e6457 ("KVM: selftests: Unconditionally use memslot 0 for
vaddr allocations") removed the memslot parameters from vm_vaddr_alloc.
It addressed all callers except one under lib/aarch64/, due to a race
with commit e3db7579ef35 ("KVM: selftests: Add exception handling
support for aarch64")

Fix the vm_vaddr_alloc call in lib/aarch64/processor.c.

Reported-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
---
 tools/testing/selftests/kvm/lib/aarch64/processor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Auger July 5, 2021, 9:57 a.m. UTC | #1
Hi Ricardo,

On 7/2/21 10:10 PM, Ricardo Koller wrote:
> Commit a75a895e6457 ("KVM: selftests: Unconditionally use memslot 0 for
> vaddr allocations") removed the memslot parameters from vm_vaddr_alloc.
> It addressed all callers except one under lib/aarch64/, due to a race
> with commit e3db7579ef35 ("KVM: selftests: Add exception handling
> support for aarch64")
> 
> Fix the vm_vaddr_alloc call in lib/aarch64/processor.c.
> 
> Reported-by: Zenghui Yu <yuzenghui@huawei.com>
> Signed-off-by: Ricardo Koller <ricarkol@google.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric

> ---
>  tools/testing/selftests/kvm/lib/aarch64/processor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/lib/aarch64/processor.c b/tools/testing/selftests/kvm/lib/aarch64/processor.c
> index 9f49f6caafe5..632b74d6b3ca 100644
> --- a/tools/testing/selftests/kvm/lib/aarch64/processor.c
> +++ b/tools/testing/selftests/kvm/lib/aarch64/processor.c
> @@ -401,7 +401,7 @@ void route_exception(struct ex_regs *regs, int vector)
>  void vm_init_descriptor_tables(struct kvm_vm *vm)
>  {
>  	vm->handlers = vm_vaddr_alloc(vm, sizeof(struct handlers),
> -			vm->page_size, 0, 0);
> +			vm->page_size);
>  
>  	*(vm_vaddr_t *)addr_gva2hva(vm, (vm_vaddr_t)(&exception_handlers)) = vm->handlers;
>  }
>
Paolo Bonzini July 8, 2021, 5:16 p.m. UTC | #2
On 02/07/21 22:10, Ricardo Koller wrote:
> Commit a75a895e6457 ("KVM: selftests: Unconditionally use memslot 0 for
> vaddr allocations") removed the memslot parameters from vm_vaddr_alloc.
> It addressed all callers except one under lib/aarch64/, due to a race
> with commit e3db7579ef35 ("KVM: selftests: Add exception handling
> support for aarch64")
> 
> Fix the vm_vaddr_alloc call in lib/aarch64/processor.c.
> 
> Reported-by: Zenghui Yu <yuzenghui@huawei.com>
> Signed-off-by: Ricardo Koller <ricarkol@google.com>
> ---
>   tools/testing/selftests/kvm/lib/aarch64/processor.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/lib/aarch64/processor.c b/tools/testing/selftests/kvm/lib/aarch64/processor.c
> index 9f49f6caafe5..632b74d6b3ca 100644
> --- a/tools/testing/selftests/kvm/lib/aarch64/processor.c
> +++ b/tools/testing/selftests/kvm/lib/aarch64/processor.c
> @@ -401,7 +401,7 @@ void route_exception(struct ex_regs *regs, int vector)
>   void vm_init_descriptor_tables(struct kvm_vm *vm)
>   {
>   	vm->handlers = vm_vaddr_alloc(vm, sizeof(struct handlers),
> -			vm->page_size, 0, 0);
> +			vm->page_size);
>   
>   	*(vm_vaddr_t *)addr_gva2hva(vm, (vm_vaddr_t)(&exception_handlers)) = vm->handlers;
>   }
> 

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/lib/aarch64/processor.c b/tools/testing/selftests/kvm/lib/aarch64/processor.c
index 9f49f6caafe5..632b74d6b3ca 100644
--- a/tools/testing/selftests/kvm/lib/aarch64/processor.c
+++ b/tools/testing/selftests/kvm/lib/aarch64/processor.c
@@ -401,7 +401,7 @@  void route_exception(struct ex_regs *regs, int vector)
 void vm_init_descriptor_tables(struct kvm_vm *vm)
 {
 	vm->handlers = vm_vaddr_alloc(vm, sizeof(struct handlers),
-			vm->page_size, 0, 0);
+			vm->page_size);
 
 	*(vm_vaddr_t *)addr_gva2hva(vm, (vm_vaddr_t)(&exception_handlers)) = vm->handlers;
 }