mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
Cc: Shuah Khan <shuah@kernel.org>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Igor Mammedov <imammedo@redhat.com>,
	Yanan Wang <wangyanan55@huawei.com>,
	Andrew Jones <drjones@redhat.com>,
	kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: selftests: page_table_test: fix calculation of guest_test_phys_mem
Date: Fri, 26 Nov 2021 17:11:08 +0100	[thread overview]
Message-ID: <ee41580b-7c1f-eca0-539d-e96f56c7c1db@redhat.com> (raw)
In-Reply-To: <52e487458c3172923549bbcf9dfccfbe6faea60b.1637940473.git.maciej.szmigiero@oracle.com>

On 11/26/21 16:28, Maciej S. Szmigiero wrote:
> From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
> 
> A kvm_page_table_test run with its default settings fails on VMX due to
> memory region add failure:
>> ==== Test Assertion Failure ====
>>   lib/kvm_util.c:952: ret == 0
>>   pid=10538 tid=10538 errno=17 - File exists
>>      1  0x00000000004057d1: vm_userspace_mem_region_add at kvm_util.c:947
>>      2  0x0000000000401ee9: pre_init_before_test at kvm_page_table_test.c:302
>>      3   (inlined by) run_test at kvm_page_table_test.c:374
>>      4  0x0000000000409754: for_each_guest_mode at guest_modes.c:53
>>      5  0x0000000000401860: main at kvm_page_table_test.c:500
>>      6  0x00007f82ae2d8554: ?? ??:0
>>      7  0x0000000000401894: _start at ??:?
>>   KVM_SET_USER_MEMORY_REGION IOCTL failed,
>>   rc: -1 errno: 17
>>   slot: 1 flags: 0x0
>>   guest_phys_addr: 0xc0000000 size: 0x40000000
> 
> This is because the memory range that this test is trying to add
> (0x0c0000000 - 0x100000000) conflicts with LAPIC mapping at 0x0fee00000.
> 
> Looking at the code it seems that guest_test_*phys*_mem variable gets
> mistakenly overwritten with guest_test_*virt*_mem while trying to adjust
> the former for alignment.
> With the correct variable adjusted this test runs successfully.
> 
> Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
> ---
>   tools/testing/selftests/kvm/kvm_page_table_test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/kvm_page_table_test.c b/tools/testing/selftests/kvm/kvm_page_table_test.c
> index 3836322add00..ba1fdc3dcf4a 100644
> --- a/tools/testing/selftests/kvm/kvm_page_table_test.c
> +++ b/tools/testing/selftests/kvm/kvm_page_table_test.c
> @@ -280,7 +280,7 @@ static struct kvm_vm *pre_init_before_test(enum vm_guest_mode mode, void *arg)
>   #ifdef __s390x__
>   	alignment = max(0x100000, alignment);
>   #endif
> -	guest_test_phys_mem = align_down(guest_test_virt_mem, alignment);
> +	guest_test_phys_mem = align_down(guest_test_phys_mem, alignment);
>   
>   	/* Set up the shared data structure test_args */
>   	test_args.vm = vm;
> 

Queued, thanks.

Paolo


      reply	other threads:[~2021-11-26 16:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26 15:28 Maciej S. Szmigiero
2021-11-26 16:11 ` Paolo Bonzini [this message]

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=ee41580b-7c1f-eca0-539d-e96f56c7c1db@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=drjones@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mail@maciej.szmigiero.name \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=vkuznets@redhat.com \
    --cc=wangyanan55@huawei.com \
    --cc=wanpengli@tencent.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

all inboxes | Powered by JetHome®