All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Christoffer Dall <christoffer.dall@arm.com>,
	Eric Auger <eric.auger@redhat.com>,
	KarimAllah Ahmed <karahmed@amazon.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Olof Johansson <olof@lixom.net>,
	Vladimir Murzin <vladimir.murzin@arm.com>,
	Will Deacon <will@kernel.org>, Zenghui Yu <yuzenghui@huawei.com>,
	James Morse <james.morse@arm.com>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org,
	kvmarm@lists.cs.columbia.edu
Subject: [PATCH 14/15] KVM: arm64: GICv4.1: Allow non-trapping WFI when using HW SGIs
Date: Tue, 31 Mar 2020 13:16:44 +0100	[thread overview]
Message-ID: <20200331121645.388250-15-maz@kernel.org> (raw)
In-Reply-To: <20200331121645.388250-1-maz@kernel.org>

Just like for VLPIs, it is beneficial to avoid trapping on WFI when the
vcpu is using the GICv4.1 SGIs.

Add such a check to vcpu_clear_wfx_traps().

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20200304203330.4967-23-maz@kernel.org
---
 arch/arm64/include/asm/kvm_emulate.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
index f658dda12364..a30b4eec7cb4 100644
--- a/arch/arm64/include/asm/kvm_emulate.h
+++ b/arch/arm64/include/asm/kvm_emulate.h
@@ -89,7 +89,8 @@ static inline unsigned long *vcpu_hcr(struct kvm_vcpu *vcpu)
 static inline void vcpu_clear_wfx_traps(struct kvm_vcpu *vcpu)
 {
 	vcpu->arch.hcr_el2 &= ~HCR_TWE;
-	if (atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count))
+	if (atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count) ||
+	    vcpu->kvm->arch.vgic.nassgireq)
 		vcpu->arch.hcr_el2 &= ~HCR_TWI;
 	else
 		vcpu->arch.hcr_el2 |= HCR_TWI;
-- 
2.25.0


WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	KarimAllah Ahmed <karahmed@amazon.de>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	Olof Johansson <olof@lixom.net>, Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu
Subject: [PATCH 14/15] KVM: arm64: GICv4.1: Allow non-trapping WFI when using HW SGIs
Date: Tue, 31 Mar 2020 13:16:44 +0100	[thread overview]
Message-ID: <20200331121645.388250-15-maz@kernel.org> (raw)
In-Reply-To: <20200331121645.388250-1-maz@kernel.org>

Just like for VLPIs, it is beneficial to avoid trapping on WFI when the
vcpu is using the GICv4.1 SGIs.

Add such a check to vcpu_clear_wfx_traps().

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20200304203330.4967-23-maz@kernel.org
---
 arch/arm64/include/asm/kvm_emulate.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
index f658dda12364..a30b4eec7cb4 100644
--- a/arch/arm64/include/asm/kvm_emulate.h
+++ b/arch/arm64/include/asm/kvm_emulate.h
@@ -89,7 +89,8 @@ static inline unsigned long *vcpu_hcr(struct kvm_vcpu *vcpu)
 static inline void vcpu_clear_wfx_traps(struct kvm_vcpu *vcpu)
 {
 	vcpu->arch.hcr_el2 &= ~HCR_TWE;
-	if (atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count))
+	if (atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count) ||
+	    vcpu->kvm->arch.vgic.nassgireq)
 		vcpu->arch.hcr_el2 &= ~HCR_TWI;
 	else
 		vcpu->arch.hcr_el2 |= HCR_TWI;
-- 
2.25.0

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Vladimir Murzin <vladimir.murzin@arm.com>,
	kvm@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	KarimAllah Ahmed <karahmed@amazon.de>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Christoffer Dall <christoffer.dall@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Eric Auger <eric.auger@redhat.com>,
	James Morse <james.morse@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	Olof Johansson <olof@lixom.net>, Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu,
	Julien Thierry <julien.thierry.kdev@gmail.com>
Subject: [PATCH 14/15] KVM: arm64: GICv4.1: Allow non-trapping WFI when using HW SGIs
Date: Tue, 31 Mar 2020 13:16:44 +0100	[thread overview]
Message-ID: <20200331121645.388250-15-maz@kernel.org> (raw)
In-Reply-To: <20200331121645.388250-1-maz@kernel.org>

Just like for VLPIs, it is beneficial to avoid trapping on WFI when the
vcpu is using the GICv4.1 SGIs.

Add such a check to vcpu_clear_wfx_traps().

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20200304203330.4967-23-maz@kernel.org
---
 arch/arm64/include/asm/kvm_emulate.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
index f658dda12364..a30b4eec7cb4 100644
--- a/arch/arm64/include/asm/kvm_emulate.h
+++ b/arch/arm64/include/asm/kvm_emulate.h
@@ -89,7 +89,8 @@ static inline unsigned long *vcpu_hcr(struct kvm_vcpu *vcpu)
 static inline void vcpu_clear_wfx_traps(struct kvm_vcpu *vcpu)
 {
 	vcpu->arch.hcr_el2 &= ~HCR_TWE;
-	if (atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count))
+	if (atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count) ||
+	    vcpu->kvm->arch.vgic.nassgireq)
 		vcpu->arch.hcr_el2 &= ~HCR_TWI;
 	else
 		vcpu->arch.hcr_el2 |= HCR_TWI;
-- 
2.25.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-03-31 12:21 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 12:16 [GIT PULL] KVM/arm updates for Linux 5.7 Marc Zyngier
2020-03-31 12:16 ` Marc Zyngier
2020-03-31 12:16 ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 01/15] KVM: arm64: Use the correct timer structure to access the physical counter Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 02/15] arm: Unplug KVM from the build system Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 03/15] arm: Remove KVM from config files Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 04/15] arm: Remove 32bit KVM host support Marc Zyngier
2020-03-31 12:16 ` [PATCH 05/15] arm: Remove HYP/Stage-2 page-table support Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 06/15] arm: Remove GICv3 vgic compatibility macros Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 07/15] arm: Remove the ability to set HYP vectors outside of the decompressor Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 08/15] MAINTAINERS: RIP KVM/arm Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 09/15] KVM: arm64: GICv4.1: Let doorbells be auto-enabled Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 10/15] KVM: arm64: GICv4.1: Add direct injection capability to SGI registers Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 11/15] KVM: arm64: GICv4.1: Allow SGIs to switch between HW and SW interrupts Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 12/15] KVM: arm64: GICv4.1: Plumb SGI implementation selection in the distributor Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 13/15] KVM: arm64: GICv4.1: Reload VLPI configuration on distributor enable/disable Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` Marc Zyngier [this message]
2020-03-31 12:16   ` [PATCH 14/15] KVM: arm64: GICv4.1: Allow non-trapping WFI when using HW SGIs Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16 ` [PATCH 15/15] KVM: arm64: GICv4.1: Expose HW-based SGIs in debugfs Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 12:16   ` Marc Zyngier
2020-03-31 14:45 ` [GIT PULL] KVM/arm updates for Linux 5.7 Paolo Bonzini
2020-03-31 14:45   ` Paolo Bonzini
2020-03-31 14:45   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200331121645.388250-15-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@arm.com \
    --cc=eric.auger@redhat.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=karahmed@amazon.de \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=olof@lixom.net \
    --cc=pbonzini@redhat.com \
    --cc=suzuki.poulose@arm.com \
    --cc=vladimir.murzin@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.