Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com
Subject: Re: [PATCH] kvm: selftests: aarch64: dirty_log_test: fix unaligned memslot size
Date: Thu, 23 May 2019 17:48:59 +0800	[thread overview]
Message-ID: <20190523094859.GB2517@xz-x1> (raw)
In-Reply-To: <20190523093405.17887-1-drjones@redhat.com>

On Thu, May 23, 2019 at 11:34:05AM +0200, Andrew Jones wrote:
> The memory slot size must be aligned to the host's page size. When
> testing a guest with a 4k page size on a host with a 64k page size,
> then 3 guest pages are not host page size aligned. Since we just need
> a nearly arbitrary number of extra pages to ensure the memslot is not
> aligned to a 64 host-page boundary for this test, then we can use
> 16, as that's 64k aligned, but not 64 * 64k aligned.
> 
> Fixes: 76d58e0f07ec ("KVM: fix KVM_CLEAR_DIRTY_LOG for memory slots of unaligned size", 2019-04-17)
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> 
> ---
> Note, the commit "KVM: fix KVM_CLEAR_DIRTY_LOG for memory slots of
> unaligned size" was somehow committed twice. 76d58e0f07ec is the
> first instance.
> 
>  tools/testing/selftests/kvm/dirty_log_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/selftests/kvm/dirty_log_test.c
> index f50a15c38f9b..bf85afbf1b5f 100644
> --- a/tools/testing/selftests/kvm/dirty_log_test.c
> +++ b/tools/testing/selftests/kvm/dirty_log_test.c
> @@ -292,7 +292,7 @@ static void run_test(enum vm_guest_mode mode, unsigned long iterations,
>  	 * A little more than 1G of guest page sized pages.  Cover the
>  	 * case where the size is not aligned to 64 pages.
>  	 */
> -	guest_num_pages = (1ul << (30 - guest_page_shift)) + 3;
> +	guest_num_pages = (1ul << (30 - guest_page_shift)) + 16;

Hi, Drew,

Could you help explain what's the error on ARM?  Since I still cannot
understand how it failed from the first glance...

Also, even if we want to have the alignment, shall we do the math
using known host/guest page size rather than another adhoc number or
could it still break with some other combinations of host/guest page
sizes?

Thanks,

-- 
Peter Xu

  reply	other threads:[~2019-05-23  9:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23  9:34 [PATCH] kvm: selftests: aarch64: dirty_log_test: fix unaligned memslot size Andrew Jones
2019-05-23  9:48 ` Peter Xu [this message]
2019-05-23 10:05   ` Andrew Jones
2019-05-23 13:47     ` Peter Xu
2019-05-23 17:15       ` Andrew Jones
2019-05-24 19:23 ` 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=20190523094859.GB2517@xz-x1 \
    --to=peterx@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@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