All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the cgroup tree with the kvm tree
@ 2021-04-22  5:53 Stephen Rothwell
  2021-04-22  6:34 ` Paolo Bonzini
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2021-04-22  5:53 UTC (permalink / raw)
  To: Tejun Heo, Paolo Bonzini, KVM
  Cc: Linux Kernel Mailing List, Linux Next Mailing List,
	Sean Christopherson, Vipin Sharma

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

Hi all,

Today's linux-next merge of the cgroup tree got conflicts in:

  arch/x86/kvm/svm/sev.c

between commit:

  9fa1521daafb ("KVM: SVM: Do not set sev->es_active until KVM_SEV_ES_INIT completes")

from the kvm tree and commit:

  7aef27f0b2a8 ("svm/sev: Register SEV and SEV-ES ASIDs to the misc controller")

from the cgroup 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/x86/kvm/svm/sev.c
index 63923fa0b172,214eefb20414..000000000000
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@@ -93,10 -103,21 +109,21 @@@ static bool __sev_recycle_asids(int min
  	return true;
  }
  
 -static int sev_asid_new(struct kvm_sev_info *sev)
 +static int sev_asid_new(bool es_active)
  {
- 	int pos, min_asid, max_asid;
+ 	int pos, min_asid, max_asid, ret;
  	bool retry = true;
+ 	enum misc_res_type type;
+ 
+ 	type = sev->es_active ? MISC_CG_RES_SEV_ES : MISC_CG_RES_SEV;
+ 	WARN_ON(sev->misc_cg);
+ 	sev->misc_cg = get_current_misc_cg();
+ 	ret = misc_cg_try_charge(type, sev->misc_cg, 1);
+ 	if (ret) {
+ 		put_misc_cg(sev->misc_cg);
+ 		sev->misc_cg = NULL;
+ 		return ret;
+ 	}
  
  	mutex_lock(&sev_bitmap_lock);
  
@@@ -182,17 -224,16 +221,17 @@@ static int sev_guest_init(struct kvm *k
  	if (unlikely(sev->active))
  		return ret;
  
 -	asid = sev_asid_new(sev);
 +	asid = sev_asid_new(es_active);
  	if (asid < 0)
  		return ret;
+ 	sev->asid = asid;
  
  	ret = sev_platform_init(&argp->error);
  	if (ret)
  		goto e_free;
  
  	sev->active = true;
 +	sev->es_active = es_active;
- 	sev->asid = asid;
  	INIT_LIST_HEAD(&sev->regions_list);
  
  	return 0;

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

^ permalink raw reply	[flat|nested] 10+ messages in thread
* linux-next: manual merge of the cgroup tree with the kvm tree
@ 2021-04-22  5:57 Stephen Rothwell
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2021-04-22  5:57 UTC (permalink / raw)
  To: Tejun Heo, Paolo Bonzini, KVM
  Cc: Linux Kernel Mailing List, Linux Next Mailing List,
	Nathan Tempelman, Vipin Sharma

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

Hi all,

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

  arch/x86/kvm/svm/svm.h

between commit:

  54526d1fd593 ("KVM: x86: Support KVM VMs sharing SEV context")

from the kvm tree and commit:

  7aef27f0b2a8 ("svm/sev: Register SEV and SEV-ES ASIDs to the misc controller")

from the cgroup 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/x86/kvm/svm/svm.h
index 454da1c1d9b7,9806aaebc37f..000000000000
--- a/arch/x86/kvm/svm/svm.h
+++ b/arch/x86/kvm/svm/svm.h
@@@ -68,7 -65,7 +68,8 @@@ struct kvm_sev_info 
  	unsigned long pages_locked; /* Number of pages locked */
  	struct list_head regions_list;  /* List of registered regions */
  	u64 ap_jump_table;	/* SEV-ES AP Jump Table address */
 +	struct kvm *enc_context_owner; /* Owner of copied encryption context */
+ 	struct misc_cg *misc_cg; /* For misc cgroup accounting */
  };
  
  struct kvm_svm {

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

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

end of thread, other threads:[~2021-04-22 17:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22  5:53 linux-next: manual merge of the cgroup tree with the kvm tree Stephen Rothwell
2021-04-22  6:34 ` Paolo Bonzini
2021-04-22  7:33   ` Vipin Sharma
2021-04-22  7:47     ` Paolo Bonzini
2021-04-22 17:09       ` Vipin Sharma
2021-04-22 17:18         ` Paolo Bonzini
2021-04-22 17:30           ` Vipin Sharma
2021-04-22 11:48   ` Tejun Heo
2021-04-22 11:56     ` Paolo Bonzini
2021-04-22  5:57 Stephen Rothwell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.