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.
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -340,29 +340,6 @@ static inline uint64_t hmm_device_entry_from_pfn(const struct hmm_range *range, · 339 unmodified lines | ||
| 340 | 340 | |
| 341 | 341 | struct 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 | − */ | |
| 347 | −enum 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 | − */ | |
| 359 | −struct hmm_update { | |
| 360 | − unsigned long start; | |
| 361 | − unsigned long end; | |
| 362 | − enum hmm_update_event event; | |
| 363 | − bool blockable; | |
| 364 | −}; | |
| 365 | − | |
| 366 | 343 | /* |
| 367 | 344 | * struct hmm_mirror_ops - HMM mirror device operations callback |
| 368 | 345 | * |
| @@ -383,9 +360,9 @@ struct hmm_mirror_ops { · 14 unmodified lines | ||
| 383 | 360 | /* sync_cpu_device_pagetables() - synchronize page tables |
| 384 | 361 | * |
| 385 | 362 | * @mirror: pointer to struct hmm_mirror |
| 386 | − * @update: update information (see struct hmm_update) | |
| 387 | − * Return: -EAGAIN if update.blockable false and callback need to | |
| 388 | − * block, 0 otherwise. | |
| 363 | + * @update: update information (see struct mmu_notifier_range) | |
| 364 | + * Return: -EAGAIN if mmu_notifier_range_blockable(update) is false | |
| 365 | + * and callback needs to block, 0 otherwise. | |
| 389 | 366 | * |
| 390 | 367 | * This callback ultimately originates from mmu_notifiers when the CPU |
| 391 | 368 | * page table is updated. The device driver must update its page table |
| @@ -396,8 +373,9 @@ struct hmm_mirror_ops { · 4 unmodified lines | ||
| 396 | 373 | * page tables are completely updated (TLBs flushed, etc); this is a |
| 397 | 374 | * synchronous call. |
| 398 | 375 | */ |
| 399 | − int (*sync_cpu_device_pagetables)(struct hmm_mirror *mirror, | |
| 400 | − const struct hmm_update *update); | |
| 376 | + int (*sync_cpu_device_pagetables)( | |
| 377 | + struct hmm_mirror *mirror, | |
| 378 | + const struct mmu_notifier_range *update); | |
| 401 | 379 | }; |
| 402 | 380 | |
| 403 | 381 | /* |