linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the kvm-arm tree with the kvm-fixes tree
@ 2020-07-31  6:41 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2020-07-31  6:41 UTC (permalink / raw)
  To: Christoffer Dall, Marc Zyngier, Paolo Bonzini, KVM
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Sean Christopherson

[-- Attachment #1: Type: text/plain, Size: 3753 bytes --]

Hi all,

Today's linux-next merge of the kvm-arm tree got a conflict in:

  arch/arm64/kvm/mmu.c

between commit:

  b757b47a2fcb ("KVM: arm64: Don't inherit exec permission across page-table levels")

from the kvm-fixes tree and commit:

  a0e50aa3f4a8 ("KVM: arm64: Factor out stage 2 page table data from struct kvm")

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.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/arm64/kvm/mmu.c
index 7a7ddc4558a7,05e0e03fbdf8..000000000000
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@@ -124,11 -127,44 +127,12 @@@ static void stage2_dissolve_pud(struct 
  	put_page(virt_to_page(pudp));
  }
  
- static void clear_stage2_pgd_entry(struct kvm *kvm, pgd_t *pgd, phys_addr_t addr)
 -static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache,
 -				  int min, int max)
 -{
 -	void *page;
 -
 -	BUG_ON(max > KVM_NR_MEM_OBJS);
 -	if (cache->nobjs >= min)
 -		return 0;
 -	while (cache->nobjs < max) {
 -		page = (void *)__get_free_page(GFP_PGTABLE_USER);
 -		if (!page)
 -			return -ENOMEM;
 -		cache->objects[cache->nobjs++] = page;
 -	}
 -	return 0;
 -}
 -
 -static void mmu_free_memory_cache(struct kvm_mmu_memory_cache *mc)
 -{
 -	while (mc->nobjs)
 -		free_page((unsigned long)mc->objects[--mc->nobjs]);
 -}
 -
 -static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc)
 -{
 -	void *p;
 -
 -	BUG_ON(!mc || !mc->nobjs);
 -	p = mc->objects[--mc->nobjs];
 -	return p;
 -}
 -
+ static void clear_stage2_pgd_entry(struct kvm_s2_mmu *mmu, pgd_t *pgd, phys_addr_t addr)
  {
+ 	struct kvm *kvm = mmu->kvm;
  	p4d_t *p4d_table __maybe_unused = stage2_p4d_offset(kvm, pgd, 0UL);
  	stage2_pgd_clear(kvm, pgd);
- 	kvm_tlb_flush_vmid_ipa(kvm, addr);
+ 	kvm_tlb_flush_vmid_ipa(mmu, addr, S2_NO_LEVEL_HINT);
  	stage2_p4d_free(kvm, p4d_table);
  	put_page(virt_to_page(pgd));
  }
@@@ -1294,7 -1356,7 +1324,8 @@@ static bool stage2_get_leaf_entry(struc
  	return true;
  }
  
- static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr, unsigned long sz)
 -static bool stage2_is_exec(struct kvm_s2_mmu *mmu, phys_addr_t addr)
++static bool stage2_is_exec(struct kvm_s2_mmu *mmu, phys_addr_t addr,
++			   unsigned long sz)
  {
  	pud_t *pudp;
  	pmd_t *pmdp;
@@@ -1306,14 -1368,15 +1337,15 @@@
  		return false;
  
  	if (pudp)
 -		return kvm_s2pud_exec(pudp);
 +		return sz <= PUD_SIZE && kvm_s2pud_exec(pudp);
  	else if (pmdp)
 -		return kvm_s2pmd_exec(pmdp);
 +		return sz <= PMD_SIZE && kvm_s2pmd_exec(pmdp);
  	else
 -		return kvm_s2pte_exec(ptep);
 +		return sz == PAGE_SIZE && kvm_s2pte_exec(ptep);
  }
  
