diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2014-01-22 04:43:38 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2014-03-02 20:15:23 -0500 |
commit | ac30a11e8e92a03dbe236b285c5cbae0bf563141 (patch) | |
tree | fe7e8a2493f46af06b0c59c18f71ab60562b3d15 /arch/arm/kvm/interrupts_head.S | |
parent | 547f781378a22b65c2ab468f235c23001b5924da (diff) |
ARM: KVM: introduce per-vcpu HYP Configuration Register
So far, KVM/ARM used a fixed HCR configuration per guest, except for
the VI/VF/VA bits to control the interrupt in absence of VGIC.
With the upcoming need to dynamically reconfigure trapping, it becomes
necessary to allow the HCR to be changed on a per-vcpu basis.
The fix here is to mimic what KVM/arm64 already does: a per vcpu HCR
field, initialized at setup time.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/kvm/interrupts_head.S')
-rw-r--r-- | arch/arm/kvm/interrupts_head.S | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S index 6f18695a09cb..a37270d7d4d6 100644 --- a/arch/arm/kvm/interrupts_head.S +++ b/arch/arm/kvm/interrupts_head.S | |||
@@ -597,17 +597,14 @@ vcpu .req r0 @ vcpu pointer always in r0 | |||
597 | 597 | ||
598 | /* Enable/Disable: stage-2 trans., trap interrupts, trap wfi, trap smc */ | 598 | /* Enable/Disable: stage-2 trans., trap interrupts, trap wfi, trap smc */ |
599 | .macro configure_hyp_role operation | 599 | .macro configure_hyp_role operation |
600 | mrc p15, 4, r2, c1, c1, 0 @ HCR | ||
601 | bic r2, r2, #HCR_VIRT_EXCP_MASK | ||
602 | ldr r3, =HCR_GUEST_MASK | ||
603 | .if \operation == vmentry | 600 | .if \operation == vmentry |
604 | orr r2, r2, r3 | 601 | ldr r2, [vcpu, #VCPU_HCR] |
605 | ldr r3, [vcpu, #VCPU_IRQ_LINES] | 602 | ldr r3, [vcpu, #VCPU_IRQ_LINES] |
606 | orr r2, r2, r3 | 603 | orr r2, r2, r3 |
607 | .else | 604 | .else |
608 | bic r2, r2, r3 | 605 | mov r2, #0 |
609 | .endif | 606 | .endif |
610 | mcr p15, 4, r2, c1, c1, 0 | 607 | mcr p15, 4, r2, c1, c1, 0 @ HCR |
611 | .endm | 608 | .endm |
612 | 609 | ||
613 | .macro load_vcpu | 610 | .macro load_vcpu |