public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Do not account for temporary memory allocation in ECREATE emulation
@ 2024-07-15 10:12 Kai Huang
  2024-08-23 23:48 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Huang @ 2024-07-15 10:12 UTC (permalink / raw)
  To: pbonzini, seanjc, kvm; +Cc: linux-kernel, Kai Huang

In handle_encls_ecreate(), a page is allocated to store a copy of SECS
structure used by the ENCLS[ECREATE] leaf from the guest.  This page is
only used temporarily and is freed after use in handle_encls_ecreate().

Don't account for the memory allocation of this page per [1].

Link: https://lore.kernel.org/kvm/b999afeb588eb75d990891855bc6d58861968f23.camel@intel.com/T/#mb81987afc3ab308bbb5861681aa9a20f2aece7fd [1]
Signed-off-by: Kai Huang <kai.huang@intel.com>
---
 arch/x86/kvm/vmx/sgx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/sgx.c b/arch/x86/kvm/vmx/sgx.c
index 6fef01e0536e..a3c3d2a51f47 100644
--- a/arch/x86/kvm/vmx/sgx.c
+++ b/arch/x86/kvm/vmx/sgx.c
@@ -274,7 +274,7 @@ static int handle_encls_ecreate(struct kvm_vcpu *vcpu)
 	 * simultaneously set SGX_ATTR_PROVISIONKEY to bypass the check to
 	 * enforce restriction of access to the PROVISIONKEY.
 	 */
-	contents = (struct sgx_secs *)__get_free_page(GFP_KERNEL_ACCOUNT);
+	contents = (struct sgx_secs *)__get_free_page(GFP_KERNEL);
 	if (!contents)
 		return -ENOMEM;
 

base-commit: c8b8b8190a80b591aa73c27c70a668799f8db547
-- 
2.45.2


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

* Re: [PATCH] KVM: VMX: Do not account for temporary memory allocation in ECREATE emulation
  2024-07-15 10:12 [PATCH] KVM: VMX: Do not account for temporary memory allocation in ECREATE emulation Kai Huang
@ 2024-08-23 23:48 ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2024-08-23 23:48 UTC (permalink / raw)
  To: Sean Christopherson, pbonzini, kvm, Kai Huang; +Cc: linux-kernel

On Mon, 15 Jul 2024 22:12:24 +1200, Kai Huang wrote:
> In handle_encls_ecreate(), a page is allocated to store a copy of SECS
> structure used by the ENCLS[ECREATE] leaf from the guest.  This page is
> only used temporarily and is freed after use in handle_encls_ecreate().
> 
> Don't account for the memory allocation of this page per [1].
> 
> 
> [...]

Applied to kvm-x86 vmx, thanks!

[1/1] KVM: VMX: Do not account for temporary memory allocation in ECREATE emulation
      https://github.com/kvm-x86/linux/commit/d9aa56edad35

--
https://github.com/kvm-x86/linux/tree/next

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

end of thread, other threads:[~2024-08-23 23:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-15 10:12 [PATCH] KVM: VMX: Do not account for temporary memory allocation in ECREATE emulation Kai Huang
2024-08-23 23:48 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox