Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Oliver Upton <oliver.upton@linux.dev>
To: Fuad Tabba <tabba@google.com>
Cc: kvmarm@lists.linux.dev, maz@kernel.org, catalin.marinas@arm.com,
	joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com,
	will@kernel.org
Subject: Re: [PATCH v1 4/4] KVM: arm64: Initialize trap register values in hyp in pKVM
Date: Tue, 15 Oct 2024 00:57:06 -0700	[thread overview]
Message-ID: <Zw4gUsF-j8H-x2CZ@linux.dev> (raw)
In-Reply-To: <20241014102413.4092725-5-tabba@google.com>

On Mon, Oct 14, 2024 at 11:24:12AM +0100, Fuad Tabba wrote:
> Handle the initialization of trap registers at the hypervisor in
> pKVM, even for non-protected guests. The host is not trusted with
> the values of the trap registers, regardless of the VM type.
> Therefore, when switching between the host and the guests, only
> flush the required bits of the trap registers from the host's
> view that are required for hyp-host communication.

It'd be a bit more precise to just mention that the host is allowed to
configure TWI and TWE still for opportunistic scheduling, as neither
affects the protection of VMs or the hypervisor.

>  	pvm_init_trap_regs(vcpu);
>  	pvm_init_traps_aa64pfr0(vcpu);
>  	pvm_init_traps_aa64pfr1(vcpu);

aside: it'd be great to reorganize all of these traps in terms of the
affected trap register and not the feature register.

But that can happen later.

-- 
Thanks,
Oliver

  reply	other threads:[~2024-10-15  7:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 10:24 [PATCH v1 0/4] KVM: arm64: Fix initialization of trap register values in pKVM Fuad Tabba
2024-10-14 10:24 ` [PATCH v1 1/4] KVM: arm64: Move pkvm_vcpu_init_traps() to init_pkvm_hyp_vcpu() Fuad Tabba
2024-10-15  7:37   ` Oliver Upton
2024-10-15  8:22     ` Fuad Tabba
2024-10-15  8:30       ` Oliver Upton
2024-10-15  9:35         ` Fuad Tabba
2024-10-14 10:24 ` [PATCH v1 2/4] KVM: arm64: Refactor kvm_vcpu_enable_ptrauth() for hyp use Fuad Tabba
2024-10-14 10:24 ` [PATCH v1 3/4] KVM: arm64: Initialize the hypervisor's VM state at EL2 Fuad Tabba
2024-10-14 10:24 ` [PATCH v1 4/4] KVM: arm64: Initialize trap register values in hyp in pKVM Fuad Tabba
2024-10-15  7:57   ` Oliver Upton [this message]
2024-10-15  8:19     ` Fuad Tabba
2024-10-15  8:22       ` Oliver Upton

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=Zw4gUsF-j8H-x2CZ@linux.dev \
    --to=oliver.upton@linux.dev \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tabba@google.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