hmm.h (704f3f2cf63cdb76925ac2ff432182c73574b20b) hmm.h (25f23a0c7127b65c4d8200ccda8a352ad5ce1e1d)
1/*
2 * Copyright 2013 Red Hat Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 351 unchanged lines hidden (view full) ---

360 * To snapshot the CPU page table, call hmm_vma_get_pfns(), then take a device
361 * driver lock that serializes device page table updates, then call
362 * hmm_vma_range_done(), to check if the snapshot is still valid. The same
363 * device driver page table update lock must also be used in the
364 * hmm_mirror_ops.sync_cpu_device_pagetables() callback, so that CPU page
365 * table invalidation serializes on it.
366 *
367 * YOU MUST CALL hmm_vma_range_done() ONCE AND ONLY ONCE EACH TIME YOU CALL
1/*
2 * Copyright 2013 Red Hat Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 351 unchanged lines hidden (view full) ---

360 * To snapshot the CPU page table, call hmm_vma_get_pfns(), then take a device
361 * driver lock that serializes device page table updates, then call
362 * hmm_vma_range_done(), to check if the snapshot is still valid. The same
363 * device driver page table update lock must also be used in the
364 * hmm_mirror_ops.sync_cpu_device_pagetables() callback, so that CPU page
365 * table invalidation serializes on it.
366 *
367 * YOU MUST CALL hmm_vma_range_done() ONCE AND ONLY ONCE EACH TIME YOU CALL
368 * hmm_vma_get_pfns() WITHOUT ERROR !
368 * hmm_range_snapshot() WITHOUT ERROR !
369 *
370 * IF YOU DO NOT FOLLOW THE ABOVE RULE THE SNAPSHOT CONTENT MIGHT BE INVALID !
371 */
369 *
370 * IF YOU DO NOT FOLLOW THE ABOVE RULE THE SNAPSHOT CONTENT MIGHT BE INVALID !
371 */
372int hmm_vma_get_pfns(struct hmm_range *range);
372long hmm_range_snapshot(struct hmm_range *range);
373bool hmm_vma_range_done(struct hmm_range *range);
374
375
376/*
377 * Fault memory on behalf of device driver. Unlike handle_mm_fault(), this will
378 * not migrate any device memory back to system memory. The HMM pfn array will
379 * be updated with the fault result and current snapshot of the CPU page table
380 * for the range.

--- 221 unchanged lines hidden ---
373bool hmm_vma_range_done(struct hmm_range *range);
374
375
376/*
377 * Fault memory on behalf of device driver. Unlike handle_mm_fault(), this will
378 * not migrate any device memory back to system memory. The HMM pfn array will
379 * be updated with the fault result and current snapshot of the CPU page table
380 * for the range.

--- 221 unchanged lines hidden ---