- static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
+ static int stage2_set_pte(struct kvm_s2_mmu *mmu,
+ 			  struct kvm_mmu_memory_cache *cache,
  			  phys_addr_t addr, const pte_t *new_pte,
  			  unsigned long flags)
  {
@@@ -1924,8 -1995,7 +1962,8 @@@ static int user_mem_abort(struct kvm_vc
  	 * execute permissions, and we preserve whatever we have.
  	 */
  	needs_exec = exec_fault ||
 -		(fault_status == FSC_PERM && stage2_is_exec(mmu, fault_ipa));
 +		(fault_status == FSC_PERM &&
- 		 stage2_is_exec(kvm, fault_ipa, vma_pagesize));
++		 stage2_is_exec(mmu, fault_ipa, vma_pagesize));
  
  	if (vma_pagesize == PUD_SIZE) {
  		pud_t new_pud = kvm_pfn_pud(pfn, mem_type);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread
* linux-next: manual merge of the kvm-arm tree with the kvm-fixes tree
@ 2023-04-04  2:32 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2023-04-04  2:32 UTC (permalink / raw)
  To: Christoffer Dall, Marc Zyngier, Paolo Bonzini
  Cc: KVM, Alexey Kardashevskiy, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1195 bytes --]

Hi all,

Today's linux-next merge of the kvm-arm tree got a conflict in:

  arch/arm64/kvm/arm.c

between commit:

  52882b9c7a76 ("KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE platform dependent")

from the kvm-fixes tree and commit:

  30ec7997d175 ("KVM: arm64: timers: Allow userspace to set the global counter offset")

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.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/arm64/kvm/arm.c
index aaa752be3776,0e5a3ff8cc5a..000000000000
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@@ -220,7 -232,7 +232,8 @@@ int kvm_vm_ioctl_check_extension(struc
  	case KVM_CAP_VCPU_ATTRIBUTES:
  	case KVM_CAP_PTP_KVM:
  	case KVM_CAP_ARM_SYSTEM_SUSPEND:
 +	case KVM_CAP_IRQFD_RESAMPLE:
+ 	case KVM_CAP_COUNTER_OFFSET:
  		r = 1;
  		break;
  	case KVM_CAP_SET_GUEST_DEBUG2:

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread
* linux-next: manual merge of the kvm-arm tree with the kvm-fixes tree
@ 2019-02-14  3:30 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2019-02-14  3:30 UTC (permalink / raw)
  To: Christoffer Dall, Marc Zyngier, Paolo Bonzini,
	Radim Krčmář,
	KVM
  Cc: Linux Next Mailing List, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1469 bytes --]

Hi all,

Today's linux-next merge of the kvm-arm tree got a conflict in:

  arch/arm/include/asm/kvm_host.h

between commit:

  358b28f09f0a ("arm/arm64: KVM: Allow a VCPU to fully reset itself")

from the kvm-fixes tree and commit:

  42a2502ef5f8 ("arm/arm64: KVM: Statically configure the host's view of MPIDR")

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.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/arm/include/asm/kvm_host.h
index 50e89869178a,8073267dc4a0..000000000000
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@@ -148,13 -151,13 +152,20 @@@ struct kvm_cpu_context 
  
  typedef struct kvm_cpu_context kvm_cpu_context_t;
  
+ static inline void kvm_init_host_cpu_context(kvm_cpu_context_t *cpu_ctxt,
+ 					     int cpu)
+ {
+ 	/* The host's MPIDR is immutable, so let's set it up at boot time */
+ 	cpu_ctxt->cp15[c0_MPIDR] = cpu_logical_map(cpu);
+ }
+ 
 +struct vcpu_reset_state {
 +	unsigned long	pc;
 +	unsigned long	r0;
 +	bool		be;
 +	bool		reset;
 +};
 +
  struct kvm_vcpu_arch {
  	struct kvm_cpu_context ctxt;
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-04  2:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  6:41 linux-next: manual merge of the kvm-arm tree with the kvm-fixes tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2023-04-04  2:32 Stephen Rothwell
2019-02-14  3:30 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).