mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
Merge "fix(smccc): check smc_fid [23:17] bits" into integration
This commit is contained in:
commit
0e7d97d037
2 changed files with 22 additions and 8 deletions
|
@ -506,6 +506,17 @@ sync_handler64:
|
|||
/* Copy SCR_EL3.NS bit to the flag to indicate caller's security */
|
||||
bfi x7, x18, #0, #1
|
||||
|
||||
mov sp, x12
|
||||
|
||||
/*
|
||||
* Per SMCCC documentation, bits [23:17] must be zero for Fast
|
||||
* SMCs. Other values are reserved for future use. Ensure that
|
||||
* these bits are zeroes, if not report as unknown SMC.
|
||||
*/
|
||||
tbz x0, #FUNCID_TYPE_SHIFT, 2f /* Skip check if its a Yield Call*/
|
||||
tst x0, #(FUNCID_FC_RESERVED_MASK << FUNCID_FC_RESERVED_SHIFT)
|
||||
b.ne smc_unknown
|
||||
|
||||
/*
|
||||
* Per SMCCCv1.3 a caller can set the SVE hint bit in the SMC FID
|
||||
* passed through x0. Copy the SVE hint bit to flags and mask the
|
||||
|
@ -513,11 +524,10 @@ sync_handler64:
|
|||
* A service/dispatcher can retrieve the SVE hint bit state from
|
||||
* flags using the appropriate helper.
|
||||
*/
|
||||
2:
|
||||
bfi x7, x0, #FUNCID_SVE_HINT_SHIFT, #FUNCID_SVE_HINT_MASK
|
||||
bic x0, x0, #(FUNCID_SVE_HINT_MASK << FUNCID_SVE_HINT_SHIFT)
|
||||
|
||||
mov sp, x12
|
||||
|
||||
/* Get the unique owning entity number */
|
||||
ubfx x16, x0, #FUNCID_OEN_SHIFT, #FUNCID_OEN_WIDTH
|
||||
ubfx x15, x0, #FUNCID_TYPE_SHIFT, #FUNCID_TYPE_WIDTH
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2022, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2016-2023, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -37,6 +37,10 @@
|
|||
#define FUNCID_OEN_MASK U(0x3f)
|
||||
#define FUNCID_OEN_WIDTH U(6)
|
||||
|
||||
#define FUNCID_FC_RESERVED_SHIFT U(17)
|
||||
#define FUNCID_FC_RESERVED_MASK U(0x7f)
|
||||
#define FUNCID_FC_RESERVED_WIDTH U(7)
|
||||
|
||||
#define FUNCID_SVE_HINT_SHIFT U(16)
|
||||
#define FUNCID_SVE_HINT_MASK U(1)
|
||||
#define FUNCID_SVE_HINT_WIDTH U(1)
|
||||
|
|
Loading…
Add table
Reference in a new issue