linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Fuad Tabba <tabba@google.com>
Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	oliver.upton@linux.dev, will@kernel.org, joey.gouly@arm.com,
	suzuki.poulose@arm.com, yuzenghui@huawei.com,
	catalin.marinas@arm.com, vladimir.murzin@arm.com
Subject: Re: [PATCH v1 3/8] KVM: arm64: Enable LS64 instructions when supported by guest
Date: Tue, 04 Nov 2025 15:26:09 +0000	[thread overview]
Message-ID: <86fratvmy6.wl-maz@kernel.org> (raw)
In-Reply-To: <20251104125906.1919426-4-tabba@google.com>

On Tue, 04 Nov 2025 12:59:01 +0000,
Fuad Tabba <tabba@google.com> wrote:
> 
> The FEAT_LS64* family (FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA)
> enables support for LD64B, ST64B, and their variants. If a guest is
> advertised these features, KVM should not trap accesses to these
> instructions to EL2.
> 
> This is controlled by the HCRX_EL2_EnASR, HCRX_EL2_EnALS, and
> HCRX_EL2_EnAS0 bits. When clear, these bits trap the corresponding
> instructions. KVM did not set them, which would cause guest-supported
> instructions to trap.
> 
> This also created a state mismatch for nested virtualization, which
> validates its own HCRX_EL2 value against the features advertised in the
> guest's ID_AA64ISAR1_EL1 (in handle_other()).
> 
> Fix this by checking for each FEAT_LS64* variant in
> vcpu_set_hcrx() and setting the corresponding HCRX_EL2 enable
> bit if the guest supports the feature.
> 
> Signed-off-by: Fuad Tabba <tabba@google.com>

Please see 20240815125959.2097734-1-maz@kernel.org, which has a large
portion of what is required for this to work. Just flipping the bits
isn't quite enough.

Thanks,

	M.

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


  reply	other threads:[~2025-11-04 15:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04 12:58 [PATCH v1 0/8] KVM: arm64: Fixes for guest CPU feature trapping and enabling Fuad Tabba
2025-11-04 12:58 ` [PATCH v1 1/8] KVM: arm64: Route MOPS exceptions to EL2 when guest lacks support Fuad Tabba
2025-11-04 13:44   ` Joey Gouly
2025-11-04 13:49     ` Fuad Tabba
2025-11-04 12:59 ` [PATCH v1 2/8] KVM: arm64: Trap access to ALLINT if FEAT_NMI not supported by the guest Fuad Tabba
2025-11-04 15:15   ` Marc Zyngier
2025-11-04 15:30     ` Fuad Tabba
2025-11-04 17:22       ` Marc Zyngier
2025-11-04 17:30         ` Fuad Tabba
2025-11-04 12:59 ` [PATCH v1 3/8] KVM: arm64: Enable LS64 instructions when supported by guest Fuad Tabba
2025-11-04 15:26   ` Marc Zyngier [this message]
2025-11-04 15:31     ` Fuad Tabba
2025-11-04 12:59 ` [PATCH v1 4/8] KVM: arm64: Refactor vcpu_set_hcrx() to reduce indentation Fuad Tabba
2025-11-04 12:59 ` [PATCH v1 5/8] KVM: arm64: Fix Trace Buffer trap polarity for protected VMs Fuad Tabba
2025-11-04 17:50   ` Suzuki K Poulose
2025-11-04 17:56     ` Fuad Tabba
2025-11-04 18:03       ` Suzuki K Poulose
2025-11-04 19:04         ` Fuad Tabba
2025-11-04 12:59 ` [PATCH v1 6/8] KVM: arm64: Fix MTE flag initialization " Fuad Tabba
2025-11-04 12:59 ` [PATCH v1 7/8] KVM: arm64: Prevent host from managing timer offsets " Fuad Tabba
2025-11-04 12:59 ` [PATCH v1 8/8] KVM: arm64: Define FAR_MASK for faulting IPA offset Fuad Tabba

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=86fratvmy6.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.com \
    --cc=tabba@google.com \
    --cc=vladimir.murzin@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).