Merge tag 'kvmarm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm...
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 1 Jul 2023 11:04:29 +0000 (07:04 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 1 Jul 2023 11:04:29 +0000 (07:04 -0400)
KVM/arm64 updates for 6.5

 - Eager page splitting optimization for dirty logging, optionally
   allowing for a VM to avoid the cost of block splitting in the stage-2
   fault path.

 - Arm FF-A proxy for pKVM, allowing a pKVM host to safely interact with
   services that live in the Secure world. pKVM intervenes on FF-A calls
   to guarantee the host doesn't misuse memory donated to the hyp or a
   pKVM guest.

 - Support for running the split hypervisor with VHE enabled, known as
   'hVHE' mode. This is extremely useful for testing the split
   hypervisor on VHE-only systems, and paves the way for new use cases
   that depend on having two TTBRs available at EL2.

 - Generalized framework for configurable ID registers from userspace.
   KVM/arm64 currently prevents arbitrary CPU feature set configuration
   from userspace, but the intent is to relax this limitation and allow
   userspace to select a feature set consistent with the CPU.

 - Enable the use of Branch Target Identification (FEAT_BTI) in the
   hypervisor.

 - Use a separate set of pointer authentication keys for the hypervisor
   when running in protected mode, as the host is untrusted at runtime.

 - Ensure timer IRQs are consistently released in the init failure
   paths.

 - Avoid trapping CTR_EL0 on systems with Enhanced Virtualization Traps
   (FEAT_EVT), as it is a register commonly read from userspace.

 - Erratum workaround for the upcoming AmpereOne part, which has broken
   hardware A/D state management.

As a consequence of the hVHE series reworking the arm64 software
features framework, the for-next/module-alloc branch from the arm64 tree
comes along for the ride.

13 files changed:
1  2 
arch/arm64/Kconfig
arch/arm64/include/asm/kvm_host.h
arch/arm64/include/asm/kvm_pgtable.h
arch/arm64/include/asm/sysreg.h
arch/arm64/kvm/hyp/include/hyp/switch.h
arch/arm64/kvm/hyp/nvhe/mem_protect.c
arch/arm64/kvm/hyp/nvhe/switch.c
arch/arm64/kvm/hyp/pgtable.c
arch/arm64/kvm/hyp/vhe/switch.c
arch/arm64/kvm/sys_regs.c
include/linux/arm_ffa.h
include/uapi/linux/kvm.h
virt/kvm/kvm_main.c

Simple merge
Simple merge
Simple merge
Simple merge
index 4fe217efa2185a73bea804b1842deff3684918a7,dc584b0f4f12e250317b0d0e1a4d16581859a21b..f35d5abedf9c08302f3fb9576387c0d26e9d037b
@@@ -112,22 -148,11 +154,16 @@@ static inline void __deactivate_traps_c
        write_sysreg(vcpu->arch.mdcr_el2_host, mdcr_el2);
  
        write_sysreg(0, hstr_el2);
 -      if (kvm_arm_support_pmu_v3())
 -              write_sysreg(0, pmuserenr_el0);
 +      if (kvm_arm_support_pmu_v3()) {
 +              struct kvm_cpu_context *hctxt;
 +
 +              hctxt = &this_cpu_ptr(&kvm_host_data)->host_ctxt;
 +              write_sysreg(ctxt_sys_reg(hctxt, PMUSERENR_EL0), pmuserenr_el0);
 +              vcpu_clear_flag(vcpu, PMUSERENR_ON_CPU);
 +      }
  
-       if (cpus_have_final_cap(ARM64_SME)) {
-               sysreg_clear_set_s(SYS_HFGRTR_EL2, 0,
-                                  HFGxTR_EL2_nSMPRI_EL1_MASK |
-                                  HFGxTR_EL2_nTPIDR2_EL0_MASK);
-               sysreg_clear_set_s(SYS_HFGWTR_EL2, 0,
-                                  HFGxTR_EL2_nSMPRI_EL1_MASK |
-                                  HFGxTR_EL2_nTPIDR2_EL0_MASK);
-       }
+       if (__hfgxtr_traps_required())
+               __deactivate_traps_hfgxtr();
  }
  
  static inline void ___activate_traps(struct kvm_vcpu *vcpu)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 583fe3b49a49ccd5e18b1d3963b94e46df00622e,b9f81035eb419501689b80bfdb7c2d133c1dbe42..cc060da51becf416d735780ab0df8973cdf6aea5
   */
  #define FFA_PAGE_SIZE         SZ_4K
  
+ /*
+  * Minimum buffer size/alignment encodings returned by an FFA_FEATURES
+  * query for FFA_RXTX_MAP.
+  */
+ #define FFA_FEAT_RXTX_MIN_SZ_4K               0
+ #define FFA_FEAT_RXTX_MIN_SZ_64K      1
+ #define FFA_FEAT_RXTX_MIN_SZ_16K      2
  /* FFA Bus/Device/Driver related */
  struct ffa_device {
 +      u32 id;
        int vm_id;
        bool mode_32bit;
        uuid_t uuid;
Simple merge
Simple merge