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,
james.morse@arm.com, suzuki.poulose@arm.com,
yuzenghui@huawei.com, will@kernel.org
Subject: Re: [PATCH v2 1/7] KVM: arm64: Factor out code for checking E2H into a macro
Date: Fri, 21 Jul 2023 21:21:20 +0000 [thread overview]
Message-ID: <ZLr20NXdQfXlxV9j@linux.dev> (raw)
In-Reply-To: <20230721095144.306817-2-tabba@google.com>
Hi Fuad,
On Fri, Jul 21, 2023 at 10:51:38AM +0100, Fuad Tabba wrote:
> The code for checking whether the kernel is in (h)VHE mode is
> repeated, and will be needed again in future patches. Factor it
> out in a macro.
>
> No functional change intended.
> No change in emitted assembly code intended.
>
> Signed-off-by: Fuad Tabba <tabba@google.com>
Looks good, one nitpick below:
> ---
> arch/arm64/include/asm/el2_setup.h | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h
> index 8e5ffb58f83e..383f6be66ed6 100644
> --- a/arch/arm64/include/asm/el2_setup.h
> +++ b/arch/arm64/include/asm/el2_setup.h
> @@ -31,6 +31,13 @@
> .Lskip_hcrx_\@:
> .endm
>
> +/* Check if running in host at EL2 mode, i.e., (h)VHE. Jumps to fail if not. */
> +.macro __check_e2h fail, tmp
> + mrs \tmp, hcr_el2
> + and \tmp, \tmp, #HCR_E2H
> + cbz \tmp, \fail
> +.endm
> +
I was really hoping for the macro to have hVHE somewhere in the name,
since it may not be immediately obvious to folks why we're testing E2H
in this context.
So maybe: s/__check_e2h/__check_hvhe/ ?
I can fix it up when applying the series if you agree.
--
Thanks,
Oliver
next prev parent reply other threads:[~2023-07-21 21:21 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 [this message]
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 ` [PATCH v2 0/7] Fix setting SVE and SME traps in (h)VHE Marc Zyngier
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=ZLr20NXdQfXlxV9j@linux.dev \
--to=oliver.upton@linux.dev \
--cc=catalin.marinas@arm.com \
--cc=james.morse@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 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.