From debc5002b99082214221b01a3c2b43160e767d57 Mon Sep 17 00:00:00 2001 From: Zhiguang Ni Date: Mon, 22 Dec 2025 10:41:39 +0000 Subject: [PATCH] anolis: x86/mm: Batch flusing user memory encrytion status change ANBZ: #28344 Hygon-SIG: commit none hygon x86/mm: Batch flusing user memory encrytion status change Each time when a user page encryption status changes, invoking hypercall to map/unmap the page from iommu page table is expensive as to performance, Besides, on CSV3 platform, changing the page between private and shared is very expensive. The patch enables batch operation of pages should change their encryption status, optimize the perfromance. The APIs in this file are intended for exclusive use by specific device drivers. The drivers are responsible for ensuring that no race conditions arise from concurrent access, including those involving the TLB and cache. Signed-off-by: Yang Wencheng Signed-off-by: Zhiguang Ni Cc: hygon-arch@list.openanolis.cn --- arch/x86/mm/pat/user_mem_encrypt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/mm/pat/user_mem_encrypt.c b/arch/x86/mm/pat/user_mem_encrypt.c index bc7b37aad069..a94f7c3d73fc 100644 --- a/arch/x86/mm/pat/user_mem_encrypt.c +++ b/arch/x86/mm/pat/user_mem_encrypt.c @@ -299,8 +299,6 @@ static int __change_page_attr(struct cpa_data *cpa) */ if (pte_val(old_pte) != pte_val(new_pte)) { cpa_page_cache_insert(cpa, pte_page(old_pte)); - cpa_page_cache_flush(cpa); - //pte_lockptr() set_pte_atomic(kpte, new_pte); } cpa->numpages = 1; -- Gitee