From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.51]) by mx.groups.io with SMTP id smtpd.web10.2497.1689198557954373952 for ; Wed, 12 Jul 2023 14:49:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=TCRdSGUG; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.243.51, mailfrom: gmahadevan@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jaMTYZXrBMFqTq4+Cqrn6YcLSjLFlUtd0WZVm6DmJtgBku/R9WC52yBJrAGGUTyadYaiT+N+sbkojWvJjpLdJyBLsf7A4nrYJzRsH2J2oClvalXpLCec6Rjw+wIjjc15+1nBAV6MbHeXPWNZR0QoVtmLQDi7rftVxGTDR9X/i2oAOldYAjVEnqWOzL0AxNHrSsyOyW24oyG3DvXwXwk3tlXVMGgCf8Iu5qT9Ogtm1GtnQqejzKs0oQQC9UHDor8TNx/G4IibI8JK0XpZLQCpKKI1T23Q9P0FmCwLWnEvxqFc4zOJKtz/wVX/Pd0KYLbh6r+l8clZkzWAoaJcxf8n4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AnJ+COCYQ2XFbq7/9c8o/eIGbwZ1orjj0wzWYgi8Ons=; b=Sef2HMsHYg0Vrkxk3xde8y1cv5nLIIl7mXRKdmcW04NnAumo07bVUDTmXgQxqx+3YldNu7yVIrCBu69sVqL9gyQo2KYSfBQ7xi2j50sQc85Yo2V0tSqEZ9jvNLxcjVY9RVQ7HYZyVWr0pZnFuH+bIvWnSqY18zzdN9XsaIi/5Cwo3kZ1Cec+EsVD0SeOL/noTq0//T7opOacVMUi82ljvEEdSVg7r/YMiBPtvShulTqE7CuRVk3j16T+o7zGGkcp3MxhL4cOnl/KqoXJxZlpmSBpeWKGaLdFsyzu04zYuc1IMr5bnUkvs+XceXFtxefsQ/EU+HUb5tWqBTxIhlWLvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AnJ+COCYQ2XFbq7/9c8o/eIGbwZ1orjj0wzWYgi8Ons=; b=TCRdSGUGsSeQJubnVATjiYdStZFfjcppEwPDxu/bIo9Gtw8EPvjmcFqUxM3zlOLRPWYqbNTq3FnxmeT9HyC8R/0lHSXm6UXVGQsKaxtpJXQAm4N1Or+m5ujLJUQXstw/IMQK/m9mZkgDZe3bNP8asLCUnG0w0e11YR4gJA/j/n6c80Q0DqotRN+u82X8wS7fCJyaVyL8GdTperrH+KP6kO9WtF3AlSImln9jfpzz+SiGwj7GJUzaD4fPgGRLZ7tPCn9mn8d9sJTgLrnn4kT1II83JL/sPKNCNXi9v1VT/R/t8wutI6hrWt3pap/GwfaDFDaBDeTpzC7obFcMsf5n8w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6297.namprd12.prod.outlook.com (2603:10b6:930:22::19) by MW6PR12MB8661.namprd12.prod.outlook.com (2603:10b6:303:23f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Wed, 12 Jul 2023 21:49:15 +0000 Received: from CY5PR12MB6297.namprd12.prod.outlook.com ([fe80::cc7d:38f9:a163:1106]) by CY5PR12MB6297.namprd12.prod.outlook.com ([fe80::cc7d:38f9:a163:1106%5]) with mapi id 15.20.6588.022; Wed, 12 Jul 2023 21:49:15 +0000 Message-ID: <700fef2b-47ed-b32a-5ad5-edb679f944ac@nvidia.com> Date: Wed, 12 Jul 2023 15:49:11 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 19/20] ArmPkg/MmCommunicationDxe: Use the FF-A transport for MM requests To: devel@edk2.groups.io, nishant.sharma@arm.com Cc: Ard Biesheuvel , Sami Mujawar , Thomas Abraham , Sayanta Pattanayak , Achin Gupta , Aditya Angadi References: <20230711143658.781597-1-nishant.sharma@arm.com> <20230711143658.781597-20-nishant.sharma@arm.com> From: "Girish Mahadevan" In-Reply-To: <20230711143658.781597-20-nishant.sharma@arm.com> X-ClientProxiedBy: MN2PR22CA0004.namprd22.prod.outlook.com (2603:10b6:208:238::9) To CY5PR12MB6297.namprd12.prod.outlook.com (2603:10b6:930:22::19) Return-Path: gmahadevan@nvidia.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6297:EE_|MW6PR12MB8661:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a53a1eb-7d97-48a7-5bcf-08db8321d652 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MNMn4b0gzRPfxqQSRfT1yRYspVuei9sSMa4u+LPtTDauZH4aVTah6O8ZRzksh9cdIXa80a5Ss1nBLzfW1M9QmGq1SJmv6h+w1gp5qAK/jmPNc48E2L8kUcwG/TTqs9NpEqYAn9ZZESVQB9enBlmf4Wkk/VwYjcV0nbe5ijds0ajW4GaoN/upekjJa5EhMFsjIpt5vsEj5mUy0LFh8kSv4d2roOuoJtOhs1LEHV8zn1hSfuouG4qAPqR+rDGF+GRJ86vGTiJWaiFWrRpfVzmifTFTnliGj1eO/k4ViNXY2oqBnGt6nbw6wu6FZ+14g660EswcuflDyVdez5pkYBUL8gOoSBGRkUUJy3a7226HfEWBQcBLs1+pG661JfdKE7p0QeMT3BZXlxpuX4k/T4MPsnKgGoCFHept867O4oc9pKyESBU4Z9rKFNE6mrI4d762B2OFD2tNmPcHeT/pZC9gw0wjOLU/ykNcxbTDHEDF25ROqj98+DbVyKz2KraJekXXDsh/4Yo4gxzWaVqcKdVt+343QBLQP5khim4wLyZYHWcttf502sxScmb0wah1BECfklJrncR7+5KD9K8Iv+L7nC0DIF5KTxzH9fCGIdjr6hx2K3FoWtnuUW963utXQvQFikc3dWCxAy9adzvilx78uw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6297.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(6029001)(4636009)(39860400002)(366004)(396003)(136003)(376002)(346002)(451199021)(31686004)(66899021)(6486002)(478600001)(6666004)(54906003)(19627235002)(86362001)(36756003)(2616005)(31696002)(2906002)(41300700001)(186003)(6506007)(6512007)(53546011)(966005)(83380400001)(26005)(38100700002)(66476007)(316002)(5660300002)(66556008)(8676002)(4326008)(66946007)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UDdQY0dEUnZwSkdnckJZZXBINDN2Q1pVZWQrVTVCN0ZWcWdRc2Jjemdab1VJ?= =?utf-8?B?WWl2OWFRMG9BM3pyYlJ6Y3pPV3F0eUZ1VHZOS1k5dWI0ZE1pdEROQlAxMGdH?= =?utf-8?B?L3ROUXMxSnhJaSsycnFld0gyQjBMVW5aQTliU242dkZLNXExUW5UalR3RDdo?= =?utf-8?B?L09kVklmbGFGWU5ZYnlia0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1eld1dC9o?= =?utf-8?B?VFJQeGRNU09LVTE3dTBzM0ZxV3ZUWlNmQStGT1BWSmJKd0g4eWpLL1JuKzBY?= =?utf-8?B?L21aaE5taUUxczRFdWY2UTFoVUY1VS9hWDdyem9kYzAvdjJIRkJIVXVKYTk1?= =?utf-8?Q?TgzPpplKh6CKp1V8B6jasP998?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a53a1eb-7d97-48a7-5bcf-08db8321d652 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 21:49:15.7470 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xrJd6u+LZDx7SCfsuv9ZPkdU3eVSRo1XXV+31pYl6Kw4NKdu0HWlEnr4iEMcrrklCoCF1eBgVVS5OEDRvQsSPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8661 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Couple of comments/questions inline (prefixed by [GM]) Thanks Girish On 7/11/2023 8:36 AM, Nishant Sharma via groups.io wrote: > External email: Use caution opening links or attachments > > > From: Achin Gupta > > This patch packages requests for accessing a Standalone MM driver > through the MM communication protocol as FF-A direct messages. > Corresponding changes in Standalone MM Core ensure that responses are > packaged in the same way. > > Signed-off-by: Achin Gupta > Co-developed-by: Aditya Angadi > Signed-off-by: Nishant Sharma > --- > ArmPkg/Include/IndustryStandard/ArmFfaSvc.h | 2 + > ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c | 141 +++++++++++++------- > 2 files changed, 97 insertions(+), 46 deletions(-) > > diff --git a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h > index 530af8bd3c2e..493997346143 100644 > --- a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h > +++ b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h > @@ -23,6 +23,7 @@ > #define ARM_SVC_ID_FFA_RXTX_UNMAP_AARCH32 0x84000067 > #define ARM_SVC_ID_FFA_PARTITION_INFO_GET_AARCH32 0x84000068 > #define ARM_SVC_ID_FFA_ID_GET_AARCH32 0x84000069 > +#define ARM_SVC_ID_FFA_RUN_AARCH32 0x8400006D > #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH32 0x8400006F > #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH32 0x84000070 > #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 0xC400006F > @@ -31,6 +32,7 @@ > #define ARM_SVC_ID_FFA_SUCCESS_AARCH64 0xC4000061 > #define ARM_SVC_ID_FFA_MEM_PERM_SET_AARCH32 0x84000089 > #define ARM_SVC_ID_FFA_MEM_PERM_GET_AARCH32 0x84000088 > +#define ARM_SVC_ID_FFA_INTERRUPT_AARCH32 0x84000062 > #define ARM_SVC_ID_FFA_ERROR_AARCH32 0x84000060 > #define ARM_SVC_ID_FFA_ERROR_AARCH64 0xC4000060 > #define ARM_SVC_ID_FFA_MSG_WAIT_AARCH32 0x8400006B > diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c > index 94a5d96c051d..a70318581bd2 100644 > --- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c > +++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c > @@ -100,6 +100,7 @@ MmCommunication2Communicate ( > ARM_SMC_ARGS CommunicateSmcArgs; > EFI_STATUS Status; > UINTN BufferSize; > + UINTN Ret; > > Status = EFI_ACCESS_DENIED; > BufferSize = 0; > @@ -160,60 +161,108 @@ MmCommunication2Communicate ( > return Status; > } > > - // SMC Function ID > - CommunicateSmcArgs.Arg0 = ARM_SMC_ID_MM_COMMUNICATE_AARCH64; > - > - // Cookie > - CommunicateSmcArgs.Arg1 = 0; > - > // Copy Communication Payload > CopyMem ((VOID *)mNsCommBuffMemRegion.VirtualBase, CommBufferVirtual, BufferSize); > > - // comm_buffer_address (64-bit physical address) > - CommunicateSmcArgs.Arg2 = (UINTN)mNsCommBuffMemRegion.PhysicalBase; [GM] Just out of curiosity, how are you figuring out this Address ? Hardcoding it in the PCD ? > + // Use the FF-A interface if enabled. > + if (FixedPcdGet32 (PcdFfaEnable) != 0) { > + // FF-A Interface ID for direct message communication > + CommunicateSmcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64; > > - // comm_size_address (not used, indicated by setting to zero) > - CommunicateSmcArgs.Arg3 = 0; > + // FF-A Destination EndPoint ID, not used as of now > + CommunicateSmcArgs.Arg1 = mFfaPartId << 16 | mStmmPartInfo.PartId; [GM] To be clear the Sender Id is 0. (so in FF-A anything from NS is 0 ? Correct ?) > > + // Reserved for future use(MBZ) > + CommunicateSmcArgs.Arg2 = 0x0; > + > + // comm_buffer_address (64-bit physical address) > + CommunicateSmcArgs.Arg3 = (UINTN)mNsCommBuffMemRegion.PhysicalBase; > + > + // Cookie > + CommunicateSmcArgs.Arg4 = 0x0; > + > + // Not Used > + CommunicateSmcArgs.Arg5 = 0; > + > + // comm_size_address (not used, indicated by setting to zero) > + CommunicateSmcArgs.Arg6 = 0; > + } else { > + // SMC Function ID > + CommunicateSmcArgs.Arg0 = ARM_SMC_ID_MM_COMMUNICATE_AARCH64; > + > + // Cookie > + CommunicateSmcArgs.Arg1 = 0; > + > + // comm_buffer_address (64-bit physical address) > + CommunicateSmcArgs.Arg2 = (UINTN)mNsCommBuffMemRegion.PhysicalBase; > + > + // comm_size_address (not used, indicated by setting to zero) > + CommunicateSmcArgs.Arg3 = 0; > + } > + > +ffa_intr_loop: > // Call the Standalone MM environment. > ArmCallSmc (&CommunicateSmcArgs); > > - switch (CommunicateSmcArgs.Arg0) { > - case ARM_SMC_MM_RET_SUCCESS: > - ZeroMem (CommBufferVirtual, BufferSize); > - // On successful return, the size of data being returned is inferred from > - // MessageLength + Header. > - CommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *)mNsCommBuffMemRegion.VirtualBase; > - BufferSize = CommunicateHeader->MessageLength + > - sizeof (CommunicateHeader->HeaderGuid) + > - sizeof (CommunicateHeader->MessageLength); > - > - CopyMem ( > - CommBufferVirtual, > - (VOID *)mNsCommBuffMemRegion.VirtualBase, > - BufferSize > - ); > - Status = EFI_SUCCESS; > - break; > - > - case ARM_SMC_MM_RET_INVALID_PARAMS: > - Status = EFI_INVALID_PARAMETER; > - break; > - > - case ARM_SMC_MM_RET_DENIED: > - Status = EFI_ACCESS_DENIED; > - break; > - > - case ARM_SMC_MM_RET_NO_MEMORY: > - // Unexpected error since the CommSize was checked for zero length > - // prior to issuing the SMC > - Status = EFI_OUT_OF_RESOURCES; > - ASSERT (0); > - break; > - > - default: > - Status = EFI_ACCESS_DENIED; > - ASSERT (0); > + Ret = CommunicateSmcArgs.Arg0; > + > + if (FixedPcdGet32 (PcdFfaEnable) != 0) { > + if (Ret == ARM_SVC_ID_FFA_INTERRUPT_AARCH32) { [GM] Can you clarify how we get here ? > + DEBUG ((DEBUG_INFO, "Resuming interrupted FF-A call \n")); > + > + // FF-A Interface ID for running the interrupted partition > + CommunicateSmcArgs.Arg0 = ARM_SVC_ID_FFA_RUN_AARCH32; > + > + // FF-A Destination EndPoint and vCPU ID, TODO: We are assuming vCPU0 of the > + // StMM SP since it is UP. > + CommunicateSmcArgs.Arg1 = mStmmPartInfo.PartId << 16; [GM] Does the encoding of this argument change in this re-try loop ? I thought destination was supposed to be lower 16 bits (like you'd done on #173). > + > + // Loop if the call was interrupted > + goto ffa_intr_loop; > + } > + } > + > + if (((FixedPcdGet32 (PcdFfaEnable) != 0) && > + (Ret == ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP)) || > + (Ret == ARM_SMC_MM_RET_SUCCESS)) { > + ZeroMem (CommBufferVirtual, BufferSize); > + // On successful return, the size of data being returned is inferred from > + // MessageLength + Header. > + CommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *)mNsCommBuffMemRegion.VirtualBase; > + BufferSize = CommunicateHeader->MessageLength + > + sizeof (CommunicateHeader->HeaderGuid) + > + sizeof (CommunicateHeader->MessageLength); > + > + CopyMem (CommBufferVirtual, (VOID *)mNsCommBuffMemRegion.VirtualBase, > + BufferSize); > + Status = EFI_SUCCESS; > + return Status; > + } > + > + if (FixedPcdGet32 (PcdFfaEnable) != 0) { > + Ret = CommunicateSmcArgs.Arg2; > + } > + > + // Error Codes are same for FF-A and SMC interface > + switch (Ret) { > + case ARM_SMC_MM_RET_INVALID_PARAMS: > + Status = EFI_INVALID_PARAMETER; > + break; > + > + case ARM_SMC_MM_RET_DENIED: > + Status = EFI_ACCESS_DENIED; > + break; > + > + case ARM_SMC_MM_RET_NO_MEMORY: > + // Unexpected error since the CommSize was checked for zero length > + // prior to issuing the SMC > + Status = EFI_OUT_OF_RESOURCES; > + ASSERT (0); > + break; > + > + default: > + Status = EFI_ACCESS_DENIED; > + ASSERT (0); > } > > return Status; > -- > 2.34.1 > > > > -=-=-=-=-=-= > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#106811): https://edk2.groups.io/g/devel/message/106811 > Mute This Topic: https://groups.io/mt/100079893/6098446 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [gmahadevan@nvidia.com] > -=-=-=-=-=-= > >