From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] ARM/KVM: save and restore generic timer registers
Date: Thu, 12 Dec 2013 11:24:13 -0800 [thread overview]
Message-ID: <20131212192413.GQ2871@cbox> (raw)
In-Reply-To: <52A9EF38.3000909@arm.com>
On Thu, Dec 12, 2013 at 05:15:36PM +0000, Marc Zyngier wrote:
> On 12/12/13 11:36, Peter Maydell wrote:
> > On 12 December 2013 09:32, Andre Przywara <andre.przywara@linaro.org> wrote:
> >> On 12/12/2013 10:23 AM, Peter Maydell wrote:
> >>> What does it mean to say that a system register for AArch64
> >>> is "32 bits" given that MRS/MSR always operate on a 64 bit
> >>> register?
> >
> >> But ARMv8 ARM still defines these registers as 32-bit:
> >> D8.5.14: CNTV_CTL_EL0
> >> Attributes
> >> CNTV_CTL_EL0 is a 32-bit register.
> >> But indeed the MSR/MRS instruction references a Xt register, and the
> >> documentation does not seem to tell how this is handled, so I assume this is
> >> zero-extended.
> >
> > I checked, and for AArch64 registers, "32 bits" is just
> > a shorthand for "64 bit register where the top 32 bits are
> > RAZ/WI" (and I suspect it's not totally impossible that some
> > future architecture revision might define new bits in the
> > top half).
>
> Indeed. Actually, there isn't an instruction to access these 32bit
> registers with a 'W' register. You really have to use a 'X'.
>
> > So I would suggest that we should make the KVM user<->kernel
> > interface just consistently make all the sysregs 64 bit.
> >
> > (There is actually precedent of a sort here in that the
> > kernel claims the PSTATE register is 64 bits wide despite
> > it really being a 32 bit SPSR format value under the hood.)
>
> I definitely agree with Peter here. I'd like to keep the ABI 64bit for
> the sysregs. It makes the whole thing much nicer.
>
OK, makes perfect sense, so we just need to change the patch to export
the system registers as 64 bit in size, and then actually export them on
arm64.
-Christoffer
prev parent reply other threads:[~2013-12-12 19:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-10 10:50 [PATCH v4] ARM/KVM: save and restore generic timer registers Andre Przywara
2013-12-10 10:55 ` Andre Przywara
2013-12-12 2:28 ` Christoffer Dall
2013-12-12 9:23 ` Peter Maydell
2013-12-12 9:32 ` Andre Przywara
2013-12-12 11:36 ` Peter Maydell
2013-12-12 17:15 ` Marc Zyngier
2013-12-12 19:24 ` Christoffer Dall [this message]
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=20131212192413.GQ2871@cbox \
--to=christoffer.dall@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 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).