summaryrefslogtreecommitdiff
path: root/include/linux/kvm_types.h
diff options
context:
space:
mode:
authorAnup Patel <apatel@ventanamicro.com>2022-07-29 17:15:00 +0530
committerAnup Patel <anup@brainfault.org>2022-07-29 17:15:00 +0530
commit4ab0e470c06dc741f6583578da44961669331b78 (patch)
treeaade2851a11bbebcd640cf6da9745c7b3c47d9b5 /include/linux/kvm_types.h
parent8a061562e2f2b32bfb5bff5bf3afc64e37d95a27 (diff)
KVM: Add gfp_custom flag in struct kvm_mmu_memory_cache
The kvm_mmu_topup_memory_cache() always uses GFP_KERNEL_ACCOUNT for memory allocation which prevents it's use in atomic context. To address this limitation of kvm_mmu_topup_memory_cache(), we add gfp_custom flag in struct kvm_mmu_memory_cache. When the gfp_custom flag is set to some GFP_xyz flags, the kvm_mmu_topup_memory_cache() will use that instead of GFP_KERNEL_ACCOUNT. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include/linux/kvm_types.h')
-rw-r--r--include/linux/kvm_types.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h
index ac1ebb37a0ff..1dcfba68076a 100644
--- a/include/linux/kvm_types.h
+++ b/include/linux/kvm_types.h
@@ -87,6 +87,7 @@ struct gfn_to_pfn_cache {
struct kvm_mmu_memory_cache {
int nobjs;
gfp_t gfp_zero;
+ gfp_t gfp_custom;
struct kmem_cache *kmem_cache;
void *objects[KVM_ARCH_NR_OBJS_PER_MEMORY_CACHE];
};