All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Steffen Eiden" <seiden@linux.ibm.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v3 07/27] KVM: arm64: Provide arm64 KVM API for non-native architectures
Date: Fri, 29 May 2026 17:45:32 +0000	[thread overview]
Message-ID: <20260529174533.60EF91F0089A@smtp.kernel.org> (raw)
In-Reply-To: <20260529155050.2902245-8-seiden@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] The refactoring of `kvm_arm.h` violates the design convention explicitly stated in the commit message.
- [Low] `system_supported_vcpu_features()` is made globally visible without a prototype declaration.
- [Low] Newly extracted headers are not self-contained and lack necessary forward declarations and `#include` directives.
--

commit 106dc17001f0c5affae224d8814a51a51af0225e
Author: Steffen Eiden <seiden@linux.ibm.com>

KVM: arm64: Provide arm64 KVM API for non-native architectures

This patch moves KVM-related headers to include/kvm/arm64/ to decouple them
from the arm64 architecture directory. This allows non-native hosts to consume
the arm64 KVM infrastructure without duplicating code.

> The KVM-related headers are moved to include/kvm/arm64/, decoupling them from
> the arm64 architecture directory. The design convention is that
> architecture-specific headers under <arch>/include/asm/ include from this
> shared location, allowing non-native hosts to consume the arm64 KVM
> infrastructure without duplicating code.

[Severity: Medium]
The commit message states "architecture-specific headers under
<arch>/include/asm/ include from this shared location". Does moving kvm_arm.h
entirely and updating all the source files to include <kvm/arm64/kvm_arm.h>
directly bypass this convention?

Would it be more consistent to leave a wrapper header in
arch/arm64/include/asm/kvm_arm.h as was done for kvm_mmu.h and kvm_host.h?

> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> index 9453321ef8c67..04a4ef1c7f062 100644
> --- a/arch/arm64/kvm/arm.c
> +++ b/arch/arm64/kvm/arm.c

[ ... ]

> @@ -1541,7 +1543,7 @@ int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level,
>  	return -EINVAL;
>  }
>  
> -static unsigned long system_supported_vcpu_features(void)
> +unsigned long system_supported_vcpu_features(void)
>  {
>  	unsigned long features = KVM_VCPU_VALID_FEATURES;
>  

[Severity: Low]
The function system_supported_vcpu_features() is now globally visible. Should
a prototype be added to a header file to avoid missing prototype compiler
warnings?

> diff --git a/include/kvm/arm64/guest.h b/include/kvm/arm64/guest.h
> new file mode 100644
> index 0000000000000..fa67d992e8fd2
> --- /dev/null
> +++ b/include/kvm/arm64/guest.h
> @@ -0,0 +1,10 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef __KVM_ARM64_GUEST_H__
> +#define __KVM_ARM64_GUEST_H__
> +
> +/* Implemented by virt/kvm/arm64/guest.c */
> +unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu);
> +int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices);
> +
> +#endif /* __KVM_ARM64_GUEST_H__ */

[Severity: Low]
This new header uses types like u64, __user, and struct kvm_vcpu. Should it
include <linux/types.h>, <linux/compiler.h>, and forward-declare
struct kvm_vcpu so it is fully self-contained?

