summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e7660f9)
raw | patch | inline | side by side (parent: e7660f9)
author | Jan Kiszka <jan.kiszka@siemens.com> | |
Wed, 28 Feb 2018 07:41:58 +0000 (08:41 +0100) | ||
committer | Jan Kiszka <jan.kiszka@siemens.com> | |
Wed, 28 Feb 2018 07:41:58 +0000 (08:41 +0100) |
Jailhouse only supports hypercalls with the immediate code 0x4a48. Avoid
interpreting calls with other codes as ours.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
interpreting calls with other codes as ours.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
index f75a3b0041264456a57e6dbf163a35ef13f03ea7..15f736fc1286f67ff6f00a5132b7cfa9de994140 100644 (file)
unsigned long *regs = ctx->regs;
unsigned long code = regs[0];
+ if (HSR_ISS(ctx->hsr) != JAILHOUSE_HVC_CODE)
+ return TRAP_FORBIDDEN;
+
regs[0] = hypercall(code, regs[1], regs[2]);
if (code == JAILHOUSE_HC_DISABLE && regs[0] == 0)
index cd3092339932571bbd7283b42a8a260fd9ec4169..0c4a498d77b63e53125d26bb85f3b2ae7815670c 100644 (file)
unsigned long *regs = ctx->regs;
unsigned long code = regs[0];
+ if (ESR_ISS(ctx->esr) != JAILHOUSE_HVC_CODE)
+ return TRAP_FORBIDDEN;
+
regs[0] = hypercall(code, regs[1], regs[2]);
if (code == JAILHOUSE_HC_DISABLE && regs[0] == 0)
diff --git a/include/arch/arm/asm/jailhouse_hypercall.h b/include/arch/arm/asm/jailhouse_hypercall.h
index 8baec784e87931b1ae6728174de62cae106c56e0..e4eca625c9f2f877209cc5d5efa97b5576cf265c 100644 (file)
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define JAILHOUSE_HVC_CODE 0x4a48
+
#define JAILHOUSE_CALL_INS ".arch_extension virt\n\t" \
"hvc #0x4a48"
#define JAILHOUSE_CALL_NUM_RESULT "r0"
diff --git a/include/arch/arm64/asm/jailhouse_hypercall.h b/include/arch/arm64/asm/jailhouse_hypercall.h
index d9a9f6930c2a9a02b7b67391b90157874ad8f894..86ce6716c974b72d04af80e11c8437e1e1b3e835 100644 (file)
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define JAILHOUSE_HVC_CODE 0x4a48
+
#define JAILHOUSE_CALL_INS "hvc #0x4a48"
#define JAILHOUSE_CALL_NUM_RESULT "x0"
#define JAILHOUSE_CALL_ARG1 "x1"