linux/arch/powerpc/kvm
Jordan Niethe 797a5af8fc KVM: PPC: Reduce reliance on analyse_instr() in mmio emulation
Commit 7092360399 ("KVM: PPC: Reimplement non-SIMD LOAD/STORE
instruction mmio emulation with analyse_instr() input") and
commit 2b33cb585f ("KVM: PPC: Reimplement LOAD_FP/STORE_FP instruction
mmio emulation with analyse_instr() input") made
kvmppc_emulate_loadstore() use the results from analyse_instr() for
instruction emulation. In particular the effective address from
analyse_instr() is used for UPDATE type instructions and fact that
op.val is all ready endian corrected is used in the STORE case.

However, these changes now have some negative implications for the
nestedv2 case.  For analyse_instr() to determine the correct effective
address, the GPRs must be loaded from the L0. This is not needed as
vcpu->arch.vaddr_accessed is already set. Change back to using
vcpu->arch.vaddr_accessed.

In the STORE case, use kvmppc_get_gpr() value instead of the op.val.
kvmppc_get_gpr() will reload from the L0 if needed in the nestedv2 case.
This means if a byte reversal is needed must now be passed to
kvmppc_handle_store() like in the kvmppc_handle_load() case.

This means the call to kvmhv_nestedv2_reload_ptregs() can be avoided as
there is no concern about op.val being stale. Drop the call to
kvmhv_nestedv2_mark_dirty_ptregs() as without the call to
kvmhv_nestedv2_reload_ptregs(), stale state could be marked as valid.

This is fine as the required marking things dirty is already handled for
the UPDATE case by the call to kvmppc_set_gpr(). For LOADs, it is
handled in kvmppc_complete_mmio_load(). This is called either directly
in __kvmppc_handle_load() if the load can be handled in KVM, or on the
next kvm_arch_vcpu_ioctl_run() if an exit was required.

Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231201132618.555031-12-vaibhav@linux.ibm.com
2023-12-07 23:33:08 +11:00
..
book3s_32_mmu_host.c powerpc/32s: move CTX_TO_VSID() into mmu-hash.h 2021-06-17 00:09:08 +10:00
book3s_32_mmu.c KVM: Use 'unsigned long' as kvm_for_each_vcpu()'s index 2021-12-08 04:24:15 -05:00
book3s_32_sr.S KVM: PPC: Book3S PR: Enable MSR_DR for switch_mmu_context() 2022-05-11 23:03:16 +10:00
book3s_64_entry.S docs: move powerpc under arch 2023-10-10 13:35:55 -06:00
book3s_64_mmu_host.c KVM: Rename mmu_notifier_* to mmu_invalidate_* 2022-08-19 04:05:41 -04:00
book3s_64_mmu_hv.c KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long 2023-09-14 22:04:24 +10:00
book3s_64_mmu_radix.c KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST 2023-12-07 23:33:08 +11:00
book3s_64_mmu.c KVM: Use 'unsigned long' as kvm_for_each_vcpu()'s index 2021-12-08 04:24:15 -05:00
book3s_64_slb.S
book3s_64_vio.c Merge branch 'topic/ppc-kvm' into next 2023-10-27 20:58:03 +11:00
book3s_emulate.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
book3s_exports.c
book3s_hv_builtin.c KVM: PPC: Book3S HV: Introduce low level MSR accessor 2023-09-14 22:04:24 +10:00
book3s_hv_hmi.c KVM: PPC: Book3S HV P9: Remove subcore HMI handling 2021-11-24 21:09:03 +11:00
book3s_hv_interrupts.S powerpc: Fix objtool unannotated intra-function call warnings 2022-11-15 20:11:47 +11:00
book3s_hv_nested.c KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest 2023-12-07 23:33:07 +11:00
book3s_hv_nestedv2.c KVM: PPC: Book3S HV nestedv2: Register the VPA with the L0 2023-12-07 23:33:08 +11:00
book3s_hv_p9_entry.c KVM: PPC: Use accessors for VCPU registers 2023-09-14 22:04:24 +10:00
book3s_hv_p9_perf.c powerpc/kvm: Remove comment related to moving PMU code to perf subsystem 2022-07-20 22:28:31 +10:00
book3s_hv_ras.c KVM: PPC: Use accessors for VCORE registers 2023-09-14 22:04:24 +10:00
book3s_hv_rm_mmu.c KVM: PPC: Always use the GPR accessors 2023-09-14 22:04:23 +10:00
book3s_hv_rm_xics.c KVM: PPC: Always use the GPR accessors 2023-09-14 22:04:23 +10:00
book3s_hv_rmhandlers.S powerpc: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-16 23:54:48 +10:00
book3s_hv_tm_builtin.c
book3s_hv_tm.c KVM: PPC: Book3S HV Nested: Fix TM softpatch HFAC interrupt emulation 2021-08-25 16:37:17 +10:00
book3s_hv_uvmem.c KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long 2023-09-14 22:04:24 +10:00
book3s_hv.c KVM: PPC: Book3S HV nestedv2: Register the VPA with the L0 2023-12-07 23:33:08 +11:00
book3s_hv.h KVM: PPC: Add support for nestedv2 guests 2023-09-14 22:04:24 +10:00
book3s_interrupts.S powerpc: Replace PPC64_ELF_ABI_v{1/2} by CONFIG_PPC64_ELF_ABI_V{1/2} 2022-05-19 23:11:29 +10:00
book3s_mmu_hpte.c
book3s_paired_singles.c KVM: PPC: Make kvmppc_get_last_inst() produce a ppc_inst_t 2023-04-03 15:45:41 +10:00
book3s_pr_papr.c KVM: remove KVM_REQ_UNHALT 2022-09-26 12:37:21 -04:00
book3s_pr.c s390: 2023-05-01 12:06:20 -07:00
book3s_rmhandlers.S KVM: PPC: Enable prefixed instructions for HV KVM and disable for PR KVM 2023-04-03 15:45:59 +10:00
book3s_rtas.c KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused 2022-04-21 13:16:11 -04:00
book3s_segment.S KVM: PPC: Book3S 64: move bad_host_intr check to HV handler 2021-06-10 22:12:12 +10:00
book3s_xics.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
book3s_xics.h KVM: PPC: Book3s: Fix warning about xics_rm_h_xirr_x 2022-06-24 12:58:33 +10:00
book3s_xive_native.c powerpc: Use NULL instead of 0 for null pointers 2023-10-19 17:12:47 +11:00
book3s_xive.c KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long 2023-09-14 22:04:24 +10:00
book3s_xive.h powerpc/xive: remove unused parameter 2022-11-24 23:12:18 +11:00
book3s.c KVM: PPC: Book3S HV nestedv2: Do not inject certain interrupts 2023-12-07 23:33:07 +11:00
book3s.h KVM: PPC: Book3S PR: Declare kvmppc_handle_exit_pr() 2021-08-20 22:17:38 +10:00
booke_emulate.c
booke_interrupts.S powerpc: Remove CONFIG_FSL_BOOKE 2022-09-26 22:47:37 +10:00
booke.c KVM: PPC: Fetch prefixed instructions from the guest 2023-04-03 15:45:50 +10:00
booke.h KVM: PPC: BookE: Fix W=1 warnings 2023-04-03 14:54:20 +10:00
bookehv_interrupts.S KVM: PPC: Fetch prefixed instructions from the guest 2023-04-03 15:45:50 +10:00
e500_emulate.c KVM: Use 'unsigned long' as kvm_for_each_vcpu()'s index 2021-12-08 04:24:15 -05:00
e500_mmu_host.c KVM: PPC: Fetch prefixed instructions from the guest 2023-04-03 15:45:50 +10:00
e500_mmu_host.h
e500_mmu.c
e500.c KVM: Drop kvm_arch_check_processor_compat() hook 2022-12-29 15:41:28 -05:00
e500.h powerpc: Remove CONFIG_PPC_BOOK3E_MMU 2022-09-26 23:00:14 +10:00
e500mc.c powerpc/inst: add PPC_TLBILX_LPID 2023-08-16 23:54:48 +10:00
emulate_loadstore.c KVM: PPC: Reduce reliance on analyse_instr() in mmio emulation 2023-12-07 23:33:08 +11:00
emulate.c KVM: PPC: Fetch prefixed instructions from the guest 2023-04-03 15:45:50 +10:00
fpu.S powerpc/32: Fix objtool unannotated intra-function call warnings 2022-11-18 19:00:06 +11:00
guest-state-buffer.c KVM: PPC: Add support for nestedv2 guests 2023-09-14 22:04:24 +10:00
Kconfig kvm: Remove "select SRCU" 2023-04-05 13:47:42 +00:00
Makefile KVM: PPC: Add support for nestedv2 guests 2023-09-14 22:04:24 +10:00
mpic.c
powerpc.c KVM: PPC: Use accessors for VCPU registers 2023-09-14 22:04:24 +10:00
test-guest-state-buffer.c KVM: PPC: Add helper library for Guest State Buffers 2023-09-14 22:04:24 +10:00
timing.c KVM: PPC: Merge powerpc's debugfs entry content into generic entry 2022-02-02 20:30:26 +11:00
timing.h KVM: PPC: Merge powerpc's debugfs entry content into generic entry 2022-02-02 20:30:26 +11:00
tm.S powerpc: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-16 23:54:48 +10:00
trace_book3s.h
trace_booke.h KVM: Move arm64's MMU notifier trace events to generic code 2021-04-17 08:30:56 -04:00
trace_hv.h KVM: PPC: Book3S HV: tracing: Add missing hcall names 2022-06-29 19:21:29 +10:00
trace_pr.h
trace.h