linux-next: manual merge of the kvm-arm tree with the kvm tree
Subsystems (4)
Mark Brown
maintainerHi all,
Today's linux-next merge of the kvm-arm tree got a conflict in:
arch/arm64/kvm/mmu.c
between commit:
dd0bc00e3e920 ("Merge branch kvm-arm64/cca-7.4 into kvmarm-master/next")
from the kvm tree and commits:
b44a8c32f0116 ("KVM: arm64: Abstract out memory abort handling") 892c8a0bcc8e3 ("Merge branch kvm-arm64/cca-7.4 into kvmarm-master/next")
from the kvm-arm tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
arch/arm64/kvm/mmu.c +0 -0
@@@ -329,6 -329,9 +329,9 @@@ static void kvm_vm_stage2_unmap_range(sstruct kvm *kvm =kvm_s2_mmu_to_kvm (mmu);int (*fn)(struct kvm_pgtable *,u64 ,u64 ); +lockdep_assert_held_write (&kvm->mmu_lock); +WARN_ON (size & ~PAGE_MASK ); +if (kvm_is_nested_s2_mmu (kvm, mmu)) fn = kvm_pgtable_stage2_unmap_tracked;else return PAGE_SIZE ; } -static int get_vma_page_shift(struct vm_area_struct *vma, unsigned long hva) +static int get_vma_page_shift(struct vm_area_struct *vma) { - unsigned long pa; - - if (is_vm_hugetlb_page(vma) && !(vma->vm_flags & VM_PFNMAP)) + if (vma_is_hugetlb(vma))return huge_page_shift (hstate_vma (vma)); - if (!(vma->vm_flags & VM_PFNMAP)) - return PAGE_SHIFT; - -VM_BUG_ON (is_vm_hugetlb_page (vma)); - - pa = (vma->vm_pgoff <<PAGE_SHIFT ) + (hva - vma->vm_start); - -#ifndef __PAGETABLE_PMD_FOLDED - if ((hva & (PUD_SIZE - 1)) == (pa & (PUD_SIZE - 1)) && -ALIGN_DOWN (hva,PUD_SIZE ) >= vma->vm_start && -ALIGN (hva,PUD_SIZE ) <= vma->vm_end) - return PUD_SHIFT; -#endif - - if ((hva & (PMD_SIZE - 1)) == (pa & (PMD_SIZE - 1)) && -ALIGN_DOWN (hva,PMD_SIZE ) >= vma->vm_start && -ALIGN (hva,PMD_SIZE ) <= vma->vm_end) - return PMD_SHIFT; - return PAGE_SHIFT; } vma_shift =PAGE_SHIFT ; }else { s2vi->max_map_size =PUD_SIZE ; - vma_shift =get_vma_page_shift (vma, s2fd->hva); + vma_shift =get_vma_page_shift (vma); }switch (vma_shift) {return -EFAULT ; } }else { -/* - * If the page was identified as device early by looking at - * the VMA flags, vma_pagesize is already representing the - * largest quantity we can map. If instead it was mapped - * via __kvm_faultin_pfn(), vma_pagesize is set to PAGE_SIZE - * and must not be upgraded. - * - * In both cases, we don't let transparent_hugepage_adjust() - * change things at the last minute. - */ s2vi->map_non_cacheable = true; }/* * If we are not forced to use page mapping, check if we are - * backed by a THP and thus use block mapping if possible. + * backed by a huge stage-1 mapping and thus use block mapping if + * possible. */ - if (mapping_size == PAGE_SIZE && - !(s2vi->max_map_size == PAGE_SIZE || s2vi->map_non_cacheable)) { + if (mapping_size == PAGE_SIZE && s2vi->max_map_size != PAGE_SIZE) {if (perm_fault_granule >PAGE_SIZE ) { mapping_size = perm_fault_granule; }else {return ret; } -/* - * Let's check if we will get back a huge page backed by hugetlbfs, or - * get block mapping for device MMIO region. - */ ret =kvm_s2_fault_pin_pfn (s2fd, &s2vi);if (ret == -EHWPOISON ) {/* If result is specified, let the caller handle this. */ static int kvm_vm_mem_abort (const struct kvm_s2_fault_desc *s2fd) { -VM_WARN_ON_ONCE (kvm_s2_fault_is_perm (s2fd) && - !esr_abt_is_write_fault (s2fd->esr) && - !kvm_s2_fault_is_exec (s2fd)); +struct kvm_vcpu *vcpu = s2fd->vcpu; + +VM_WARN_ON_ONCE (kvm_vcpu_trap_is_permission_fault (vcpu) && + !kvm_is_write_fault (vcpu) && + !esr_abt_is_exec_fault (kvm_vcpu_get_esr (vcpu)));if (kvm_slot_has_gmem (s2fd->memslot))return gmem_abort (s2fd,NULL );/* * If this is the first time we do a S/W operation - * (i.e. HCR_TVM not set) flush the whole memory, and set the + * (i.e. HCR_EL2_TVM not set) flush the whole memory, and set the * VM trapping. * * Otherwise, rely on the VM trapping to wait for the MMU + * Caches to be turned off. At that point, we'll be able to * clean the caches again. */ - if (!(hcr & HCR_TVM)) { + if (!(hcr & HCR_EL2_TVM)) {trace_kvm_set_way_flush (*vcpu_pc (vcpu),vcpu_has_cache_enabled (vcpu));stage2_flush_vm (vcpu->kvm); - *vcpu_hcr (vcpu) = hcr |HCR_TVM ; + *vcpu_hcr (vcpu) = hcr |HCR_EL2_TVM ; } }/* Caches are now on, stop trapping VM ops (until a S/W op) */ if (now_enabled) - *vcpu_hcr (vcpu) &= ~HCR_TVM ; + *vcpu_hcr (vcpu) &= ~HCR_EL2_TVM ;trace_kvm_toggle_cache (*vcpu_pc (vcpu), was_enabled, now_enabled); }
Paolo Bonzini
maintainerIl lun 19 ott 2026, 18:46 Mark Brown <[email protected]> ha scritto:
Quoted 9 lines
Hi all,
Today's linux-next merge of the kvm-arm tree got a conflict in:
arch/arm64/kvm/mmu.cbetween commit:
Quoted 8 lines
dd0bc00e3e920("Merge branch kvm-arm64/cca-7.4 into kvmarm-master/next")from the kvm tree and commits:
b44a8c32f0116("KVM: arm64: Abstract out memory abort handling")892c8a0bcc8e3("Merge branch kvm-arm64/cca-7.4 into kvmarm-master/next")from the kvm-arm tree.
Hi Marc/Oliver, is this something that will be fixed on your side by rebasing?
Paolo
Marc Zyngier
maintainerQuoted 13 lines · Paolo Bonzini
Il lun 19 ott 2026, 18:46 Mark Brown <[email protected]> ha scritto:
Quoted 11 lines
Hi all,
Today's linux-next merge of the kvm-arm tree got a conflict in:
arch/arm64/kvm/mmu.cbetween commit:
dd0bc00e3e920("Merge branch kvm-arm64/cca-7.4 into kvmarm-master/next")
Quoted 8 lines
Quoted 6 lines
from the kvm tree and commits:
b44a8c32f0116("KVM: arm64: Abstract out memory abort handling")892c8a0bcc8e3("Merge branch kvm-arm64/cca-7.4 into kvmarm-master/next")from the kvm-arm tree.
Hi Marc/Oliver, is this something that will be fixed on your side by rebasing?
Yes. As soon as you have a stable tag on your side, I'll remerge the fix branches on that, and all will be forgiven.
Thanks,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
Paolo Bonzini
maintainerQuoted 4 lines · Marc Zyngier
Quoted 1 line
Hi Marc/Oliver, is this something that will be fixed on your side by rebasing?
Yes. As soon as you have a stable tag on your side, I'll remerge the fix branches on that, and all will be forgiven.
I have pushed both the next branch and tags/for-linus to kvm.git, so you can go ahead.
Paolo
Marc Zyngier
maintainerQuoted 9 lines · Paolo Bonzini
Quoted 4 lines · Marc Zyngier
Quoted 1 line
Hi Marc/Oliver, is this something that will be fixed on your side by rebasing?
Yes. As soon as you have a stable tag on your side, I'll remerge the fix branches on that, and all will be forgiven.
I have pushed both the next branch and tags/for-linus to kvm.git, so you can go ahead.
Just pushed out the resulting branch to kvmarm/fixes.
Thanks,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.