qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 7/7] target-arm: Hacky implementation of kvm


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC PATCH 7/7] target-arm: Hacky implementation of kvm_arch_reset_vcpu() for KVM ARM64
Date: Thu, 27 Feb 2014 11:26:24 +0000

On 27 February 2014 10:35, Pranavkumar Sawargaonkar
<address@hidden> wrote:
> Hi Peter,
>
> On 27 February 2014 15:23, Peter Maydell <address@hidden> wrote:
>> On 27 February 2014 06:51, Pranavkumar Sawargaonkar
>> <address@hidden> wrote:
>>> We need to "Feed the kernel back its initial register state" using KVM
>>> ioctls for KVM ARM64 (just like KVM ARM). This means we need to save
>>> the "initial register state" in kvm_arch_init_vcpu() which is not the
>>> case for KVM ARM64 right now. In simpler work, we are depended upon
>>> VCPU register init/save/restore for implementing kvm_arch_reset_vcpu().
>>>
>>> This patch adds a hacky implementation of kvm_arch_reset_vcpu() which
>>> only works for "mach-virt". As-per this hacky implemenation, we re-init
>>> the VCPU using kvm_arch_init_vcpu() so that all registers of VCPU are
>>> set to their reset values by in-kernel KVM code.
>>
>> Re-initing the VCPU is actually the right way to do this -- it is feeding
>> all the register state back to KVM that is the hack. (One day I may
>> fix 32 bit ARM to re-init the VCPU).
>>
>
> Ok, I mentioned this a hack since it is different from arm32 way.
> I will update patch comment and description accordingly.
>
>> Why does this only work for mach-virt?
>
> Due to re-init pc becomes zero which is fine for mach-virt but
> may not work for some other machine type.

That is the correct reset value for the CPU (assuming
no hivecs); it should be fine for everything. (Supporting
a CPU with hivecs enabled from reset would probably
require an extra VCPU_INIT feature flag, but it would only
be relevant for AArch32 anyway and we can deal with that
if we ever have a board that actually needs it.)

> This brings me back to the question that are we going to
> allow any other machine type with KVM ARM/ARM64 ?

Of course. For 32 bit KVM/ARM we already support vexpress-a15
and I see no reason why midway or any other implemented A15
board should not work too. For 64-bit we happen not to have
any board models other than virt, but if anybody contributes
one it should also work just fine with KVM.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]