[Devel] [PATCH RH9 05/30] x86/kvm/vmx: Suppress warning on high-order allocation

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Tue Sep 28 21:48:56 MSK 2021


From: Jan Dakinevich <jan.dakinevich at virtuozzo.com>

For L1TF mitigation vmx allocates 16 pages (4th order) and use them to
move out the content of L1D cache. An attempt to use physically
non-contiguous memory could break the algorithm.

https://jira.sw.ru/browse/HCI-133

Signed-off-by: Jan Dakinevich <jan.dakinevich at virtuozzo.com>

(cherry-picked from vz7 commit a8c7017e8f9b ("x86/kvm/vmx: suppress warning on
high-order allocation"))

Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
khorenko@: s/__GFP_NOWARN/__GFP_ORDER_NOWARN/

(cherry picked from vz8 commit a3543acd64a93983238c5a75bf6571892f36e586)
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 arch/x86/kvm/vmx/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 927a552..31bed0f 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -278,7 +278,7 @@ static int vmx_setup_l1d_flush(enum vmx_l1d_flush_state l1tf)
 		 * This allocation for vmx_l1d_flush_pages is not tied to a VM
 		 * lifetime and so should not be charged to a memcg.
 		 */
-		page = alloc_pages(GFP_KERNEL, L1D_CACHE_ORDER);
+		page = alloc_pages(GFP_KERNEL | __GFP_ORDER_NOWARN, L1D_CACHE_ORDER);
 		if (!page)
 			return -ENOMEM;
 		vmx_l1d_flush_pages = page_address(page);
-- 
1.8.3.1



More information about the Devel mailing list