Skip to content

Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs

Sean Christopherson kvm kvm-riscv kvmarm linux-arm-kernel linux-hyperv linux-riscv lkml loongarch rcu 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 9 repliesIn review
  2. v15 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Rebase on hyperv-next.
- Fix and converge the VTL code as well. [Peter, Nuno]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guestdrivers/hv/mshv_common.c drivers/hv/mshv_root_main.c drivers/hv/mshv_vtl_main.c+5 -31 reply
2/7Drivers: hv: Disentangle VTL return cancellation from SIGPENDINGdrivers/hv/mshv_vtl_main.c+7 -51 reply
3/7Drivers: hv: Disable IRQs only after handling pending work before VTL returndrivers/hv/mshv_vtl_main.c+7 -80 replies
4/7entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM properarch/arm64/kvm/arm.c arch/loongarch/kvm/vcpu.c arch/riscv/kvm/vcpu.c +5 more+24 -261 reply
5/7entry: Rename "kvm" entry code assets to "virt" to genericize APIsMAINTAINERS arch/arm64/kvm/Kconfig arch/loongarch/kvm/Kconfig +9 more+19 -192 replies
6/7Drivers: hv: Use common "entry virt" APIs to do work in root before running guestdrivers/hv/Kconfig drivers/hv/mshv_root_main.c+7 -261 reply
7/7Drivers: hv: Use "entry virt" APIs to do work before returning to lower VTLdrivers/hv/Kconfig drivers/hv/mshv.h drivers/hv/mshv_common.c +1 more+4 -320 replies

Reviews trailers per patch

4 of 7 patches have a Reviewed-by or Acked-by.

PatchNuno Das NevesThomas GleixnerJoel Fernandes
1/7T-b R-b
2/7
3/7
4/7R-b
5/7R-b R-b
6/7T-b R-b
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/7] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs

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/[email protected]

Sean Christopherson (7):
Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest
Drivers: hv: Disentangle VTL return cancellation from SIGPENDING
Drivers: hv: Disable IRQs only after handling pending work before VTL
return
entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM
proper
entry: Rename "kvm" entry code assets to "virt" to genericize APIs
Drivers: hv: Use common "entry virt" APIs to do work in root before
running guest
Drivers: hv: Use "entry virt" APIs to do work before returning to
lower VTL

 MAINTAINERS                                 |  2 +-
 arch/arm64/kvm/Kconfig                      |  2 +-
 arch/arm64/kvm/arm.c                        |  3 +-
 arch/loongarch/kvm/Kconfig                  |  2 +-
 arch/loongarch/kvm/vcpu.c                   |  3 +-
 arch/riscv/kvm/Kconfig                      |  2 +-
 arch/riscv/kvm/vcpu.c                       |  3 +-
 arch/x86/kvm/Kconfig                        |  2 +-
 arch/x86/kvm/vmx/vmx.c                      |  1 -
 arch/x86/kvm/x86.c                          |  3 +-
 drivers/hv/Kconfig                          |  2 ++
 drivers/hv/mshv.h                           |  2 --
 drivers/hv/mshv_common.c                    | 22 ---------------
 drivers/hv/mshv_root_main.c                 | 31 ++++-----------------
 drivers/hv/mshv_vtl_main.c                  | 23 +++++++--------
 include/linux/{entry-kvm.h => entry-virt.h} | 19 +++++--------
 include/linux/kvm_host.h                    | 17 +++++++++--
 include/linux/rcupdate.h                    |  2 +-
 kernel/entry/Makefile                       |  2 +-
 kernel/entry/{kvm.c => virt.c}              | 15 ++++------
 kernel/rcu/tree.c                           |  6 ++--
 virt/kvm/Kconfig                            |  2 +-
 22 files changed, 60 insertions(+), 106 deletions(-)
 rename include/linux/{entry-kvm.h => entry-virt.h} (83%)
 rename kernel/entry/{kvm.c => virt.c} (66%)

base-commit: 03ac62a578566730ab3c320f289f7320798ee2e1

Signature · 1 line
2.51.0.268.g9569e192d0-goog