[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190829164432.e5kxt4e2f5ncxwlc@kamzik.brq.redhat.com>
Date: Thu, 29 Aug 2019 18:44:32 +0200
From: Andrew Jones <drjones@...hat.com>
To: Peter Xu <peterx@...hat.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Thomas Huth <thuth@...hat.com>
Subject: Re: [PATCH v2 1/4] KVM: selftests: Move vm type into _vm_create()
internally
On Thu, Aug 29, 2019 at 10:21:14AM +0800, Peter Xu wrote:
> Rather than passing the vm type from the top level to the end of vm
> creation, let's simply keep that as an internal of kvm_vm struct and
> decide the type in _vm_create(). Several reasons for doing this:
>
> - The vm type is only decided by physical address width and currently
> only used in aarch64, so we've got enough information as long as
> we're passing vm_guest_mode into _vm_create(),
>
> - This removes a loop dependency between the vm->type and creation of
> vms. That's why now we need to parse vm_guest_mode twice sometimes,
> once in run_test() and then again in _vm_create(). The follow up
> patches will move on to clean up that as well so we can have a
> single place to decide guest machine types and so.
>
> Note that this patch will slightly change the behavior of aarch64
> tests in that previously most vm_create() callers will directly pass
> in type==0 into _vm_create() but now the type will depend on
> vm_guest_mode, however it shouldn't affect any user because all
> vm_create() users of aarch64 will be using VM_MODE_DEFAULT guest
> mode (which is VM_MODE_P40V48_4K) so at last type will still be zero.
>
> Signed-off-by: Peter Xu <peterx@...hat.com>
> ---
> tools/testing/selftests/kvm/dirty_log_test.c | 13 +++---------
> .../testing/selftests/kvm/include/kvm_util.h | 3 +--
> tools/testing/selftests/kvm/lib/kvm_util.c | 21 ++++++++++++-------
> 3 files changed, 17 insertions(+), 20 deletions(-)
>
Reviewed-by: Andrew Jones <drjones@...hat.com>
Powered by blists - more mailing lists