[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v2 14/26] armv7m: prevent unprivileged write to STIR
From: |
Michael Davidsaver |
Subject: |
[Qemu-arm] [PATCH v2 14/26] armv7m: prevent unprivileged write to STIR |
Date: |
Wed, 2 Dec 2015 19:18:41 -0500 |
Prevent unprivileged from writing to the
Software Triggered Interrupt register
---
hw/intc/armv7m_nvic.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 0f9ca6a..5731146 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -727,7 +727,9 @@ static void nvic_writel(NVICState *s, uint32_t offset,
uint32_t value)
"NVIC: Aux fault status registers unimplemented\n");
break;
case 0xf00: /* Software Triggered Interrupt Register */
- if ((value & 0x1ff) < NVIC_MAX_IRQ) {
+ /* STIR write allowed if privlaged or USERSETMPEND set */
+ if ((arm_current_el(&cpu->env) || (cpu->env.v7m.ccr & 2))
+ && ((value & 0x1ff) < NVIC_MAX_IRQ)) {
armv7m_nvic_set_pending(s, (value&0x1ff)+16);
}
break;
--
2.1.4
- Re: [Qemu-arm] [PATCH v2 11/26] arm: gic: Remove references to NVIC, (continued)
- [Qemu-arm] [PATCH v2 10/26] armv7m: auto-clear FAULTMASK, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 17/26] armv7m: mpu background miss is perm fault, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 21/26] armv7m: CONTROL<1> handling, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 16/26] armv7m: add some mpu debugging prints, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 24/26] armv7m: split armv7m_init in two parts, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 22/26] armv7m: priority field mask, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 25/26] armv7m: remove extra cpu_reset(), Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 15/26] armv7m: add MPU to cortex-m3 and cortex-m4, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 14/26] armv7m: prevent unprivileged write to STIR,
Michael Davidsaver <=
- [Qemu-arm] [PATCH v2 19/26] armv7m: mpu not allowed to map exception return codes, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 13/26] armv7m: implement CCR, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 12/26] armv7m: check exception return consistency, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 20/26] armv7m: observable initial register state, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 18/26] armv7m: update base region policy, Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 23/26] qom: add cpu_generic_init_unrealized(), Michael Davidsaver, 2015/12/02
- [Qemu-arm] [PATCH v2 08/26] armv7m: rewrite NVIC, Michael Davidsaver, 2015/12/02