Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Fuad Tabba <tabba@google.com>
Cc: kvmarm@lists.linux.dev, oliver.upton@linux.dev,
	catalin.marinas@arm.com, james.morse@arm.com,
	suzuki.poulose@arm.com, yuzenghui@huawei.com, will@kernel.org
Subject: Re: [PATCH v2 0/7] Fix setting SVE and SME traps in (h)VHE
Date: Fri, 21 Jul 2023 14:41:51 +0100	[thread overview]
Message-ID: <86o7k5tm8w.wl-maz@kernel.org> (raw)
In-Reply-To: <20230721095144.306817-1-tabba@google.com>

Hey Fuad,

On Fri, 21 Jul 2023 10:51:37 +0100,
Fuad Tabba <tabba@google.com> wrote:
> 
> Hi,
> 
> Changes from V1:
> - Expanded the cover letter to clarify the reasoning behind being
> consistent in writing to the architectural trap register based on
> the KVM mode (Marc)
> - Factored out the code for checking E2H into a macro (Oliver)
> - Factored out the code that selects which register to write to
> into a function (Oliver)
> 
> The (re)setting and disabling of SVE/SME trap handling (mostly)
> done for the hVHE work [*] misses a couple of cases.
> 
> This patch series ensures that these traps are disabled on setup
> and reset. Moreover, it makes the code consistent in using
> CPACR_EL1 or CPTR_EL2, depending on the mode.
> 
> CPACR_EL1 aliases to CPTR_EL2 when HCR_EL2.E2H == 1, but by being
> consistent we don't need to issue a synchronisation when
> alternating between one or the other accessor. Moreover, when
> running hVHE under NV, we don't trap unnecessarily on accessing
> CPTR_EL2, while CPACR_EL1 can be used directly without any trap.
> 
> Based on Linux 6.5-rc2.
> 
> Cheers,
> /fuad
> 
> [*] https://lore.kernel.org/all/20230609162200.2024064-1-maz@kernel.org/
> 
> Fuad Tabba (7):
>   KVM: arm64: Factor out code for checking E2H into a macro
>   KVM: arm64: Use the appropriate feature trap register for SVE at EL2
>     setup
>   KVM: arm64: Disable SME traps for (h)VHE at setup
>   KVM: arm64: Helper to write to appropriate feature trap register based
>     on mode
>   KVM: arm64: Use the appropriate feature trap register when activating
>     traps
>   KVM: arm64: Fix resetting SVE trap values on reset for hVHE
>   KVM: arm64: Fix resetting SME trap values on reset for (h)VHE
> 
>  arch/arm64/include/asm/el2_setup.h   | 44 ++++++++++++++++++----------
>  arch/arm64/include/asm/kvm_emulate.h | 21 ++++++++++---
>  arch/arm64/kvm/hyp/nvhe/switch.c     |  2 +-
>  3 files changed, 47 insertions(+), 20 deletions(-)

Thanks again for fixing this, and going the extra mile on the cleanup
front. FWIW,

Reviewed-by: Marc Zyngier <maz@kernel.org>

	     M.

-- 
Without deviation from the norm, progress is not possible.

      parent reply	other threads:[~2023-07-21 13:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21  9:51 [PATCH v2 0/7] Fix setting SVE and SME traps in (h)VHE Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 1/7] KVM: arm64: Factor out code for checking E2H into a macro Fuad Tabba
2023-07-21 21:21   ` Oliver Upton
2023-07-22 11:20     ` Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 2/7] KVM: arm64: Use the appropriate feature trap register for SVE at EL2 setup Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 3/7] KVM: arm64: Disable SME traps for (h)VHE at setup Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 4/7] KVM: arm64: Helper to write to appropriate feature trap register based on mode Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 5/7] KVM: arm64: Use the appropriate feature trap register when activating traps Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 6/7] KVM: arm64: Fix resetting SVE trap values on reset for hVHE Fuad Tabba
2023-07-21  9:51 ` [PATCH v2 7/7] KVM: arm64: Fix resetting SME trap values on reset for (h)VHE Fuad Tabba
2023-07-21 13:41 ` Marc Zyngier [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=86o7k5tm8w.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=oliver.upton@linux.dev \
    --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