All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Fuad Tabba" <fuad.tabba@linux.dev>, kvmarm@lists.linux.dev
Cc: kvm@vger.kernel.org, "Oliver Upton" <oupton@kernel.org>,
	"Marc Zyngier" <maz@kernel.org>
Subject: Re: [PATCH v2 09/20] KVM: arm64: Report an incomplete feature map with WARN_ON()
Date: Wed, 25 Nov 2026 15:55:36 +0000	[thread overview]
Message-ID: <sashiko-outbox-233684@kernel.org> (raw)
In-Reply-To: <20261125153911.106793-10-fuad.tabba@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] KVM: arm64: unused str parameter and name field in
  check_feat_map()
--

commit ef16fb792e699aa85734a7167ff79fe6521ee780
Author: Fuad Tabba <fuad.tabba@linux.dev>

KVM: arm64: Report an incomplete feature map with WARN_ON()

This commit replaces the kvm_err() call in check_feat_map() with WARN_ON()
so that arch/arm64/kvm/config.c can be built into the nVHE hypervisor
without depending on printk().

> diff --git a/arch/arm64/kvm/config.c b/arch/arm64/kvm/config.c
> index c65cf1dd27330..eef5ca50fc382 100644
> --- a/arch/arm64/kvm/config.c
> +++ b/arch/arm64/kvm/config.c
> @@ -1409,9 +1409,7 @@ static void __init check_feat_map(const struct reg_bits_to_feat_map *map,
>  		if (!((map[i].flags & FORCE_RESx) && (map[i].bits & resx)))
>  			mask |= map[i].bits;
>  
> -	if (mask != ~resx)
> -		kvm_err("Undefined %s behaviour, bits %016llx\n",
> -			str, mask ^ ~resx);
> +	WARN_ON(mask != ~resx);
>  }

[Severity: Low]
Does replacing kvm_err() with WARN_ON() leave the str parameter of
check_feat_map() and struct reg_feat_map_desc::name unused?

check_reg_desc() passing r->name to check_feat_map() was the only reader
of struct reg_feat_map_desc::name.  Leaving str and name in place triggers
an unused-parameter warning under W=3 and, once config.c is built into
nVHE hyp, keeps unused string literals and relocation entries in
.hyp.rodata and .hyp.reloc, while the bare WARN_ON() across the 23
check_reg_desc() calls in check_feature_map() no longer reports which
register or bits failed.  Either str and struct reg_feat_map_desc::name
should be removed, or check_feat_map(), check_reg_desc() and
check_feature_map() could be guarded with #ifndef __KVM_NVHE_HYPERVISOR__
so the host init check keeps logging the register name and mismatched
bits.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125153911.106793-1-fuad.tabba@linux.dev?part=9

  reply	other threads:[~2026-11-25 15:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 15:38 [PATCH v2 00/20] KVM: arm64: Support debug, SVE, MOPS, PIE/POE, FPMR and more in protected VMs Fuad Tabba
2026-11-25 15:38 ` [PATCH v2 01/20] KVM: arm64: Only allow ptrauth for a pVM on a system with full ptrauth Fuad Tabba
2026-11-25 15:38 ` [PATCH v2 02/20] KVM: arm64: Don't advertise the host's MTE_frac to protected VMs Fuad Tabba
2026-11-25 15:49   ` sashiko-bot
2026-11-25 15:52     ` Fuad Tabba
2026-11-25 15:38 ` [PATCH v2 03/20] KVM: arm64: Add support for self-hosted debug in protected guests Fuad Tabba
2026-11-25 15:38 ` [PATCH v2 04/20] KVM: arm64: Remove redundant kern_hyp_va() calls from the pKVM FP sync Fuad Tabba
2026-11-25 15:38 ` [PATCH v2 05/20] KVM: arm64: Allocate a protected vCPU's SVE state at EL2 Fuad Tabba
2026-11-25 15:38 ` [PATCH v2 06/20] KVM: arm64: Advertise ID_AA64ZFR0_EL1 to protected VMs Fuad Tabba
2026-11-25 15:38 ` [PATCH v2 07/20] KVM: arm64: Allow protected VMs to use SVE Fuad Tabba
2026-11-25 15:38 ` [PATCH v2 08/20] KVM: arm64: Move the VM's FGU initialisation into config.c Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 09/20] KVM: arm64: Report an incomplete feature map with WARN_ON() Fuad Tabba
2026-11-25 15:55   ` sashiko-bot [this message]
2026-11-25 15:58     ` Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 10/20] KVM: arm64: Advertise the GICv3 CPU interface to protected VMs on GICv5 Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 11/20] KVM: arm64: Compute a protected vCPU's fine-grained traps at EL2 Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 12/20] KVM: arm64: Advertise TCR2, SCTLR2, S1PIE and S1POE to protected VMs Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 13/20] KVM: arm64: Advertise MOPS " Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 14/20] KVM: arm64: Advertise FPMR " Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 15/20] KVM: arm64: Advertise HBC, CLRBHB, RPRFM, CSSC and LUT " Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 16/20] KVM: arm64: Advertise FAMINMAX, LSFE, LSUI and FPRCVT " Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 17/20] KVM: arm64: Advertise AFP and RPRES " Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 18/20] KVM: arm64: Advertise ECBHB, TIDCP1, TTST and LVA " Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 19/20] KVM: arm64: Advertise FP8 and F16MM " Fuad Tabba
2026-11-25 15:39 ` [PATCH v2 20/20] KVM: arm64: Advertise ECV, HAFT and ETS3 " 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=sashiko-outbox-233684@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=fuad.tabba@linux.dev \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.