Skip to content

Commit

Permalink
[Cherry-Pick] UefiCpuPkg: Add PcdCpuSmmApSyncTimeout2 PCD (#1096)
Browse files Browse the repository at this point in the history
## Description
Cherry-Picking PCD definition from edk2. This does not change the
basecore functionality to consume this pcd.

Provide the capability for platform to specifies the 2nd timeout value
in microseconds for the BSP/AP in SMM to wait for one another to enter
SMM.

The added interface can enhance the flexibility of timeout
configuration. In some cases, certain processors may not be able to
enter SMI, and prolonged waiting could lead to kernel soft/hard lockup.
We have now defined two timeouts. The first timeout can be set to a
smaller value to reduce the waiting period. Processors that are unable
to enter SMI will be woken up through SMIIPL to enter SMI, followed by a
second waiting period. The second timeout can be set to a larger value
to prevent delays in processors entering SMI case due to the long
instruction execution.


Cc: Ray Ni <[email protected]>
Cc: Rahul Kumar <[email protected]>
Cc: Gerd Hoffmann <[email protected]>


- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested
Local CI

## Integration Instructions
N/A

Signed-off-by: Jiaxin Wu <[email protected]>
Co-authored-by: Jiaxin Wu <[email protected]>
  • Loading branch information
apop5 and jiaxinwu authored Aug 7, 2024
1 parent 45e4430 commit 835d06b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions UefiCpuPkg/UefiCpuPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@
# @Prompt AP synchronization timeout value in SMM.
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout|1000000|UINT64|0x32132104

## Specifies the 2nd timeout value in microseconds for the BSP/AP in SMM to wait for one another to enter SMM.
# @Prompt The 2nd BSP/AP synchronization timeout value in SMM.
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout2|1000000|UINT64|0x32132115

## Indicates the CPU synchronization method used when processing an SMI.
# 0x00 - Traditional CPU synchronization method.<BR>
# 0x01 - Relaxed CPU synchronization method.<BR>
Expand Down
6 changes: 5 additions & 1 deletion UefiCpuPkg/UefiCpuPkg.uni
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// This Package provides UEFI compatible CPU modules and libraries.
//
// Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2007 - 2024, Intel Corporation. All rights reserved.<BR>
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down Expand Up @@ -132,6 +132,10 @@

#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuSmmApSyncTimeout_HELP #language en-US "Specifies timeout value in microseconds for the BSP in SMM to wait for all APs to come into SMM."

#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuSmmApSyncTimeout2_PROMPT #language en-US "The 2nd BSP/AP synchronization timeout value in SMM"

#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuSmmApSyncTimeout2_HELP #language en-US "Specifies the 2nd timeout value in microseconds for the BSP/AP in SMM to wait for one another to enter SMM."

#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuSmmCodeAccessCheckEnable_PROMPT #language en-US "SMM Code Access Check"

#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuSmmCodeAccessCheckEnable_HELP #language en-US "Enable SMM Code Access Check? If enabled, the SMM handler cannot execute the code outside SMM regions. This PCD is suggested to TRUE in production image.<BR><BR>\n"
Expand Down

0 comments on commit 835d06b

Please sign in to comment.