From: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Anup Patel <anup.patel@linaro.org>,
patches@apm.com, QEMU Developers <qemu-devel@nongnu.org>,
Christoffer Dall <christoffer.dall@linaro.org>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [Qemu-devel] [RFC PATCH V2 4/6] target-arm: Implement kvm_arch_reset_vcpu() for KVM ARM64
Date: Wed, 2 Apr 2014 10:22:20 +0530 [thread overview]
Message-ID: <CAAHg+HhyJePtNcP2Y24bn3XcCvXc9R3OQgumdKfr4GgSD6GmnQ@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA82zS-4k=oYFq6KmxivFMDmVH7zu8AkeczHyJp=SWOyOw@mail.gmail.com>
On 1 April 2014 17:43, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 1 April 2014 12:53, Pranavkumar Sawargaonkar <pranavkumar@linaro.org> wrote:
>> To implement kvm_arch_reset_vcpu(), we simply 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.
>>
>> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
>> Signed-off-by: Anup Patel <anup.patel@linaro.org>
>> ---
>> target-arm/kvm64.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c
>> index 02bba45..97defa3 100644
>> --- a/target-arm/kvm64.c
>> +++ b/target-arm/kvm64.c
>> @@ -204,4 +204,8 @@ int kvm_arch_get_registers(CPUState *cs)
>>
>> void kvm_arch_reset_vcpu(CPUState *cs)
>> {
>> + /* Re-init VCPU so that all registers are set to their
>> + * respective reset values.
>> + */
>> + kvm_arch_init_vcpu(cs);
>> }
>
> Calling kvm_arch_init_vcpu() will end up doing more
> work than we really need, because it will end up filling
> in the cpreg tuple list [code not yet present for 64 bit
> but you can see from the 32 bit kvm_arch_init_vcpu()
> what it will look like]. So we should have a QEMU function
> for doing the vcpu init.
>
> I think I would suggest adding a uint32_t kvm_target_features
> to ARMCPU (under kvm_target). Then kvm_arch_init_vcpu and
> kvm_arch_reset_vcpu can both call a small function which
> does
>
> int kvm_arm_reinit_vcpu(CPUState *cs)
> {
> struct kvm_vcpu_init init;
>
> init.target = cpu->kvm_target;
> memset(init.features, 0, sizeof(init.features));
> init.features[0] = cpu->kvm_target_features;
> return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init);
> }
>
> (put that in target-arm/kvm.c, prototype in target-arm/kvm_arm.h,
> needs a proper doc comment in the .h file.)
Sure I will update this as per your suggestion.
>
> thanks
> -- PMM
Thanks,
Pranav
next prev parent reply other threads:[~2014-04-02 4:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 11:53 [Qemu-devel] [RFC PATCH V2 0/6] PSCI v0.2 support for KVM ARM/ARM64 Pranavkumar Sawargaonkar
2014-04-01 11:53 ` [Qemu-devel] [RFC PATCH V2 1/6] linux-headers: Update KVM headers from v3.14 Pranavkumar Sawargaonkar
2014-04-01 11:53 ` [Qemu-devel] [RFC PATCH V2 2/6] kvm: Handle exit reason KVM_EXIT_SYSTEM_EVENT Pranavkumar Sawargaonkar
2014-04-01 11:53 ` [Qemu-devel] [RFC PATCH V2 3/6] target-arm: Enable KVM_ARM_VCPU_PSCI_0_2 feature when possible Pranavkumar Sawargaonkar
2014-04-01 12:16 ` Peter Maydell
2014-04-02 4:51 ` Pranavkumar Sawargaonkar
2014-04-01 11:53 ` [Qemu-devel] [RFC PATCH V2 4/6] target-arm: Implement kvm_arch_reset_vcpu() for KVM ARM64 Pranavkumar Sawargaonkar
2014-04-01 12:13 ` Peter Maydell
2014-04-02 4:52 ` Pranavkumar Sawargaonkar [this message]
2014-04-01 11:53 ` [Qemu-devel] [RFC PATCH V2 5/6] target-arm: Provide PSCI v0.2 constants to generic QEMU code Pranavkumar Sawargaonkar
2014-04-01 11:53 ` [Qemu-devel] [RFC PATCH V2 6/6] hw/arm/virt: Use PSCI v0.2 function IDs when kernel supports its Pranavkumar Sawargaonkar
2014-04-01 12:00 ` Pranavkumar Sawargaonkar
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=CAAHg+HhyJePtNcP2Y24bn3XcCvXc9R3OQgumdKfr4GgSD6GmnQ@mail.gmail.com \
--to=pranavkumar@linaro.org \
--cc=anup.patel@linaro.org \
--cc=christoffer.dall@linaro.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=patches@apm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).