]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(xilinx): resolve integer handling issue
authorAkshay Belsare <Akshay.Belsare@amd.com>
Thu, 15 Dec 2022 10:26:23 +0000 (15:56 +0530)
committerAkshay Belsare <akshay.belsare@amd.com>
Fri, 16 Dec 2022 12:13:43 +0000 (17:43 +0530)
OEN Number 48 to 63 is for Trusted App and OS.
GET_SMC_OEN limits the return value of OEN number to 63 by bitwise AND
operation with 0x3F. Thus the upper limit check for OEN value returned
by GET_SMC_OEN is not required.
Removing the upper limit check for the OEN value returned by GET_SMC_OEN
resolves integer handling issue CONSTANT_EXPRESSION_RESULT

Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
Change-Id: Ie04a4e2fb7cc85ec6055a5662736a805a89f7085

plat/xilinx/common/ipi_mailbox_service/ipi_mailbox_svc.c

index 30b0176a088e138a56f2c5754e61a31634334984..8438aba7bf5a972ed53c473833d0982c922ead8e 100644 (file)
@@ -74,8 +74,12 @@ uint64_t ipi_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2,
        ipi_local_id = x1 & UNSIGNED32_MASK;
        ipi_remote_id = x2 & UNSIGNED32_MASK;
 
-       if ((GET_SMC_OEN(smc_fid) >= OEN_TAP_START) &&
-           (GET_SMC_OEN(smc_fid) <= OEN_TOS_END)) {
+       /* OEN Number 48 to 63 is for Trusted App and OS
+        * GET_SMC_OEN limits the return value of OEN number to 63 by bitwise
+        * AND operation with 0x3F.
+        * Upper limit check for OEN value is not required.
+        */
+       if (GET_SMC_OEN(smc_fid) >= OEN_TAP_START) {
                is_secure = 1;
        } else {
                is_secure = 0;