linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Yoan Picchi <yoan.picchi@arm.com>
Cc: james.morse@arm.com, julien.thierry.kdev@gmail.com,
	suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, catalin.marinas@arm.com,
	will@kernel.org
Subject: Re: [PATCH 7/7] KVM: arm64: Add irq_inject counter for kvm_stat
Date: Tue, 23 Mar 2021 18:36:31 +0000	[thread overview]
Message-ID: <87ft0lk98w.wl-maz@kernel.org> (raw)
In-Reply-To: <c1ca65a5-1b7e-8ec2-ecbb-8ceda973bb14@arm.com>

On Tue, 23 Mar 2021 17:53:42 +0000,
Yoan Picchi <yoan.picchi@arm.com> wrote:
> 
> Hi Mark.

s/k/c/, please!

> 
> Thanks for all the reviews. I am a beginner and you gave me a lot to
> learn about.  I will reply to the other patch progressively once I
> understand better the issues.

I think you should consider what I said in my reply to the cover
letter before going all out on every counter you have introduced in
this series.

[...]

> >> diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c
> >> index 1c597c988..9e504243b 100644
> >> --- a/arch/arm64/kvm/vgic/vgic.c
> >> +++ b/arch/arm64/kvm/vgic/vgic.c
> >> @@ -458,6 +458,8 @@ int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int intid,
> >>     	raw_spin_lock_irqsave(&irq->irq_lock, flags);
> >>   +	kvm->stat.irq_inject++;
> >> +
> >>   	if (!vgic_validate_injection(irq, level, owner)) {
> > So even if the injection failed, you report an injection? And what
> > about injection that occur via the MMIO interface? What about direct
> > injection? What about a level interrupt that is forever high?
> > 
> > 	M.
> > 
> This one I actually started to fix this afternoon by moving the
> counter into vgic_queue_irq_unlock().  This way it is only
> incremented when the interrupt is inserted into a vcpu, and it also
> takes care of the vgic_mmio injections. I also fixed the issue with
> the interrupt line so it only increment when the line change of
> level.

But if you do that, you start counting interrupts the guest itself
generates. What is the exact semantic of this counter? userspace
injected interrupts? Acked interrupts? Any interrupt?

Take my level interrupt example. The interrupt will be forever
pending, the guest will take as many interrupt as it can process, and
yet your counter will have been incremented *once*. What does your
counter mean then?

> I'm not sure about what you mean by direct injection yet though.

GICv4.{0,1}, where an interrupt gets directly delivered to the guest
without (too much) SW intervention. With this, directly injected LPIs
will never result in the counter being incremented, and yet can pin
the guest to the ground under interrupt load.

Again, defining the exact behaviour of the counter would avoid me
ranting away...

	M.

-- 
Without deviation from the norm, progress is not possible.

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

  reply	other threads:[~2021-03-23 18:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 16:17 [PATCH 0/7] KVM: arm64: add more event counters for kvm_stat Yoan Picchi
2021-03-19 16:17 ` [PATCH 1/7] KVM: arm64: Add two page mapping " Yoan Picchi
2021-03-23 11:52   ` Keqian Zhu
2021-03-23 17:03     ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 2/7] KVM: arm64: Add remote_tlb_flush counter " Yoan Picchi
2021-03-23 17:12   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 3/7] KVM: arm64: Add cached_page_invalidated " Yoan Picchi
2021-03-23 17:17   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 4/7] KVM: arm64: Add flush_all_cache_lines " Yoan Picchi
2021-03-23 17:22   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 5/7] KVM: arm64: Add memory_slot_unmaped " Yoan Picchi
2021-03-23 17:33   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 6/7] KVM: arm64: Add stage2_unmap_vm " Yoan Picchi
2021-03-23 17:33   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 7/7] KVM: arm64: Add irq_inject " Yoan Picchi
2021-03-23 17:37   ` Marc Zyngier
2021-03-23 17:53     ` Yoan Picchi
2021-03-23 18:36       ` Marc Zyngier [this message]
2021-03-23 18:04 ` [PATCH 0/7] KVM: arm64: add more event counters " Marc Zyngier

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=87ft0lk98w.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yoan.picchi@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).