> diff --git a/include/kvm/arm64/kvm_mmu.h b/include/kvm/arm64/kvm_mmu.h
> new file mode 100644
> index 0000000000000..91607105eaf67
> --- /dev/null
> +++ b/include/kvm/arm64/kvm_mmu.h
> @@ -0,0 +1,47 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef KVM_ARM64_KVM_MMU_H__
> +#define KVM_ARM64_KVM_MMU_H__
> +
> +/*
> + * We currently support using a VM-specified IPA size. For backward
> + * compatibility, the default IPA size is fixed to 40bits.
> + */
> +#define KVM_PHYS_SHIFT	(40)
> +
> +/*
> + * We are not in the kvm->srcu critical section most of the time, so we take
> + * the SRCU read lock here. Since we copy the data from the user page, we
> + * can immediately drop the lock again.
> + */
> +static inline int kvm_read_guest_lock(struct kvm *kvm,
> +				      gpa_t gpa, void *data, unsigned long len)
> +{

[Severity: Low]
This header uses gpa_t, phys_addr_t, size_t, bool, and srcu functions. Does it
need to include <linux/types.h>, <linux/srcu.h>, and other relevant headers to
ensure it compiles independently?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260529155050.2902245-1-seiden@linux.ibm.com?part=7

  reply	other threads:[~2026-05-29 17:45 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 15:50 [PATCH v3 00/27] KVM: s390: Introduce arm64 KVM Steffen Eiden
2026-05-29 15:50 ` [PATCH v3 01/27] VFIO: take reference to the KVM module Steffen Eiden
2026-05-29 16:49   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 02/27] KVM, vfio: remove symbol_get(kvm_get_kvm_safe) from vfio Steffen Eiden
2026-05-29 16:39   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 03/27] KVM, vfio: remove symbol_get(kvm_put_kvm) " Steffen Eiden
2026-05-29 17:22   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 04/27] uapi: KVM: Provide arm64 UAPI for other host architectures Steffen Eiden
2026-05-29 17:10   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 05/27] arm64: Extract sysreg definitions Steffen Eiden
2026-05-29 17:22   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 06/27] arm64: Provide arm64 API for non-native architectures Steffen Eiden
2026-05-29 17:41   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 07/27] KVM: arm64: Provide arm64 KVM " Steffen Eiden
2026-05-29 17:45   ` sashiko-bot [this message]
2026-05-29 15:50 ` [PATCH v3 08/27] arm64: Extract pstate definitions from ptrace Steffen Eiden
2026-05-29 15:50 ` [PATCH v3 09/27] KVM: arm64: Share kvm_emulate definitions Steffen Eiden
2026-05-29 18:13   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 10/27] KVM: arm64: Make some arm64 KVM code shareable Steffen Eiden
2026-05-29 19:15   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 11/27] KVM: arm64: Access elements of vcpu_gp_regs individually Steffen Eiden
2026-05-29 15:50 ` [PATCH v3 12/27] KVM: arm64: Share reset general register code Steffen Eiden
2026-05-29 15:50 ` [PATCH v3 13/27] KVM: arm64: Extract & share ipa size shift calculation Steffen Eiden
2026-05-29 15:50 ` [PATCH v3 14/27] KVM: s390: Move s390 kvm code into a subdirectory Steffen Eiden
2026-05-30  6:46   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 15/27] KVM: S390: Refactor gmap Steffen Eiden
2026-05-30  6:56   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 16/27] KVM: Make device name configurable Steffen Eiden
2026-05-30  7:12   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 17/27] KVM: Remove KVM_MMIO as config option Steffen Eiden
2026-05-30  7:23   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 18/27] KVM: s390: Prepare kvm-s390 for a second kvm module Steffen Eiden
2026-05-29 15:50 ` [PATCH v3 19/27] s390: Introduce Start Arm Execution instruction Steffen Eiden
2026-05-29 15:50 ` [PATCH v3 20/27] KVM: s390: arm64: Introduce host definitions Steffen Eiden
2026-05-30  8:07   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 21/27] s390/hwcaps: Report SAE support as hwcap Steffen Eiden
2026-05-29 15:50 ` [PATCH v3 22/27] KVM: s390: Add basic arm64 kvm module Steffen Eiden
2026-05-30  8:23   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 23/27] KVM: s390: arm64: Implement required functions Steffen Eiden
2026-05-29 15:50 ` [PATCH v3 24/27] KVM: s390: arm64: Implement vm/vcpu create destroy Steffen Eiden
2026-05-30  8:57   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 25/27] KVM: s390: arm64: Implement vCPU IOCTLs Steffen Eiden
2026-05-30  9:09   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 26/27] KVM: s390: arm64: Implement basic page fault handler Steffen Eiden
2026-05-30  9:22   ` sashiko-bot
2026-05-29 15:50 ` [PATCH v3 27/27] KVM: s390: arm64: Enable KVM_ARM64 config and Kbuild Steffen Eiden
2026-05-30  9:37   ` sashiko-bot

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=20260529174533.60EF91F0089A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=seiden@linux.ibm.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.