History

mm/hmm: replace hmm_update with mmu_notifier_range

The hmm_mirror_ops callback function sync_cpu_device_pagetables() passes a struct hmm_update which is a simplified version of struct mmu_notifier_range. This is unnecessary so replace hmm_update with mmu_notifier_range directly.

Ralph Campbell committed 7 years ago

Commit 1f961801 parent e709acc4 files · +20 −45Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/hmm.h+6−28
@@ -340,29 +340,6 @@ static inline uint64_t hmm_device_entry_from_pfn(const struct hmm_range *range, · 339 unmodified lines
340 340
341struct hmm_mirror;341struct hmm_mirror;
342 342
343/*
344 * enum hmm_update_event - type of update
345 * @HMM_UPDATE_INVALIDATE: invalidate range (no indication as to why)
346 */
347enum hmm_update_event {
348 HMM_UPDATE_INVALIDATE,
349};
350
351/*
352 * struct hmm_update - HMM update information for callback
353 *
354 * @start: virtual start address of the range to update
355 * @end: virtual end address of the range to update
356 * @event: event triggering the update (what is happening)
357 * @blockable: can the callback block/sleep ?
358 */
359struct hmm_update {
360 unsigned long start;
361 unsigned long end;
362 enum hmm_update_event event;
363 bool blockable;
364};
365
366/*343/*
367 * struct hmm_mirror_ops - HMM mirror device operations callback344 * struct hmm_mirror_ops - HMM mirror device operations callback
368 *345 *
@@ -383,9 +360,9 @@ struct hmm_mirror_ops { · 14 unmodified lines
383 /* sync_cpu_device_pagetables() - synchronize page tables360 /* sync_cpu_device_pagetables() - synchronize page tables
384 *361 *
385 * @mirror: pointer to struct hmm_mirror362 * @mirror: pointer to struct hmm_mirror
386 * @update: update information (see struct hmm_update)363 * @update: update information (see struct mmu_notifier_range)
387 * Return: -EAGAIN if update.blockable false and callback need to364 * Return: -EAGAIN if mmu_notifier_range_blockable(update) is false
388 * block, 0 otherwise.365 * and callback needs to block, 0 otherwise.
389 *366 *
390 * This callback ultimately originates from mmu_notifiers when the CPU367 * This callback ultimately originates from mmu_notifiers when the CPU
391 * page table is updated. The device driver must update its page table368 * page table is updated. The device driver must update its page table
@@ -396,8 +373,9 @@ struct hmm_mirror_ops { · 4 unmodified lines
396 * page tables are completely updated (TLBs flushed, etc); this is a373 * page tables are completely updated (TLBs flushed, etc); this is a
397 * synchronous call.374 * synchronous call.
398 */375 */
399 int (*sync_cpu_device_pagetables)(struct hmm_mirror *mirror,376 int (*sync_cpu_device_pagetables)(
400 const struct hmm_update *update);377 struct hmm_mirror *mirror,
378 const struct mmu_notifier_range *update);
401};379};
402 380
403/*381/*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t