Skip to content

Add Gunyah-specific distro configuration#306

Draft
vkraleti wants to merge 1 commit into
qualcomm-linux:mainfrom
vkraleti:klmt-kvm
Draft

Add Gunyah-specific distro configuration#306
vkraleti wants to merge 1 commit into
qualcomm-linux:mainfrom
vkraleti:klmt-kvm

Conversation

@vkraleti

@vkraleti vkraleti commented May 22, 2026

Copy link
Copy Markdown
Contributor

Define qcom-distro-gunyah modeled after the KVM variant. It enables the 'gunyah' DISTRO_FEATURE and provides a dedicated configuration for Gunyah-based builds.

@lumag lumag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The DISTRO_FEATURES are features of the distro. They should not depend on the machine. If you want to select something based on both, use COMBINED_FEATURES.

@vkraleti

Copy link
Copy Markdown
Contributor Author

At present, KVM is a DISTRO_FEATURE, but not all boards are ready to support it.
The ask here is to:

  1. Generate CI builds with KVM enabled for boards that are getting ready for KVM testing, and
  2. Switch boards that are already validated to KVM by default.

Given that this is effectively an either-or decision per board, but not checking KVM through COMBINED_FEATURES for both.

If conditionally enabling DISTRO_FEATURES per machine is not recommended, should we instead move KVM checks entirely to MACHINE_FEATURES?

@lumag

lumag commented May 24, 2026

Copy link
Copy Markdown
Contributor

At present, KVM is a DISTRO_FEATURE, but not all boards are ready to support it. The ask here is to:

Well, you didn't write any of this in the commit message. That's why we are always asking to start the commit message from the description of the issue or the problem that is being solved.

  1. Generate CI builds with KVM enabled for boards that are getting ready for KVM testing, and
  2. Switch boards that are already validated to KVM by default.

Here you have two different items:

  • Select whether to include KVM enablement into the generated kernel+rootfs image.
  • Select whether to enable KVM-enabled XBL config in the flashable image.

Those two items (ideally) should be independent. The first one is (correctly) controlled by the kvm being a part of DISTRO_FEATURES. The second one is purely a part of the machine configuration.

Given that this is effectively an either-or decision per board, but not checking KVM through COMBINED_FEATURES for both.

If conditionally enabling DISTRO_FEATURES per machine is not recommended, should we instead move KVM checks entirely to MACHINE_FEATURES?

I think, the correct way to fix your problem would be to make machines use MACHINE_FEATURES to control kvm vs gunyah XBL config, enable kvm in qcom-distro's DISTRO_FEATURES and drop qcom-disto-kvm completely. I'm slowly implementing support for multi-config 'flash' image generation (which would get rid of this issue, letting us generate both KVM and Gunyah images at the same time, just in the different subfolders), but that will take some time to materialize.

@vkraleti

Copy link
Copy Markdown
Contributor Author

There is only one place in image_types_qcom.bbclass where the KVM distro feature is checked.
Given that, it seems much simpler to introduce a conditional check that considers both MACHINE_FEATURES and DISTRO_FEATURES in this bbclass itself, rather than restructuring how the feature is assigned across multiple layers. I added a 2a9b412 in qualcomm-linux/meta-qcom#2251 to add this conditional check.

@lumag

lumag commented May 24, 2026

Copy link
Copy Markdown
Contributor

@vkraleti if you are switching to MACHINE_FEATURES, there is no need to check for DISTRO_FEATURES anymore.

@vkraleti

Copy link
Copy Markdown
Contributor Author

@vkraleti if you are switching to MACHINE_FEATURES, there is no need to check for DISTRO_FEATURES anymore.

Agreed. Check of both MACHINE_FEATURES & DISTRO_FEATURES is needed in short term for transition till all KLMT boards are ready to switch to default KVM. Post that qcom-disto-kvm can be completely dropped.

@lumag

lumag commented May 24, 2026

Copy link
Copy Markdown
Contributor

@vkraleti if you are switching to MACHINE_FEATURES, there is no need to check for DISTRO_FEATURES anymore.

Agreed. Check of both MACHINE_FEATURES & DISTRO_FEATURES is needed in short term for transition till all KLMT boards are ready to switch to default KVM. Post that qcom-disto-kvm can be completely dropped.

No. We can drop it now. Enable KVM parts of the distro by default and let machines dictate if Gunyah or KVM XBL config is installed by default.

@vkraleti vkraleti requested a review from quaresmajose as a code owner May 25, 2026 17:30
@vkraleti vkraleti changed the title Handle kvm via MACHINE_FEATURES or DISTRO_FEATURES Enable KVM as a default DISTRO_FEATURE May 25, 2026
@vkraleti vkraleti changed the title Enable KVM as a default DISTRO_FEATURE Add Gunyah-specific distro configuration May 29, 2026
vkraleti added a commit to vkraleti/meta-qcom-distro that referenced this pull request May 30, 2026
…ation

Enable selection of Gunyah-based virtualization as an
alternative to KVM for platform validation across boards.

Define qcom-distro-gunyah.conf modeled after the KVM variant.
It enables the 'gunyah' as part of DISTRO_FEATURES and provides
a dedicated configuration for Gunyah-based builds.

Declare mutual exclusion between KVM and Gunyah using
CONFLICT_DISTRO_FEATURES to prevent invalid configurations.

Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
Comment thread conf/distro/include/qcom-distro-kvm.inc Outdated
DISTRO_NAME:append = " (KVM-enabled)"

# Gunyah and KVM are mutually exclusive
DISTRO_FEATURES:remove = "gunyah"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need :remove here? What is going to add those?

@vkraleti vkraleti Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at this point. But when kvm is enabled by default in #314, both kvm and gunyah may endup in distro - - features. Moved :remove to PR#314 for better alignment.

Enable selection of Gunyah-based virtualization as an
alternative to KVM for platform validation across boards.

Define qcom-distro-gunyah.conf modeled after the KVM variant.
It enables the 'gunyah' as part of DISTRO_FEATURES and provides
a dedicated configuration for Gunyah-based builds.

Declare mutual exclusion between KVM and Gunyah using
CONFLICT_DISTRO_FEATURES to prevent invalid configurations.

Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
@@ -0,0 +1,8 @@
DISTRO_FEATURES:append = " \
gunyah \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why this is needed yet, nothing else depend on it.

@vkraleti vkraleti Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

POR is still to support both hypervisors. Once kvm is default, builds with gunyah are still needed for interested users. Thus this DISTRO_FEATURE is defined. A refrence usage is in qualcomm-linux/meta-qcom@4f52095

@vkraleti

vkraleti commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@ricardosalveti @lumag Thank you for the offline discussion. As suggested, we will hold this PR for now.

I’ve updated #314 to make kvm as a part of default DISTRO_FEATURES. We can revisit this PR once a dedicated Gunyah build is required.

@ricardosalveti

Copy link
Copy Markdown
Contributor

Will move to draft then!

@ricardosalveti ricardosalveti marked this pull request as draft June 9, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants