[PW_SID:995384] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs - #835
[PW_SID:995384] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs#835linux-riscv-bot wants to merge 5 commits into
Conversation
Move the root partition's handling of pending thread work fully into mshv_common.c so that the "work pending" and "do work" code is co-located. Splitting the flags-to-check logic makes the code unnnecessarily difficult to maintain, e.g. it would be all too easy to add a check in "do work" but not in "work pending", and vice versa. Note, this adds an extra CALL+RET when no work is pending; that will be remedied in the near feature by switching to common virtualization entry APIs. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Check for NEED_RESCHED_LAZY, not just NEED_RESCHED, prior to transferring control to a guest. Failure to check for lazy resched can unnecessarily delay rescheduling until the next tick when using a lazy preemption model. Fixes: 621191d ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs") Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…oper Move KVM's morphing of pending signals into userspace exits into KVM proper, and drop the @vcpu param from xfer_to_guest_mode_handle_work(). How KVM responds to -EINTR is a detail that really belongs in KVM itself, and invoking kvm_handle_signal_exit() from kernel code creates an inverted module dependency. E.g. attempting to move kvm_handle_signal_exit() into kvm_main.c would generate an linker error when building kvm.ko as a module. Dropping KVM details will also converting the KVM "entry" code into a more generic virtualization framework so that it can be used when running as a Hyper-V root partition. Lastly, eliminating usage of "struct kvm_vcpu" outside of KVM is also nice to have for KVM x86 developers, as keeping the details of kvm_vcpu purely within KVM allows changing the layout of the structure without having to boot into a new kernel, e.g. allows rebuilding and reloading kvm.ko with a modified kvm_vcpu structure as part of debug/development. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Rename the "kvm" entry code files and Kconfigs to use generic "virt" nomenclature so that the code can be reused by other hypervisors (or rather, their root/dom0 partition drivers), without incorrectly suggesting the code somehow relies on and/or involves KVM. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…uest Use the kernel's common "entry virt" APIs to handle pending work prior to (re)entering guest mode, now that the virt APIs don't have a superfluous dependency on KVM. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 1: "[1/5] Drivers: hv: Move TIF pre-guest work handling fully into mshv_common.c" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 2: "[2/5] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest" |
|
Patch 3: "[3/5] entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper" |
|
Patch 3: "[3/5] entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper" |
|
Patch 3: "[3/5] entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper" |
|
Patch 3: "[3/5] entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper" |
|
Patch 3: "[3/5] entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 4: "[4/5] entry: Rename "kvm" entry code assets to "virt" to genericize APIs" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
|
Patch 5: "[5/5] Drivers: hv: Use common "entry virt" APIs to do work before running guest" |
PR for series 995384 applied to workflow__riscv__fixes
Name: Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=995384
Version: 1