mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kevin Brodsky <kevin.brodsky@arm.com>
To: "Jürgen Groß" <jgross@suse.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Cc: marmarek@invisiblethingslab.com,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/xen: Tolerate nested XEN_LAZY_MMU entering/leaving
Date: Mon, 18 May 2026 16:34:41 +0200	[thread overview]
Message-ID: <10d4eaed-eaee-47b7-9ccf-7f1931b26b02@arm.com> (raw)
In-Reply-To: <36fc4317-d7a0-410c-9d95-28858018053c@suse.com>

On 09/05/2026 08:32, Jürgen Groß wrote:
> On 08.05.26 22:54, Kevin Brodsky wrote:
>> On 08/05/2026 16:39, Juergen Gross wrote:
>>> With the support of nested lazy mmu sections it can happen that
>>> arch_enter_lazy_mmu_mode() is being called twice without a call of
>>> arch_leave_lazy_mmu_mode() in between, as the lazy_mmu_*() helpers
>>> are not disabling preemption when checking for nested lazy mmu
>>> sections.
>>
>> I think this is a correct description of the issue, i.e. potentially we
>> have arch_enter_lazy_mmu_mode() called twice *sequentially*. Therefore I
>> don't think that disabling preemption inside arch_enter_lazy_mmu_mode()
>> is enough - we have a problem with preemption occurring inside
>> lazy_mmu_mode_enable() generally, not necessarily inside
>> arch_enter_lazy_mmu_mode().
>>
>> Preemption shouldn't matter if commit 291b3abed657 is reverted. AFAICT
>> this is the only easy fix.
> The description wasn't really complete, I think.
>
> The double call will only be possible if arch_end_context_switch() is
> calling arch_enter_lazy_mmu_mode(), and this is happening for Xen PV
> only.
> arch_end_context_switch() is a nop for all other cases.

Right, agreed. Would be good to update the commit message.

>
> So this can be handled completely internal of Xen (otherwise a revert of
> 291b3abed657 wouldn't help), and it is easy to do so as my patch is
> showing.
>
> As said, I'd like to get rid of the extra tracking by Xen regarding
> lazy mode.

Got it, that would be best.

This patch should ensure that xen_lazy_mode always has the correct value
regardless of preemption, which is what matters for Xen.

Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>

  reply	other threads:[~2026-05-18 14:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 14:39 Juergen Gross
2026-05-08 20:54 ` Kevin Brodsky
2026-05-09  6:32   ` Jürgen Groß
2026-05-18 14:34     ` Kevin Brodsky [this message]
2026-05-12 16:05 ` Marek Marczykowski-Górecki
2026-05-12 16:10   ` Jürgen Groß

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=10d4eaed-eaee-47b7-9ccf-7f1931b26b02@arm.com \
    --to=kevin.brodsky@arm.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marmarek@invisiblethingslab.com \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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

all inboxes | Powered by JetHome®