From: Anup Patel <anup.patel@linaro.org>
To: Will Deacon <will.deacon@arm.com>
Cc: "kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"patches@apm.com" <patches@apm.com>,
Marc Zyngier <Marc.Zyngier@arm.com>,
"penberg@kernel.org" <penberg@kernel.org>,
"christoffer.dall@linaro.org" <christoffer.dall@linaro.org>,
"pranavkumar@linaro.org" <pranavkumar@linaro.org>
Subject: Re: [PATCH 1/5] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu
Date: Thu, 7 Aug 2014 14:14:37 +0530 [thread overview]
Message-ID: <CALrVBkvihECTzE4beNGR++DNd5TPm3iv5D4EDofkFufB-8GjWw@mail.gmail.com> (raw)
In-Reply-To: <20140806124821.GM25953@arm.com>
On 6 August 2014 18:18, Will Deacon <will.deacon@arm.com> wrote:
> On Tue, Aug 05, 2014 at 09:49:55AM +0100, Anup Patel wrote:
>> Instead, of trying out each and every target type we should use
>> KVM_ARM_PREFERRED_TARGET vm ioctl to determine target type
>> for KVM ARM/ARM64.
>>
>> We bail-out target type returned by KVM_ARM_PREFERRED_TARGET vm ioctl
>> is not known to kvmtool.
>
> -ENOPARSE
OK, I will fix the wordings here.
>
>> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
>> Signed-off-by: Anup Patel <anup.patel@linaro.org>
>> ---
>> tools/kvm/arm/kvm-cpu.c | 21 ++++++++++++++++-----
>> 1 file changed, 16 insertions(+), 5 deletions(-)
>>
>> diff --git a/tools/kvm/arm/kvm-cpu.c b/tools/kvm/arm/kvm-cpu.c
>> index aeaa4cf..7478f8f 100644
>> --- a/tools/kvm/arm/kvm-cpu.c
>> +++ b/tools/kvm/arm/kvm-cpu.c
>> @@ -34,6 +34,7 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
>> struct kvm_cpu *vcpu;
>> int coalesced_offset, mmap_size, err = -1;
>> unsigned int i;
>> + struct kvm_vcpu_init preferred_init;
>> struct kvm_vcpu_init vcpu_init = {
>> .features = ARM_VCPU_FEATURE_FLAGS(kvm, cpu_id)
>> };
>> @@ -46,6 +47,10 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
>> if (vcpu->vcpu_fd < 0)
>> die_perror("KVM_CREATE_VCPU ioctl");
>>
>> + err = ioctl(kvm->vm_fd, KVM_ARM_PREFERRED_TARGET, &preferred_init);
>> + if (err < 0)
>> + die_perror("KVM_ARM_PREFERRED_TARGET ioctl");
>
> Is this ioctl always available? If not, I don't like dying here as that
> could cause a regression under older hosts.
The KVM_ARM_PREFERRED_TARGET ioctl is available from 3.13 onwards.
I think we should first try KVM_ARM_PREFERRED_TARGET. If it fails then
we should fallback to old method of trying each and every target type.
What say?
--
Anup
>
> Will
next prev parent reply other threads:[~2014-08-07 8:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-05 8:49 [PATCH 0/5] kvmtool: ARM/ARM64: Misc updates Anup Patel
2014-08-05 8:49 ` [PATCH 1/5] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu Anup Patel
2014-08-06 12:48 ` Will Deacon
2014-08-07 8:44 ` Anup Patel [this message]
2014-08-07 8:52 ` Peter Maydell
2014-08-05 8:49 ` [PATCH 2/5] kvmtool: ARM64: Fix compile error for aarch64 Anup Patel
2014-08-06 12:50 ` Will Deacon
2014-08-07 8:50 ` Anup Patel
2014-08-07 9:12 ` Will Deacon
2014-08-28 9:56 ` Pekka Enberg
2014-08-28 10:03 ` Will Deacon
2014-08-05 8:49 ` [PATCH 3/5] kvmtool: ARM64: Add target type potenza " Anup Patel
2014-08-06 12:52 ` Will Deacon
2014-08-07 8:56 ` Anup Patel
2014-08-07 9:01 ` Will Deacon
2014-08-05 8:49 ` [PATCH 4/5] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT Anup Patel
2014-08-06 12:53 ` Will Deacon
2014-08-07 8:57 ` Anup Patel
2014-08-05 8:49 ` [PATCH 5/5] kvmtool: ARM/ARM64: Provide PSCI-0.2 guest when in-kernel KVM supports it Anup Patel
2014-08-06 12:56 ` Will Deacon
2014-08-07 9:00 ` Anup Patel
2014-08-07 9:09 ` Will Deacon
2014-08-05 8:53 ` [PATCH 0/5] kvmtool: ARM/ARM64: Misc updates Anup Patel
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=CALrVBkvihECTzE4beNGR++DNd5TPm3iv5D4EDofkFufB-8GjWw@mail.gmail.com \
--to=anup.patel@linaro.org \
--cc=Marc.Zyngier@arm.com \
--cc=christoffer.dall@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=patches@apm.com \
--cc=penberg@kernel.org \
--cc=pranavkumar@linaro.org \
--cc=will.deacon@arm.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).