Skip to contentSkip to conversation

arm64: Add SMC and HVC commands

PATCH Superseded Michalis Pappas 2 participants 3 messages Apr 9, 2018

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm64: Add SMC and HVC commands

This patch adds smc and hvc commands, that allow issuing Secure Monitor Calls and Hypervisor Calls conforming to the ARM SMC Calling Convention.

Add Kconfig items to allow each command can be individually enabled.

---

 cmd/Kconfig  | 14 ++++++++++
 cmd/Makefile |  2 ++
 cmd/smccc.c  | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+)
 create mode 100644 cmd/smccc.c
cmd/Kconfig +14 -0
index 136836d146..a2b09620f3 100644
@@ -1348,6 +1348,20 @@ config CMD_HASH
 	  saved to memory or to an environment variable. It is also possible
 	  to verify a hash against data in memory.
 
+config CMD_HVC
+	bool "Support the 'hvc' command"
+	depends on ARM64
+	help
+	  Allows issuing Hypervisor Calls (HVCs). Mostly useful for
+	  development and testing.
+
+config CMD_SMC
+	bool "Support the 'smc' command"
+	depends on ARM64
+	help
+	  Allows issuing Secure Monitor Calls (SMCs). Mostly useful for
+	  development and testing.
+
 config HASH_VERIFY
 	bool "hash -v"
 	depends on CMD_HASH
cmd/Makefile +2 -0
index 9a358e4801..5656a1a40a 100644
@@ -61,6 +61,7 @@ obj-$(CONFIG_CMD_FS_GENERIC) += fs.o
 obj-$(CONFIG_CMD_FUSE) += fuse.o
 obj-$(CONFIG_CMD_GETTIME) += gettime.o
 obj-$(CONFIG_CMD_GPIO) += gpio.o
+obj-$(CONFIG_CMD_HVC) += smccc.o
 obj-$(CONFIG_CMD_I2C) += i2c.o
 obj-$(CONFIG_CMD_IOTRACE) += iotrace.o
 obj-$(CONFIG_CMD_HASH) += hash.o
@@ -113,6 +114,7 @@ obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o
 obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
 obj-$(CONFIG_CMD_SPI) += spi.o
 obj-$(CONFIG_CMD_STRINGS) += strings.o
+obj-$(CONFIG_CMD_SMC) += smccc.o
 obj-$(CONFIG_CMD_TERMINAL) += terminal.o
 obj-$(CONFIG_CMD_TIME) += time.o
 obj-$(CONFIG_CMD_TRACE) += trace.o
cmd/smccc.c new file +72 -0

72 lines not on this page · raw message

--
2.17.0

#1 lore raw

PATCH v2 1/1 arm64: Add SMC and HVC commands

Quoted 25 lines · Michalis Pappas

This patch adds smc and hvc commands, that allow issuing Secure Monitor Calls and Hypervisor Calls conforming to the ARM SMC Calling Convention.

Add Kconfig items to allow each command can be individually enabled.

---

 cmd/Kconfig  | 14 ++++++++++
 cmd/Makefile |  2 ++
 cmd/smccc.c  | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+)
 create mode 100644 cmd/smccc.c
cmd/Kconfig +3 -0
index 136836d146..a2b09620f3 100644
@@ -1348,6 +1348,20 @@ config CMD_HASH
 	  saved to memory or to an environment variable. It is also possible
 	  to verify a hash against data in memory.
 
+config CMD_HVC
+	bool "Support the 'hvc' command"
+	depends on ARM64

cmd/Kconfig config CMD_HASH · line 1363

Quoted 10 lines
cmd/Kconfig +10 -0
+	help
+	  Allows issuing Hypervisor Calls (HVCs). Mostly useful for
+	  development and testing.
+
+config CMD_SMC
+	bool "Support the 'smc' command"
+	depends on ARM64
+	help
+	  Allows issuing Secure Monitor Calls (SMCs). Mostly useful for
+	  development and testing.

Sorry for not catching this before, in both cases we should depend on ARM_SMCC as that's what provides the underlying functions and is available on both ARMv7 and ARMv8.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180409/5affe874/attachment.sig>
#2 lore raw

PATCH v2 1/1 arm64: Add SMC and HVC commands

Quoted 23 lines · Tom Rini
Quoted 22 lines · Michalis Pappas

This patch adds smc and hvc commands, that allow issuing Secure Monitor Calls and Hypervisor Calls conforming to the ARM SMC Calling Convention.

Add Kconfig items to allow each command can be individually enabled.

---

  cmd/Kconfig  | 14 ++++++++++
  cmd/Makefile |  2 ++
  cmd/smccc.c  | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 88 insertions(+)

create mode 100644 cmd/smccc.c

cmd/Kconfig +0 -0
index 136836d146..a2b09620f3 100644
@@ -1348,6 +1348,20 @@ config CMD_HASH
  	  saved to memory or to an environment variable. It is also possible
  	  to verify a hash against data in memory.
 
Quoted 17 lines

cmd/Kconfig config CMD_HASH · line 1363

Quoted 13 lines
cmd/Kconfig +13 -0
+config CMD_HVC
+	bool "Support the 'hvc' command"
+	depends on ARM64
+	help
+	  Allows issuing Hypervisor Calls (HVCs). Mostly useful for
+	  development and testing.
+
+config CMD_SMC
+	bool "Support the 'smc' command"
+	depends on ARM64
+	help
+	  Allows issuing Secure Monitor Calls (SMCs). Mostly useful for
+	  development and testing.

Sorry for not catching this before, in both cases we should depend on ARM_SMCC as that's what provides the underlying functions and is available on both ARMv7 and ARMv8.

Ah, you're right, I should had spotted that too. Will replace the ARM64 dependendy with ARM_SMCCC and issue another patch.

Thanks