This is a cherry-pick from 6.12, as such, it should
be clearly indicated that it is a backport request.

That being said, I think we could simply this fragment
a bit.

How are you enabling it via kernel-features ? Rather
than having a common fragment "qemu-kvm-enable.scc",
we could just have the two architecture specific ones
and do the conditional inclusion at the recipe / meta-data
level.

I assume you are enabling it via KERNEL_FEATURES ? If
so, the addition to the KERNEL_FEATURES could test on the
architecture and directly include the required fragment.

After some time, I could then remove the generic one
and not rely on the scc internal conditional (which makes
processing complicated in some scenarios)

Bruce

In message: [linux-yocto][yocto-kernel-cache yocto-6.6][PATCH] features/kvm: 
enable kvm configs for arm64
on 13/02/2025 [email protected] wrote:

> From: Wenlin Kang <[email protected]>
> 
> The CONFIG_VIRTUALIZATION is not enabled for ARM64, but it is
> default for X86. And CONFIG_KVM depends on CONFIG_VIRTUALIZATION.
> 
> In addition, the CONFIG_KVM is a bool type in ARM64, it could not
> be built as a kernel module, so split KVM configs out based the
> architecture to standalone files.
> 
> Signed-off-by: Liu Haitao <[email protected]>
> Signed-off-by: Wenlin Kang <[email protected]>
> Signed-off-by: Bin Lan <[email protected]>
> ---
>  features/kvm/qemu-kvm-arm64.cfg  | 3 +++
>  features/kvm/qemu-kvm-enable.scc | 5 +++++
>  features/kvm/qemu-kvm-x86.cfg    | 4 ++++
>  features/kvm/qemu-kvm.cfg        | 3 ---
>  4 files changed, 12 insertions(+), 3 deletions(-)
>  create mode 100644 features/kvm/qemu-kvm-arm64.cfg
>  create mode 100644 features/kvm/qemu-kvm-x86.cfg
> 
> diff --git a/features/kvm/qemu-kvm-arm64.cfg b/features/kvm/qemu-kvm-arm64.cfg
> new file mode 100644
> index 00000000..143a7bc4
> --- /dev/null
> +++ b/features/kvm/qemu-kvm-arm64.cfg
> @@ -0,0 +1,3 @@
> +# SPDX-License-Identifier: MIT
> +CONFIG_VIRTUALIZATION=y
> +CONFIG_KVM=y
> diff --git a/features/kvm/qemu-kvm-enable.scc 
> b/features/kvm/qemu-kvm-enable.scc
> index 880bdaa0..23b4af5f 100644
> --- a/features/kvm/qemu-kvm-enable.scc
> +++ b/features/kvm/qemu-kvm-enable.scc
> @@ -3,3 +3,8 @@ define KFEATURE_DESCRIPTION "Enable KVM host support"
>  define KFEATURE_COMPATIBILITY board
>  
>  kconf non-hardware qemu-kvm.cfg
> +if [ "$KARCH" = "x86_64" ] || [ "$KARCH" = "x86" ] || [ "$KARCH" = "i386" ]; 
> then
> +     kconf non-hardware qemu-kvm-x86.cfg
> +elif [ "$KARCH" = "arm64" ]; then
> +     kconf non-hardware qemu-kvm-arm64.cfg
> +fi
> diff --git a/features/kvm/qemu-kvm-x86.cfg b/features/kvm/qemu-kvm-x86.cfg
> new file mode 100644
> index 00000000..5c885b9e
> --- /dev/null
> +++ b/features/kvm/qemu-kvm-x86.cfg
> @@ -0,0 +1,4 @@
> +# SPDX-License-Identifier: MIT
> +CONFIG_KVM=m
> +CONFIG_KVM_INTEL=m
> +CONFIG_KVM_AMD=m
> diff --git a/features/kvm/qemu-kvm.cfg b/features/kvm/qemu-kvm.cfg
> index aa0c29ff..3eef744e 100644
> --- a/features/kvm/qemu-kvm.cfg
> +++ b/features/kvm/qemu-kvm.cfg
> @@ -1,7 +1,4 @@
>  # SPDX-License-Identifier: MIT
> -CONFIG_KVM=m
> -CONFIG_KVM_INTEL=m
> -CONFIG_KVM_AMD=m
>  CONFIG_TUN=y
>  
>  # Macvtap
> -- 
> 2.34.1
> 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#14774): 
https://lists.yoctoproject.org/g/linux-yocto/message/14774
Mute This Topic: https://lists.yoctoproject.org/mt/111159504/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to