genodelabs / genode

Genode OS Framework
https://genode.org/
Other
1.07k stars 254 forks source link

base-hw: busy loop while booting Tigerlake+ platforms #5215

Open chelmuth opened 5 months ago

chelmuth commented 5 months ago

It seems the initialization enters a busy loop on more recent CPUs. I successfully ran simple scenarios on Whiskeylake (i7-8665UE) but failed on Tigerlake (i7-1185G7) and newer.

chelmuth commented 5 months ago

With IOMMU support progressing pretty well on base-hw (https://github.com/genodelabs/genode/issues/5066#issuecomment-2139050160), testing on recent platforms (e.g., Framework or T14 with Intel Gen12) becomes more and more relevant. Are there any ideas how to proceed with this issue?

jschlatow commented 3 months ago

@chelmuth I am wondering whether the workaround mentioned in #5304 has any effect on this issue.

chelmuth commented 3 months ago

Most certainly you identified the right spot. Will give it a try on Tigerlake.

chelmuth commented 3 months ago

Heureka, I successfully ran make run/log KERNEL=hw on i7-1185G7 for the time just now. So, this issue is a duplicate of #5304 (or vice versa).

jschlatow commented 3 months ago

Heureka, I successfully ran make run/log KERNEL=hw on i7-1185G7 for the time just now. So, this issue is a duplicate of #5304 (or vice versa).

Perfect. I closed the other issue as a duplicate.

I'm still wondering how to solve this issue properly. I believe we could add info about the availability of an ACPI timer during bootstrap, store this in the boot info, and use the ACPI timer (if available) for timer calibration. The PIT-based calibration could stay in place as a fallback.

chelmuth commented 3 months ago

I suggest to replace the PIT-based calibration with an implementation based on the ACPI timer (which should be always available?). Later we could carefully add code to discover exact values from CPUID for most relevant platforms, e.g., Haswell/Broadwell and later as well as our chosen Qemu-emulated CPU Nehalem. In any case, all this code should stay in bootstrap and, thus, outside of the kernel. Especially, everything from base-hw/src/include/hw/spec/x86_64 /x86_64.h that was added for this purpose must be removed again.