public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org,
	Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Subject: [PATCH v2 2/2] ArmPkg/Include: Add SVC function IDs for Management Mode.
Date: Wed, 27 Sep 2017 19:58:59 +0100	[thread overview]
Message-ID: <20170927185859.27833-2-supreeth.venkatesh@arm.com> (raw)
In-Reply-To: <20170927185859.27833-1-supreeth.venkatesh@arm.com>

SVCs are in the range 0xC4000060 - 0xC400007f.
The functions available to the secure MM partition:
1. Signal completion of MM event handling.
2. Set/Get memory attributes for a memory region at runtime.
3. Get version number of secure partition manager.

Also, it defines memory attributes required for set/get operations.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
---
 ArmPkg/Include/IndustryStandard/ArmMmSvc.h | 43 ++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 ArmPkg/Include/IndustryStandard/ArmMmSvc.h

diff --git a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
new file mode 100644
index 0000000000..4c7b6c3386
--- /dev/null
+++ b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
@@ -0,0 +1,43 @@
+/** @file
+*
+*  Copyright (c) 2012-2017, ARM Limited. All rights reserved.
+*
+*  This program and the accompanying materials
+*  are licensed and made available under the terms and conditions of the BSD License
+*  which accompanies this distribution.  The full text of the license may be found at
+*  http://opensource.org/licenses/bsd-license.php
+*
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+#ifndef __ARM_MM_SVC_H__
+#define __ARM_MM_SVC_H__
+
+/*
+ * SVC IDs to allow the MM secure partition to initialise itself, handle
+ * delegated events and request the Secure partition manager to perform
+ * privileged operations on its behalf.
+ */
+#define ARM_SVC_ID_SPM_VERSION_AARCH64             0xC4000060
+#define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64       0xC4000061
+#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64   0xC4000064
+#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64   0xC4000065
+
+#define SET_MEM_ATTR_DATA_PERM_MASK       0x3
+#define SET_MEM_ATTR_DATA_PERM_SHIFT        0
+#define SET_MEM_ATTR_DATA_PERM_NO_ACCESS    0
+#define SET_MEM_ATTR_DATA_PERM_RW           1
+#define SET_MEM_ATTR_DATA_PERM_RO           3
+
+#define SET_MEM_ATTR_CODE_PERM_MASK   0x1
+#define SET_MEM_ATTR_CODE_PERM_SHIFT    2
+#define SET_MEM_ATTR_CODE_PERM_X        0
+#define SET_MEM_ATTR_CODE_PERM_XN       1
+
+#define SET_MEM_ATTR_MAKE_PERM_REQUEST(d_perm, c_perm)                            \
+    ((((c_perm) & SET_MEM_ATTR_CODE_PERM_MASK) << SET_MEM_ATTR_CODE_PERM_SHIFT) | \
+    (( (d_perm) & SET_MEM_ATTR_DATA_PERM_MASK) << SET_MEM_ATTR_DATA_PERM_SHIFT))
+
+#endif
-- 
2.14.1



  reply	other threads:[~2017-09-27 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 18:58 [PATCH v2 1/2] ArmPkg/Include: Add standard SMC function IDs for MM interface Supreeth Venkatesh
2017-09-27 18:58 ` Supreeth Venkatesh [this message]
2017-10-06 21:05 ` Ard Biesheuvel
2017-10-09  8:52   ` Achin Gupta
2017-10-09 15:15     ` Supreeth Venkatesh
2017-10-09 22:19       ` Achin Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170927185859.27833-2-supreeth.venkatesh@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox