All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Andreas Grapentin" <gra@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: Re: [PATCH 02/10] s390/sae: Add sae_entry and sae_exit symbols
Date: Fri, 04 Dec 2026 12:30:49 +0000	[thread overview]
Message-ID: <sashiko-outbox-249793@kernel.org> (raw)
In-Reply-To: <20261204-host-irq-v1-2-a8387ee8a380@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] KVM: s390: instrumentable virt_to_phys() in noinstr
  arm_vcpu_enter_exit()
--

commit 155c5874ac9bbb93ac7fc196ae66f83afc0d9d94
Author: Steffen Eiden <seiden@linux.ibm.com>

s390/sae: Add sae_entry and sae_exit symbols

This commit adds sae_entry and sae_exit boundary labels around the SAE
instruction in entry.S, exports sae_exit, and moves the sie_exit declaration
alongside sae_exit in asm/kvm_host.h.

> diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
> index 14dea207b30e8..8ef6fc13fc08c 100644
> --- a/arch/s390/kernel/entry.S
> +++ b/arch/s390/kernel/entry.S
> @@ -258,10 +258,12 @@ SYM_FUNC_START(sae)
>  	stg	%r3,__SF_SAE_BLOCK(%r15)	# save sae block for perf
>  	stg	%r4,__SF_SAE_VCPU(%r15)		# save vcpu ptr for interrupt handling
>  	stosm	__SF_SAE_IRQ(%r15),0x03
> +SYM_INNER_LABEL(sae_entry, SYM_L_LOCAL)
>  	.insn	rre,0xb9a50000,%r2,0		# Start Arm Execution

[Severity: Low]
Can calling virt_to_phys(sae_block) inside noinstr arm_vcpu_enter_exit()
violate the non-instrumentable guest-entry window under CONFIG_DEBUG_VIRTUAL?

In commit "s390/sae: Prepare handling host interrupts during SAE execution",
virt_to_phys(sae_block) was moved into arm_vcpu_enter_exit() between
guest_state_enter_irqoff() and sae():

arch/s390/kvm/arm64/arm.c:arm_vcpu_enter_exit() {
	guest_timing_enter_irqoff();
	guest_state_enter_irqoff();

	sae(virt_to_phys(sae_block), sae_block, vcpu);

	guest_state_exit_irqoff();
	guest_timing_exit_irqoff();
}

With CONFIG_DEBUG_VIRTUAL=y, virt_to_phys() expands through __pa() to the
out-of-line __phys_addr() and is_vmalloc_or_module_addr(), neither of which
is marked noinstr, notrace, or NOKPROBE_SYMBOL.

If a kprobe fires on __phys_addr() here while hardware IRQs are still
disabled, __do_pgm_check() -> irqentry_enter_from_kernel_mode() calls
lockdep_hardirqs_off(), and irqentry_exit_to_kernel_mode_after_preempt()
skips lockdep_hardirqs_on() because regs_irqs_disabled(regs) is true.

That leaves lockdep hardirq state disabled when sae() enables hardware IRQs
via stosm, leading to lockdep hardirq-state desynchronization and splats.
Computing virt_to_phys(sae_block) before guest_timing_enter_irqoff() or in
kvm_arch_vcpu_ioctl_run() avoids calling instrumentable code in this window.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-host-irq-v1-0-a8387ee8a380@linux.ibm.com?part=2

  reply	other threads:[~2026-12-04 12:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 12:09 [PATCH 00/10] s390: Host interrupt handling for SAE guests Andreas Grapentin
2026-12-04 12:09 ` [PATCH 01/10] s390/sae: Prepare handling host interrupts during SAE execution Andreas Grapentin
2026-12-04 12:31   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 02/10] s390/sae: Add sae_entry and sae_exit symbols Andreas Grapentin
2026-12-04 12:30   ` sashiko-bot [this message]
2026-12-04 12:09 ` [PATCH 03/10] KVM: s390: Share mcck_volatile_info between KVMs Andreas Grapentin
2026-12-04 12:09 ` [PATCH 04/10] s390/irq: Add kvm_exit callback for arm-on-s390 Andreas Grapentin
2026-12-04 12:40   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 05/10] KVM: s390: arm64: Enable host irq Andreas Grapentin
2026-12-04 12:35   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 06/10] s390: Rename CIF_MCCK_GUEST to CIF_MCCK_SIE Andreas Grapentin
2026-12-04 12:09 ` [PATCH 07/10] s390/nmi: Handle MCCKs for SAE guests Andreas Grapentin
2026-12-04 12:40   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 08/10] KVM: s390: arm64: Enable SError injection Andreas Grapentin
2026-12-04 12:34   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 09/10] KVM: s390: arm64: Enable mcck forwarding Andreas Grapentin
2026-12-04 12:33   ` sashiko-bot
2026-12-04 12:09 ` [PATCH 10/10] s390/perf: Recognize SAE guests Andreas Grapentin
2026-12-04 12:30   ` sashiko-bot
2026-12-04 12:40 ` [PATCH 00/10] s390: Host interrupt handling for " 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-249793@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=gra@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-s390@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 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.