Re: [PATCH 1/1] KVM: selftests: pmu_counters_test: increase robustness of LLC cache misses

2024-07-04 Thread Maxim Levitsky
On Thu, 2024-06-27 at 10:42 -0700, Sean Christopherson wrote: > On Fri, Jun 21, 2024, Maxim Levitsky wrote: > > Currently this test does a single CLFLUSH on its memory location > > but due to speculative execution this might not cause LLC misses. > > > > Instead, do

Re: [PATCH 1/1] KVM: selftests: pmu_counters_test: increase robustness of LLC cache misses

2024-06-26 Thread Maxim Levitsky
On Fri, 2024-06-21 at 16:43 -0400, Maxim Levitsky wrote: > Currently this test does a single CLFLUSH on its memory location > but due to speculative execution this might not cause LLC misses. > > Instead, do a cache flush on each loop iteration to confuse the prediction > and make

[PATCH 0/1] KVM: selftests: pmu_counters_test: increase robustness of LLC cache misses

2024-06-21 Thread Maxim Levitsky
ed on each iteration of the measured loop which should at least reduce by order of magnitude the chance of this happening. This patch survived more that a day of running in a loop on a Comet Lake machine, where the test used to fail after about 10-20 minites. Best regards, Maxim Levitsky

[PATCH 1/1] KVM: selftests: pmu_counters_test: increase robustness of LLC cache misses

2024-06-21 Thread Maxim Levitsky
Currently this test does a single CLFLUSH on its memory location but due to speculative execution this might not cause LLC misses. Instead, do a cache flush on each loop iteration to confuse the prediction and make sure that cache misses always occur. Signed-off-by: Maxim Levitsky

Re: [PATCH] KVM: selftests: fix max_guest_memory_test with more that 256 vCPUs

2024-04-02 Thread Maxim Levitsky
On Fri, 2024-03-15 at 10:35 -0400, Maxim Levitsky wrote: > max_guest_memory_test uses ucalls to sync with the host, but > it also resets the guest RIP back to its initial value in between > tests stages. > > This makes the guest never reach the code which frees the ucall struc

[PATCH] KVM: selftests: fix max_guest_memory_test with more that 256 vCPUs

2024-03-15 Thread Maxim Levitsky
more that 256 vCPUs are used. Fix that by replacing the manual register reset with a loop in the guest code. Signed-off-by: Maxim Levitsky --- .../testing/selftests/kvm/max_guest_memory_test.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/testing

Re: [PATCH 1/1] selftests: KVM: add test to print boottime wallclock

2023-10-11 Thread Maxim Levitsky
У вт, 2023-10-10 у 09:31 -0700, Dongli Zhang пише: > Hi Maxim, > > On 10/10/23 09:13, Maxim Levitsky wrote: > > У пт, 2023-10-06 у 10:57 -0700, Dongli Zhang пише: > > > As inspired by the discussion in [1], the boottime wallclock may drift due > > > to the f

Re: [PATCH 1/1] selftests: KVM: add test to print boottime wallclock

2023-10-10 Thread Maxim Levitsky
; + period = atoi_positive("The period (seconds)", optarg); > + break; > + case 'h': > + default: > + pr_info("usage: %s [-p period (seconds)]\n", argv[0]); > + exit(1); > + } > + } > + > + pr_info("Capture boottime wallclock every %d seconds.\n", period); > + pr_info("Stop with Ctrl + c.\n\n"); > + > + vm = vm_create_with_one_vcpu(&vcpu, guest_main); > + > + wc_gva = vm_vaddr_alloc(vm, getpagesize(), 0x1); > + wc_gpa = addr_gva2gpa(vm, wc_gva); > + vcpu_args_set(vcpu, 2, wc_gpa, wc_gva); > + > + enter_guest(vcpu); > + kvm_vm_free(vm); > +} Best regards, Maxim Levitsky

Re: [RFC PATCH v2 14/20] x86/kvm: Make kvm_async_pf_enabled __ro_after_init

2023-10-09 Thread Maxim Levitsky
ex 1cceac5984daa..319460090a836 100644 > --- a/arch/x86/kernel/kvm.c > +++ b/arch/x86/kernel/kvm.c > @@ -44,7 +44,7 @@ > #include > #include > > -DEFINE_STATIC_KEY_FALSE(kvm_async_pf_enabled); > +DEFINE_STATIC_KEY_FALSE_RO(kvm_async_pf_enabled); > > static int kvmapf = 1; > Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky