]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
Merge branch kvm-arm64/mmu/el2-tracking into kvmarm-master/next
authorMarc Zyngier <maz@kernel.org>
Fri, 20 Aug 2021 11:17:13 +0000 (12:17 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Aug 2021 11:22:35 +0000 (12:22 +0100)
* kvm-arm64/mmu/el2-tracking: (25 commits)
  : Enable tracking of page sharing between host EL1 and EL2
  KVM: arm64: Minor optimization of range_is_memory
  KVM: arm64: Make hyp_panic() more robust when protected mode is enabled
  KVM: arm64: Return -EPERM from __pkvm_host_share_hyp()
  KVM: arm64: Make __pkvm_create_mappings static
  KVM: arm64: Restrict EL2 stage-1 changes in protected mode
  KVM: arm64: Refactor protected nVHE stage-1 locking
  KVM: arm64: Remove __pkvm_mark_hyp
  KVM: arm64: Mark host bss and rodata section as shared
  KVM: arm64: Enable retrieving protections attributes of PTEs
  KVM: arm64: Introduce addr_is_memory()
  KVM: arm64: Expose pkvm_hyp_id
  KVM: arm64: Expose host stage-2 manipulation helpers
  KVM: arm64: Add helpers to tag shared pages in SW bits
  KVM: arm64: Allow populating software bits
  KVM: arm64: Enable forcing page-level stage-2 mappings
  KVM: arm64: Tolerate re-creating hyp mappings to set software bits
  KVM: arm64: Don't overwrite software bits with owner id
  KVM: arm64: Rename KVM_PTE_LEAF_ATTR_S2_IGNORED
  KVM: arm64: Optimize host memory aborts
  KVM: arm64: Expose page-table helpers
  ...

Signed-off-by: Marc Zyngier <maz@kernel.org>
1  2 
arch/arm64/kvm/arm.c
arch/arm64/kvm/mmu.c

index 9eb80a34b4aeaca8f9ae144db554871ff782a57b,37f738877aa3fb59cea4f0b5e9983d18a11dab3c..fd9a6bcf797f1c5083acc18089991fc1c660f051
@@@ -1960,49 -1963,6 +1955,13 @@@ static int finalize_hyp_mode(void
        if (!is_protected_kvm_enabled())
                return 0;
  
-       ret = pkvm_mark_hyp_section(__hyp_idmap_text);
-       if (ret)
-               return ret;
-       ret = pkvm_mark_hyp_section(__hyp_text);
-       if (ret)
-               return ret;
-       ret = pkvm_mark_hyp_section(__hyp_rodata);
-       if (ret)
-               return ret;
 +      /*
 +       * Exclude HYP BSS from kmemleak so that it doesn't get peeked
 +       * at, which would end badly once the section is inaccessible.
 +       * None of other sections should ever be introspected.
 +       */
 +      kmemleak_free_part(__hyp_bss_start, __hyp_bss_end - __hyp_bss_start);
-       ret = pkvm_mark_hyp_section(__hyp_bss);
-       if (ret)
-               return ret;
-       ret = pkvm_mark_hyp(hyp_mem_base, hyp_mem_base + hyp_mem_size);
-       if (ret)
-               return ret;
-       for_each_possible_cpu(cpu) {
-               phys_addr_t start = virt_to_phys((void *)kvm_arm_hyp_percpu_base[cpu]);
-               phys_addr_t end = start + (PAGE_SIZE << nvhe_percpu_order());
-               ret = pkvm_mark_hyp(start, end);
-               if (ret)
-                       return ret;
-               start = virt_to_phys((void *)per_cpu(kvm_arm_hyp_stack_page, cpu));
-               end = start + PAGE_SIZE;
-               ret = pkvm_mark_hyp(start, end);
-               if (ret)
-                       return ret;
-       }
 +
        /*
         * Flip the static key upfront as that may no longer be possible
         * once the host stage 2 is installed.
Simple merge