Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org, kvm@vger.kernel.org,
	bpf@vger.kernel.org
Subject: Re: [RFC PATCH 03/16] KVM: Add NMI-safe guest-to-host IP translation infrastructure
Date: Tue, 01 Dec 2026 23:40:02 +0000	[thread overview]
Message-ID: <sashiko-outbox-244424@kernel.org> (raw)
In-Reply-To: <20261201232116.1988791-4-irogers@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] KVM: host-wide IPI storms from synchronize_rcu_expedited() on
  memslot swaps
--

commit c3fd2e2a56f630639fb857330005768b10210e44
Author: Ian Rogers <irogers@google.com>

KVM: Add NMI-safe guest-to-host IP translation infrastructure

This commit adds RCU-protected memslot lookup and no-fault guest memory
read helpers, and wires up kvm_guest_get_host_ip() in kvm_guest_cbs for
NMI-safe guest-to-host IP translation.

> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 83e727bf6452c..7935d4a346a37 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -1658,6 +1658,7 @@ static void kvm_swap_active_memslots(struct kvm *kvm, int as_id)
>  	mutex_unlock(&kvm->slots_arch_lock);
>  
>  	synchronize_srcu_expedited(&kvm->srcu);
> +	synchronize_rcu_expedited();

[Severity: Medium]
Does calling synchronize_rcu_expedited() unconditionally here cause
host-wide IPI storms on memslot updates?

Previously, kvm_swap_active_memslots() only synchronized the per-VM
kvm->srcu, which completes via local barriers and per-CPU counter checks
without sending cross-CPU IPIs.  Adding synchronize_rcu_expedited() turns
every memslot create or flag change into one global expedited RCU grace
period (and every delete or move into two, via kvm_invalidate_memslot()
followed by kvm_activate_memslot()), broadcasting IPIs to all non-idle
online CPUs on the host during VM startup, PCI BAR enumeration, or
dirty-log toggling even when no guest perf event is active or no vCPU has
run.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201232116.1988791-1-irogers@google.com?part=3

  reply	other threads:[~2026-12-01 23:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 23:21 [RFC PATCH 00/16] perf, kvm: Add PERF_SAMPLE_HOST_IP for host-side guest symbolization Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 01/16] perf/core: Add PERF_SAMPLE_HOST_IP sample format Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 02/16] perf/core, bpf: Support BPF filtering of mmap_data events Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 03/16] KVM: Add NMI-safe guest-to-host IP translation infrastructure Ian Rogers
2026-12-01 23:40   ` sashiko-bot [this message]
2026-12-01 23:21 ` [RFC PATCH 04/16] KVM: x86: Implement kvm_arch_vcpu_get_ip_gpa() Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 05/16] KVM: arm64: " Ian Rogers
2026-12-01 23:41   ` sashiko-bot
2026-12-01 23:21 ` [RFC PATCH 06/16] KVM: riscv: " Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 07/16] KVM: loongarch: " Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 08/16] tools headers UAPI: Sync linux/perf_event.h with the kernel sources Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 09/16] perf tools: Add PERF_SAMPLE_HOST_IP parsing, synthesis, and record --host-ip Ian Rogers
2026-12-01 23:36   ` sashiko-bot
2026-12-01 23:21 ` [RFC PATCH 10/16] perf symbol: Support host IP resolution and guest fallback symbolization Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 11/16] perf report, script: Add host_ip, host_dso, and host_sym fields Ian Rogers
2026-12-01 23:41   ` sashiko-bot
2026-12-01 23:21 ` [RFC PATCH 12/16] perf record: Synthesize hypervisor file-backed data mappings for --host-ip Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 13/16] perf record: Filter runtime hypervisor data mmaps with BPF " Ian Rogers
2026-12-01 23:43   ` sashiko-bot
2026-12-01 23:21 ` [RFC PATCH 14/16] perf bpf-filter: Support host_ip in BPF sample filters Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 15/16] perf aslr: Anonymize sampled host_ip values Ian Rogers
2026-12-01 23:21 ` [RFC PATCH 16/16] perf test: Add PERF_SAMPLE_HOST_IP symbolization, sorting, and ASLR tests Ian Rogers
2026-12-01 23:40   ` sashiko-bot
2026-12-01 23:43 ` [RFC PATCH 00/16] perf, kvm: Add PERF_SAMPLE_HOST_IP for host-side guest symbolization sashiko-bot

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=sashiko-outbox-244424@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=irogers@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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