xref: /openbmc/linux/drivers/misc/cxl/fault.c (revision d9fa0e37)
12874c5fdSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-or-later
2f204e0b8SIan Munsie /*
3f204e0b8SIan Munsie  * Copyright 2014 IBM Corp.
4f204e0b8SIan Munsie  */
5f204e0b8SIan Munsie 
6f204e0b8SIan Munsie #include <linux/workqueue.h>
7174cd4b1SIngo Molnar #include <linux/sched/signal.h>
86e84f315SIngo Molnar #include <linux/sched/mm.h>
9f204e0b8SIan Munsie #include <linux/pid.h>
10f204e0b8SIan Munsie #include <linux/mm.h>
11f204e0b8SIan Munsie #include <linux/moduleparam.h>
12f204e0b8SIan Munsie 
13f204e0b8SIan Munsie #undef MODULE_PARAM_PREFIX
14f204e0b8SIan Munsie #define MODULE_PARAM_PREFIX "cxl" "."
15f204e0b8SIan Munsie #include <asm/current.h>
16f204e0b8SIan Munsie #include <asm/copro.h>
17f204e0b8SIan Munsie #include <asm/mmu.h>
18f204e0b8SIan Munsie 
19f204e0b8SIan Munsie #include "cxl.h"
209bcf28cdSIan Munsie #include "trace.h"
21f204e0b8SIan Munsie 
sste_matches(struct cxl_sste * sste,struct copro_slb * slb)22eb01d4c2SIan Munsie static bool sste_matches(struct cxl_sste *sste, struct copro_slb *slb)
23eb01d4c2SIan Munsie {
24eb01d4c2SIan Munsie 	return ((sste->vsid_data == cpu_to_be64(slb->vsid)) &&
25eb01d4c2SIan Munsie 		(sste->esid_data == cpu_to_be64(slb->esid)));
26eb01d4c2SIan Munsie }
27eb01d4c2SIan Munsie 
28eb01d4c2SIan Munsie /*
29eb01d4c2SIan Munsie  * This finds a free SSTE for the given SLB, or returns NULL if it's already in
30eb01d4c2SIan Munsie  * the segment table.
31eb01d4c2SIan Munsie  */
find_free_sste(struct cxl_context * ctx,struct copro_slb * slb)32b03a7f57SIan Munsie static struct cxl_sste *find_free_sste(struct cxl_context *ctx,
33b03a7f57SIan Munsie 				       struct copro_slb *slb)
34f204e0b8SIan Munsie {
35eb01d4c2SIan Munsie 	struct cxl_sste *primary, *sste, *ret = NULL;
36b03a7f57SIan Munsie 	unsigned int mask = (ctx->sst_size >> 7) - 1; /* SSTP0[SegTableSize] */
375100a9d6SIan Munsie 	unsigned int entry;
38b03a7f57SIan Munsie 	unsigned int hash;
39f204e0b8SIan Munsie 
40b03a7f57SIan Munsie 	if (slb->vsid & SLB_VSID_B_1T)
41b03a7f57SIan Munsie 		hash = (slb->esid >> SID_SHIFT_1T) & mask;
42b03a7f57SIan Munsie 	else /* 256M */
43b03a7f57SIan Munsie 		hash = (slb->esid >> SID_SHIFT) & mask;
44b03a7f57SIan Munsie 
45b03a7f57SIan Munsie 	primary = ctx->sstp + (hash << 3);
46b03a7f57SIan Munsie 
47b03a7f57SIan Munsie 	for (entry = 0, sste = primary; entry < 8; entry++, sste++) {
48eb01d4c2SIan Munsie 		if (!ret && !(be64_to_cpu(sste->esid_data) & SLB_ESID_V))
49eb01d4c2SIan Munsie 			ret = sste;
50eb01d4c2SIan Munsie 		if (sste_matches(sste, slb))
51eb01d4c2SIan Munsie 			return NULL;
52f204e0b8SIan Munsie 	}
53eb01d4c2SIan Munsie 	if (ret)
54eb01d4c2SIan Munsie 		return ret;
55b03a7f57SIan Munsie 
56f204e0b8SIan Munsie 	/* Nothing free, select an entry to cast out */
57eb01d4c2SIan Munsie 	ret = primary + ctx->sst_lru;
58b03a7f57SIan Munsie 	ctx->sst_lru = (ctx->sst_lru + 1) & 0x7;
59f204e0b8SIan Munsie 
60eb01d4c2SIan Munsie 	return ret;
61f204e0b8SIan Munsie }
62f204e0b8SIan Munsie 
cxl_load_segment(struct cxl_context * ctx,struct copro_slb * slb)63f204e0b8SIan Munsie static void cxl_load_segment(struct cxl_context *ctx, struct copro_slb *slb)
64f204e0b8SIan Munsie {
65f204e0b8SIan Munsie 	/* mask is the group index, we search primary and secondary here. */
66f204e0b8SIan Munsie 	struct cxl_sste *sste;
67f204e0b8SIan Munsie 	unsigned long flags;
68f204e0b8SIan Munsie 
69f204e0b8SIan Munsie 	spin_lock_irqsave(&ctx->sste_lock, flags);
70b03a7f57SIan Munsie 	sste = find_free_sste(ctx, slb);
71eb01d4c2SIan Munsie 	if (!sste)
72eb01d4c2SIan Munsie 		goto out_unlock;
73f204e0b8SIan Munsie 
74f204e0b8SIan Munsie 	pr_devel("CXL Populating SST[%li]: %#llx %#llx\n",
75f204e0b8SIan Munsie 			sste - ctx->sstp, slb->vsid, slb->esid);
769bcf28cdSIan Munsie 	trace_cxl_ste_write(ctx, sste - ctx->sstp, slb->esid, slb->vsid);
77f204e0b8SIan Munsie 
78f204e0b8SIan Munsie 	sste->vsid_data = cpu_to_be64(slb->vsid);
79f204e0b8SIan Munsie 	sste->esid_data = cpu_to_be64(slb->esid);
80eb01d4c2SIan Munsie out_unlock:
81f204e0b8SIan Munsie 	spin_unlock_irqrestore(&ctx->sste_lock, flags);
82f204e0b8SIan Munsie }
83f204e0b8SIan Munsie 
cxl_fault_segment(struct cxl_context * ctx,struct mm_struct * mm,u64 ea)84f204e0b8SIan Munsie static int cxl_fault_segment(struct cxl_context *ctx, struct mm_struct *mm,
85f204e0b8SIan Munsie 			     u64 ea)
86f204e0b8SIan Munsie {
87f204e0b8SIan Munsie 	struct copro_slb slb = {0,0};
88f204e0b8SIan Munsie 	int rc;
89f204e0b8SIan Munsie 
90f204e0b8SIan Munsie 	if (!(rc = copro_calculate_slb(mm, ea, &slb))) {
91f204e0b8SIan Munsie 		cxl_load_segment(ctx, &slb);
92f204e0b8SIan Munsie 	}
93f204e0b8SIan Munsie 
94f204e0b8SIan Munsie 	return rc;
95f204e0b8SIan Munsie }
96f204e0b8SIan Munsie 
cxl_ack_ae(struct cxl_context * ctx)97f204e0b8SIan Munsie static void cxl_ack_ae(struct cxl_context *ctx)
98f204e0b8SIan Munsie {
99f204e0b8SIan Munsie 	unsigned long flags;
100f204e0b8SIan Munsie 
1015be587b1SFrederic Barrat 	cxl_ops->ack_irq(ctx, CXL_PSL_TFC_An_AE, 0);
102f204e0b8SIan Munsie 
103f204e0b8SIan Munsie 	spin_lock_irqsave(&ctx->lock, flags);
104f204e0b8SIan Munsie 	ctx->pending_fault = true;
105f204e0b8SIan Munsie 	ctx->fault_addr = ctx->dar;
106f204e0b8SIan Munsie 	ctx->fault_dsisr = ctx->dsisr;
107f204e0b8SIan Munsie 	spin_unlock_irqrestore(&ctx->lock, flags);
108f204e0b8SIan Munsie 
109f204e0b8SIan Munsie 	wake_up_all(&ctx->wq);
110f204e0b8SIan Munsie }
111f204e0b8SIan Munsie 
cxl_handle_segment_miss(struct cxl_context * ctx,struct mm_struct * mm,u64 ea)112f204e0b8SIan Munsie static int cxl_handle_segment_miss(struct cxl_context *ctx,
113f204e0b8SIan Munsie 				   struct mm_struct *mm, u64 ea)
114f204e0b8SIan Munsie {
115f204e0b8SIan Munsie 	int rc;
116f204e0b8SIan Munsie 
117f204e0b8SIan Munsie 	pr_devel("CXL interrupt: Segment fault pe: %i ea: %#llx\n", ctx->pe, ea);
1189bcf28cdSIan Munsie 	trace_cxl_ste_miss(ctx, ea);
119f204e0b8SIan Munsie 
120f204e0b8SIan Munsie 	if ((rc = cxl_fault_segment(ctx, mm, ea)))
121f204e0b8SIan Munsie 		cxl_ack_ae(ctx);
122f204e0b8SIan Munsie 	else {
123f204e0b8SIan Munsie 
124f204e0b8SIan Munsie 		mb(); /* Order seg table write to TFC MMIO write */
1255be587b1SFrederic Barrat 		cxl_ops->ack_irq(ctx, CXL_PSL_TFC_An_R, 0);
126f204e0b8SIan Munsie 	}
127f204e0b8SIan Munsie 
128f204e0b8SIan Munsie 	return IRQ_HANDLED;
129f204e0b8SIan Munsie }
130f204e0b8SIan Munsie 
cxl_handle_mm_fault(struct mm_struct * mm,u64 dsisr,u64 dar)1313ced8d73SChristophe Lombard int cxl_handle_mm_fault(struct mm_struct *mm, u64 dsisr, u64 dar)
132f204e0b8SIan Munsie {
13350a7ca3cSSouptick Joarder 	vm_fault_t flt = 0;
134f204e0b8SIan Munsie 	int result;
135aefa5688SAneesh Kumar K.V 	unsigned long access, flags, inv_flags = 0;
136f204e0b8SIan Munsie 
1370f4bc093SAneesh Kumar K.V 	/*
1380f4bc093SAneesh Kumar K.V 	 * Add the fault handling cpu to task mm cpumask so that we
1390f4bc093SAneesh Kumar K.V 	 * can do a safe lockless page table walk when inserting the
14022259a6eSAneesh Kumar K.V 	 * hash page table entry. This function get called with a
14122259a6eSAneesh Kumar K.V 	 * valid mm for user space addresses. Hence using the if (mm)
14222259a6eSAneesh Kumar K.V 	 * check is sufficient here.
1430f4bc093SAneesh Kumar K.V 	 */
14422259a6eSAneesh Kumar K.V 	if (mm && !cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm))) {
1450f4bc093SAneesh Kumar K.V 		cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm));
14622259a6eSAneesh Kumar K.V 		/*
14722259a6eSAneesh Kumar K.V 		 * We need to make sure we walk the table only after
14822259a6eSAneesh Kumar K.V 		 * we update the cpumask. The other side of the barrier
14922259a6eSAneesh Kumar K.V 		 * is explained in serialize_against_pte_lookup()
15022259a6eSAneesh Kumar K.V 		 */
15122259a6eSAneesh Kumar K.V 		smp_mb();
15222259a6eSAneesh Kumar K.V 	}
153f204e0b8SIan Munsie 	if ((result = copro_handle_mm_fault(mm, dar, dsisr, &flt))) {
154f204e0b8SIan Munsie 		pr_devel("copro_handle_mm_fault failed: %#x\n", result);
1553ced8d73SChristophe Lombard 		return result;
156f204e0b8SIan Munsie 	}
157f204e0b8SIan Munsie 
158f24be42aSChristophe Lombard 	if (!radix_enabled()) {
159f204e0b8SIan Munsie 		/*
160f204e0b8SIan Munsie 		 * update_mmu_cache() will not have loaded the hash since current->trap
161f204e0b8SIan Munsie 		 * is not a 0x400 or 0x300, so just call hash_page_mm() here.
162f204e0b8SIan Munsie 		 */
163c7d54842SAneesh Kumar K.V 		access = _PAGE_PRESENT | _PAGE_READ;
164f204e0b8SIan Munsie 		if (dsisr & CXL_PSL_DSISR_An_S)
165c7d54842SAneesh Kumar K.V 			access |= _PAGE_WRITE;
166ac29c640SAneesh Kumar K.V 
1670034d395SAneesh Kumar K.V 		if (!mm && (get_region_id(dar) != USER_REGION_ID))
168ac29c640SAneesh Kumar K.V 			access |= _PAGE_PRIVILEGED;
169aefa5688SAneesh Kumar K.V 
170aefa5688SAneesh Kumar K.V 		if (dsisr & DSISR_NOHPTE)
171aefa5688SAneesh Kumar K.V 			inv_flags |= HPTE_NOHPTE_UPDATE;
172aefa5688SAneesh Kumar K.V 
173f204e0b8SIan Munsie 		local_irq_save(flags);
174aefa5688SAneesh Kumar K.V 		hash_page_mm(mm, dar, access, 0x300, inv_flags);
175f204e0b8SIan Munsie 		local_irq_restore(flags);
176f24be42aSChristophe Lombard 	}
1773ced8d73SChristophe Lombard 	return 0;
1783ced8d73SChristophe Lombard }
1793ced8d73SChristophe Lombard 
cxl_handle_page_fault(struct cxl_context * ctx,struct mm_struct * mm,u64 dsisr,u64 dar)1803ced8d73SChristophe Lombard static void cxl_handle_page_fault(struct cxl_context *ctx,
1813ced8d73SChristophe Lombard 				  struct mm_struct *mm,
1823ced8d73SChristophe Lombard 				  u64 dsisr, u64 dar)
1833ced8d73SChristophe Lombard {
1843ced8d73SChristophe Lombard 	trace_cxl_pte_miss(ctx, dsisr, dar);
1853ced8d73SChristophe Lombard 
1863ced8d73SChristophe Lombard 	if (cxl_handle_mm_fault(mm, dsisr, dar)) {
1873ced8d73SChristophe Lombard 		cxl_ack_ae(ctx);
1883ced8d73SChristophe Lombard 	} else {
189f204e0b8SIan Munsie 		pr_devel("Page fault successfully handled for pe: %i!\n", ctx->pe);
1905be587b1SFrederic Barrat 		cxl_ops->ack_irq(ctx, CXL_PSL_TFC_An_R, 0);
191f204e0b8SIan Munsie 	}
1923ced8d73SChristophe Lombard }
193f204e0b8SIan Munsie 
1947b8ad495SVaibhav Jain /*
1956dd2d234SChristophe Lombard  * Returns the mm_struct corresponding to the context ctx.
1966dd2d234SChristophe Lombard  * mm_users == 0, the context may be in the process of being closed.
1977b8ad495SVaibhav Jain  */
get_mem_context(struct cxl_context * ctx)1987b8ad495SVaibhav Jain static struct mm_struct *get_mem_context(struct cxl_context *ctx)
1997b8ad495SVaibhav Jain {
2006dd2d234SChristophe Lombard 	if (ctx->mm == NULL)
2017b8ad495SVaibhav Jain 		return NULL;
2027b8ad495SVaibhav Jain 
203615d2ef0SLaurent Dufour 	if (!mmget_not_zero(ctx->mm))
2046dd2d234SChristophe Lombard 		return NULL;
2057b8ad495SVaibhav Jain 
2066dd2d234SChristophe Lombard 	return ctx->mm;
2077b8ad495SVaibhav Jain }
2087b8ad495SVaibhav Jain 
cxl_is_segment_miss(struct cxl_context * ctx,u64 dsisr)209f24be42aSChristophe Lombard static bool cxl_is_segment_miss(struct cxl_context *ctx, u64 dsisr)
210f24be42aSChristophe Lombard {
211797625deSChristophe Lombard 	if ((cxl_is_power8() && (dsisr & CXL_PSL_DSISR_An_DS)))
212f24be42aSChristophe Lombard 		return true;
2137b8ad495SVaibhav Jain 
214f24be42aSChristophe Lombard 	return false;
215f24be42aSChristophe Lombard }
216f24be42aSChristophe Lombard 
cxl_is_page_fault(struct cxl_context * ctx,u64 dsisr)217f24be42aSChristophe Lombard static bool cxl_is_page_fault(struct cxl_context *ctx, u64 dsisr)
218f24be42aSChristophe Lombard {
219797625deSChristophe Lombard 	if ((cxl_is_power8()) && (dsisr & CXL_PSL_DSISR_An_DM))
220f24be42aSChristophe Lombard 		return true;
221f24be42aSChristophe Lombard 
22256328743SChristophe Lombard 	if (cxl_is_power9())
223f24be42aSChristophe Lombard 		return true;
224f24be42aSChristophe Lombard 
225f24be42aSChristophe Lombard 	return false;
226f24be42aSChristophe Lombard }
2277b8ad495SVaibhav Jain 
cxl_handle_fault(struct work_struct * fault_work)228f204e0b8SIan Munsie void cxl_handle_fault(struct work_struct *fault_work)
229f204e0b8SIan Munsie {
230f204e0b8SIan Munsie 	struct cxl_context *ctx =
231f204e0b8SIan Munsie 		container_of(fault_work, struct cxl_context, fault_work);
232f204e0b8SIan Munsie 	u64 dsisr = ctx->dsisr;
233f204e0b8SIan Munsie 	u64 dar = ctx->dar;
234a6b07d82SMichael Neuling 	struct mm_struct *mm = NULL;
235f204e0b8SIan Munsie 
236ea2d1f95SFrederic Barrat 	if (cpu_has_feature(CPU_FTR_HVMODE)) {
237f204e0b8SIan Munsie 		if (cxl_p2n_read(ctx->afu, CXL_PSL_DSISR_An) != dsisr ||
238f204e0b8SIan Munsie 		    cxl_p2n_read(ctx->afu, CXL_PSL_DAR_An) != dar ||
239f204e0b8SIan Munsie 		    cxl_p2n_read(ctx->afu, CXL_PSL_PEHandle_An) != ctx->pe) {
240ea2d1f95SFrederic Barrat 			/* Most likely explanation is harmless - a dedicated
241ea2d1f95SFrederic Barrat 			 * process has detached and these were cleared by the
242ea2d1f95SFrederic Barrat 			 * PSL purge, but warn about it just in case
243ea2d1f95SFrederic Barrat 			 */
244f204e0b8SIan Munsie 			dev_notice(&ctx->afu->dev, "cxl_handle_fault: Translation fault regs changed\n");
245f204e0b8SIan Munsie 			return;
246f204e0b8SIan Munsie 		}
247ea2d1f95SFrederic Barrat 	}
248f204e0b8SIan Munsie 
24913da7046SIan Munsie 	/* Early return if the context is being / has been detached */
25013da7046SIan Munsie 	if (ctx->status == CLOSED) {
25113da7046SIan Munsie 		cxl_ack_ae(ctx);
25213da7046SIan Munsie 		return;
25313da7046SIan Munsie 	}
25413da7046SIan Munsie 
255f204e0b8SIan Munsie 	pr_devel("CXL BOTTOM HALF handling fault for afu pe: %i. "
256f204e0b8SIan Munsie 		"DSISR: %#llx DAR: %#llx\n", ctx->pe, dsisr, dar);
257f204e0b8SIan Munsie 
258a6b07d82SMichael Neuling 	if (!ctx->kernel) {
2597b8ad495SVaibhav Jain 
2607b8ad495SVaibhav Jain 		mm = get_mem_context(ctx);
2617b8ad495SVaibhav Jain 		if (mm == NULL) {
2627b8ad495SVaibhav Jain 			pr_devel("%s: unable to get mm for pe=%d pid=%i\n",
2637b8ad495SVaibhav Jain 				 __func__, ctx->pe, pid_nr(ctx->pid));
264f204e0b8SIan Munsie 			cxl_ack_ae(ctx);
265f204e0b8SIan Munsie 			return;
2667b8ad495SVaibhav Jain 		} else {
2677b8ad495SVaibhav Jain 			pr_devel("Handling page fault for pe=%d pid=%i\n",
2687b8ad495SVaibhav Jain 				 ctx->pe, pid_nr(ctx->pid));
269f204e0b8SIan Munsie 		}
270a6b07d82SMichael Neuling 	}
271f204e0b8SIan Munsie 
272f24be42aSChristophe Lombard 	if (cxl_is_segment_miss(ctx, dsisr))
273f204e0b8SIan Munsie 		cxl_handle_segment_miss(ctx, mm, dar);
274f24be42aSChristophe Lombard 	else if (cxl_is_page_fault(ctx, dsisr))
275f204e0b8SIan Munsie 		cxl_handle_page_fault(ctx, mm, dsisr, dar);
276f204e0b8SIan Munsie 	else
277f204e0b8SIan Munsie 		WARN(1, "cxl_handle_fault has nothing to handle\n");
278f204e0b8SIan Munsie 
279a6b07d82SMichael Neuling 	if (mm)
280f204e0b8SIan Munsie 		mmput(mm);
281f204e0b8SIan Munsie }
282f204e0b8SIan Munsie 
next_segment(u64 ea,u64 vsid)283f204e0b8SIan Munsie static u64 next_segment(u64 ea, u64 vsid)
284f204e0b8SIan Munsie {
285f204e0b8SIan Munsie 	if (vsid & SLB_VSID_B_1T)
286f204e0b8SIan Munsie 		ea |= (1ULL << 40) - 1;
287f204e0b8SIan Munsie 	else
288f204e0b8SIan Munsie 		ea |= (1ULL << 28) - 1;
289f204e0b8SIan Munsie 
290f204e0b8SIan Munsie 	return ea + 1;
291f204e0b8SIan Munsie }
292f204e0b8SIan Munsie 
cxl_prefault_vma(struct cxl_context * ctx,struct mm_struct * mm)293*d9fa0e37SMatthew Wilcox (Oracle) static void cxl_prefault_vma(struct cxl_context *ctx, struct mm_struct *mm)
294f204e0b8SIan Munsie {
295f204e0b8SIan Munsie 	u64 ea, last_esid = 0;
296f204e0b8SIan Munsie 	struct copro_slb slb;
297*d9fa0e37SMatthew Wilcox (Oracle) 	VMA_ITERATOR(vmi, mm, 0);
298f204e0b8SIan Munsie 	struct vm_area_struct *vma;
299f204e0b8SIan Munsie 	int rc;
300f204e0b8SIan Munsie 
301d8ed45c5SMichel Lespinasse 	mmap_read_lock(mm);
302*d9fa0e37SMatthew Wilcox (Oracle) 	for_each_vma(vmi, vma) {
303f204e0b8SIan Munsie 		for (ea = vma->vm_start; ea < vma->vm_end;
304f204e0b8SIan Munsie 				ea = next_segment(ea, slb.vsid)) {
305f204e0b8SIan Munsie 			rc = copro_calculate_slb(mm, ea, &slb);
306f204e0b8SIan Munsie 			if (rc)
307f204e0b8SIan Munsie 				continue;
308f204e0b8SIan Munsie 
309f204e0b8SIan Munsie 			if (last_esid == slb.esid)
310f204e0b8SIan Munsie 				continue;
311f204e0b8SIan Munsie 
312f204e0b8SIan Munsie 			cxl_load_segment(ctx, &slb);
313f204e0b8SIan Munsie 			last_esid = slb.esid;
314f204e0b8SIan Munsie 		}
315f204e0b8SIan Munsie 	}
316d8ed45c5SMichel Lespinasse 	mmap_read_unlock(mm);
317f204e0b8SIan Munsie }
318f204e0b8SIan Munsie 
cxl_prefault(struct cxl_context * ctx,u64 wed)319f204e0b8SIan Munsie void cxl_prefault(struct cxl_context *ctx, u64 wed)
320f204e0b8SIan Munsie {
321*d9fa0e37SMatthew Wilcox (Oracle) 	struct mm_struct *mm = get_mem_context(ctx);
322*d9fa0e37SMatthew Wilcox (Oracle) 
323*d9fa0e37SMatthew Wilcox (Oracle) 	if (mm == NULL) {
324*d9fa0e37SMatthew Wilcox (Oracle) 		pr_devel("cxl_prefault unable to get mm %i\n",
325*d9fa0e37SMatthew Wilcox (Oracle) 			 pid_nr(ctx->pid));
326*d9fa0e37SMatthew Wilcox (Oracle) 		return;
327*d9fa0e37SMatthew Wilcox (Oracle) 	}
328*d9fa0e37SMatthew Wilcox (Oracle) 
329f204e0b8SIan Munsie 	switch (ctx->afu->prefault_mode) {
330f204e0b8SIan Munsie 	case CXL_PREFAULT_WED:
331*d9fa0e37SMatthew Wilcox (Oracle) 		cxl_fault_segment(ctx, mm, wed);
332f204e0b8SIan Munsie 		break;
333f204e0b8SIan Munsie 	case CXL_PREFAULT_ALL:
334*d9fa0e37SMatthew Wilcox (Oracle) 		cxl_prefault_vma(ctx, mm);
335f204e0b8SIan Munsie 		break;
336f204e0b8SIan Munsie 	default:
337f204e0b8SIan Munsie 		break;
338f204e0b8SIan Munsie 	}
339*d9fa0e37SMatthew Wilcox (Oracle) 
340*d9fa0e37SMatthew Wilcox (Oracle) 	mmput(mm);
341f204e0b8SIan Munsie }
342