From: "Mian M. Hamayun" <m.hamayun@virtualopensystems.com>
To: Alexander Graf <agraf@suse.de>
Cc: tech@virtualopensystems.com, qemu-devel@nongnu.org,
kvmarm@lists.cs.columbia.edu
Subject: Re: [Qemu-devel] [PATCH 3/6] Added Aarch64 CPU Initialization, Get and Put Registers Support.
Date: Sat, 29 Jun 2013 19:48:06 +0200 [thread overview]
Message-ID: <51CF1DD6.9060809@virtualopensystems.com> (raw)
In-Reply-To: <E0DBFCC4-5DFF-45A5-AAD4-A2A8AEF25C96@suse.de>
On 06/28/2013 02:43 PM, Alexander Graf wrote:
> On 28.06.2013, at 14:11, Mian M. Hamayun wrote:
>
>> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
>> index c614070..4df5292 100644
>> --- a/linux-headers/linux/kvm.h
>> +++ b/linux-headers/linux/kvm.h
>> @@ -783,6 +783,7 @@ struct kvm_dirty_tlb {
>> #define KVM_REG_IA64 0x3000000000000000ULL
>> #define KVM_REG_ARM 0x4000000000000000ULL
>> #define KVM_REG_S390 0x5000000000000000ULL
>> +#define KVM_REG_ARM64 0x6000000000000000ULL
>>
>> #define KVM_REG_SIZE_SHIFT 52
>> #define KVM_REG_SIZE_MASK 0x00f0000000000000ULL
> This should be part of your header update patch.
Just to make sure that we understand it correctly, do you mean that this
macro definition should be moved to the arm64 specific header that we
include in another patch series ? or keep this change in the same file
and do it along with the header inclusion in a single patch ?
>> +#ifdef TARGET_AARCH64
>> +int kvm_arch_init_vcpu(CPUState *cs)
>> +{
>> + struct kvm_vcpu_init init;
>> + int ret;
>> +
>> + /* Try initializing with Foundation Models */
>> + init.target = KVM_ARM_TARGET_FOUNDATION_V8;
>> + memset(init.features, 0, sizeof(init.features));
>> + ret = kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init);
>> + if (ret) {
>> + /* Retry initializing with Fast Models */
>> + init.target = KVM_ARM_TARGET_AEM_V8;
>> + ret = kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init);
> Not sure I understand this part. Do we have different CPU types for the different models? If so, they'd be different -cpu parameters, with -cpu host picking the same as the host's.
KVM tool does a very similar thing, using a loop and tries to initialize
supported processors types and gets done when it succeeds with anyone of
them. We could include a similar implementation in the next revision.
>> +{
>> + struct kvm_one_reg reg;
>> + int i;
>> + int ret;
>> +
>> + ARMCPU *cpu = ARM_CPU(cs);
>> + CPUARMState *env = &cpu->env;
>> +
>> + for (i = 0; i < 31; i++) {
> s/31/ARRAY_SIZE(...)/
Agreed, we should avoid hard-coding as much as possible.
>> + reg.id = AARCH64_CORE_REG(regs.regs[i]);
>> + reg.addr = (uintptr_t)(env) + offsetof(CPUARMState, xregs[i]);
> reg.addr = (uintptr_t)&env->xregs[i];
Our implementation was influenced by the existing
kvm_arch_get_registers() implementation for the A15 CPU, with slight
differences. Anyways, we will include the proposed change in the next
revision.
--
Hamayun
next prev parent reply other threads:[~2013-06-29 17:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 12:11 [Qemu-devel] [PATCH 1/6] Added aarch64 configure support and default configuration Mian M. Hamayun
2013-06-28 12:11 ` [Qemu-devel] [PATCH 2/6] Added KVM Headers from KVM Tool Mian M. Hamayun
2013-06-28 12:11 ` [Qemu-devel] [PATCH 3/6] Added Aarch64 CPU Initialization, Get and Put Registers Support Mian M. Hamayun
2013-06-28 12:43 ` Alexander Graf
2013-06-29 17:48 ` Mian M. Hamayun [this message]
2013-06-29 18:05 ` Alexander Graf
2013-06-29 19:17 ` Peter Maydell
2013-07-01 17:54 ` Alexander Spyridakis
2013-06-28 12:11 ` [Qemu-devel] [PATCH 4/6] Added the Versatile Express Machine Model for A57 Mian M. Hamayun
2013-06-29 19:21 ` Peter Maydell
2013-07-01 18:06 ` Alexander Spyridakis
2013-07-01 19:08 ` Peter Maydell
2013-06-28 12:11 ` [Qemu-devel] [PATCH 5/6] Added Boot Support for Aarch64 Processor Mian M. Hamayun
2013-06-28 12:11 ` [Qemu-devel] [PATCH 6/6] Added SMP for Aarch64 Processors Mian M. Hamayun
2013-06-29 19:24 ` Peter Maydell
2013-07-01 18:18 ` Alexander Spyridakis
2013-06-29 19:20 ` [Qemu-devel] [PATCH 1/6] Added aarch64 configure support and default configuration Peter Maydell
2013-07-01 18:46 ` Alexander Spyridakis
2013-07-01 19:22 ` Peter Maydell
2013-07-01 19:24 ` Peter Maydell
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=51CF1DD6.9060809@virtualopensystems.com \
--to=m.hamayun@virtualopensystems.com \
--cc=agraf@suse.de \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=qemu-devel@nongnu.org \
--cc=tech@virtualopensystems.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).