Patch Set 2:

Patch Set 2:

Patch Set 2:

Patch Set 2:

I tested this on Lenovo X230 (CPU: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz) and Asrock B85M Pro4 (CPU: Intel(R) Core(TM) i7-4770S CPU @ 3.10GHz): both locked up inside `src/cpu/x86/smm/smi_trigger.c` function `apm_control()`.

Log of the Asrock B85M Pro4: https://paste.flashrom.org/view.php?id=3349

Angel, can you please set MAX_CPUS to a 8 or more in Kconfig? In server mp_init code we error out if MAX_CPUS is less than what's found in the system, but that's not happening here and hence we are getting this error in the log:
smm_create_map: more CPUs than originally configured for

Weird... I have MAX_CPUS=8 when building for the Asrock B85M Pro4 and the i7-4770S is a quad-core with HyperThreading, so it has 8 threads... Should be enough. I wonder where `cpus in one segment 30` comes from.

Angel,
I think I found the issue. I've uploaded a new patch. The changes are in smm_loaderv2.c only. It provides more debug information and solves the issue with error you were seeing related to:
smm_create_map: more CPUs than originally configured for. I tested this on my system by using various CPU threads and its working. Please try with these changes. Thank you for your help!

I tried again, I ended up with the same problem. I think I found out why, though.

In `src/cpu/x86/mp_init.c`, function `smm_do_relocation`, there's a calculation that needs to match that of the SMM module loader. In my case, it didn't, and that's why I was getting hangs whenever SMM was called. Adding this offset worked for me on Haswell (but it's not a good idea to hardcode it):

 perm_smbase += (0x7faea000 - 0x7f800000);

The first value is the location of the relocated SMBASE for CPU #0. The second value is smram_start.

Patch set 3:Code-Review +1

View Change

To view, visit change 43684. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I00a23a5f2a46110536c344254868390dbb71854c
Gerrit-Change-Number: 43684
Gerrit-PatchSet: 3
Gerrit-Owner: Rocky Phagura
Gerrit-Reviewer: Aaron Durbin <adurbin@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Eugene Myers <cedarhouse1@comcast.net>
Gerrit-Reviewer: Eugene Myers <cedarhouse@comcast.net>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: Jonathan Zhang <jonzhang@fb.com>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Comment-Date: Tue, 04 Aug 2020 10:55:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment