From: Fuad Tabba <tabba@google.com>
To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Cc: maz@kernel.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, tabba@google.com
Subject: [PATCH v4 1/8] KVM: arm64: Fix Trace Buffer trapping for protected VMs
Date: Wed, 12 Nov 2025 09:20:44 +0000 [thread overview]
Message-ID: <20251112092051.1376245-2-tabba@google.com> (raw)
In-Reply-To: <20251112092051.1376245-1-tabba@google.com>
For protected VMs in pKVM, the hypervisor should trap accesses to trace
buffer system registers if Trace Buffer isn't supported by the VM.
However, the current code only traps if Trace Buffer External Mode isn't
supported.
Fix this by checking for FEAT_TRBE (Trace Buffer) rather than
FEAT_TRBE_EXT.
Fixes: 9d5261269098 ("KVM: arm64: Trap external trace for protected VMs")
Reported-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Fuad Tabba <tabba@google.com>
---
arch/arm64/kvm/hyp/nvhe/pkvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c
index 43bde061b65d..8d06a246dfd1 100644
--- a/arch/arm64/kvm/hyp/nvhe/pkvm.c
+++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c
@@ -117,7 +117,7 @@ static void pvm_init_traps_mdcr(struct kvm_vcpu *vcpu)
if (!kvm_has_feat(kvm, ID_AA64DFR0_EL1, TraceFilt, IMP))
val |= MDCR_EL2_TTRF;
- if (!kvm_has_feat(kvm, ID_AA64DFR0_EL1, ExtTrcBuff, IMP))
+ if (!kvm_has_feat(kvm, ID_AA64DFR0_EL1, TraceBuffer, IMP))
val |= MDCR_EL2_E2TB_MASK;
/* Trap Debug Communications Channel registers */
--
2.51.2.1041.gc1ab5b90ca-goog
next prev parent reply other threads:[~2025-11-12 9:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 9:20 [PATCH v4 0/8] KVM: arm64: Fixes for guest CPU feature trapping and enabling Fuad Tabba
2025-11-12 9:20 ` Fuad Tabba [this message]
2025-11-12 9:20 ` [PATCH v4 2/8] KVM: arm64: Fix Trace Buffer trap polarity for protected VMs Fuad Tabba
2025-11-12 9:20 ` [PATCH v4 3/8] KVM: arm64: Fix MTE flag initialization " Fuad Tabba
2025-11-12 9:39 ` Ben Horgan
2025-11-12 9:20 ` [PATCH v4 4/8] KVM: arm64: Introduce helper to calculate fault IPA offset Fuad Tabba
2025-11-12 9:20 ` [PATCH v4 5/8] KVM: arm64: Include VM type when checking VM capabilities in pKVM Fuad Tabba
2025-11-12 9:20 ` [PATCH v4 6/8] KVM: arm64: Do not allow KVM_CAP_ARM_MTE for any guest " Fuad Tabba
2025-11-12 9:20 ` [PATCH v4 7/8] KVM: arm64: Check whether a VM IOCTL is allowed " Fuad Tabba
2025-11-12 10:07 ` Oliver Upton
2025-11-12 10:51 ` Fuad Tabba
2025-11-12 9:20 ` [PATCH v4 8/8] KVM: arm64: Prevent host from managing timer offsets for protected VMs 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=20251112092051.1376245-2-tabba@google.com \
--to=tabba@google.com \
--cc=catalin.marinas@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=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 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.