linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Sascha Bischoff <Sascha.Bischoff@arm.com>
Cc: "sascha.bischoff@googlemail.com" <sascha.bischoff@googlemail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>, nd <nd@arm.com>,
	"oliver.upton@linux.dev" <oliver.upton@linux.dev>,
	Joey Gouly <Joey.Gouly@arm.com>,
	Suzuki Poulose <Suzuki.Poulose@arm.com>,
	"yuzenghui@huawei.com" <yuzenghui@huawei.com>,
	"will@kernel.org" <will@kernel.org>
Subject: Re: [PATCH 0/2] Enable GICv5 Legacy CPUIF trapping & fix TDIR cap test
Date: Mon, 08 Dec 2025 15:53:41 +0000	[thread overview]
Message-ID: <864iq1otq2.wl-maz@kernel.org> (raw)
In-Reply-To: <20251208152724.3637157-1-sascha.bischoff@arm.com>

On Mon, 08 Dec 2025 15:28:22 +0000,
Sascha Bischoff <Sascha.Bischoff@arm.com> wrote:
> 
> These changes address two trapping-related issues when running legacy
> (i.e. GICv3) guests on GICv5 hosts.
> 
> The first change enables the vgic_v3_cpuif_trap static branch on GICv5
> hosts with legacy support, if trapping is required. The missing enable
> was caught as part of debugging why UNDEFs were being injected into
> guests when the ICH_HCR_EL2.TC bit was set - the expected bahaviour
> was that KVM should handle the trapped accesses, with the guest
> remaining blissfully unaware.
> 
> The second change fixes the specific cause of the TC bit being set in
> the first place. The test for the ICH_HCR_EL2_TDIR cap was checking
> for GICv3 CPUIF support and returning false prior to checking for
> GICv5 Legacy support. The result was that on GICv5 hosts, the test
> always returned false, and therefore the TC bit was being set. The
> issue is fixed by reordering the checks to check for GICv5 Legacy
> support first.
> 
> These changes are based against kvmarm/next.
> 
> Thanks,
> Sascha
> 
> Sascha Bischoff (2):
>   KVM: arm64: gic: Enable GICv3 CPUIF trapping on GICv5 hosts if
>     required
>   KVM: arm64: Correct test for ICH_HCR_EL2_TDIR cap for GICv5 hosts
> 
>  arch/arm64/kernel/cpufeature.c |  8 ++++----
>  arch/arm64/kvm/vgic/vgic-v3.c  | 25 +++++++++++++++----------
>  arch/arm64/kvm/vgic/vgic-v5.c  |  2 ++
>  arch/arm64/kvm/vgic/vgic.h     |  1 +
>  4 files changed, 22 insertions(+), 14 deletions(-)

Thanks for the debugging, and putting this together!

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

	M.

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


      parent reply	other threads:[~2025-12-08 15:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 15:28 [PATCH 0/2] Enable GICv5 Legacy CPUIF trapping & fix TDIR cap test Sascha Bischoff
2025-12-08 15:28 ` [PATCH 1/2] KVM: arm64: gic: Enable GICv3 CPUIF trapping on GICv5 hosts if required Sascha Bischoff
2025-12-08 15:28 ` [PATCH 0/2] Enable GICv5 Legacy CPUIF trapping & fix TDIR cap test Sascha Bischoff
2025-12-08 15:28 ` [PATCH 2/2] KVM: arm64: Correct test for ICH_HCR_EL2_TDIR cap for GICv5 hosts Sascha Bischoff
2025-12-08 15:53 ` 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=864iq1otq2.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=Joey.Gouly@arm.com \
    --cc=Sascha.Bischoff@arm.com \
    --cc=Suzuki.Poulose@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nd@arm.com \
    --cc=oliver.upton@linux.dev \
    --cc=sascha.bischoff@googlemail.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).