kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Andrew Jones <drjones@redhat.com>, kvm@vger.kernel.org
Cc: pbonzini@redhat.com, frankja@linux.ibm.com, bgardon@google.com,
	peterx@redhat.com
Subject: Re: [PATCH 09/11] KVM: selftests: Make vm_create_default common
Date: Thu, 5 Nov 2020 08:18:37 +0100	[thread overview]
Message-ID: <c2c57735-2d1c-5abf-c2c0-ed04a19db5a0@de.ibm.com> (raw)
In-Reply-To: <20201104213612.rjykwe7pozcoqbcb@kamzik.brq.redhat.com>



On 04.11.20 22:36, Andrew Jones wrote:
> On Wed, Nov 04, 2020 at 10:23:55PM +0100, Andrew Jones wrote:
>> The code is almost 100% the same anyway. Just move it to common
>> and add a few arch-specific helpers.
>>
>> Signed-off-by: Andrew Jones <drjones@redhat.com>
>> ---
>>  .../selftests/kvm/include/aarch64/processor.h |  3 ++
>>  .../selftests/kvm/include/s390x/processor.h   |  4 +++
>>  .../selftests/kvm/include/x86_64/processor.h  |  4 +++
>>  .../selftests/kvm/lib/aarch64/processor.c     | 17 ----------
>>  tools/testing/selftests/kvm/lib/kvm_util.c    | 26 +++++++++++++++
>>  .../selftests/kvm/lib/s390x/processor.c       | 22 -------------
>>  .../selftests/kvm/lib/x86_64/processor.c      | 32 -------------------
>>  7 files changed, 37 insertions(+), 71 deletions(-)
>>
>> diff --git a/tools/testing/selftests/kvm/include/aarch64/processor.h b/tools/testing/selftests/kvm/include/aarch64/processor.h
>> index b7fa0c8551db..5e5849cdd115 100644
>> --- a/tools/testing/selftests/kvm/include/aarch64/processor.h
>> +++ b/tools/testing/selftests/kvm/include/aarch64/processor.h
>> @@ -9,6 +9,9 @@
>>  
>>  #include "kvm_util.h"
>>  
>> +#define PTRS_PER_PAGE(page_size)	((page_size) / 8)
>> +#define min_page_size()			(4096)
>> +#define min_page_shift()		(12)
>>  
>>  #define ARM64_CORE_REG(x) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
>>  			   KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(x))
>> diff --git a/tools/testing/selftests/kvm/include/s390x/processor.h b/tools/testing/selftests/kvm/include/s390x/processor.h
>> index e0e96a5f608c..0952f53c538b 100644
>> --- a/tools/testing/selftests/kvm/include/s390x/processor.h
>> +++ b/tools/testing/selftests/kvm/include/s390x/processor.h
>> @@ -5,6 +5,10 @@
>>  #ifndef SELFTEST_KVM_PROCESSOR_H
>>  #define SELFTEST_KVM_PROCESSOR_H
>>  
>> +#define PTRS_PER_PAGE(page_size)	((page_size) / 8)
> 
> Doh. I think this 8 is supposed to be a 16 for s390x, considering it
> was dividing by 256 in its version of vm_create_default. I need
> guidance from s390x gurus as to whether or not I should respin though.
> 
> Thanks,
> drew
> 

This is kind of tricky. The last level page table is only 2kb (256 entries = 1MB range).
Depending on whether the page table allocation is clever or not (you can have 2 page
tables in one page) this means that indeed 16 might be better. But then you actually 
want to change the macro name to PTES_PER_PAGE?

  reply	other threads:[~2020-11-05  7:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04 21:23 [PATCH 00/11] KVM: selftests: Cleanups Andrew Jones
2020-11-04 21:23 ` [PATCH 01/11] KVM: selftests: Add x86_64/tsc_msrs_test to .gitignore Andrew Jones
2020-11-04 21:23 ` [PATCH 02/11] KVM: selftests: Drop pointless vm_create wrapper Andrew Jones
2020-11-04 21:23 ` [PATCH 03/11] KVM: selftests: Always clear dirty bitmap after iteration Andrew Jones
2020-11-04 21:23 ` [PATCH 04/11] KVM: selftests: Use a single binary for dirty/clear log test Andrew Jones
2020-11-04 21:23 ` [PATCH 05/11] KVM: selftests: Introduce after_vcpu_run hook for dirty " Andrew Jones
2020-11-04 21:23 ` [PATCH 06/11] KVM: selftests: Make the per vcpu memory size global Andrew Jones
2020-11-04 21:23 ` [PATCH 07/11] KVM: selftests: Make the number of vcpus global Andrew Jones
2020-11-04 21:23 ` [PATCH 08/11] KVM: selftests: Factor out guest mode code Andrew Jones
2020-11-04 21:23 ` [PATCH 09/11] KVM: selftests: Make vm_create_default common Andrew Jones
2020-11-04 21:36   ` Andrew Jones
2020-11-05  7:18     ` Christian Borntraeger [this message]
2020-11-05  9:59       ` Andrew Jones
2020-11-05 18:45         ` Peter Xu
2020-11-05 18:54           ` Christian Borntraeger
2020-11-04 21:23 ` [PATCH 10/11] KVM: selftests: Introduce vm_create_[default_]vcpus Andrew Jones
2020-11-04 21:23 ` [PATCH 11/11] KVM: selftests: Remove create_vm Andrew Jones
2020-11-05  7:08 ` [PATCH 00/11] KVM: selftests: Cleanups Christian Borntraeger
2020-11-05 18:55 ` Peter Xu
2020-11-05 19:41   ` Ben Gardon
2020-11-06  9:45     ` Andrew Jones
2020-11-06 15:04       ` Peter Xu
2020-11-09 17:11         ` Ben Gardon
2020-11-06 13:01 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2c57735-2d1c-5abf-c2c0-ed04a19db5a0@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=bgardon@google.com \
    --cc=drjones@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).