* [PATCH] KVM: arm64: vgic: Update some comments to improve the code readability
@ 2025-01-08 10:39 Zhiyuan Dai
2025-01-08 10:58 ` Marc Zyngier
0 siblings, 1 reply; 2+ messages in thread
From: Zhiyuan Dai @ 2025-01-08 10:39 UTC (permalink / raw)
To: maz, oliver.upton, catalin.marinas
Cc: joey.gouly, uzuki.poulose, yuzenghui, kvmarm, linux-kernel,
Zhiyuan Dai
This patch updates the comments in the vgic_v3_queue_sgi function
to improve the readability of the code.
Signed-off-by: Zhiyuan Dai <daizhiyuan@phytium.com.cn>
---
arch/arm64/kvm/vgic/vgic-mmio-v3.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/vgic/vgic-mmio-v3.c b/arch/arm64/kvm/vgic/vgic-mmio-v3.c
index ae4c0593d114..f3b328373869 100644
--- a/arch/arm64/kvm/vgic/vgic-mmio-v3.c
+++ b/arch/arm64/kvm/vgic/vgic-mmio-v3.c
@@ -1040,8 +1040,13 @@ static void vgic_v3_queue_sgi(struct kvm_vcpu *vcpu, u32 sgi, bool allow_group1)
irq->pending_latch = true;
vgic_queue_irq_unlock(vcpu->kvm, irq, flags);
} else {
- /* HW SGI? Ask the GIC to inject it */
int err;
+
+ /*
+ * With GICv4.1, vSGI can be directly injected.
+ * So let's pretend that they are HW interrupts,
+ * tied to a host IRQ.
+ */
err = irq_set_irqchip_state(irq->host_irq,
IRQCHIP_STATE_PENDING,
true);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] KVM: arm64: vgic: Update some comments to improve the code readability
2025-01-08 10:39 [PATCH] KVM: arm64: vgic: Update some comments to improve the code readability Zhiyuan Dai
@ 2025-01-08 10:58 ` Marc Zyngier
0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2025-01-08 10:58 UTC (permalink / raw)
To: Zhiyuan Dai
Cc: oliver.upton, catalin.marinas, joey.gouly, suzuki.poulose,
yuzenghui, kvmarm, linux-kernel
[Fixing Suzuki's address]
On Wed, 08 Jan 2025 10:39:19 +0000,
Zhiyuan Dai <daizhiyuan@phytium.com.cn> wrote:
>
> This patch updates the comments in the vgic_v3_queue_sgi function
> to improve the readability of the code.
>
> Signed-off-by: Zhiyuan Dai <daizhiyuan@phytium.com.cn>
> ---
> arch/arm64/kvm/vgic/vgic-mmio-v3.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kvm/vgic/vgic-mmio-v3.c b/arch/arm64/kvm/vgic/vgic-mmio-v3.c
> index ae4c0593d114..f3b328373869 100644
> --- a/arch/arm64/kvm/vgic/vgic-mmio-v3.c
> +++ b/arch/arm64/kvm/vgic/vgic-mmio-v3.c
> @@ -1040,8 +1040,13 @@ static void vgic_v3_queue_sgi(struct kvm_vcpu *vcpu, u32 sgi, bool allow_group1)
> irq->pending_latch = true;
> vgic_queue_irq_unlock(vcpu->kvm, irq, flags);
> } else {
> - /* HW SGI? Ask the GIC to inject it */
> int err;
> +
> + /*
> + * With GICv4.1, vSGI can be directly injected.
> + * So let's pretend that they are HW interrupts,
> + * tied to a host IRQ.
> + */
> err = irq_set_irqchip_state(irq->host_irq,
> IRQCHIP_STATE_PENDING,
> true);
Do you really see this as an improvement? I don't think we need to
paraphrase the code, which is pretty obvious. If anything, I'd happily
remove the *existing* comment.
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-08 10:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-08 10:39 [PATCH] KVM: arm64: vgic: Update some comments to improve the code readability Zhiyuan Dai
2025-01-08 10:58 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox