From: Sean Christopherson <seanjc@google.com>
To: Wei Liu <wei.liu@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Tianrui Zhao <zhaotianrui@loongson.cn>,
Bibo Mao <maobibo@loongson.cn>,
Huacai Chen <chenhuacai@kernel.org>,
Anup Patel <anup@brainfault.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Dexuan Cui <decui@microsoft.com>,
Peter Zijlstra <peterz@infradead.org>,
Andy Lutomirski <luto@kernel.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Joel Fernandes <joelagnelf@nvidia.com>,
Josh Triplett <josh@joshtriplett.org>,
Boqun Feng <boqun.feng@gmail.com>,
Uladzislau Rezki <urezki@gmail.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
kvm@vger.kernel.org, loongarch@lists.linux.dev,
kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org,
linux-hyperv@vger.kernel.org, rcu@vger.kernel.org,
Nuno Das Neves <nunodasneves@linux.microsoft.com>,
Mukesh R <mrathor@linux.microsoft.com>
Subject: Re: [PATCH v2 0/7] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs
Date: Thu, 4 Sep 2025 22:39:37 -0700 [thread overview]
Message-ID: <aLp3makY6FzuUwor@google.com> (raw)
In-Reply-To: <aLojpyTwAMdb1z6D@liuwe-devbox-ubuntu-v2.lamzopl0uupeniq2etz1fddiyg.xx.internal.cloudapp.net>
On Thu, Sep 04, 2025, Wei Liu wrote:
> On Wed, Aug 27, 2025 at 05:01:49PM -0700, Sean Christopherson wrote:
> > Fix a bug where MSHV root partitions (and upper-level VTL code) don't honor
> > NEED_RESCHED_LAZY, and then deduplicate the TIF related MSHV code by turning
> > the "kvm" entry APIs into more generic "virt" APIs.
> >
> > This version is based on
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-next
> >
> > in order to pickup the VTL changes that are queued for 6.18. I also
> > squashed the NEED_RESCHED_LAZY fixes for root and VTL modes into a single
> > patch, as it should be easy/straightforward to drop the VTL change as needed
> > if we want this in 6.17 or earlier.
> >
> > That effectively means the full series is dependent on the VTL changes being
> > fully merged for 6.18. But I think that's ok as it's really only the MSHV
> > changes that have any urgency whatsoever, and I assume that Microsoft is
> > the only user that truly cares about the MSHV root fix. I.e. if the whole
> > thing gets delayed, I think it's only the Hyper-V folks that are impacted.
> >
> > I have no preference what tree this goes through, or when, and can respin
> > and/or split as needed.
> >
> > As with v1, the Hyper-V stuff and non-x86 architectures are compile-tested
> > only.
> >
> > v2:
> > - Rebase on hyperv-next.
> > - Fix and converge the VTL code as well. [Peter, Nuno]
> >
> > v1: https://lore.kernel.org/all/20250825200622.3759571-1-seanjc@google.com
> >
>
> I dropped the mshv_vtl changes in this series and applied the rest
> (including the KVM changes) to hyperv-next.
mshv_do_pre_guest_mode_work() ended up getting left behind since its removal was
in the last mshv_vtl patch.
$ git grep mshv_do_pre_guest_mode_work
drivers/hv/mshv.h:int mshv_do_pre_guest_mode_work(ulong th_flags);
drivers/hv/mshv_common.c:int mshv_do_pre_guest_mode_work(ulong th_flags)
drivers/hv/mshv_common.c:EXPORT_SYMBOL_GPL(mshv_do_pre_guest_mode_work);
Want to squash this into 3786d7d6b3c0 ("mshv: Use common "entry virt" APIs to do
work in root before running guest")?
---
drivers/hv/mshv.h | 2 --
drivers/hv/mshv_common.c | 22 ----------------------
2 files changed, 24 deletions(-)
diff --git a/drivers/hv/mshv.h b/drivers/hv/mshv.h
index 0340a67acd0a..d4813df92b9c 100644
--- a/drivers/hv/mshv.h
+++ b/drivers/hv/mshv.h
@@ -25,6 +25,4 @@ int hv_call_set_vp_registers(u32 vp_index, u64 partition_id, u16 count,
int hv_call_get_partition_property(u64 partition_id, u64 property_code,
u64 *property_value);
-int mshv_do_pre_guest_mode_work(ulong th_flags);
-
#endif /* _MSHV_H */
diff --git a/drivers/hv/mshv_common.c b/drivers/hv/mshv_common.c
index eb3df3e296bb..aa2be51979fd 100644
--- a/drivers/hv/mshv_common.c
+++ b/drivers/hv/mshv_common.c
@@ -138,25 +138,3 @@ int hv_call_get_partition_property(u64 partition_id,
return 0;
}
EXPORT_SYMBOL_GPL(hv_call_get_partition_property);
-
-/*
- * Handle any pre-processing before going into the guest mode on this cpu, most
- * notably call schedule(). Must be invoked with both preemption and
- * interrupts enabled.
- *
- * Returns: 0 on success, -errno on error.
- */
-int mshv_do_pre_guest_mode_work(ulong th_flags)
-{
- if (th_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
- return -EINTR;
-
- if (th_flags & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY))
- schedule();
-
- if (th_flags & _TIF_NOTIFY_RESUME)
- resume_user_mode_work(NULL);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(mshv_do_pre_guest_mode_work);
base-commit: 3786d7d6b3c0a412ebe4439ba4a7d4b0e27d9a12
--
prev parent reply other threads:[~2025-09-05 5:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 0:01 [PATCH v2 0/7] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs Sean Christopherson
2025-08-28 0:01 ` [PATCH v2 1/7] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest Sean Christopherson
2025-08-28 23:56 ` Nuno Das Neves
2025-08-28 0:01 ` [PATCH v2 2/7] Drivers: hv: Disentangle VTL return cancellation from SIGPENDING Sean Christopherson
2025-08-29 18:38 ` Wei Liu
2025-08-28 0:01 ` [PATCH v2 3/7] Drivers: hv: Disable IRQs only after handling pending work before VTL return Sean Christopherson
2025-08-28 0:01 ` [PATCH v2 4/7] entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper Sean Christopherson
2025-09-02 15:41 ` Thomas Gleixner
2025-08-28 0:01 ` [PATCH v2 5/7] entry: Rename "kvm" entry code assets to "virt" to genericize APIs Sean Christopherson
2025-09-02 15:41 ` Thomas Gleixner
2025-08-28 0:01 ` [PATCH v2 6/7] Drivers: hv: Use common "entry virt" APIs to do work in root before running guest Sean Christopherson
2025-08-29 0:03 ` Nuno Das Neves
2025-08-28 0:01 ` [PATCH v2 7/7] Drivers: hv: Use "entry virt" APIs to do work before returning to lower VTL Sean Christopherson
2025-09-04 23:41 ` [PATCH v2 0/7] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs Wei Liu
2025-09-05 5:39 ` Sean Christopherson [this message]
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=aLp3makY6FzuUwor@google.com \
--to=seanjc@google.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=boqun.feng@gmail.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=frederic@kernel.org \
--cc=haiyangz@microsoft.com \
--cc=joelagnelf@nvidia.com \
--cc=josh@joshtriplett.org \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=kys@microsoft.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=luto@kernel.org \
--cc=maobibo@loongson.cn \
--cc=maz@kernel.org \
--cc=mingo@redhat.com \
--cc=mrathor@linux.microsoft.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=nunodasneves@linux.microsoft.com \
--cc=oliver.upton@linux.dev \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=paulmck@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=urezki@gmail.com \
--cc=wei.liu@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=zhaotianrui@loongson.cn \
/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).