Skip to content

fix(psci): per-plat smccc version support#329

Merged
josecm merged 1 commit into
mainfrom
fix/psci
Mar 4, 2026
Merged

fix(psci): per-plat smccc version support#329
josecm merged 1 commit into
mainfrom
fix/psci

Conversation

@DavidMCerdeira
Copy link
Copy Markdown
Member

@DavidMCerdeira DavidMCerdeira commented Mar 3, 2026

With S32G3 platform we misinterpreted the VENDOR_START PSCI_FEATURES
argument. The correct flag is SMCC_VERSION. This flag seems to be needed
for vendor specific calls that depend on a high-enough smccc version.
Addtionally, we make this flag per-platform, since currently supported
platforms except for S32G3 don't need this feature.

@DavidMCerdeira DavidMCerdeira force-pushed the fix/psci branch 2 times, most recently from 5e4a75d to 7f5150d Compare March 3, 2026 20:52
Copy link
Copy Markdown
Member

@josecm josecm left a comment

Choose a reason for hiding this comment

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

Shouldn't this be part of PSCI-specific code?

Also, can't we probe for the support for if the service is implemented or not and act accordingly?

@joaopeixoto13
Copy link
Copy Markdown
Member

Since PSCI_1_1_RESET_TYPE_VENDOR_START is only needed for the S32G3 to issue vendor-specific SMCs, would it make sense to introduce a dedicated platform define, such as PLAT_PSCI_SUPPORT_RESET_TYPE_VENDOR_START?

Each platform could explicitly define this macro if it requires support for PSCI_1_1_RESET_TYPE_VENDOR_START. At the moment, this would apply only to S32G3, but it keeps the design extensible in case other platforms need the same support in the future.

Then, in psci_features_handler(), we could conditionally advertise support for PSCI_1_1_RESET_TYPE_VENDOR_START only when PLAT_PSCI_SUPPORT_RESET_TYPE_VENDOR_START is defined, for example:

src/platform/s32g3/inc/plat/psci.h

#define PLAT_PSCI_SUPPORT_RESET_TYPE_VENDOR_START 1

src/arch/armv8/psci.c

static int32_t psci_features_handler(uint32_t feature_id)
{
    int32_t ret = PSCI_E_NOT_SUPPORTED;

    switch (feature_id) {
    case PSCI_VERSION:
    case PSCI_CPU_OFF:
    case PSCI_CPU_SUSPEND_SMC32:
    case PSCI_CPU_SUSPEND_SMC64:
    case PSCI_CPU_ON_SMC32:
    case PSCI_CPU_ON_SMC64:
    case PSCI_AFFINITY_INFO_SMC32:
    case PSCI_AFFINITY_INFO_SMC64:
    case PSCI_FEATURES:
#ifdef PLAT_PSCI_SUPPORT_RESET_TYPE_VENDOR_START
    case PSCI_1_1_RESET_TYPE_VENDOR_START:
#endif
        ret = PSCI_E_SUCCESS;
        break;

    default:
        ret = PSCI_E_NOT_SUPPORTED;
        break;
    }

    return ret;
}

@DavidMCerdeira DavidMCerdeira changed the title fix(psci): fake successful VENDOR_START fix(psci): Per-platform VENDOR_START support Mar 4, 2026
josecm
josecm previously approved these changes Mar 4, 2026
@josecm josecm self-assigned this Mar 4, 2026
With S32G3 platform we misinterpreted the VENDOR_START PSCI_FEATURES
argument. The correct flag is SMCC_VERSION. This flag seems to be needed
for vendor specific calls that depend on a high-enough smccc version.
Addtionally, we make this flag per-platform, since currently supported
platforms except for S32G3 don't need this feature.

Signed-off-by: David Cerdeira <davidmcerdeira@gmail.com>
@DavidMCerdeira DavidMCerdeira changed the title fix(psci): Per-platform VENDOR_START support fix(psci): per-plat smccc version support Mar 4, 2026
@DavidMCerdeira DavidMCerdeira requested a review from josecm March 4, 2026 11:03
@joaopeixoto13
Copy link
Copy Markdown
Member

Everything works on qemu-aarch64-virt and on s32g3

@DavidMCerdeira
Copy link
Copy Markdown
Member Author

Working on RPi4

Comment thread src/arch/armv8/psci.c
@josecm josecm merged commit 0af4a1a into main Mar 4, 2026
45 checks passed
@josecm josecm deleted the fix/psci branch March 4, 2026 11:26
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