[Android-virt] [PATCH 1/4] ARM: KVM: Do not trap on WFE execution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We currently trap both WFI and WFE, and treat WFE exactly as WFI.
This is not a very nice thing to do in an SMP configuration, as
any spinlock contention on the guest will result in a massive
performance degradation.

WFE is usually used for very short periods, so staying on the
physical CPU is likely to be the best choice.

Signed-off-by: Marc Zyngier <marc.zyngier at arm.com>
---
 arch/arm/include/asm/kvm_arm.h |    2 +-
 arch/arm/kvm/interrupts.S      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/kvm_arm.h b/arch/arm/include/asm/kvm_arm.h
index 1769187..0b21e52 100644
--- a/arch/arm/include/asm/kvm_arm.h
+++ b/arch/arm/include/asm/kvm_arm.h
@@ -47,7 +47,7 @@
 #define HCR_PTW		(1 << 2)
 #define HCR_SWIO	(1 << 1)
 #define HCR_VM		1
-#define HCR_GUEST_MASK (HCR_TSC | HCR_TWE | HCR_TWI | HCR_VM | HCR_AMO | \
+#define HCR_GUEST_MASK (HCR_TSC | HCR_TWI | HCR_VM | \
 			HCR_AMO | HCR_IMO | HCR_FMO | HCR_SWIO)
 #define HCR_VIRT_EXCP_MASK (HCR_VA | HCR_VI | HCR_VF)
 
diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
index 4830d8b..2c32d22 100644
--- a/arch/arm/kvm/interrupts.S
+++ b/arch/arm/kvm/interrupts.S
@@ -249,7 +249,7 @@ ENTRY(__kvm_flush_vm_context)
 	mcr	p15, 4, r2, c1, c1, 3
 .endm
 
-/* Enable/Disable: stage-2 trans., trap interrupts, trap wfi/wfe, trap smc */
+/* Enable/Disable: stage-2 trans., trap interrupts, trap wfi, trap smc */
 .macro configure_hyp_role entry, vcpu_ptr
 	mrc	p15, 4, r2, c1, c1, 0	@ HCR
 	bic	r2, r2, #HCR_VIRT_EXCP_MASK
-- 
1.7.7.1





[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux