Merge "fix(rmmd): align RMI and GTSI FIDs with SMCCC" into integration
This commit is contained in:
commit
b09b150add
|
@ -14,12 +14,16 @@
|
||||||
#define GTSI_ERROR_INVALID_PAS -3
|
#define GTSI_ERROR_INVALID_PAS -3
|
||||||
|
|
||||||
/* The macros below are used to identify GTSI calls from the SMC function ID */
|
/* The macros below are used to identify GTSI calls from the SMC function ID */
|
||||||
#define GTSI_FNUM_MIN_VALUE U(0x100)
|
#define GTSI_FNUM_MIN_VALUE U(0x1B0)
|
||||||
#define GTSI_FNUM_MAX_VALUE U(0x101)
|
#define GTSI_FNUM_MAX_VALUE U(0x1B1)
|
||||||
#define is_gtsi_fid(fid) __extension__ ({ \
|
#define is_gtsi_fid(fid) __extension__ ({ \
|
||||||
__typeof__(fid) _fid = (fid); \
|
__typeof__(fid) _fid = (fid); \
|
||||||
((GET_SMC_NUM(_fid) >= GTSI_FNUM_MIN_VALUE) && \
|
((GET_SMC_NUM(_fid) >= GTSI_FNUM_MIN_VALUE) && \
|
||||||
(GET_SMC_NUM(_fid) <= GTSI_FNUM_MAX_VALUE)); })
|
(GET_SMC_NUM(_fid) <= GTSI_FNUM_MAX_VALUE) && \
|
||||||
|
(GET_SMC_TYPE(_fid) == SMC_TYPE_FAST) && \
|
||||||
|
(GET_SMC_CC(_fid) == SMC_64) && \
|
||||||
|
(GET_SMC_OEN(_fid) == OEN_STD_START) && \
|
||||||
|
((_fid & 0x00FE0000) == 0U)); })
|
||||||
|
|
||||||
/* Get GTSI fastcall std FID from function number */
|
/* Get GTSI fastcall std FID from function number */
|
||||||
#define GTSI_FID(smc_cc, func_num) \
|
#define GTSI_FID(smc_cc, func_num) \
|
||||||
|
@ -28,8 +32,8 @@
|
||||||
(OEN_STD_START << FUNCID_OEN_SHIFT) | \
|
(OEN_STD_START << FUNCID_OEN_SHIFT) | \
|
||||||
((func_num) << FUNCID_NUM_SHIFT))
|
((func_num) << FUNCID_NUM_SHIFT))
|
||||||
|
|
||||||
#define GRAN_TRANS_TO_REALM_FNUM U(0x100)
|
#define GRAN_TRANS_TO_REALM_FNUM U(0x1B0)
|
||||||
#define GRAN_TRANS_TO_NS_FNUM U(0x101)
|
#define GRAN_TRANS_TO_NS_FNUM U(0x1B1)
|
||||||
|
|
||||||
#define SMC_ASC_MARK_REALM GTSI_FID(SMC_64, GRAN_TRANS_TO_REALM_FNUM)
|
#define SMC_ASC_MARK_REALM GTSI_FID(SMC_64, GRAN_TRANS_TO_REALM_FNUM)
|
||||||
#define SMC_ASC_MARK_NONSECURE GTSI_FID(SMC_64, GRAN_TRANS_TO_NS_FNUM)
|
#define SMC_ASC_MARK_NONSECURE GTSI_FID(SMC_64, GRAN_TRANS_TO_NS_FNUM)
|
||||||
|
|
|
@ -17,22 +17,22 @@
|
||||||
#define RMI_ERROR_INVALID_PAS -3
|
#define RMI_ERROR_INVALID_PAS -3
|
||||||
|
|
||||||
/* The macros below are used to identify RMI calls from the SMC function ID */
|
/* The macros below are used to identify RMI calls from the SMC function ID */
|
||||||
#define RMI_FNUM_MIN_VALUE U(0x00)
|
#define RMI_FNUM_MIN_VALUE U(0x150)
|
||||||
#define RMI_FNUM_MAX_VALUE U(0x20)
|
#define RMI_FNUM_MAX_VALUE U(0x18F)
|
||||||
#define is_rmi_fid(fid) __extension__ ({ \
|
#define is_rmi_fid(fid) __extension__ ({ \
|
||||||
__typeof__(fid) _fid = (fid); \
|
__typeof__(fid) _fid = (fid); \
|
||||||
((GET_SMC_NUM(_fid) >= RMI_FNUM_MIN_VALUE) && \
|
((GET_SMC_NUM(_fid) >= RMI_FNUM_MIN_VALUE) && \
|
||||||
(GET_SMC_NUM(_fid) <= RMI_FNUM_MAX_VALUE) && \
|
(GET_SMC_NUM(_fid) <= RMI_FNUM_MAX_VALUE) && \
|
||||||
(GET_SMC_TYPE(_fid) == SMC_TYPE_FAST) && \
|
(GET_SMC_TYPE(_fid) == SMC_TYPE_FAST) && \
|
||||||
(GET_SMC_CC(_fid) == SMC_64) && \
|
(GET_SMC_CC(_fid) == SMC_64) && \
|
||||||
(GET_SMC_OEN(_fid) == OEN_ARM_START) && \
|
(GET_SMC_OEN(_fid) == OEN_STD_START) && \
|
||||||
((_fid & 0x00FE0000) == 0U)); })
|
((_fid & 0x00FE0000) == 0U)); })
|
||||||
|
|
||||||
/* Get RMI fastcall std FID from function number */
|
/* Get RMI fastcall std FID from function number */
|
||||||
#define RMI_FID(smc_cc, func_num) \
|
#define RMI_FID(smc_cc, func_num) \
|
||||||
((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT) | \
|
((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT) | \
|
||||||
((smc_cc) << FUNCID_CC_SHIFT) | \
|
((smc_cc) << FUNCID_CC_SHIFT) | \
|
||||||
(OEN_ARM_START << FUNCID_OEN_SHIFT) | \
|
(OEN_STD_START << FUNCID_OEN_SHIFT) | \
|
||||||
((func_num) << FUNCID_NUM_SHIFT))
|
((func_num) << FUNCID_NUM_SHIFT))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -41,19 +41,20 @@
|
||||||
* always invoked by the Normal world, forwarded by RMMD and handled by the
|
* always invoked by the Normal world, forwarded by RMMD and handled by the
|
||||||
* RMM
|
* RMM
|
||||||
*/
|
*/
|
||||||
#define RMI_FNUM_REQ_COMPLETE U(0x10)
|
#define RMI_FNUM_REQ_COMPLETE U(0x18F)
|
||||||
#define RMI_FNUM_VERSION_REQ U(0x00)
|
#define RMI_FNUM_VERSION_REQ U(0x150)
|
||||||
|
|
||||||
#define RMI_FNUM_GRAN_NS_REALM U(0x01)
|
#define RMI_FNUM_GRANULE_DELEGATE U(0x151)
|
||||||
#define RMI_FNUM_GRAN_REALM_NS U(0x02)
|
#define RMI_FNUM_GRANULE_UNDELEGATE U(0x152)
|
||||||
|
|
||||||
/* RMI SMC64 FIDs handled by the RMMD */
|
/* RMI SMC64 FIDs handled by the RMMD */
|
||||||
#define RMI_RMM_REQ_COMPLETE RMI_FID(SMC_64, RMI_FNUM_REQ_COMPLETE)
|
#define RMI_RMM_REQ_COMPLETE RMI_FID(SMC_64, RMI_FNUM_REQ_COMPLETE)
|
||||||
#define RMI_RMM_REQ_VERSION RMI_FID(SMC_64, RMI_FNUM_VERSION_REQ)
|
#define RMI_RMM_REQ_VERSION RMI_FID(SMC_64, RMI_FNUM_VERSION_REQ)
|
||||||
|
|
||||||
#define RMI_RMM_GRANULE_DELEGATE RMI_FID(SMC_64, RMI_FNUM_GRAN_NS_REALM)
|
#define RMI_RMM_GRANULE_DELEGATE RMI_FID(SMC_64, \
|
||||||
#define RMI_RMM_GRANULE_UNDELEGATE RMI_FID(SMC_64, RMI_FNUM_GRAN_REALM_NS)
|
RMI_FNUM_GRANULE_DELEGATE)
|
||||||
|
#define RMI_RMM_GRANULE_UNDELEGATE RMI_FID(SMC_64, \
|
||||||
|
RMI_FNUM_GRANULE_UNDELEGATE)
|
||||||
|
|
||||||
#define RMI_ABI_VERSION_GET_MAJOR(_version) ((_version) >> 16)
|
#define RMI_ABI_VERSION_GET_MAJOR(_version) ((_version) >> 16)
|
||||||
#define RMI_ABI_VERSION_GET_MINOR(_version) ((_version) & 0xFFFF)
|
#define RMI_ABI_VERSION_GET_MINOR(_version) ((_version) & 0xFFFF)
|
||||||
|
|
|
@ -11,19 +11,9 @@
|
||||||
#include <lib/cpus/wa_cve_2018_3639.h>
|
#include <lib/cpus/wa_cve_2018_3639.h>
|
||||||
#include <lib/smccc.h>
|
#include <lib/smccc.h>
|
||||||
#include <services/arm_arch_svc.h>
|
#include <services/arm_arch_svc.h>
|
||||||
#include <services/rmi_svc.h>
|
|
||||||
#include <services/rmmd_svc.h>
|
|
||||||
#include <smccc_helpers.h>
|
#include <smccc_helpers.h>
|
||||||
#include <plat/common/platform.h>
|
#include <plat/common/platform.h>
|
||||||
|
|
||||||
#if ENABLE_RME
|
|
||||||
/* Setup Arm architecture Services */
|
|
||||||
static int32_t arm_arch_svc_setup(void)
|
|
||||||
{
|
|
||||||
return rmmd_setup();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int32_t smccc_version(void)
|
static int32_t smccc_version(void)
|
||||||
{
|
{
|
||||||
return MAKE_SMCCC_VERSION(SMCCC_MAJOR_VERSION, SMCCC_MINOR_VERSION);
|
return MAKE_SMCCC_VERSION(SMCCC_MAJOR_VERSION, SMCCC_MINOR_VERSION);
|
||||||
|
@ -143,16 +133,6 @@ static uintptr_t arm_arch_svc_smc_handler(uint32_t smc_fid,
|
||||||
SMC_RET0(handle);
|
SMC_RET0(handle);
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
#if ENABLE_RME
|
|
||||||
/*
|
|
||||||
* RMI functions are allocated from the Arch service range. Call
|
|
||||||
* the RMM dispatcher to handle RMI calls.
|
|
||||||
*/
|
|
||||||
if (is_rmi_fid(smc_fid)) {
|
|
||||||
return rmmd_rmi_handler(smc_fid, x1, x2, x3, x4, cookie,
|
|
||||||
handle, flags);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
WARN("Unimplemented Arm Architecture Service Call: 0x%x \n",
|
WARN("Unimplemented Arm Architecture Service Call: 0x%x \n",
|
||||||
smc_fid);
|
smc_fid);
|
||||||
SMC_RET1(handle, SMC_UNK);
|
SMC_RET1(handle, SMC_UNK);
|
||||||
|
@ -165,10 +145,6 @@ DECLARE_RT_SVC(
|
||||||
OEN_ARM_START,
|
OEN_ARM_START,
|
||||||
OEN_ARM_END,
|
OEN_ARM_END,
|
||||||
SMC_TYPE_FAST,
|
SMC_TYPE_FAST,
|
||||||
#if ENABLE_RME
|
|
||||||
arm_arch_svc_setup,
|
|
||||||
#else
|
|
||||||
NULL,
|
NULL,
|
||||||
#endif
|
|
||||||
arm_arch_svc_smc_handler
|
arm_arch_svc_smc_handler
|
||||||
);
|
);
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include <lib/runtime_instr.h>
|
#include <lib/runtime_instr.h>
|
||||||
#include <services/gtsi_svc.h>
|
#include <services/gtsi_svc.h>
|
||||||
#include <services/pci_svc.h>
|
#include <services/pci_svc.h>
|
||||||
|
#include <services/rmi_svc.h>
|
||||||
#include <services/rmmd_svc.h>
|
#include <services/rmmd_svc.h>
|
||||||
#include <services/sdei.h>
|
#include <services/sdei.h>
|
||||||
#include <services/spm_mm_svc.h>
|
#include <services/spm_mm_svc.h>
|
||||||
|
@ -62,6 +63,12 @@ static int32_t std_svc_setup(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLE_RME
|
||||||
|
if (rmmd_setup() != 0) {
|
||||||
|
ret = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SDEI_SUPPORT
|
#if SDEI_SUPPORT
|
||||||
/* SDEI initialisation */
|
/* SDEI initialisation */
|
||||||
sdei_init();
|
sdei_init();
|
||||||
|
@ -169,6 +176,11 @@ static uintptr_t std_svc_smc_handler(uint32_t smc_fid,
|
||||||
return rmmd_gtsi_handler(smc_fid, x1, x2, x3, x4, cookie,
|
return rmmd_gtsi_handler(smc_fid, x1, x2, x3, x4, cookie,
|
||||||
handle, flags);
|
handle, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_rmi_fid(smc_fid)) {
|
||||||
|
return rmmd_rmi_handler(smc_fid, x1, x2, x3, x4, cookie,
|
||||||
|
handle, flags);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SMC_PCI_SUPPORT
|
#if SMC_PCI_SUPPORT
|
||||||
|
|
Loading…
Reference in New Issue