kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>,
	James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Joey Gouly <joey.gouly@arm.com>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev
Subject: Re: [PATCH v2 2/2] KVM: arm64: Move FGT value configuration to vCPU state
Date: Thu, 23 Mar 2023 22:08:44 +0000	[thread overview]
Message-ID: <4f6a5565-af40-4bde-8aaf-5470e9562b0e@sirena.org.uk> (raw)
In-Reply-To: <865yarxnwv.wl-maz@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]

On Thu, Mar 23, 2023 at 07:34:08PM +0000, Marc Zyngier wrote:
> Mark Brown <broonie@kernel.org> wrote:

> > +++ b/arch/arm64/include/asm/kvm_host.h
> > @@ -365,6 +365,8 @@ enum vcpu_sysreg {
> >  	TPIDR_EL2,	/* EL2 Software Thread ID Register */
> >  	CNTHCTL_EL2,	/* Counter-timer Hypervisor Control register */
> >  	SP_EL2,		/* EL2 Stack Pointer */
> > +	HFGRTR_EL2,	/* Fine Grained Read Traps */
> > +	HFGWTR_EL2,	/* Fine Grained Write Traps */

> No, this is the wrong spot. These registers describe the *guest*
> state. Not the state that KVM sets for its own use. These registers
> would be used by a guest hypervisor to manage traps it uses for its
> own guests.

Ah, sorry, I misinterpreted what you meant when you said to put them in
kvm_vcpu_context - the sys_regs array in there seemed to be the place
where data for sysregs is stored.  The large set of EL2 registers in
there already stopped alarm bells going off, as did the fact that with
the patch above we were loading a copy from there for the guest.

To clarify, place just regular member variables in kvm_vcpu_context then
save host state to the percpu host context (I guess while activating
traps) and load the guest state from vcpu->arch.ctxt.hfgxtr_el2?  I've
got that testing locally just now.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-03-23 22:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 15:48 [PATCH v2 0/2] KVM: arm64: Support for per-guest fine grained traps configuration Mark Brown
2023-03-23 15:48 ` [PATCH v2 1/2] arm64: Add feature detection for fine grained traps Mark Brown
2023-03-23 15:48 ` [PATCH v2 2/2] KVM: arm64: Move FGT value configuration to vCPU state Mark Brown
2023-03-23 19:34   ` Marc Zyngier
2023-03-23 22:08     ` Mark Brown [this message]
2023-03-28 15:27   ` Will Deacon
2023-03-28 15:44     ` Mark Brown

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=4f6a5565-af40-4bde-8aaf-5470e9562b0e@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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).