linux/arch/powerpc/kvm
Sean Christopherson 2a49f61dfc KVM: Ensure validity of memslot with respect to kvm_get_dirty_log()
Rework kvm_get_dirty_log() so that it "returns" the associated memslot
on success.  A future patch will rework memslot handling such that
id_to_memslot() can return NULL, returning the memslot makes it more
obvious that the validity of the memslot has been verified, i.e.
precludes the need to add validity checks in the arch code that are
technically unnecessary.

To maintain ordering in s390, move the call to kvm_arch_sync_dirty_log()
from s390's kvm_vm_ioctl_get_dirty_log() to the new kvm_get_dirty_log().
This is a nop for PPC, the only other arch that doesn't select
KVM_GENERIC_DIRTYLOG_READ_PROTECT, as its sync_dirty_log() is empty.

Ideally, moving the sync_dirty_log() call would be done in a separate
patch, but it can't be done in a follow-on patch because that would
temporarily break s390's ordering.  Making the move in a preparatory
patch would be functionally correct, but would create an odd scenario
where the moved sync_dirty_log() would operate on a "different" memslot
due to consuming the result of a different id_to_memslot().  The
memslot couldn't actually be different as slots_lock is held, but the
code is confusing enough as it is, i.e. moving sync_dirty_log() in this
patch is the lesser of all evils.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-03-16 17:57:25 +01:00
..
book3s.c KVM: Provide common implementation for generic dirty log functions 2020-03-16 17:57:24 +01:00
book3s.h KVM: PPC: Book3S HV: Reuse kvmppc_inject_interrupt for async guest delivery 2019-10-22 16:29:02 +11:00
book3s_32_mmu.c KVM: PPC: Book3S: Replace reset_msr mmu op with inject_interrupt arch op 2019-10-22 16:29:02 +11:00
book3s_32_mmu_host.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_32_sr.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_64_mmu.c KVM: PPC: Book3S: Replace reset_msr mmu op with inject_interrupt arch op 2019-10-22 16:29:02 +11:00
book3s_64_mmu_host.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_64_mmu_hv.c KVM: PPC: Book3S: Replace current->mm by kvm->mm 2020-01-17 15:08:28 +11:00
book3s_64_mmu_radix.c powerpc updates for 5.6 2020-02-04 13:06:46 +00:00
book3s_64_slb.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_64_vio.c KVM: PPC: Book3S: Replace current->mm by kvm->mm 2020-01-17 15:08:28 +11:00
book3s_64_vio_hv.c KVM: PPC: Book3S: Invalidate multiple TCEs at once 2019-08-30 09:40:14 +10:00
book3s_emulate.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_exports.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_hv.c KVM: Simplify kvm_free_memslot() and all its descendents 2020-03-16 17:57:22 +01:00
book3s_hv_builtin.c KVM: PPC: Book3S HV: Implement LPCR[AIL]=3 mode for injected interrupts 2019-10-22 16:29:02 +11:00
book3s_hv_hmi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 114 2019-05-24 17:39:01 +02:00
book3s_hv_interrupts.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_hv_nested.c KVM: PPC: Book3S: Define and use SRR1_MSR_BITS 2019-10-22 16:29:02 +11:00
book3s_hv_ras.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
book3s_hv_rm_mmu.c powerpc/mm: Fixup tlbie vs mtpidr/mtlpidr ordering issue on POWER9 2019-09-24 20:58:55 +10:00
book3s_hv_rm_xics.c KVM: PPC: Book3S HV: use smp_mb() when setting/clearing host_ipi flag 2019-09-24 12:46:26 +10:00
book3s_hv_rm_xive.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
book3s_hv_rmhandlers.S powerpc/mm: Remove kvm radix prefetch workaround for Power9 DD2.2 2020-01-26 00:11:37 +11:00
book3s_hv_tm.c powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
book3s_hv_tm_builtin.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
book3s_hv_uvmem.c KVM: PPC: Book3S HV: Release lock on page-out failure path 2020-01-29 16:47:45 +11:00
book3s_interrupts.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_mmu_hpte.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_paired_singles.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_pr.c KVM: Ensure validity of memslot with respect to kvm_get_dirty_log() 2020-03-16 17:57:25 +01:00
book3s_pr_papr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
book3s_rmhandlers.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_rtas.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
book3s_segment.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_xics.c scripts/spelling.txt: drop "sepc" from the misspelling list 2019-07-12 11:05:41 -07:00
book3s_xics.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
book3s_xive.c KVM: PPC: Book3S HV: XIVE: Fix typo in comment 2020-01-23 21:31:23 +11:00
book3s_xive.h KVM: PPC: Book3S HV: XIVE: Make VP block size configurable 2019-10-22 16:29:02 +11:00
book3s_xive_native.c KVM: Use vcpu-specific gva->hva translation when querying host page size 2020-01-27 20:00:02 +01:00
book3s_xive_template.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
booke.c KVM: Provide common implementation for generic dirty log functions 2020-03-16 17:57:24 +01:00
booke.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
booke_emulate.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
booke_interrupts.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
bookehv_interrupts.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
e500.c KVM: PPC: Move kvm_vcpu_init() invocation to common code 2020-01-24 09:19:01 +01:00
e500.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
e500_emulate.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
e500_mmu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
e500_mmu_host.c KVM: PPC: E500: Replace current->mm by kvm->mm 2019-10-22 16:29:01 +11:00
e500_mmu_host.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
e500mc.c KVM: PPC: Move kvm_vcpu_init() invocation to common code 2020-01-24 09:19:01 +01:00
emulate.c Merge remote-tracking branch 'remotes/powerpc/topic/ppc-kvm' into kvm-ppc-next 2019-08-23 14:08:04 +10:00
emulate_loadstore.c KVM: PPC: Remove set but not used variable 'ra', 'rs', 'rt' 2020-01-17 15:08:28 +11:00
fpu.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
irq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig powerpc/Kconfig: Clean up formatting 2019-07-04 16:55:10 +10:00
Makefile KVM: PPC: Book3S HV: Support for running secure guests 2019-11-28 16:30:02 +11:00
mpic.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
powerpc.c KVM: Simplify kvm_free_memslot() and all its descendents 2020-03-16 17:57:22 +01:00
timing.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
timing.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
tm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
trace.h KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE 2018-11-07 23:04:38 +11:00
trace_book3s.h KVM: PPC: Book3S: Simplify external interrupt handling 2018-10-09 16:04:27 +11:00
trace_booke.h KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE 2018-11-07 23:04:38 +11:00
trace_hv.h KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE 2018-11-07 23:04:38 +11:00
trace_pr.h KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE 2018-11-07 23:04:38 +11:00