The Firmware Features extension is meant to control the behavior of specific firmware features. FWFT Feature Types defines 32-bit identifiers for the features which supervisor-mode software may request to set or get.
Value | Name | Description |
---|---|---|
0x00000000 |
MISALIGNED_EXC_DELEG |
Control misaligned access exception
delegation to supervisor-mode if
|
0x00000001 |
LANDING_PAD |
Control landing pad support for supervisor-mode. |
0x00000002 |
SHADOW_STACK |
Control shadow stack support for supervisor-mode. |
0x00000003 |
DOUBLE_TRAP |
Control double trap support for supervisor-mode. |
0x00000004 |
PTE_AD_HW_UPDATING |
Control hardware updating of PTE A/D bits for supervisor-mode. |
0x00000005 - 0x3fffffff |
Local feature types reserved for future use. |
|
0x40000000 - 0x7fffffff |
Platform specific local feature types. |
|
0x80000000 - 0xbfffffff |
Global feature types reserved for future use. |
|
0xc0000000 - 0xffffffff |
Platform specific global feature types. |
These features have some attributes that define their behavior and are described in FWFT Feature Attributes. The attribute values are defined for each feature in FWFT Feature Attribute Values.
Attribute | Description |
---|---|
Scope |
Defines if a feature is local (per-hart) or global. Global features only need to be enabled/disabled by a single hart, whereas local features need to be enabled/disabled by each hart. The status and flags of local features can be different from one hart to another. |
Reset value |
Reset value of the feature. Might be implementation defined. |
Values |
Per feature values that can be set. |
During non-retentive suspend, feature values are retained and restored by the SBI when resuming operations. Upon hart reset, local feature values are not retained and reset to their default reset values according to the feature description. Upon system reset, global and local feature values are reset.
Feature Name | Reset | Scope | Values | ||||
---|---|---|---|---|---|---|---|
MISALIGNED_EXC_DELEG |
Implementation-defined |
Local |
|
||||
LANDING_PAD |
0 |
Local |
|
||||
SHADOW_STACK |
0 |
Local |
|
||||
DOUBLE_TRAP |
0 |
Local |
|
||||
PTE_AD_HW_UPDATING |
0 |
Local |
|
struct sbiret sbi_fwft_set(unsigned long feature,
unsigned long value,
unsigned long flags)
A successful return from sbi_fwft_set()
results in the requested
firmware feature to be set according to the value
and flags
parameters for
which per feature supported values are described in
FWFT Feature Attributes and flags in FWFT Firmware Features Set Flags.
Name | Encoding | Description |
---|---|---|
LOCK |
BIT[0] |
If provided, once set, the feature value can no longer
be modified until: |
BIT[XLEN-1:1] |
Reserved for future use. |
In case of failure, feature
value is not modified and the possible error codes
returned in sbiret.error
are shown in FWFT Firmware Features Set Errors below.
Error code | Description |
---|---|
SBI_SUCCESS |
|
SBI_ERR_NOT_SUPPORTED |
|
SBI_ERR_INVALID_PARAM |
Provided |
SBI_ERR_DENIED |
|
SBI_ERR_FAILED |
The set operation failed for unspecified or unknown other reasons. |
Note
|
The rationale for an SBI implementation to return SBI_ERR_DENIED is for
instance to allow some hypervisors to simply passthrough the misaligned
delegation state to the Guest/VM and deny any changes to that delegation state
from the Guest/VM. If authorized, an SBI call would be required at each Guest/VM
switch if delegation choices are different between Host and Guest/VM.
|
struct sbiret sbi_fwft_get(unsigned long feature)
A successful return from sbi_fwft_get()
results in the firmware
feature configuration value to be returned in sbiret.value
. Possible
sbiret.value
values are described in FWFT Feature Attributes for each
feature ID.
In case of failure, the content of sbiret.value
is zero and the possible error
codes returned in sbiret.error
are shown in FWFT Firmware Features Get Errors.
Error code | Description |
---|---|
SBI_SUCCESS |
Feature status was retrieved successfully. |
SBI_ERR_NOT_SUPPORTED |
|
SBI_ERR_DENIED |
|
SBI_ERR_FAILED |
The get operation failed for unspecified or unknown other reasons. |