kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: "Chen, Zide" <zide.chen@intel.com>, <isaku.yamahata@intel.com>,
	<pbonzini@redhat.com>, <erdemaktas@google.com>,
	<vkuznets@redhat.com>, <seanjc@google.com>,
	<vannapurve@google.com>, <jmattson@google.com>,
	<mlevitsk@redhat.com>, <xiaoyao.li@intel.com>,
	<chao.gao@intel.com>, <rick.p.edgecombe@intel.com>
Cc: <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V5 4/4] KVM: selftests: Add test for configure of x86 APIC bus frequency
Date: Fri, 26 Apr 2024 16:26:23 -0700	[thread overview]
Message-ID: <12445519-efd9-42e9-a226-60cfa9d2a880@intel.com> (raw)
In-Reply-To: <f5a80896-e1aa-4f23-a739-5835f7430f78@intel.com>

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

  reply	other threads:[~2024-04-26 23:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25 22:06 [PATCH V5 0/4] KVM: x86: Make bus clock frequency for vAPIC timer configurable Reinette Chatre
2024-04-25 22:06 ` [PATCH V5 1/4] KVM: x86: hyper-v: Calculate APIC bus frequency for Hyper-V Reinette Chatre
2024-04-25 22:07 ` [PATCH V5 2/4] KVM: x86: Make nsec per APIC bus cycle a VM variable Reinette Chatre
2024-04-29  4:23   ` Xiaoyao Li
2024-04-25 22:07 ` [PATCH V5 3/4] KVM: x86: Add a capability to configure bus frequency for APIC timer Reinette Chatre
2024-04-28  6:24   ` Yuan Yao
2024-04-29  5:28   ` Xiaoyao Li
2024-04-25 22:07 ` [PATCH V5 4/4] KVM: selftests: Add test for configure of x86 APIC bus frequency Reinette Chatre
2024-04-26 23:06   ` Chen, Zide
2024-04-26 23:26     ` Reinette Chatre [this message]
2024-04-27  5:38       ` Chen, Zide
2024-04-29 15:23         ` Reinette Chatre

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=12445519-efd9-42e9-a226-60cfa9d2a880@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=chao.gao@intel.com \
    --cc=erdemaktas@google.com \
    --cc=isaku.yamahata@intel.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=vannapurve@google.com \
    --cc=vkuznets@redhat.com \
    --cc=xiaoyao.li@intel.com \
    --cc=zide.chen@intel.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;
as well as URLs for NNTP newsgroup(s).