Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qemu virt smp #1820

Merged
merged 5 commits into from
Sep 20, 2017
Merged

Qemu virt smp #1820

merged 5 commits into from
Sep 20, 2017

Conversation

jenswi-linaro
Copy link
Contributor

Enables SMP for QEMU virt.

To be able to start qemu with -smp 4 https://github.com/jenswi-linaro/bios_qemu_tz_arm/tree/smp is needed. This however depends on some patches in linaro-swg/bios_qemu_tz_arm#13. I'll create another bios PR once linaro-swg/bios_qemu_tz_arm#13 is merged. In the meantime, please review this.

@jforissier
Copy link
Contributor

Due to #1821 the CI status is incorrect. There is a compile-time assert with CFG_CORE_SANITIZE_KADDRESS=y.

@jenswi-linaro
Copy link
Contributor Author

Update

Copy link
Contributor

@jforissier jforissier left a comment

Choose a reason for hiding this comment

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

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>

@@ -180,3 +188,36 @@ static TEE_Result init_tzc400(void)

service_init(init_tzc400);
#endif /*CFG_TZC400*/

#if defined(PLATFORM_FLAVOR_qemu_virt)
int psci_cpu_on(uint32_t core_idx, uint32_t entry, uint32_t context_id __unused)
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: I suggest cpu_id rather than core_idx because this is not an index (I know this name is used in some platform code, but the common code uses cpu_id which IMO is better).


sec_entry_addrs[pos] = CFG_TEE_RAM_START;
dsb_ishst();
sev();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it work with a single call to dsb_ishst()? I mean:

        ns_entry_addrs[pos] = entry;
        sec_entry_addrs[pos] = CFG_TEE_RAM_START;
        dsb_ishst();
        sev();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it would but it's more correct to make sure that the updated value of sec_entry_addrs[pos] can't be read before ns_entry_addrs[pos].

The second write will release core from the loop at https://github.com/linaro-swg/bios_qemu_tz_arm/blob/master/bios/entry.S#L139

Copy link
Contributor

Choose a reason for hiding this comment

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

OK I see.

@jenswi-linaro
Copy link
Contributor Author

Update

@jforissier
Copy link
Contributor

As I wrote above:
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>

reset_secondary() and dependencies has to be unpaged as most of it is
executed before the core has been properly configured to use the pager.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Initialize GIC on secondary cores if not configured with ARM-TF.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Changes number of supported cores for variant qemu_virt to 4.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
If configured with device tree and PSCI update the FDT with PSCI nodes
and other information needed by the kernel to start up the secondary
cores.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Enables SMP boot of the plat-vexpress qemu_virt flavor. This includes
PSCI support and coherent memory shared with bios.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
@jenswi-linaro
Copy link
Contributor Author

Tag applied

@jforissier jforissier merged commit 5402a9f into OP-TEE:master Sep 20, 2017
@jenswi-linaro jenswi-linaro deleted the qemu_virt_smp branch September 20, 2017 11:38
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.

2 participants