From: alex.bennee@linaro.org (Alex Bennée)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs
Date: Fri, 01 Aug 2014 10:11:52 +0100 [thread overview]
Message-ID: <87fvhgin6s.fsf@linaro.org> (raw)
In-Reply-To: <20140731163805.GK11610@cbox>
Christoffer Dall writes:
> On Thu, Jul 31, 2014 at 04:14:51PM +0100, Alex Benn?e wrote:
>>
>> Christoffer Dall writes:
>>
>> > On Wed, Jul 09, 2014 at 02:55:12PM +0100, Alex Benn?e wrote:
>> >> To cleanly restore an SMP VM we need to ensure that the current pause
>> >> state of each vcpu is correctly recorded. Things could get confused if
>> >> the CPU starts running after migration restore completes when it was
>> >> paused before it state was captured.
>> >>
>> <snip>
>> >> +/* Power state (PSCI), not real registers */
>> >> +#define KVM_REG_ARM_PSCI (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
>> >> +#define KVM_REG_ARM_PSCI_REG(n) \
>> >> + (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | KVM_REG_ARM_PSCI | \
>> >> + (n & ~KVM_REG_ARM_COPROC_MASK))
>> >
>> > I don't understand this mask, why isn't this
>> > (n & 0xffff))
>>
>> I was trying to use the existing masks, but of course if anyone changes
>> that it would be an ABI change so probably not worth it.
>>
>
> the KVM_REG_ARM_COPROC_MASK is part of the uapi IIRC, so that's not the
> issue, but that mask doesn't cover all the upper bits, so it feels weird
> to use that to me.
Yeah I missed that. I could do a:
#define KVM_REG_ARM_COPROC_INDEX_MASK ((1<<KVM_REG_ARM_COPROC_SHIFT)-1)
and use that. I'm generally try to avoid hardcoded numbers but I could
be being a little OCD here ;-)
>> > Can you add the 32-bit counterpart as part of this patch?
>>
>> Same patch? Sure.
>
> really up to you if you want to split it up into two patches, but I
> think it's small enough that you can just create one patch.
Given the similarity of this code between arm and arm64 I'm wondering if
it's worth doing a arch/arm/kvm/guest_common.c or something to reduce
the amount of copy paste stuff?
--
Alex Benn?e
WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org,
Marc Zyngier <marc.zyngier@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>, Gleb Natapov <gleb@kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs
Date: Fri, 01 Aug 2014 10:11:52 +0100 [thread overview]
Message-ID: <87fvhgin6s.fsf@linaro.org> (raw)
In-Reply-To: <20140731163805.GK11610@cbox>
Christoffer Dall writes:
> On Thu, Jul 31, 2014 at 04:14:51PM +0100, Alex Bennée wrote:
>>
>> Christoffer Dall writes:
>>
>> > On Wed, Jul 09, 2014 at 02:55:12PM +0100, Alex Bennée wrote:
>> >> To cleanly restore an SMP VM we need to ensure that the current pause
>> >> state of each vcpu is correctly recorded. Things could get confused if
>> >> the CPU starts running after migration restore completes when it was
>> >> paused before it state was captured.
>> >>
>> <snip>
>> >> +/* Power state (PSCI), not real registers */
>> >> +#define KVM_REG_ARM_PSCI (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
>> >> +#define KVM_REG_ARM_PSCI_REG(n) \
>> >> + (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | KVM_REG_ARM_PSCI | \
>> >> + (n & ~KVM_REG_ARM_COPROC_MASK))
>> >
>> > I don't understand this mask, why isn't this
>> > (n & 0xffff))
>>
>> I was trying to use the existing masks, but of course if anyone changes
>> that it would be an ABI change so probably not worth it.
>>
>
> the KVM_REG_ARM_COPROC_MASK is part of the uapi IIRC, so that's not the
> issue, but that mask doesn't cover all the upper bits, so it feels weird
> to use that to me.
Yeah I missed that. I could do a:
#define KVM_REG_ARM_COPROC_INDEX_MASK ((1<<KVM_REG_ARM_COPROC_SHIFT)-1)
and use that. I'm generally try to avoid hardcoded numbers but I could
be being a little OCD here ;-)
>> > Can you add the 32-bit counterpart as part of this patch?
>>
>> Same patch? Sure.
>
> really up to you if you want to split it up into two patches, but I
> think it's small enough that you can just create one patch.
Given the similarity of this code between arm and arm64 I'm wondering if
it's worth doing a arch/arm/kvm/guest_common.c or something to reduce
the amount of copy paste stuff?
--
Alex Bennée
next prev parent reply other threads:[~2014-08-01 9:11 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 13:55 [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs Alex Bennée
2014-07-09 13:55 ` Alex Bennée
2014-07-31 14:35 ` Christoffer Dall
2014-07-31 14:35 ` Christoffer Dall
2014-07-31 15:14 ` Alex Bennée
2014-07-31 15:14 ` Alex Bennée
2014-07-31 16:38 ` Christoffer Dall
2014-07-31 16:38 ` Christoffer Dall
2014-07-31 16:45 ` Peter Maydell
2014-07-31 16:45 ` Peter Maydell
2014-07-31 16:50 ` Christoffer Dall
2014-07-31 16:50 ` Christoffer Dall
2014-07-31 16:53 ` Peter Maydell
2014-07-31 16:53 ` Peter Maydell
2014-08-01 9:48 ` Alex Bennée
2014-08-01 9:48 ` Alex Bennée
2014-08-04 12:11 ` Christoffer Dall
2014-08-04 12:11 ` Christoffer Dall
2014-08-01 9:11 ` Alex Bennée [this message]
2014-08-01 9:11 ` Alex Bennée
2014-08-04 12:13 ` Christoffer Dall
2014-08-04 12:13 ` Christoffer Dall
2014-07-31 16:57 ` Paolo Bonzini
2014-07-31 16:57 ` Paolo Bonzini
2014-07-31 17:04 ` Peter Maydell
2014-07-31 17:04 ` Peter Maydell
2014-07-31 17:21 ` Paolo Bonzini
2014-07-31 17:21 ` Paolo Bonzini
2014-07-31 17:36 ` Peter Maydell
2014-07-31 17:36 ` Peter Maydell
2014-07-31 17:44 ` Will Deacon
2014-07-31 17:44 ` Will Deacon
2014-08-04 12:16 ` Christoffer Dall
2014-08-04 12:16 ` Christoffer Dall
2014-08-04 12:35 ` Alex Bennée
2014-08-04 12:35 ` Alex Bennée
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=87fvhgin6s.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.