Re: [PATCH V4] KVM: selftests: Add a new option to rseq_test

2024-05-02 Thread Chen, Zide
On 5/2/2024 10:40 AM, Sean Christopherson wrote: > On Mon, Apr 29, 2024, Zide Chen wrote: >> Currently, the migration worker delays 1-10 us, assuming that one >> KVM_RUN iteration only takes a few microseconds. But if the CPU low >> power wakeup latency is large enough, for example, hundreds or

Re: [PATCH v2 15/15] KVM: x86: Factor out kvm_use_master_clock()

2024-05-01 Thread Chen, Zide
On 4/27/2024 4:05 AM, David Woodhouse wrote: > From: David Woodhouse > > Both kvm_track_tsc_matching() and pvclock_update_vm_gtod_copy() make a > decision about whether the KVM clock should be in master clock mode. > > They use *different* criteria for the decision though. This isn't really >

Re: [PATCH V3] KVM: selftests: Add a new option to rseq_test

2024-04-29 Thread Chen, Zide
On 4/29/2024 12:39 PM, Sean Christopherson wrote: >> Signed-off-by: Zide Chen >> Signed-off-by: donsheng > > Why does this have Donghsheng's SoB? Is this a Co-developed-by situation? Yes, Co-developed-by is more suitable. >> > > Put per-patch notes that aren't intended for the final chang

Re: [PATCH 2/2] KVM: selftests: Add KVM/PV clock selftest to prove timer drift correction

2024-04-23 Thread Chen, Zide
On 4/23/2024 12:49 AM, David Woodhouse wrote: >> If I restored the KVM_REQ_GLOBAL_CLOCK_UPDATE request from >> kvm_arch_vcpu_load(), the selftest works for me, and I ran the test for >> 1000+ iterations, w/ or w/o TSC scaling, the TEST_ASSERT(delta_corrected >>  <= ±1) never got hit. This is awe

Re: [PATCH 2/2] KVM: selftests: Add KVM/PV clock selftest to prove timer drift correction

2024-04-22 Thread Chen, Zide
On 4/20/2024 9:03 AM, David Woodhouse wrote: > On Fri, 2024-04-19 at 16:54 -0700, Chen, Zide wrote: >> >> However, the selftest hangs: >> >> [Apr19 16:15] kselftest: Running tests in kvm >> [Apr19 16:16] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: &

Re: [PATCH 2/2] KVM: selftests: Add KVM/PV clock selftest to prove timer drift correction

2024-04-19 Thread Chen, Zide
On 4/19/2024 11:43 AM, David Woodhouse wrote: > On 19 April 2024 19:40:06 BST, David Woodhouse wrote: >> On 19 April 2024 18:13:16 BST, "Chen, Zide" wrote: >>> I'm wondering what's the underling theory that we definitely can achieve >>> ±1ns accu

Re: [PATCH 2/2] KVM: selftests: Add KVM/PV clock selftest to prove timer drift correction

2024-04-19 Thread Chen, Zide
On 4/19/2024 12:34 PM, David Woodhouse wrote: > On 19 April 2024 18:13:16 BST, "Chen, Zide" wrote: >> I'm wondering what's the underling theory that we definitely can achieve >> ±1ns accuracy? I tested it on a Sapphire Rapids @2100MHz TSC frequency, >&

Re: [PATCH 2/2] KVM: selftests: Add KVM/PV clock selftest to prove timer drift correction

2024-04-19 Thread Chen, Zide
On 4/8/2024 3:07 PM, Jack Allister wrote: > This test proves that there is an inherent KVM/PV clock drift away from the > guest TSC when KVM decides to update the PV time information structure due > to a KVM_REQ_MASTERCLOCK_UPDATE. This drift is exascerbated when a guest is > using TSC scaling a

Re: [PATCH V2] KVM: selftests: Take large C-state exit latency into consideration

2024-04-16 Thread Chen, Zide
On 4/15/2024 4:23 PM, Sean Christopherson wrote: > On Fri, Apr 12, 2024, Zide Chen wrote: >> Currently, the migration worker delays 1-10 us, assuming that one >> KVM_RUN iteration only takes a few microseconds. But if C-state exit >> latencies are large enough, for example, hundreds or even tho

Re: [PATCH] selftests/rseq: take large C-state exit latency into consideration

2024-04-12 Thread Chen, Zide
On 4/12/2024 11:52 AM, Sean Christopherson wrote: > On Fri, Apr 12, 2024, Zide Chen wrote: >> On 4/5/2024 4:01 PM, Sean Christopherson wrote: >>> On Fri, Mar 22, 2024, Zide Chen wrote: Currently, the migration worker delays 1-10 us, assuming that one KVM_RUN iteration only takes a few

Re: [PATCH] selftests/rseq: take large C-state exit latency into consideration

2024-04-12 Thread Chen, Zide
On 4/5/2024 4:01 PM, Sean Christopherson wrote: > On Fri, Mar 22, 2024, Zide Chen wrote: >> Currently, the migration worker delays 1-10 us, assuming that one >> KVM_RUN iteration only takes a few microseconds. But if C-state exit >> latencies are large enough, for example, hundreds or even thou

Re: [RFC PATCH v5 08/29] KVM: selftests: TDX: Add TDX lifecycle test

2024-03-22 Thread Chen, Zide
On 12/12/2023 12:46 PM, Sagi Shahar wrote: > From: Erdem Aktas > > Adding a test to verify TDX lifecycle by creating a TD and running a > dummy TDG.VP.VMCALL inside it. > > Signed-off-by: Erdem Aktas > Signed-off-by: Ryan Afranji > Signed-off-by: Sagi Shahar > Co-developed-by: Ackerley Tn

Re: [RFC PATCH v5 23/29] KVM: selftests: TDX: Add shared memory test

2024-03-15 Thread Chen, Zide
On 12/12/2023 12:47 PM, Sagi Shahar wrote: > > > -Original Message- > From: Sagi Shahar > Sent: Tuesday, December 12, 2023 12:47 PM > To: linux-kselftest@vger.kernel.org; Ackerley Tng ; > Afranji, Ryan ; Aktas, Erdem ; > Sagi Shahar ; Yamahata, Isaku > Cc: Sean Christopherson ; Pa

Re: [RFC PATCH v5 22/29] KVM: selftests: Add functions to allow mapping as shared

2024-03-15 Thread Chen, Zide
On 12/12/2023 12:47 PM, Sagi Shahar wrote: > > > -Original Message- > From: Sagi Shahar > Sent: Tuesday, December 12, 2023 12:47 PM > To: linux-kselftest@vger.kernel.org; Ackerley Tng ; > Afranji, Ryan ; Aktas, Erdem ; > Sagi Shahar ; Yamahata, Isaku > Cc: Sean Christopherson ; P

Re: [RFC PATCH v5 27/29] KVM: selftests: Propagate KVM_EXIT_MEMORY_FAULT to userspace

2024-03-14 Thread Chen, Zide
On 12/12/2023 12:47 PM, Shashar, Sagi wrote: > > > -Original Message- > From: Sagi Shahar > Sent: Tuesday, December 12, 2023 12:47 PM > To: linux-kselftest@vger.kernel.org; Ackerley Tng ; > Afranji, Ryan ; Aktas, Erdem ; > Sagi Shahar ; Yamahata, Isaku > Cc: Sean Christopherson ;