lkml.org 
[lkml]   [2021]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH RFC] KVM: SVM: reduce guest MAXPHYADDR by one in case C-bit is a physical bit
Date
Vitaly Kuznetsov <vkuznets@redhat.com> writes:

> Sean Christopherson <seanjc@google.com> writes:
>
>> On Fri, Oct 15, 2021, Vitaly Kuznetsov wrote:
>>> Several selftests (memslot_modification_stress_test, kvm_page_table_test,
>>> dirty_log_perf_test,.. ) which rely on vm_get_max_gfn() started to fail
>>> since commit ef4c9f4f65462 ("KVM: selftests: Fix 32-bit truncation of
>>> vm_get_max_gfn()") on AMD EPYC 7401P:
>>>
>>> ./tools/testing/selftests/kvm/demand_paging_test
>>> Testing guest mode: PA-bits:ANY, VA-bits:48, 4K pages
>>> guest physical test memory offset: 0xffffbffff000
>>
>> This look a lot like the signature I remember from the original bug[1]. I assume
>> you're hitting the magic HyperTransport region[2]. I thought that was fixed, but
>> the hack-a-fix for selftests never got applied[3].
>>
>> [1] https://lore.kernel.org/lkml/20210623230552.4027702-4-seanjc@google.com/
>
> Hey,
>
> it seems I'm only three months late to the party!
>
>> [2] https://lkml.kernel.org/r/7e3a90c0-75a1-b8fe-dbcf-bda16502ace9@amd.com
>> [3] https://lkml.kernel.org/r/20210805105423.412878-1-pbonzini@redhat.com
>>
>
> This patch helps indeed

FWIW, 'access_tracking_perf_test' remains broken even after the patch is
applied:

# ./access_tracking_perf_test
Testing guest mode: PA-bits:ANY, VA-bits:48, 4K pages
guest physical test memory offset: 0xfffcbffff000

Populating memory : 3.858448918s
Writing to populated memory : 0.937319626s
Reading from populated memory : 0.003073207s
==== Test Assertion Failure ====
lib/kvm_util.c:1382: false
pid=6422 tid=6425 errno=4 - Interrupted system call
1 0x000000000040667d: addr_gpa2hva at kvm_util.c:1382
2 (inlined by) addr_gpa2hva at kvm_util.c:1376
3 (inlined by) addr_gva2hva at kvm_util.c:2245
4 0x0000000000402909: lookup_pfn at access_tracking_perf_test.c:98
5 (inlined by) mark_vcpu_memory_idle at access_tracking_perf_test.c:152
6 (inlined by) vcpu_thread_main at access_tracking_perf_test.c:232
7 0x00007fd02d1cb431: ?? ??:0
8 0x00007fd02d0f9912: ?? ??:0
No vm physical memory at 0xfcbffff000

(and my cpuid hack reducing guest physical address space by half doesn't
seem to help either)

--
Vitaly

\
 
 \ /
  Last update: 2021-10-18 13:24    [W:0.096 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site