2022-12-07 22:02:29

by Oliver Upton

[permalink] [raw]
Subject: [PATCH 4/4] KVM: selftests: Allocate ucall pool from MEM_REGION_DATA

MEM_REGION_TEST_DATA is meant to hold data explicitly used by a
selftest, not implicit allocations due to the selftests infrastructure.
Allocate the ucall pool from MEM_REGION_DATA much like the rest of the
selftests library allocations.

Fixes: 426729b2cf2e ("KVM: selftests: Add ucall pool based implementation")
Signed-off-by: Oliver Upton <[email protected]>
---
tools/testing/selftests/kvm/lib/ucall_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/lib/ucall_common.c b/tools/testing/selftests/kvm/lib/ucall_common.c
index 820ce6c82829..0cc0971ce60e 100644
--- a/tools/testing/selftests/kvm/lib/ucall_common.c
+++ b/tools/testing/selftests/kvm/lib/ucall_common.c
@@ -22,7 +22,7 @@ void ucall_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
vm_vaddr_t vaddr;
int i;

- vaddr = vm_vaddr_alloc(vm, sizeof(*hdr), KVM_UTIL_MIN_VADDR);
+ vaddr = __vm_vaddr_alloc(vm, sizeof(*hdr), KVM_UTIL_MIN_VADDR, MEM_REGION_DATA);
hdr = (struct ucall_header *)addr_gva2hva(vm, vaddr);
memset(hdr, 0, sizeof(*hdr));

--
2.39.0.rc0.267.gcb52ba06e7-goog


2022-12-08 00:18:42

by Sean Christopherson

[permalink] [raw]
Subject: Re: [PATCH 4/4] KVM: selftests: Allocate ucall pool from MEM_REGION_DATA

On Wed, Dec 07, 2022, Oliver Upton wrote:
> MEM_REGION_TEST_DATA is meant to hold data explicitly used by a
> selftest, not implicit allocations due to the selftests infrastructure.
> Allocate the ucall pool from MEM_REGION_DATA much like the rest of the
> selftests library allocations.
>
> Fixes: 426729b2cf2e ("KVM: selftests: Add ucall pool based implementation")

Not that it really matters because no one will backport this verbatim, but this
is the wrong commit to blame. As of commit 426729b2cf2e, MEM_REGION_DATA does not
exist. And similarly, the common ucall code didn't exist when Ricardo's series
introduced MEM_REGION_DATA.

$ git show 426729b2cf2e:tools/testing/selftests/kvm/include/kvm_util_base.h | grep MEM_REGION_DATA
$ git show 290c5b54012b7:tools/testing/selftests/kvm/lib/ucall_common.c
fatal: path 'tools/testing/selftests/kvm/lib/ucall_common.c' exists on disk, but not in '290c5b54012b7'

The commit where the two collided is:

Fixes: cc7544101eec ("Merge tag 'kvmarm-6.2' of https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD")

> Signed-off-by: Oliver Upton <[email protected]>
> ---

Fixes nit aside,

Reviewed-by: Sean Christopherson <[email protected]>

2022-12-08 00:19:06

by Oliver Upton

[permalink] [raw]
Subject: Re: [PATCH 4/4] KVM: selftests: Allocate ucall pool from MEM_REGION_DATA

On Wed, Dec 07, 2022 at 11:44:50PM +0000, Sean Christopherson wrote:
> On Wed, Dec 07, 2022, Oliver Upton wrote:
> > MEM_REGION_TEST_DATA is meant to hold data explicitly used by a
> > selftest, not implicit allocations due to the selftests infrastructure.
> > Allocate the ucall pool from MEM_REGION_DATA much like the rest of the
> > selftests library allocations.
> >
> > Fixes: 426729b2cf2e ("KVM: selftests: Add ucall pool based implementation")
>
> Not that it really matters because no one will backport this verbatim, but this
> is the wrong commit to blame. As of commit 426729b2cf2e, MEM_REGION_DATA does not
> exist. And similarly, the common ucall code didn't exist when Ricardo's series
> introduced MEM_REGION_DATA.
>
> $ git show 426729b2cf2e:tools/testing/selftests/kvm/include/kvm_util_base.h | grep MEM_REGION_DATA
> $ git show 290c5b54012b7:tools/testing/selftests/kvm/lib/ucall_common.c
> fatal: path 'tools/testing/selftests/kvm/lib/ucall_common.c' exists on disk, but not in '290c5b54012b7'
>
> The commit where the two collided is:
>
> Fixes: cc7544101eec ("Merge tag 'kvmarm-6.2' of https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD")

Yeah, this Fixes is garbage, apologies.

I imagine Paolo is going to squash some things into the kvmarm merge, so
the Fixes tag ought to be dropped altogether.

> > Signed-off-by: Oliver Upton <[email protected]>
> > ---
>
> Fixes nit aside,
>
> Reviewed-by: Sean Christopherson <[email protected]>

Thanks!

--
Best,
Oliver