lkml.org 
[lkml]   [2024]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    SubjectRe: [PATCH V5 4/4] KVM: selftests: Add test for configure of x86 APIC bus frequency
    From
    Hi Zide,

    On 4/26/2024 4:06 PM, Chen, Zide wrote:
    >
    >
    > On 4/25/2024 3:07 PM, Reinette Chatre wrote:
    >> diff --git a/tools/testing/selftests/kvm/x86_64/apic_bus_clock_test.c b/tools/testing/selftests/kvm/x86_64/apic_bus_clock_test.c
    >> new file mode 100644
    >> index 000000000000..5100b28228af
    >> --- /dev/null
    >> +++ b/tools/testing/selftests/kvm/x86_64/apic_bus_clock_test.c
    >> @@ -0,0 +1,166 @@
    >> +// SPDX-License-Identifier: GPL-2.0-only
    >> +/*
    >> + * Test configure of APIC bus frequency.
    >> + *
    >> + * Copyright (c) 2024 Intel Corporation
    >> + *
    >> + * To verify if the APIC bus frequency can be configured this test starts
    >
    > Nit: some typos here?

    Apologies but this is not obvious to me. Could you please help
    by pointing out all those typos to me?

    >
    >> +int main(int argc, char *argv[])
    >> +{
    >> + struct kvm_vcpu *vcpu;
    >> + struct kvm_vm *vm;
    >> +
    >> + TEST_REQUIRE(kvm_has_cap(KVM_CAP_X86_APIC_BUS_CYCLES_NS));
    >> +
    >> + vm = __vm_create(VM_SHAPE_DEFAULT, 1, 0);
    >
    > Use vm_create() instead?

    Sure. This is easier on the eye while generating exactly the same code.

    diff --git a/tools/testing/selftests/kvm/x86_64/apic_bus_clock_test.c b/tools/testing/selftests/kvm/x86_64/apic_bus_clock_test.c
    index 5100b28228af..6ed253875971 100644
    --- a/tools/testing/selftests/kvm/x86_64/apic_bus_clock_test.c
    +++ b/tools/testing/selftests/kvm/x86_64/apic_bus_clock_test.c
    @@ -149,7 +149,7 @@ int main(int argc, char *argv[])

    TEST_REQUIRE(kvm_has_cap(KVM_CAP_X86_APIC_BUS_CYCLES_NS));

    - vm = __vm_create(VM_SHAPE_DEFAULT, 1, 0);
    + vm = vm_create(1);
    vm_ioctl(vm, KVM_SET_TSC_KHZ, (void *)(TSC_HZ / 1000));
    /*
    * KVM_CAP_X86_APIC_BUS_CYCLES_NS expects APIC bus clock rate in

    Reinette

    \
     
     \ /
      Last update: 2024-04-27 01:26    [W:3.611 / U:0.204 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site